Main Content
Number of Goto Statements
Number of goto
statements
Description
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 |