Back to Intellij Community

CyclomaticComplexity

java/java-impl/resources/inspectionDescriptions/CyclomaticComplexity.html

2025.3-rc-2457 B
Original Source

Reports methods that have too many branch points.

A branch point is one of the following:

  • loop statement
  • if statement
  • ternary expression
  • catch section
  • expression with one or more && or || operators inside
  • switch block with non-default branches

Methods with too high cyclomatic complexity may be confusing and hard to test.

Use the Method complexity limit field to specify the maximum allowed cyclomatic complexity for a method.