Live Cognitive ComplexityReal-time Sonar-style cognitive complexity in VS Code and Cursor. See complexity as you type, above every method and class — with color-coded low / medium / high bands, ratio %, and absolute scores.
Features
InstallFrom the VS Code Marketplace (after publish)
Same steps work in Cursor (it uses the VS Code extension ecosystem). From a VSIX (local / pre-release)
Then in VS Code / Cursor:
Development host (F5)
What it measuresLive Cognitive Complexity (Sonar) estimates how hard control flow is to understand:
Unlike cyclomatic complexity, it ignores “readable shorthand” and focuses on mental load. Defaults match Sonar rule S3776 ( Sample results (
|
| Symbol | Metric |
|---|---|
OrderService (class) |
sum 16, max 14, high 0 |
add |
CC 0 (low) |
validate |
CC 2 (low) |
fulfill |
CC 14 (medium) |
Configuration
| Setting | Default | Description |
|---|---|---|
liveCognitiveComplexity.enabled |
true |
Master switch |
liveCognitiveComplexity.showCodeLens |
true |
Method CodeLens |
liveCognitiveComplexity.showClassCodeLens |
true |
Class sum / max / high |
liveCognitiveComplexity.showStatusBar |
true |
Cursor method in status bar |
liveCognitiveComplexity.errorThreshold |
15 |
High band + ratio denominator |
liveCognitiveComplexity.warningThreshold |
10 |
Medium absolute lower bound |
liveCognitiveComplexity.mediumRatioPercent |
67 |
Medium ratio lower bound |
liveCognitiveComplexity.excludeAnonymousClassMethods |
true |
Skip anonymous class methods |
liveCognitiveComplexity.excludeEqualsHashCode |
true |
Skip equals / hashCode |
liveCognitiveComplexity.excludePatterns |
target, build, … |
Exclude globs |
Also ensure editor CodeLens is on: "editor.codeLens": true.
Requirements
- VS Code / Cursor
^1.85.0 - Native
tree-sitterbindings (bundled in the VSIX). If load fails after a platform change:npm rebuild tree-sitter tree-sitter-java
Privacy
Analysis runs entirely on your machine. Source is not uploaded. No telemetry.
Roadmap
- [ ] TypeScript / JavaScript
- [ ] Python
- [ ] Go
- [ ] Optional Problems panel diagnostics for high methods
Develop
npm install
npm test
npm run compile
See PUBLISH.md for GitHub + Marketplace release steps.
License
MIT

