Essential complexity: Difference between revisions

Content deleted Content added
Add of an url to the NIST, in order to ease the understanding and the computing of the essential complexity
sentence completed with "and then do not increase the essential cyclomatic complexity"
Line 11:
== Cyclomatic complexity ==
{{main|Cyclomatic complexity}}
'''Essential complexity''' is also used with a different meaning in connection with [[cyclomatic complexity]]. In this context, essential complexity refers to the cyclomatic complexity after iteratively replacing all well structured control structures with a single statement. Structures such as if-then-else and while loops are considered well structured and then do not increase the essential cyclomatic complexity. Unconstrained use of goto, break and continue statements can produce programs which can not be reduced in this way.
 
For example, the following C program fragment has an essential complexity of 1, because the inner '''if''' statement and the '''for''' can be reduced:
Line 23:
for(i=0;i<m;i++) {
for(j=0;j<n;j++) {
if(z[i][j] != 0) '''goto non_zero''';
}
'''goto found''';
non_zero:
}