Main Content
Number of Goto Statements
Number of goto
statements
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 goto
statements
in a function.
break
and continue
statements
are not counted.
The recommended upper limit on this metric is 0. For better
readability of your code, avoid goto
statements
in your code. To detect use of goto
statements,
check for violations of MISRA C:2012 Rule 15.1
.
To enforce limits on metrics, see Compute Code Complexity Metrics Using Polyspace.
Examples
Metric Information
Group: Function |
Acronym: GOTO |
HIS Metric: Yes |