Depends On is one of the interactive graphs Understand can draw of your code — call trees, dependencies, control flow, and more.
Depends On
Languages: AnyTargets: Classes, Files
Variants: Classic, Cluster, Compare
Show the files or classes the selected file or class depends on.
Dependencies map references to their owning file, class, or architecture. So a file's dependencies are the other files that own entities it references. For example, if a function defined in fileA calls a function defined in fileB, then fileA depends on fileB. References that contribute to dependencies vary by language, but generally include call, set, use, modify, and type references.
Dependencies always stay at the same grouping: file will only depend on other files, classes on other classes, and architectures on other architectures within the same root architecture.
Depends On - Classic
Rooted at entity.cpp in the sample project, the graph shows a direct dependency on entity.h (its own header) through 7 references and on math.h through 5 references. Plus, one step further, entity.h depends on math.h through 3 references. See Depended On By for the reverse direction.
The Classic variant shows the relationship as a simple tree (no clusters) using a custom layout algorithm instead of Graphviz.
Depends On - Cluster
Rooted at entity.cpp in the sample project, the graph shows a direct dependency on entity.h (its own header) through 7 references and on math.h through 5 references. Plus, one step further, entity.h depends on math.h through 3 references. See Depended On By for the reverse direction.
The Cluster variant shows each file/class once. In the GUI, the files/classes can be expanded to show the entities for each reference.
Depends On - Compare
Rooted at entity.cpp in the sample project, the graph shows a direct dependency on entity.h (its own header) through 7 references and on math.h through 5 references. Plus, one step further, entity.h depends on math.h through 3 references. See Depended On By for the reverse direction.
The Compare variant shows how the graph has changed relative to the project's comparison database.
The sample's comparison database is an earlier version of the project.
Since then, the io folder was removed, the cmdline
folder was added, lib/vec2.h was renamed to math.h,
ui/view was renamed to window, and the
Entity members speed and move() were
renamed to velocity and update().
Added nodes and edges are green and removed ones are red. Each edge label gives the number of unchanged references, then the number added (+) and removed (-). A reference to a renamed entity counts as one removed and one added reference.
In the sample, the added math.h replaces the removed vec2.h: the 5 references from entity.cpp and the 3 from entity.h now go to math.h. The renamed members give the edge from entity.cpp to entity.h 3 unchanged, 4 added, and 4 removed references.