AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
Analyze cyclomatic complexity, cognitive complexity, nesting depth, and maintainability of your source code. Supports JavaScript, TypeScript, Python, PHP, Java, Go, Ruby, C++, and C#.
| Function | Lines | Cyclomatic | Nesting | Assessment |
|---|
Code complexity analysis measures how complicated your source code is using software metrics. The most common metric is cyclomatic complexity, developed by Thomas McCabe in 1976, which counts the number of linearly independent paths through a program's source code. Each decision point (if, else, switch case, loop, catch, ternary operator, logical operator) increases the complexity score.
This tool also calculates cognitive complexity (how hard code is to understand for humans), nesting depth (maximum level of nested control structures), and maintainability index (a composite score from 0-100 combining cyclomatic complexity, lines of code, and Halstead volume). Lower complexity scores indicate code that is easier to test, debug, and maintain. Industry best practices recommend keeping cyclomatic complexity under 10 per function and nesting depth under 4 levels.
Cyclomatic complexity, developed by Thomas McCabe in 1976, measures the number of linearly independent paths through a program's source code. Each decision point (if, else if, switch case, while, for, catch, ?: ternary, logical &&/||) adds 1 to the count. Best practice recommends keeping it under 10 per function.
Cyclomatic complexity counts every decision point equally. Cognitive complexity, introduced by SonarSource, weights decisions by how much they increase human comprehension difficulty. Deep nesting, boolean logic chains, and recursion increase cognitive complexity more than simple independent if statements.
The maintainability index ranges from 0-100. A score of 85+ is highly maintainable, 65-84 is moderately maintainable, and below 65 indicates low maintainability where significant refactoring is recommended.
Best practices recommend keeping nesting depth at 4 levels or fewer. Depth of 1-2 is ideal, 3-4 is acceptable but worth reviewing, and 5+ indicates code that should be refactored by extracting inner blocks into separate functions or using early returns.
No. All analysis is performed entirely in your browser. Your source code is never uploaded, stored, or transmitted. The complexity metrics are computed client-side using JavaScript.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026