Skip to content

Cyclomatic Complexity

sawilde edited this page Jul 11, 2011 · 4 revisions

Cyclomatic Complexity

What is Cyclometric Complexity?

Okay the standard resources for this topic appear to be the Thomas J McCabe paper (http://www.literateprogramming.com/mccabe.pdf) and good old wikipedia (http://en.wikipedia.org/wiki/Cyclomatic_complexity).

But it seems to simplify as "number of decisions" + 1. With IL we have conditional branches, switch statements and we also have try/catch/fault/filter statements (I didn't include try/finally as this to me is part of the original path).

For now I have decided the leverage the Cyclomatic Complexity metric as produced by the Gendarme AvoidComplexMethodsRule. It also uses Mono.Cecil and so is easy to integrate into OpenCover.

Clone this wiki locally