What it analyzes
barad-dur reads your git history — no code parsing required — and computes four families of metrics.
Health
Hotspot files, coupling patterns, and an overall 0–100 score that tells you where the risk is.
Team
Ownership distribution, bus factor, and contribution spread across your codebase.
Evolution
Change frequency, age of files, and trend analysis so you can see where churn is accelerating.
Hygiene
Commit message quality, branch discipline, and merge patterns that reflect process health.
How it works
Point it at a repo
Run barad-dur analyze . inside any git repository. It walks the full history and caches the snapshot for future runs.
Metrics are computed
Each of the four metric families runs against the snapshot independently. Scores are aggregated into a single overall 0–100 grade.
Pick your output
Human-readable CLI output by default. Add --json for machine consumption or --html for a self-contained interactive report.
Output formats
barad-dur produces three output formats from a single analysis pass.
CLI
Compact, color-coded summary. Designed for daily use and CI pipelines.
JSON
Full structured output with --json. Pipe it, store it, diff it over time.
HTML
Self-contained interactive report with --html. No server needed — one file, share anywhere.
barad-dur analyze . # CLI output
barad-dur analyze . --json --pretty # JSON
barad-dur analyze . --html -o report.html # HTML
Why use it
barad-dur is built for four use cases:
- Self-assessment — understand which parts of your own codebase are drifting.
- Team leads — spot bus-factor risks and hotspots before they become incidents.
- CI/CD pipelines — track scores over time with quality gates that fail the build when health degrades.
- Onboarding — get oriented in an unfamiliar codebase in minutes, not days.