Content deleted Content added
m Bot: Migrating 2 interwiki links, now provided by Wikidata on d:q5399576 |
→Cyclomatic complexity: +dubious, see talk page, see structured program theorem |
||
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.{{Dubious|Cyclomatic complexity section is unrelated to the rest of the article.}}
However, the [[structured program theorem]] proves that goto is '''never''' necessary; any program including goto can be re-written as an equivalent program that does not contain goto. Hence, this sense of essential complexity is not essential.
For example, the following C program fragment has an essential complexity of 1, because the inner '''if''' statement and the '''for''' can be reduced:
|