Code Smell Doctor
Analyze code for the 23 classic code smells and recommend specific refactoring techniques.
Analysis Workflow
- Read the target code file(s)
- Scan for each smell category systematically
- Report findings with severity (High/Medium/Low), location, explanation, and fix
- Prioritize by impact on maintainability
Quick Reference
| Category |
Smells |
| Bloaters |
Long Method, Large Class, Primitive Obsession, Long Parameter List, Data Clumps |
| OO Abusers |
Alt Classes w/ Diff Interfaces, Refused Bequest, Switch Statements, Temporary Field |
| Change Preventers |
Divergent Change, Parallel Inheritance, Shotgun Surgery |
| Dispensables |
Comments, Duplicate Code, Data Class, Dead Code, Lazy Class, Speculative Generality |
| Couplers |
Feature Envy, Inappropriate Intimacy, Incomplete Library Class, Message Chains, Middle Man |
Detection Patterns
For detailed detection heuristics and refactoring techniques, see:
- references/bloaters.md - Size-related smells
- references/oo-abusers.md - OOP misuse patterns
- references/change-preventers.md - Rigidity smells
- references/dispensables.md - Unnecessary code
- references/couplers.md - Coupling issues
Output Format
For each smell found:
### [Smell Name] (Severity: High/Medium/Low)
**Location:** file:line or class/method name
**Problem:** Brief explanation of what's wrong
**Evidence:** Specific code indicators
**Fix:** Recommended refactoring technique(s)
Severity Guidelines
- High: Actively impedes development, causes bugs, or makes changes risky
- Medium: Makes code harder to understand or modify
- Low: Minor issue, fix when touching the code anyway
Common Detection Heuristics
Bloaters
- Method >15 lines or >3 levels of nesting → Long Method
- Class >300 lines or >10 fields → Large Class
- Repeated primitive groups (e.g.,
startDate, endDate) → Data Clumps
4 parameters → Long Parameter List
- Constants like
USER_ADMIN = 1 → Primitive Obsession
OO Abusers
switch on type codes → Switch Statements
- Subclass overrides parent methods to throw/no-op → Refused Bequest
- Fields only set in certain methods → Temporary Field
- Two classes with same behavior, different names → Alternative Classes
Change Preventers
- One class changes for unrelated reasons → Divergent Change
- One change touches many classes → Shotgun Surgery
- Creating
FooX requires creating BarX → Parallel Inheritance
Dispensables
- Comments explaining what code does (not why) → Comments smell
- Copy-pasted code blocks → Duplicate Code
- Class with only getters/setters → Data Class
- Unreachable code, unused vars → Dead Code
- Class doing almost nothing → Lazy Class
- Abstract class with one implementation → Speculative Generality
Couplers
- Method uses other object's data more than own → Feature Envy
- Classes accessing each other's internals → Inappropriate Intimacy
- Chains like
a.getB().getC().getD() → Message Chains
- Class only delegates, no real logic → Middle Man
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: twiced-technology-gmbh-seedr-code-smell-doctor3description: Code Smell Doctor4---56# Code Smell Doctor78Analyze code for the 23 classic code smells and recommend specific refactoring techniques.910## Analysis Workflow11121. Read the target code file(s)132. Scan for each smell category systematically143. Report findings with severity (High/Medium/Low), location, explanation, and fix154. Prioritize by impact on maintainability1617## Quick Reference1819| Category | Smells |20|----------|--------|21| Bloaters | Long Method, Large Class, Primitive Obsession, Long Parameter List, Data Clumps |22| OO Abusers | Alt Classes w/ Diff Interfaces, Refused Bequest, Switch Statements, Temporary Field |23| Change Preventers | Divergent Change, Parallel Inheritance, Shotgun Surgery |24| Dispensables | Comments, Duplicate Code, Data Class, Dead Code, Lazy Class, Speculative Generality |25| Couplers | Feature Envy, Inappropriate Intimacy, Incomplete Library Class, Message Chains, Middle Man |2627## Detection Patterns2829For detailed detection heuristics and refactoring techniques, see:30- [references/bloaters.md](references/bloaters.md) - Size-related smells31- [references/oo-abusers.md](references/oo-abusers.md) - OOP misuse patterns32- [references/change-preventers.md](references/change-preventers.md) - Rigidity smells33- [references/dispensables.md](references/dispensables.md) - Unnecessary code34- [references/couplers.md](references/couplers.md) - Coupling issues3536## Output Format3738For each smell found:3940```41### [Smell Name] (Severity: High/Medium/Low)42**Location:** file:line or class/method name43**Problem:** Brief explanation of what's wrong44**Evidence:** Specific code indicators45**Fix:** Recommended refactoring technique(s)46```4748## Severity Guidelines4950- **High**: Actively impedes development, causes bugs, or makes changes risky51- **Medium**: Makes code harder to understand or modify52- **Low**: Minor issue, fix when touching the code anyway5354## Common Detection Heuristics5556### Bloaters57- Method >15 lines or >3 levels of nesting → Long Method58- Class >300 lines or >10 fields → Large Class59- Repeated primitive groups (e.g., `startDate`, `endDate`) → Data Clumps60- >4 parameters → Long Parameter List61- Constants like `USER_ADMIN = 1` → Primitive Obsession6263### OO Abusers64- `switch` on type codes → Switch Statements65- Subclass overrides parent methods to throw/no-op → Refused Bequest66- Fields only set in certain methods → Temporary Field67- Two classes with same behavior, different names → Alternative Classes6869### Change Preventers70- One class changes for unrelated reasons → Divergent Change71- One change touches many classes → Shotgun Surgery72- Creating `FooX` requires creating `BarX` → Parallel Inheritance7374### Dispensables75- Comments explaining what code does (not why) → Comments smell76- Copy-pasted code blocks → Duplicate Code77- Class with only getters/setters → Data Class78- Unreachable code, unused vars → Dead Code79- Class doing almost nothing → Lazy Class80- Abstract class with one implementation → Speculative Generality8182### Couplers83- Method uses other object's data more than own → Feature Envy84- Classes accessing each other's internals → Inappropriate Intimacy85- Chains like `a.getB().getC().getD()` → Message Chains86- Class only delegates, no real logic → Middle Man8788---89> Converted and distributed by [TomeVault](https://tomevault.io/claim/twiced-technology-gmbh) — claim your Tome and manage your conversions.90<!-- tomevault:4.0:skill_md:2026-04-14 -->