Static analysis for the patterns that accumulate when AI generates faster than humans review.
Patina detects code quality anti-patterns — redundant comments, empty error handlers, structural bloat — that AI produces at dramatically elevated rates. It doesn't detect who wrote the code. It detects patterns, regardless of origin.
No models. No API keys. No telemetry. Deterministic, fast, local, and free.
# Build from source
git clone https://github.com/patina-dev/patina.git
cd patina
cargo build --release
# Scan a project
./target/release/patina scan path/to/your/project
# JSON output for CI
./target/release/patina scan path/to/your/project --format jsonGiven this JavaScript:
// Set the user name
user.setUserName(name);
// Initialize the application config
initializeApplicationConfig();Patina reports:
Warning: [slop-001] Redundant Comment: comment restates the adjacent code
╭─[ src/app.js:2:1 ]
│
2 │ // Set the user name
│ ──────────┬─────────
│ ╰─────────── Remove this comment — it restates the code without adding context.
───╯
These comments add nothing that the code doesn't already say. They're noise that slows down every reviewer who reads them.
Comments that add context beyond the code are left alone:
// Normalize Unicode before comparison to handle locale-specific equivalence
user.setName(normalizeName(name));
// Using post-increment here because the value is read before update
counter++;
// TODO: Replace with a proper LRU cache when we exceed 10k entries
const cache = new Map();These explain why, not what. Patina knows the difference.
- Walks your file tree (respects
.gitignore) - Parses JS/TS files into ASTs using tree-sitter
- For each comment, extracts meaningful tokens (strips stop words, stems suffixes, splits
camelCase/snake_caseidentifiers) - Computes overlap between comment tokens and adjacent code tokens
- If ≥70% of the comment's words are just restating the code, it's flagged
The full algorithm is documented in docs/slop-001/SPEC.md.
| Rule | Name | What it detects |
|---|---|---|
slop-001 |
Redundant Comment | Comments that restate adjacent code without adding context |
More rules are planned. See docs/VISION.md for the roadmap.
- JavaScript (
.js,.jsx) - TypeScript (
.ts,.tsx)
More languages are planned — the architecture supports any language with a tree-sitter grammar.
| Format | Flag | Use case |
|---|---|---|
| Terminal | --format terminal (default) |
Human-readable with annotated code snippets |
| JSON | --format json |
Machine-readable for CI/CD pipelines |
| Code | Meaning |
|---|---|
0 |
No findings |
1 |
Findings detected |
- Pattern-aware, not author-aware. Patina doesn't judge who wrote the code. If a human writes a redundant comment, it gets flagged. If an AI writes clean code, it stays quiet.
- Deterministic. Same input, same output. Always.
- Transparent. Every finding has a rule ID, an explanation, and a configurable threshold.
- Free forever. Open source, no billing tiers, no telemetry.
See CONTRIBUTING.md. Whether it's a bug report, a false positive, a new rule idea, or a typo fix — contributions are welcome.
GPL-3.0-only — because the tooling that keeps code honest should stay honest itself.