Code health — health, risk
repowise health scores every file from 25 deterministic biomarkers; repowise risk scores the defect risk of a commit or diff range. Both are zero-LLM and run in seconds.
repowise health
Compute per-file code-health scores from 25 deterministic biomarkers (McCabe complexity, nesting, brain methods, LCOM4 cohesion, god classes, native clone detection, untested hotspots, coverage gradient, and git-behavioural risk). Zero LLM calls — pure Python over tree-sitter + git data.
repowise health [PATH] [OPTIONS]Prop
Type
repowise health # KPIs + lowest-scoring files
repowise health --file src/api/server.py # one file in detail
repowise health --module src/api # restrict to a directory
repowise health --refactoring-targets # ranked by impact / effort
repowise health --trend # snapshot history + alerts
repowise health --coverage coverage.lcov # ingest coverage
repowise health --format json | jq .kpis # machine-readablerepowise init and repowise update populate the health tables
automatically — no separate step needed. repowise status prints a
one-line summary:
Health: 7.4 (avg) · 6.2 (hotspots) · 2.1 (worst: payments/processor.ts)Coverage biomarkers (untested_hotspot, coverage_gap,
coverage_gradient) only fire once you've passed --coverage. Per-file
biomarker overrides live in .repowise/health-rules.json.
repowise risk
Just-in-time change-risk scoring for a commit or diff range. Scores
the defect risk of a change (0–10) from the same calibrated signals the
health layer uses — no LLM calls. The revision defaults to HEAD; pass a
base..head range to score a whole branch or PR as one change.
repowise risk [REVSPEC] [OPTIONS]Prop
Type
repowise risk # score HEAD
repowise risk main..HEAD # score a branch / PR range as one change
repowise risk --ext .ts,.tsx # restrict to specific suffixesUse it in a pre-push hook or CI step to flag high-risk changes before
review. For agentic workflows, get_risk exposes
the same signals per file plus PR blast-radius analysis.