Stellarion measures code quality using industry-standard metrics that help you identify problematic code and track improvements over time.
Cyclomatic complexity counts the number of independent paths through a function. Higher numbers indicate more complex code that's harder to test and maintain.
| Score | Rating | Recommendation |
|---|---|---|
| 1-10 | Low | Code is simple and maintainable |
| 11-20 | Moderate | Consider simplifying |
| 21-30 | High | Should be refactored |
| 31+ | Very High | Requires immediate attention |
if / else statementsswitch / case blocksfor, while, do-while)&&, ||)Cognitive complexity measures how difficult code is for humans to understand. Unlike cyclomatic complexity, it considers nesting depth and cognitive "breaks" in linear flow.
| Score | Rating | Recommendation |
|---|---|---|
| 0-5 | Low | Easy to understand |
| 6-10 | Moderate | Acceptable for most functions |
| 11-15 | High | Consider breaking up |
| 16+ | Very High | Difficult to maintain |
break, continue, goto)The maintainability index is a composite score (0-100) based on:
| Score | Rating |
|---|---|
| 85-100 | Highly maintainable |
| 65-84 | Moderately maintainable |
| 0-64 | Difficult to maintain |
Metrics are indicators, not rules. A complex function might be acceptable if:
Individual scores matter less than trends. Track metrics over time to ensure quality doesn't degrade as the codebase grows.
Focus refactoring efforts on code that:
Ask Claude Code to analyze your code quality:
Analyze the complexity of all functions in src/.
Show me anything with cyclomatic complexity over 15.
What's the maintainability index for this project?
Which files score lowest?