Tool ยท in the project
Dependency graph analyser
Builds the graph of imports between modules, checks it against the allowed directions, and measures its coupling.
- Builds
- Linter, Dependency graph
catalog/tools/dependency-graph-analyser.svg This tool builds the graph of imports between the project's modules, checks it against the directions the project allows, and measures how coupled the modules are. Which one applies depends on the language, and is found in the project.
Finding it
Look for its rules in the repository (.dependency-cruiser.js, an import-linter section in pyproject.toml or
setup.cfg, ArchUnit tests among the Java tests) and in CI for the step that runs them. The rules name the layers and
the directions allowed between them.
Using it
- Run it:
depcruise srcfor dependency-cruiser,lint-importsfor import-linter; ArchUnit's rules run with the test command. - A baseline that only shrinks: known violations are recorded in the repository (
--output-type baselineand--ignore-knownin dependency-cruiser,FreezingArchRulein ArchUnit), so a new one fails and old ones are removed over time. - Coupling over time: cycles, fan-in and fan-out per module saved from each run, on each pull request and on a schedule, so the trend can be compared.
Examples: dependency-cruiser (JavaScript), ArchUnit (Java), import-linter (Python), deptrac (PHP).
Built from catalog/tools/dependency-graph-analyser.md.