Slide 3
Slide 3 text
Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 3
Function Metrics
• Cyclomatic Complexity. It is a quantitative measure of
the number of linearly independent paths
• Paths occurs when a "while", "for", "if", "case" and "goto"
keywords appear within the function.
• if the source code contained no control flow
statements (conditionals or decision points), the
complexity would be 1
• If the code had one single-condition IF statement, there
would be 2 paths through the code: one where the IF
statement evaluates to TRUE and another one where it
evaluates to FALSE
• Two nested single-condition IFs, or one IF with two
conditions, would produce a complexity of 3.