Nifty Code Metrics
Complexity and size for every function in any language, as CodeLens and warnings, plus a hotspots view of the complex files that change most often.
Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.
Features



- Complexity above every function. A CodeLens shows each function's cyclomatic complexity and size, e.g.
Complexity 14 (high) · 52 lines, in TypeScript, JavaScript, Python, Go, Rust, Java, C#, C/C++, PHP, Ruby, Kotlin, Swift and more. Click it to see what the number means and how to bring it down.
- Any language. Functions come from the language's own outline, so every language with an outline works. For Python, Ruby, Lua and shell scripts, functions are also found by indentation when no language server is installed. Comments and strings are ignored, and nested functions are counted separately.
- Warnings where it matters. Functions at or over the threshold (10 by default) are flagged as hints, or as information or warnings if you prefer, so they show up in the Problems panel.
- Status bar. Shows the complexity of the function at the cursor, turning yellow over the threshold and red at twice it.
- Functions by complexity. Show Functions by Complexity lists the file's functions with the most complex first. Pick one to jump to it.
- Complexity hotspots. A view in the Explorer ranks the files that are both complex and changed often in git. Those are the files where bugs cluster and refactoring pays off first.
- Hotspot reports. Export the ranked hotspots as Markdown or CSV for a pull request, a tech-debt review or a spreadsheet.
Commands
| Command |
What it does |
Nifty Code Metrics: Show Functions by Complexity |
List the file's functions, most complex first, and jump to one |
Nifty Code Metrics: Explain Complexity at Cursor |
Complexity, size and nesting of the function at the cursor |
Nifty Code Metrics: Refresh Hotspots |
Rescan the workspace for hotspots |
Nifty Code Metrics: Export Hotspots Report |
Save the hotspots as Markdown or CSV |
Settings
| Setting |
Default |
What it does |
nifty.metrics.threshold |
10 |
Complexity at which a function counts as complex (twice this is "very high") |
nifty.metrics.codeLens |
all |
all, complex (only over the threshold) or off |
nifty.metrics.diagnostics |
hint |
Report complex functions as hint, information or warning, or off |
nifty.metrics.statusBar |
true |
Show the complexity at the cursor in the status bar |
nifty.metrics.languages |
common languages |
Language IDs to measure |
nifty.metrics.churnMonths |
12 |
Months of git history that count as churn for hotspots |
nifty.metrics.hotspotCount |
50 |
How many files the hotspots view lists |
nifty.metrics.hotspotMaxFiles |
5000 |
Most source files to scan for hotspots |
nifty.metrics.hotspotExclude |
build and dependency folders |
Glob of files the hotspots view leaves out |
How it's measured
Cyclomatic complexity is 1 plus the number of decision points: if, else if, loops, case/when arms, catch/except, &&, ||, ?? and the ternary ?: (or and/or in Python, Ruby and Lua). The hotspot score is complexity × log₂(2 + commits in the churn window), so a moderately complex file that changes every week ranks above a huge one nobody touches.
Install
- VS Code: search for "Nifty Code Metrics" in the Extensions view, or install from the Visual Studio Marketplace.
- Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.
Privacy
This extension collects no telemetry and needs no account.
- Nifty Whitespace: Indent Rainbow, Invisible Characters & Trim: Indent rainbow, invisible and confusable characters with quick fixes, mixed line endings and tabs, and trimming trailing whitespace only on the lines you changed. (Open VSX)
- Nifty Actions: Workflow Checks, SHA Pinning & act: GitHub Actions workflows without sign-in: completion and go to definition for local and reusable actions, actionlint checks, pin actions to commit SHAs, and run jobs locally with act. (Open VSX)
- Nifty Agent Config: AGENTS.md, Rules & MCP Files: See which AGENTS.md, CLAUDE.md, Cursor, Copilot, Windsurf and Gemini rules apply to the file you are editing. Lint rule and MCP files for hidden text, secrets and broken links, and keep them in sync. (Open VSX)
- Nifty Colors: Swatches & Picker in Every Language: Colour swatches and VS Code's picker in any file: CSS, Tailwind, Flutter, Swift, Android, C# and Unity colours. Convert formats and check WCAG contrast on hover. (Open VSX)
- Nifty CSS Variables: Custom Property IntelliSense: IntelliSense for CSS custom properties across your project: complete var(--…), see resolved values and colour swatches, go to definitions, catch undefined variables, and browse a colour palette. (Open VSX)
- Nifty Data Viewer: CSV & Parquet Viewer with SQL: Open CSV, Parquet and JSON files as a fast table and query them with SQL, powered by DuckDB. Sort, page through millions of rows, and export to CSV, Parquet or JSON. (Open VSX)
See all 100+ Nifty extensions and web tools at https://getnifty.dev
| |