Class CyclicDependencyMethodLevelService
java.lang.Object
edu.university.ecs.lab.detection.antipatterns.services.CyclicDependencyMethodLevelService
Service class for detecting cyclic dependencies in a method network graph.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
findCycles
(Method currentNode) Checks if there is a cycle starting from the current node.Finds all cyclic dependencies in the given network graph.reconstructCyclePath
(String startNode, String currentNode) Reconstructs the cycle path from startNode to currentNode using the parentMap.
-
Field Details
-
allCycles
-
visited
-
recStack
-
parentMap
-
graph
-
-
Constructor Details
-
CyclicDependencyMethodLevelService
public CyclicDependencyMethodLevelService()
-
-
Method Details
-
findCyclicDependencies
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
Checks if there is a cycle starting from the current node.- Parameters:
currentNode
- the current node to check
-
reconstructCyclePath
Reconstructs the cycle path from startNode to currentNode using the parentMap.- Parameters:
startNode
- the start node of the cyclecurrentNode
- the current node to reconstruct path to- Returns:
- the list of nodes representing the cycle path
-