Real-time code complexity analysis with Cyclomatic and Halstead metrics, refactoring suggestions, and visual feedback right inside Visual Studio Code.
A VS Code extension that analyzes code complexity and provides visual feedback through status bar indicators, gutter decorations, and file explorer badges.
- Real-time Complexity Analysis: Automatically analyzes your code as you work
- Visual Feedback:
- Status bar percentage indicator
- Color-coded gutter decorations (green/blue/red)
- File explorer badges (L/M/H)
- Multiple Language Support: Works with JavaScript, TypeScript, Python, Java, and more
- Customizable Thresholds: Configure your own complexity thresholds
- Open VS Code
- Go to the Extensions view (
Ctrl+Shift+X
) - Search for "Code Check Complexity"
- Click Install
Alternatively, you can install from the VS Code Marketplace.
The extension works automatically when you:
- Open a file
- Save a file
- Switch between files
You can manually trigger analysis:
- Open the Command Palette (
Ctrl+Shift+P
) - Type "Analyze Code Complexity"
- Press Enter
Indicator | Complexity Level | Color | Description |
---|---|---|---|
L | Low (<40%) | Green | Simple, easy to understand code |
M | Medium (40-70%) | Blue | Moderately complex code |
H | High (>70%) | Red | Complex code that may need refactoring |
You can customize the extension behavior by adding these settings to your VS Code settings.json
:
{
"codeCheckComplexity.keywords": [
"if", "for", "while", "function",
"switch", "case", "catch", "try",
"else if", "else"
],
"codeCheckComplexity.lowThreshold": 40,
"codeCheckComplexity.mediumThreshold": 70
}