> ## Documentation Index
> Fetch the complete documentation index at: https://reikon.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Quality

> Complexity, duplicates, dead code, tech debt, and test coverage across 11 languages.

# Tour: Code Quality

The deepest tab — eight sub-views covering complexity, duplication, debt, and dead
code across 11 languages.

## Line Count

Per-language, per-package line/file/byte breakdown. The baseline everything else in
this tab gets measured against.

## Files

Four views in one: **Largest** files by line count, **Churn** (most-changed files),
**Dead weight** (large files with zero recent commits — candidates for deletion or
investigation), and a **Treemap** heatmap (area = lines, color = churn intensity).
Every file row has a "Safe to refactor?" check — combines ownership, complexity,
churn, and test coverage into one plain-English risk rating, e.g. *"High churn, single
owner, no test coverage — refactor carefully."* Everything it needs is already
computed elsewhere in the app; this just combines it.

Every file row (here and throughout the app) also carries an **Open in** split button:
the main part opens the file in your **default** editor in one click; the caret opens a
chooser of the editors Reikon detects on your machine (VS Code, Cursor, a JetBrains IDE,
Sublime, …) plus **Reveal in Finder/Explorer** and **Terminal** (opens the file's folder).
Your last pick becomes the new default. Detection is local — nothing is fetched.

## TODOs

Every `TODO`, `FIXME`, `HACK`, and `XXX` comment in your codebase, gathered in one place —
whatever language it's written in. If AI is connected, each one is sorted automatically into
bug, debt, feature, or question so you can see at a glance what's a real problem versus a stray note.

## Duplicates

Detected duplicate code blocks across the codebase, with an AI explanation option per
block if you want to understand what a flagged duplicate actually does before
deciding whether to extract it.

## Complexity

Cyclomatic complexity per function, across JavaScript, TypeScript, Python, Go, Rust,
Java, C, C++, Ruby, PHP, and C# — powered by tree-sitter, not a regex heuristic.
Severity bands: simple (below 6), moderate (6–9), complex (10–19), very complex (20+).
Expand any file to see a complexity trend sparkline across its recent commit history.

## Debt

Tech debt estimated per file from complexity × churn × size — see
[the formula](../../reference/formulas#tech-debt-estimate). A stat tile shows what
percentage of files flagged High Risk actually required a hotfix-pattern commit in the
last 60 days — turning the heuristic into something you can check against real history
instead of taking on faith.

## Dead Code

Unused imports, unused exports, and unused assets. JavaScript and TypeScript use real
AST analysis — path aliases and barrel re-exports are resolved so things only imported
through an index file aren't falsely flagged. Unused imports are also detected for Python
(`import` / `from … import`), PHP (`use …`), and Java (`import …`) at the file level. Each
result row shows a language badge (`TS` / `JS` / `PY` / `PHP` / `Java`) so mixed-language
repos stay readable. Go and Rust are intentionally left out — their own compilers already
reject unused imports — as are Ruby and C#, whose `require` / namespace `using` statements
don't bind a name a file refers to, so there's nothing to reliably match against.

## Coverage

Test coverage per file, read straight from whatever your test suite already produces —
LCOV (`lcov.info`), Jest's JSON summary, Cobertura XML (Python's `coverage`), JaCoCo XML
(Java), or a Go cover profile. No extra configuration: if a report is there, Reikon finds
and shows it. Absent entirely if no coverage tool is set up — Reikon never shows a
fabricated 0%.
