Minimum Recursive Depth 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.
Minimum Recursive Depth
API ID: MinRecursiveDepthLanguages: Any
Targets: Functions
The depth of the call tree at which a call to the initial function is first detected.
Example:
void directlyRecursive() // MinRecursiveDepth = 1
{
directlyRecursive();
}
void indirectRecursive1();
void indirectRecursive2() // MinRecursiveDepth = 2
{
indirectRecursive1();
}
void indirectRecursive1() // MinRecursiveDepth = 2
{
indirectRecursive2();
}
void a();
void b() { a(); } // MinRecursiveDepth = 3
void c() { b(); } // MinRecursiveDepth = 3
void a() { c(); } // MinRecursiveDepth = 3
void callsCycle() { a(); } // MinRecursiveDepth = 0, not recursive
See also the batch recursion metrics IsRecursive and IsRecursiveUsePtr. Related to Hersteller Initiative Software (HIS) AP_CG_CYCLE metric.