Free Tool
Code Complexity Calculator
Paste your code and get instant complexity metrics. Identify functions that need refactoring.
Cyclomatic Complexity
Max Nesting Depth
Lines of Code
Branch Points
if/else/switch/loop
Overall Complexity Score
Simple
Moderate
Complex
Very Complex
Complexity Breakdown
Conditional statements (if/else)
Loops (for/while/do)
Logical operators (&&/||)
Switch cases
Ternary operators
Catch blocks
Refactoring Suggestions
Try These Examples
Complexity Thresholds
| Metric | Good | Moderate | Complex | Very Complex |
|---|---|---|---|---|
| Cyclomatic Complexity | 1-10 | 11-20 | 21-30 | 31+ |
| Nesting Depth | 1-2 | 3 | 4 | 5+ |
| Lines per Function | 1-20 | 21-40 | 41-60 | 61+ |
Get AI-Powered Code Analysis
Jasper analyzes your entire codebase and provides intelligent suggestions to reduce complexity and improve maintainability.
Start Free with GitHub