scitools.com

← Architecture catalog

Dependency Cycles is one of Understand's built-in architectures — automatic ways to group a codebase (by directory, git history, language, …) for graphs, metrics, and dependency analysis.

Dependency Cycles

LanguagesAny
TagsCycles Dependencies

Group files that are in the same dependency cycle

A dependency cycle is a group of files where every file depends, directly or indirectly, on every other file in the group. Files in a cycle can't be changed, tested, or replaced on their own.

By default, companion files are combined before cycles are found, so a header and its source file count as one unit and a cycle between just the two of them doesn't count. Files are companions when they have the same name up to the first dot (the last dot for web files) and are in the same folder, or when they are in different folders and one defines most of what the other declares, or when one is a file Qt generates for the other. Uncheck "Combine companion files" to find cycles between individual files.

Within a cycle, each unit of combined companion files has its own child architecture, named after the unit's main file. Files with no companions are directly in the cycle. So the number of units in a cycle is the number of children plus the number of files directly in it.

Each cycle is named after its hub: the file the most other files in the cycle depend on. Since the hub is usually the reason the cycle exists, the name tends to stay the same as files join or leave the cycle, which makes cycles easy to compare between versions.

Set "Minimum cycle size" to leave out smaller cycles. Size counts units, so when companion files are combined, a cycle between two headers and their source files has size 2. The default, 0, includes every cycle.

The Dependency Layers architecture shows where each cycle sits in the dependency layers.