Number of Calling Functions
Number of distinct callers of a function
Description
This metric measures the number of distinct callers of a function.
In C++ , Polyspace® does not calculate this metric for virtual functions and compiler generated implicit functions, such as default constructors and destructors. The metric is calculated for user-defined constructors and destructors. In a class hierarchy, if a base class has user-defined constructors, Polyspace counts this metric for corresponding constructors of the derived classes.
The recommended upper limit for this metric is 5. For more self-contained code, try to enforce an upper limit on this metric.
To enforce limits on metrics, see Compute Code Complexity Metrics Using Polyspace.
Computation Details
Note that the metric:
Takes into account direct callers only.
Does not consider calls through a function pointer.
Takes into account all function calls, including ones in unreachable code.
However, if a caller calls a function more than once, the caller is counted only once when this metric is calculated.
Examples
Metric Information
Group: Function |
Acronym: CALLING |
HIS Metric: Yes |