// 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
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.
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).
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.
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
// verdict
## // verdict
Should I adopt this? Use it as a conversation starter, not a quality gate.
What it actually is. A client-side heuristic analyzer that scores five dimensions — complexity, documentation, error handling, type coverage — and collapses them into one composite number. No code leaves your browser; there is no backend and no model.
Use it when you want a quick, consistent read on whether a file is overcomplicated, under-documented, or thin on error handling — for personal triage or a code-review warm-up.
Don't rely on it when the score will drive any formal decision. The five metrics are real software-engineering measures (cyclomatic complexity, cognitive complexity) recognized in research literature, but the composite weighting across them is this site's own choice, not an industry standard. A file can be genuinely production-critical and still score poorly because the heuristics read density as complexity and sparse comments as a documentation gap.
The grade bands (A–F) are conventions this tool defines, not norms measured against a corpus. Treat an "A" as "the heuristics found nothing to flag here", not as a certificate.
Bottom line: fast, honest about its scope, useful for first-pass triage. Not a substitute for review, tests, or a real quality program.