Number of Called Functions
Number of distinct functions called within the body of a function
Description
This metric specifies the number of distinct functions that are called by a function within its body.
This metric includes:
Calls in unreachable code.
Calls to standard library functions.
Calls to user defined constructors and destructors.
The metric excludes:
Calls through a function pointer.
Calls to virtual functions.
Calls to
assert
. Polyspace® considersassert
as a macro and not a function.Inlined functions. Compilers might inline certain function calls, such as the default or implicit constructors and destructors.
The recommended upper limit for this metric is 7. 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. To enforce violation of code metrics limits as Bug Finder defects, use the Software Complexity checkers. See Reduce Software Complexity by Using Polyspace Checkers
Examples
Metric Information
Group: Function |
Acronym: CALLS |
HIS Metric: Yes |