Skip to content

What are dependencies & how are they determined?

Understand builds dependencies from the same data as everything else it knows — entities and references.

  • An entity is anything Understand has information on: a file, class, function, or variable.
  • A reference is a place in the code that connects two entities — function A calls function B, a class declares a member, a file includes another file.

A dependency is a reference that crosses from one group of entities into another. Grouping is based on each entity's parent chain (the define-in parent, e.g. a local object → its function → its file → the architecture nodes above the file). So dependencies aren't a separate scan — every qualifying reference in the project becomes a dependency between the two groups it connects.

Three levels: file, class, architecture

The same reference data is aggregated at whichever level you ask for:

  • File — files that depend on other files.
  • Class — classes that depend on other classes (references to non-member functions are excluded, because they have no class group).
  • Architecture — one architecture node depending on another within the same root architecture.

If an entity has no group at the requested level, its references are skipped for that level. Each dependency edge remembers the exact references that caused it, so you can always drill from an edge down to the lines of code behind it.

Direction and settings

Every reference has a direction — a call gives the caller a forward Depends On edge and the callee a reverse Depended On By edge. A few settings shape what you see: whether to include header #includes, whether to exclude standard-library entities, and whether to count C object-member references.

To actually look at and export this data, see browse & export dependencies and the dependency graphs drawn from the same edges. Scripts can walk it too — entities, references, and architectures are the Python API's Ent, Ref, and Arch objects.

Which references count

Not every reference is a dependency, and the set is language-specific. Understand keeps a per- language table mapping a readable filter name to the underlying reference kinds. The full table:

Language Reference kinds treated as dependencies
Ada Call, Derive From, Handle, Import, Include, Instanceof, Parent/Child, Raise, Rename, Separate From, Set¹, Subtype, Typed, Use, Use Package, With
Assembly Call, Goto, Include, Modify, Set, Use
BASIC (VB.NET) Base/Derive, Call, Catch, Implement, Import, Modify, Overrides, Set, Throw, Typed, Use
C Call²³, Include³, Modify, Set, Typed, Use³
C++ Base/Derive, Call²³, Catch, Include³, Modify, Overrides, Set, Throw, Typed, Use³, Using
Objective-C Call²³, Extend, Implement, Include³, Modify, Set, Typed, Use³
Objective-C++ Base/Derive, Call²³, Catch, Extend, Implement, Include³, Modify, Overrides, Set, Throw, Typed, Use³, Using
C# Base/Derive, Call, Catch, Implement, Modify, Overrides, Set, Throw, Typed, Use, Using
Fortran Call, Equivalence, Extend, Include, Module Use, Parent/Child, Rename, Set, Typed, Use, Use Module Entity
Java Call, Cast, Create, Extend, Implement, Import, Modify, Module Use, Open, Require, Set, Throw, Typed, Use
JOVIAL Call, Cast, Compool Access, Copy, Itemaccess, Overlay, Set, Typed, Use
Pascal / Delphi / SQL Call, Cast, Classof, Derive From, Helper For, Implement, Include, Inherit, Inherit Env, Set, Typed, Use
Python Call, Import, Inherit, Modify, Raise, Set, Typed, Use
Rust Call, Implement, Import, Match, Modify, Require, Set, Typed, Use
VHDL Call, Implement, Instantiate, Map, Set, Typed, Use
Web — JavaScript / TypeScript Call, Extend, Implement, Import, Modify, Reexport, Require, Set, Typed, Use
Web — PHP Call, Extend, Implement, Import, Include, Modify, Overrides, Require, Set, Typed, Use
Web — CSS Import, Set, Use
Web — HTML Call, Extend, Implement, Import, Modify, Reexport, Require, Set, Src, Typed, Use

¹ Ada Set excludes initializations. ² In the C-family languages, Call excludes calls through pointers and indirect calls. ³ In the C-family languages, Call, Include, and Use only count references in active (not #ifdef'd-out) code.

C++, Objective-C, and Objective-C++ build on the C set, Delphi and SQL use the Pascal set, and TypeScript uses the JavaScript set — so those rows match their base language plus the kinds their own parser adds. HTML combines its own Src/Use kinds with the CSS and JavaScript sets, since HTML files pull both in.

The filter list actually offered for a project is built from the languages present in it — these are the same named filters you can toggle when browsing dependencies.

Include-type edges are optional

The Include, Import, Copy, and Reexport filters are off by default in dependency calculations and are added only when the project's use includes setting is on. This keeps high-level dependency views from being swamped by header includes and import statements.