// code-iq analyze

Paste any code snippet and get a multi-dimensional intelligence score. Measures cyclomatic & cognitive complexity, documentation density, error handling coverage, and type safety — then computes a compositeCode IQ score.

// how-it-works

01

AST Analysis

Each snippet is parsed into an abstract syntax tree. Decision points, nesting depth, and structural patterns are counted from the tree — no regex guesswork.

02

Metric Scoring

Raw metrics are normalized against industry benchmarks. Cyclomatic scores use McCabe's thresholds (≤10 ideal). Cognitive complexity follows SonarQube weighting (each nesting level adds exponentially).

03

Composite IQ

The six dimension scores are weighted and combined into a single Code IQ score (0–100). The weighting favors structural health and error handling over raw documentation density.

04

Actionable Output

Every finding includes a specific recommendation — not just "complexity is high" but which function and which nesting level to refactor, prioritized by impact.

// benchmarks

A
90–100 — Excellent. Production-ready, well-structured, well-tested.
B
70–89 — Good. Minor improvements in documentation or structure would help.
C
50–69 — Fair. Needs refactoring in complexity or error handling.
D
30–49 — Needs work. High complexity, poor documentation, or missing error handling.
F
0–29 — Critical. Immediate restructuring recommended.