-
Notifications
You must be signed in to change notification settings - Fork 341
Open
Description
madge does not detect all circular dependencies or even all files with circular dependencies. I think this is a fundamental issue with the algorithm in cyclic.js. (There may be some good suggestions in here: https://stackoverflow.com/questions/546655/finding-all-cycles-in-a-directed-graph)
I created some minimal test cases here (including graphviz diagrams in case that helps):
Explanation:
- "defg" case: There are two cycles:
d -> e -> g -> dandd -> f -> g -> d. However, madge never reports thed -> f -> gcase (or indeed thatfbelongs to a cycle), regardless of which file(s) we use as the starting input. - "bcdeg" case: There are two cycles:
d -> c -> g -> dandd -> e -> g -> d.- This is equivalent to the "defg" case (but with 'c' instead of 'f'). Yet the madge output is different - it finds all the cycles.
- But if we add a dependency
b -> dand start atb, madge no longer reports one of the cycles.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels