Cognitive Complexity metric (LC0089)

Cognitive Complexity measures how difficult code is to understand, as opposed to how difficult it is to execute (Cyclomatic Complexity). It takes into account nesting depth, break in linear flow, and structural complexity.

This rule reports the calculated Cognitive Complexity for procedures, allowing developers to identify code that may be hard to understand and maintain.

See also

  • LC0090 - Cognitive Complexity threshold exceeded
  • LC0009 - Cyclomatic Complexity metric