CodeQL library for C#
codeql/csharp-all 0.9.2-dev (changelog, source)
Search

Module Complexity

Import path

import semmle.code.csharp.metrics.Complexity

Imports

csharp

The default C# QL library.

Predicates

cyclomaticComplexity

the number of branching statements (if, while, do, for, foreach switch, case, catch) plus the number of branching expressions (?, &&, ||, ??) plus one. Callables with a high cyclomatic complexity (> 10) are hard to test and maintain, given their large number of possible execution paths. They should be refactored.