Skip to content

Dependency ​

Fan-out ​

dependency.fan_out — Number of distinct functions a function calls.

ItemValue
DefinitionDistinct callee names of the call nodes in the function.
Scopefunction
InputCall nodes and their callee labels
CalculationExcludes calls made by nested functions. Includes callees defined outside the project. Calls without a callee name (e.g. f()()) are not counted.
Unitcount
Language Applicabilitypartially_language_dependent
LimitationsCalls are resolved by callee name only (no types, scopes or imports).
ReferenceHenry, S. & Kafura, D. (1981). Software Structure Metrics Based on Information Flow. IEEE TSE SE-7(5).

Fan-in ​

dependency.fan_in — Number of distinct project functions that call a function.

ItemValue
DefinitionDistinct functions in the project having a call whose callee name is this function's name.
Scopefunction
InputCall nodes and their callee labels, function names
CalculationFunctions with the same name share the value. Anonymous functions have 0.
Unitcount
Language Applicabilitypartially_language_dependent
LimitationsName-based: same-named methods of different classes are not distinguished, which overestimates fan-in.
ReferenceHenry, S. & Kafura, D. (1981). Software Structure Metrics Based on Information Flow. IEEE TSE SE-7(5).

Call Depth ​

dependency.call_depth — Longest chain of calls through project functions.

ItemValue
DefinitionLongest path, in edges, from the function's name in the project call graph of function names, with strongly connected components (recursion) collapsed.
Scopefunction
InputCall nodes and their callee labels, function names
CalculationNodes are the names of project functions; a name calls the union of what its functions call. Edges inside a strongly connected component are not counted. An anonymous function has 1 + the deepest name it calls. 0 when no project function is called.
Unitcalls
Language Applicabilitypartially_language_dependent
LimitationsName-based: same-named functions share one value.
Reference-

Dependency Count ​

dependency.dependency_count — Number of import / include declarations.

ItemValue
DefinitionNodes of kind import.
Scopefile, project
InputImport nodes
CalculationEach imported item that the grammar represents as a separate declaration counts once (e.g. each Go import spec). Project: sum.
Unitcount
Language Applicabilitypartially_language_dependent
LimitationsImport granularity differs between languages (Python from a import b, c is one import).
Reference-