Getting Started
Scan a Rust workspace, get a score out of 100 and the three rules worth fixing first.
#What is rust-doctor?
rust-doctor inspects a local Cargo workspace with curated Clippy lints and native detectors, then scores it out of 100. It ends by naming the three rules worth fixing first, ranked by what repairing each one is expected to be worth.
Everything runs on your machine. No network, no upload, no telemetry.
#Quick start
npx -y rust-doctor@latest .On a terminal, that opens the interactive report. In CI, a pipe, or an agent
run, add --yes to get the linear one.
#What it checks
62 rules across five producers. A rule's identifier names the producer that emits it.
| Producer | Rules | What it reads |
|---|---|---|
clippy::* | 37 | Clippy, curated rather than the whole set |
rust_doctor::cargo::* | 11 | Cargo.toml, Cargo.lock, .cargo/config.toml |
rust_doctor::structure::* | 9 | Complexity and near-duplicate code families |
rust_doctor::repo::* | 3 | What git tracks |
rust_doctor::source::* | 2 | Source text |
By category: maintainability 16, reliability 14, correctness 11, performance 10, security 6, dependencies 5.
Every rule ships at warn. Raising one to error, or dropping it entirely, is
your policy decision: see Configuration.
#How the score works
The score is a weighted average across 5 dimensions (Security ×2, Reliability ×1.5, Maintainability ×1, Performance ×1, Dependencies ×1). Each dimension starts at 100 and subtracts a penalty for each distinct rule violated:
- Error-level rule: -1.5 points
- Warning-level rule: -0.75 points
- Info-level rule: -0.25 points
Counting distinct rules rather than diagnostics is what keeps the score invariant to codebase size, and what makes fixing every occurrence of one issue remove that penalty entirely.
| Score | Label | Meaning |
|---|---|---|
| 75–100 | Great | Healthy codebase |
| 50–74 | Needs work | Accumulated technical debt |
| 0–49 | Critical | Significant issues to address |
A score is published as authoritative only when every pass completed. If a pass fails, the report says so at that stage and drops the flag, rather than reporting a number that silently means less.