Deslop -- Remove AI Slop
Detect and fix common low-quality AI-generated code patterns.
Patterns Detected
- Unnecessary comments:
// Get the userbeforeGetUser() - Over-abstraction: Single-use interfaces, unnecessary factories
- Verbose null checks: Where null-conditional (
?.) suffices - Redundant try-catch: Catching only to rethrow
- Magic strings: Hardcoded values that should be constants
- Dead parameters: Parameters that are never used
- Excessive logging: Logging at every method entry/exit
- Copy-paste patterns: Near-identical code blocks
What To Do
- Scan files for slop patterns using Grep
- Generate report with file:line references
- If --fix: Apply automated fixes where safe
- If --report-only: Just output the report
Arguments
--fix: Auto-fix safe patterns--report-only: Report without changes