Main Content
Number of Return Statements
Number of return
statements in a function
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 measures the number of return
statements
in a function.
The recommended upper limit for this metric is 1. If one return statement is present, when reading the code, you can easily identify what the function returns.
To enforce limits on metrics, see Compute Code Complexity Metrics Using Polyspace.
Examples
Metric Information
Group: Function |
Acronym: RETURN |
HIS Metric: Yes |