Number of Direct Recursions
Number of instances of a function calling itself directly
Description
Note
Use Bug Finder instead of Code Prover for computing code metrics. Support for computing code metrics in Code Prover will be removed in a future release. See Version History.
This metric specifies the number of direct recursions in your project.
A direct recursion is a recursion where a function calls itself in its own body. If indirect recursions do not occur, the number of direct recursions is equal to the number of recursive functions.
The recommended upper limit for this metric is 0. To avoid the possibility of exceeding
available stack space, do not use recursions in your code. To detect use of recursions,
check for violations of MISRA C:2012 Rule 17.2
or Number of Direct
Recursions Exceeds Threshold
.
To enforce limits on metrics, see:
Examples
Metric Information
Group: Project |
Acronym: AP_CG_DIRECT_CYCLE |
HIS Metric: Yes |