ποΈ Garbage Code Hunter
A humorous Rust code quality detector that roasts your garbage code with style!
Inspiration: https://github.com/Done-0/fuck-u-code.git
What is this?
Garbage Code Hunter is a Rust static analysis tool. Unlike traditional linters that give you dry warnings, we tell you how bad your code is in a sarcastic, witty, and brutally honest way.
Think of it as a code reviewer who isn't afraid to hurt your feelings (but it's for your own good).
What can it do?
- π Detect code smells: Bad naming, deep nesting, long functions, unwrap abuse...
- π Cross-file duplication detection (NEW!): Find copy-pasted code across files
- π― Context-aware analysis: Automatically adjusts sensitivity for tests/examples/UI code
- π£οΈ Savage roasts: Every warning comes with a humorous roast to make you laugh while fixing
- π Quality scoring: 0-100 scale, higher score = worse code
- π Bilingual: Supports both English and Chinese roasts
- π€ LLM powered: Connect to Ollama for even more creative roasts
- π VSCode extension: Real-time roasting in your editor
β¨ New in v0.2.0
π Cross-File Duplication Detection
Automatically detects duplicated functions across your entire codebase:
# Output includes: π cross-file-duplication: 33 issues
π― Context-Aware Analysis
Reduces false positives by understanding code context:
- Example/Demo code: Reduces sensitivity by 70%
- Test code: Reduces sensitivity by 80%
- Benchmark/Documentation: Further reductions
- Business code: Full detection (default)
β‘ Performance Improvements
- 5x faster: Large projects (200+ files) analyzed in <1 second
- Low memory usage: <50MB for 200+ file projects
- Zero warnings: Clean compilation with 57 passing tests
Quick Start
Install
Usage
# Analyze current directory
# Analyze specific file
# Chinese roasts
# Generate Markdown report
Example Output
ποΈ Garbage Code Hunter ποΈ
π Code Quality Report
ββββββββββββββββββββββββββββββββββββ
π Issue Statistics:
8 π₯ Nuclear Issues (fix immediately)
15 πΆοΈ Spicy Issues (should fix)
12 π Mild Issues (can ignore)
π Code Quality Score
ββββββββββββββββββββββββββββββββββββ
π Total: 63.0/100 π
π― Level: Poor
π src/main.rs
π·οΈ Naming issue: "This variable name is more random than my passwords"
π¦ Nesting issue: "Nesting so deep, trying to dig to the Earth's core?"
β οΈ Unwrap abuse: "unwrap() is more unstable than my emotions"
VSCode Extension
Get real-time roasting in VSCode:
- Install the
garbage-code-hunterCLI - Search "Garbage Code Hunter" in VSCode marketplace
- Analysis triggers automatically when you save Rust files
License
Apache License 2.0
Remember: We roast the code, not you. Let's make code reviews a bit more fun! π