Overview
Iris is a VS Code extension for static code insights — health scores, complexity analysis, function detection, code smell detection, and TypeScript quality metrics. It supports JavaScript, TypeScript (JS/JSX/TS/TSX), Go, and Python. Everything runs locally — no backend, no AI, no telemetry.
- Automatic analysis on every file open and save
- Health score from 0 - 100 per file and workspace
- Complexity scoring, function lists, import tracking
- Code smell detection with clickable jump-to-line
- Workspace and folder-level aggregated stats
- Configurable thresholds via
.irisconfig.jsonor VS Code settings
Installation
Install Iris from the VS Code Marketplace — it's free.
- 1Open VS Code and go to the Extensions panel (
Ctrl+Shift+X) - 2Search for Iris and click Install
- 3The Iris icon appears in the Activity Bar
- 4Open any JS, TS, Go, or Python file — the sidebar populates instantly
Quick Start
Once installed, Iris works with zero configuration. Here's what to expect:
- Open any supported file — the File tab shows the health score, complexity, functions, and smells
- Run Iris: Analyse Workspace from the command palette to scan your entire project
- Right-click any folder in Explorer and choose Iris: Analyse This Folder for scoped analysis
- Click any warning or finding in the sidebar to jump directly to that line
- Add a
.irisconfig.jsonat your project root to share thresholds across your team
File Analysis
Iris analyses every supported file automatically as you open or save it. The File tab shows:
- Health score — 0–100 composite score penalising warnings, deep nesting, long functions, and debug prints
- Language badge — Go / TypeScript / JavaScript / Python badge in the file header
- Line counts — total lines, blank lines, code lines
- Complexity score — 1–10 score based on function density, nesting depth, control flow, and import count
- Function list — all detected functions with line numbers, each clickable to jump to source
- Import tags — third-party packages detected via import statements
- Unused imports — named/default/namespace bindings that are imported but never referenced (TypeScript/JavaScript only)
TypeScript Metrics
Shown only for TS/JS files; hidden automatically for Go and Python.
| Metric | What it tracks |
|---|---|
any usages | Counts explicit : any / as any. Each occurrence is clickable. |
@ts-ignore | Count of TypeScript suppressions |
| Non-null assertions | Count of ! usages |
| Missing return types | Exported functions without an explicit return type annotation |
Python Support
Full Python analysis with language-aware routing:
- Functions — all
defdeclarations detected (top-level and class methods), with line numbers - Third-party imports —
import pkgandfrom pkg import ...; stdlib modules are excluded automatically - print() calls — flagged in Code Lens and Code Smells
- No public functions warning — flags if all functions start with
_(private by convention) - Unused Python packages — workspace scan reads
requirements.txtandpyproject.tomland flags declared packages never imported across.pyfiles __pycache__,.venv,venv— skipped automatically during scans- Parameter lists —
selfandclsare excluded from the parameter count
Go Support
Full Go analysis with language-aware routing:
- Functions — both top-level
func Name(and methodsfunc (r *T) Name(detected - Third-party imports — packages with a dot in the root path segment (e.g.
golang.org/x/...,pkg.example.com/...) - Debug prints —
fmt.Print*,log.Print*,log.Fatal*,log.Panic*flagged in Code Lens and Code Smells - No-exports warning — flags if no capitalised (exported) function names are found
- Unused Go modules — workspace scan reads
go.modand flags declared modules never imported across.gofiles vendor/directory — skipped automatically during workspace/folder scans
Code Smells
Iris detects several code smell patterns across all supported languages. Every finding is clickable to jump to the line.
| Smell | Detected in | Toggle setting |
|---|---|---|
Debug prints — console.log/warn/error | JavaScript / TypeScript | enableConsoleLogWarnings |
Debug prints — fmt.Print* / log.Print* / log.Fatal* / log.Panic* | Go | enableConsoleLogWarnings |
Debug prints — print() | Python | enableConsoleLogWarnings |
| Magic numbers — raw numeric literals (excluding 0 and 1) used inline without a named binding | All languages | enableMagicNumberDetection |
TODOs / FIXMEs / HACKs — from // comments (JS/TS, Go) and # comments (Python) | All languages | enableTodoDetection |
| Long parameter lists — functions with too many parameters | All languages | enableLongParamDetection |
| Unused variables — declared but never referenced elsewhere in the file | All languages | enableUnusedDetection |
| Unused functions — defined but never called within the file and not exported | All languages | enableUnusedDetection |
Warnings
Five warning types, each with configurable severity:
| Type | Default severity | Triggers at |
|---|---|---|
file-too-long | error / warning | > threshold / > ⅔ threshold |
function-too-long | error / warning | > 2× threshold / > threshold |
too-many-functions | warning | > maxFunctionsPerFile |
too-many-imports | warning | > maxImportsPerFile |
no-exports | info | no exported identifier found |
severityOverrides in .irisconfig.json.Workspace Analysis
Run Iris: Analyse Workspace from the command palette or the Scan Workspace button in the Workspace tab to get:
- Total files, directories, lines, functions
- File type breakdown with an interactive pie chart
- Largest files (top 5) and most complex files (top 5)
- Unused packages declared in
package.json,go.mod,requirements.txt, orpyproject.tomlbut never imported - All warnings aggregated into a Problems tab with error count badge
- All TODOs aggregated into a TODOs tab, grouped by type
- Interactive file tree grouped by directory
- Results are cached — navigate away and come back without re-scanning
Folder Analysis
Right-click any folder in Explorer and choose Iris: Analyse This Folder, or click Scan Current Folder in the Folder tab to analyse the folder of the currently open file.
Results appear in the dedicated Folder tab, which auto-activates on scan. The Folder tab shows the same stats, pie chart, ranked files, and tree as the Workspace tab, plus Rescan and Clear buttons.
Problems & TODOs
The Issues and TODOs tabs populate from the most recent folder or workspace scan. Each row shows severity (colour-coded dot), filename, line number, and message — all clickable to jump to source.
- Issues tab badge shows the error count (red) or total issue count
- TODOs tab badge shows the total count of TODO/FIXME/HACK items found
- Findings persist until you run a new scan or click Clear
Code Lens
Inline hints appear above functions that exceed the length threshold. Language-aware:
- JS/TS: hints next to every
@ts-ignoreandconsole.log - Go: hints next to
fmt.*/log.*debug print calls - Python: hints next to
print()calls
Disable Code Lens via VS Code setting: iris.enableCodeLens: false
Status Bar
Shows health score, line count, and function count for the active file. Turns warning/error colour based on health score and complexity threshold. Works for all supported languages.
Disable via VS Code setting: iris.enableStatusBar: false
VS Code Settings
Open settings with Ctrl+, and search "Iris" to configure:
| Setting | Default | Description |
|---|---|---|
iris.functionLengthThreshold | 40 | Lines before a function is flagged |
iris.fileLengthThreshold | 300 | Lines before a file is flagged |
iris.maxFunctionsPerFile | 10 | Max functions before flagging |
iris.maxImportsPerFile | 8 | Max third-party imports before flagging |
iris.maxParameterCount | 5 | Max parameters before flagging a function |
iris.complexityThreshold | 7 | Complexity score that triggers status bar warning |
iris.enableConsoleLogWarnings | true | Flag console.log / print() / fmt.Print* statements |
iris.enableMagicNumberDetection | true | Flag raw numeric literals used without a named binding |
iris.enableTodoDetection | true | Flag TODO / FIXME / HACK comments |
iris.enableLongParamDetection | true | Flag functions with too many parameters |
iris.enableUnusedDetection | true | Flag unused variables and functions |
iris.enableMissingReturnTypeWarnings | true | Flag exported functions missing return types (TS/JS only) |
iris.enableCodeLens | true | Show inline Code Lens hints |
iris.enableStatusBar | true | Show Iris item in status bar |
iris.severityOverrides | {} | Override severity per warning type |
iris.ignoreFiles | ["**/*.test.ts", ...] | Glob patterns for files to skip in workspace analysis |
iris.ignoreFunctions | [] | Function names Iris should never flag |
.irisconfig.json
Drop a .irisconfig.json at your project root and commit it. Every developer on the team runs Iris with the same thresholds — no per-machine drift.
Priority order: .irisconfig.json → VS Code settings → defaults
{
"functionLengthThreshold": 60,
"enableConsoleLogWarnings": false,
"ignoreFiles": [
"**/*.test.ts",
"**/*.spec.ts",
"**/generated/**"
],
"ignoreFunctions": ["main", "handler"],
"severityOverrides": {
"no-exports": "warning",
"file-too-long": "warning"
}
}Only include the keys you want to override — anything omitted falls back to VS Code settings, then defaults.
Severity Overrides
Override the severity of any warning type on a per-project basis:
| Warning key | Valid severities |
|---|---|
file-too-long | error · warning · info |
function-too-long | error · warning · info |
too-many-functions | error · warning · info |
too-many-imports | error · warning · info |
no-exports | error · warning · info |
Commands
All commands are available via the command palette (Ctrl+Shift+P):
| Command | Description |
|---|---|
Iris: Analyse Current File | Manually re-analyse the active file |
Iris: Analyse Workspace | Analyse all JS/TS/Go/Python files in the workspace |
Iris: Analyse This File | Right-click a file in Explorer to analyse it |
Iris: Analyse This Folder | Right-click a folder in Explorer to analyse it |
Iris: Analyse Current Folder | Analyse the folder of the currently open file |
Iris: Show Welcome Page | Open the Getting Started welcome page |
Context Menus
Iris adds entries to the right-click menu in two places:
Explorer (file tree)
- Right-click a JS/TS/Go/Python file → Iris: Analyse This File
- Right-click a folder → Iris: Analyse This Folder
- Right-click anywhere → Iris: Analyse Workspace
Editor (inside a file)
- Iris: Analyse Current File
- Iris: Analyse Current Folder
- Iris: Analyse Workspace