Class CyclicDependencyMethodLevelService

java.lang.Object
edu.university.ecs.lab.detection.antipatterns.services.CyclicDependencyMethodLevelService

public class CyclicDependencyMethodLevelService extends Object
Service class for detecting cyclic dependencies in a method network graph.
  • Field Details

  • Constructor Details

    • CyclicDependencyMethodLevelService

      public CyclicDependencyMethodLevelService()
  • Method Details

    • findCyclicDependencies

      public CyclicDependency findCyclicDependencies(MethodDependencyGraph graph)
      Finds all cyclic dependencies in the given network graph.
      Parameters:
      graph - the Microservice System to analyze
      Returns:
      a CyclicDependency object representing all detected cycles
    • findCycles

      private void findCycles(Method currentNode)
      Checks if there is a cycle starting from the current node.
      Parameters:
      currentNode - the current node to check
    • reconstructCyclePath

      private List<String> reconstructCyclePath(String startNode, String currentNode)
      Reconstructs the cycle path from startNode to currentNode using the parentMap.
      Parameters:
      startNode - the start node of the cycle
      currentNode - the current node to reconstruct path to
      Returns:
      the list of nodes representing the cycle path