Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Cyclomatic Complexity

André Ricardo edited this page Jan 29, 2018 · 9 revisions

Cyclomatic Complexity

What is Cyclometric Complexity?

Okay the standard resources for this topic appear to be the Thomas J McCabe paper and good old wikipedia.

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 to leverage the Cyclomatic Complexity metric as produced by the Gendarme AvoidComplexMethodsRule. It also uses Mono.Cecil and so is easy to integrate into OpenCover.

What is NPath Complexity?

NPath complexity explained

PMD documentation example of NPath complexity path

OpenCover NPath implementation