Code health — health, risk
repowise health scores every file from deterministic markers across three signals (defect risk, maintainability, performance); 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 deterministic markers (McCabe complexity, nesting, brain methods, LCOM4 cohesion, god classes, native clone detection, untested hotspots, coverage gradient, git-behavioural risk, and static performance risk), surfaced as three signals: defect risk, maintainability, and performance. 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 structured plans (impact / effort)
repowise health --generate-code src/api/server.py::handler # LLM patch for one target
repowise health --trend # snapshot history + alerts
repowise health --format json | jq .kpis # machine-readableCoverage is ingested separately with repowise coverage add <report>, and
repowise health automatically folds in whatever coverage you have already
ingested — no flag needed. coverage add also builds a per-test test-to-code
map when the report carries contexts (a coverage.py .coverage, or coverage run --contexts=test).
repowise 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 markers (untested_hotspot, coverage_gap,
coverage_gradient) only fire once you've ingested a report with
repowise coverage add. Per-file
marker overrides live in .repowise/health-rules.json.
--refactoring-targets emits structured, graph-aware fix plans — see
Refactoring intelligence.
repowise risk
Just-in-time change-risk scoring for a commit or diff range. Scores
the defect risk of a change from the same calibrated signals the
health layer uses — no LLM calls, and it works without repowise init
(pure git + learned constants). The revision defaults to HEAD; pass a
base..head range to score a whole branch or PR as one change.
The headline is repo-relative: the change's percentile and review
priority (Below typical / Typical / Elevated) within the repo's own
recent commits, sampled live. The raw 0–10 model score is still shown, but
as a secondary, corpus-anchored number.
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.
Distill — compact command output
Run noisy commands through repowise distill for an errors-first, fully reversible rendering — 60–90% fewer tokens on tests, builds, git, and searches, with zero error-line loss.
Workspace — multi-repo commands
Manage repos in a repowise workspace — list, add, remove, scan, and pick the default.