Cognitive complexity

This metric has no screenshot. Open it in the interactive 3D view of a project below.

What it measures

Sum of the cognitive complexity of all functions of a file. Unlike cyclomatic complexity it weighs nesting, so deeply nested code counts more than flat code with the same number of branches.

How to read it

Height is lines of code. Red means the code is hard to understand, white means it reads easily.

low highest value in project

Why it matters

Code that is hard to read is where misunderstandings and bugs happen, for people and for AI assistants alike. Tall red buildings are good candidates for refactoring.

Open it in a project

Related metrics