scitools.com

← Metric catalog

Dependencies In 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.

Dependencies In

API ID: CountDepsIn
Languages: Any
Targets: Architectures

Number of other architectures that depend on this one or any of its descendants.

Dependencies from outside into this subtree (including into child architectures) are attributed to this architecture, so "in" counts dependents of the whole subtree.

In the sample below, for "project", both "tests/main" (main_test.cpp→main.cpp) and "tests/api" (api_test.cpp→api.cpp) depend on project, so CountDepsIn is 2.

Compare to CountDirectDepsIn (only dependents that reference this architecture's own entities) and CountMajorDepsIn (sibling dependents grouped under one parent).

Consider a directory-style architecture and dependencies:

Dependencies (with reference counts):

  1. main.cpp → api.cpp (3 refs)
  2. main.cpp → ui.cpp (9 refs)
  3. main.cpp → library1.cpp (8 refs)
  4. api.cpp → library1.cpp (6 refs)
  5. ui.cpp → library2.cpp (4 refs)
  6. ui.cpp → api.cpp (2 refs)
  7. main_test.cpp → main.cpp (7 refs)
  8. api_test.cpp → api.cpp (5 refs)

For project, the metrics are:

MetricValue
CountDepsIn2
CountDepsOut2
CountDepRefsIn12
CountDepRefsOut18
CountDirectDepsIn1
CountDirectDepsOut3
CountDirectDepRefsIn7
CountDirectDepRefsOut20
CountMajorDepsIn1
CountMajorDepsOut1