Direct Dependency References Out is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Direct Dependency References Out
API ID: CountDirectDepRefsOutLanguages: Any
Targets: Architectures
Total number of dependency references from this architecture's own entities to other architectures.
References from descendants are excluded.
In the sample below, for "project", this considers only main.cpp (not descendant entities api.cpp and ui.cpp). It counts the 8 references from main.cpp to library1.cpp, the 3 from main.cpp to api.cpp, and the 9 from main.cpp to ui.cpp (20 total). It does not count api.cpp or ui.cpp references to libraries, because direct counts only this architecture's own entities. Parent-to-child and child-to-parent references from that entity still count.
Compare to CountDepRefsOut (all references from this subtree) and CountDirectDepsOut (number of partner architectures).
Consider a directory-style architecture and dependencies:
- project
- api
- api.cpp
- ui
- ui.cpp
- main.cpp
- api
- libraries
- library1
- ibrary1.cpp
- library2
- library2.cpp
- library1
- tests
- main
- main_test.cpp
- api
- api_test.cpp
- main
Dependencies (with reference counts):
- main.cpp → api.cpp (3 refs)
- main.cpp → ui.cpp (9 refs)
- main.cpp → library1.cpp (8 refs)
- api.cpp → library1.cpp (6 refs)
- ui.cpp → library2.cpp (4 refs)
- ui.cpp → api.cpp (2 refs)
- main_test.cpp → main.cpp (7 refs)
- api_test.cpp → api.cpp (5 refs)
For project, the metrics are:
| Metric | Value |
|---|---|
| CountDepsIn | 2 |
| CountDepsOut | 2 |
| CountDepRefsIn | 12 |
| CountDepRefsOut | 18 |
| CountDirectDepsIn | 1 |
| CountDirectDepsOut | 3 |
| CountDirectDepRefsIn | 7 |
| CountDirectDepRefsOut | 20 |
| CountMajorDepsIn | 1 |
| CountMajorDepsOut | 1 |