Cyclomatic complexity measures how many linearly independent paths can run through a program’s control flow. Conditional statements increase the number of paths that tests must consider.
Imperative versus functional code
The imperative showStudent implementation has cyclomatic complexity 4, while the functional implementation has complexity 1. Their complexity densities are 29% and 3%, respectively, alongside maintainability indexes of 100 and 148.




