Skip to content

Gendarme.Rules.Maintainability.AvoidComplexMethodsRule(2.10)

Sebastien Pouliot edited this page Jan 22, 2011 · 2 revisions

AvoidComplexMethodsRule

Assembly: Gendarme.Rules.Maintainability
Version: 2.10

Description

This rule computes the cyclomatic complexity (CC) for every method and reports any method with a CC over 25 (this limit is configurable). Large CC value often indicate complex code that is hard to understand and maintain. It's likely that breaking the method into several methods will help readability. This rule won't report any defects on code generated by the compiler or by tools.

Examples

Notes

  • This rule is available since Gendarme 2.0

Configuration

Some elements of this rule can be customized to better fit your needs.

HighThreshold

Methods with cyclomatic complexity less than this (but higher than MediumThreshold) will be reported as high severity.

LowThreshold

Methods with cyclomatic complexity less than this will be reported as low severity.

MediumThreshold

Methods with cyclomatic complexity less than this (but higher than LowThreshold) will be reported as medium severity.

SuccessThreshold

The cyclomatic complexity at which defects begin to be reported.

Clone this wiki locally