# Code Smells — designpattern.fyi

> Common code smells and refactoring patterns from Refactoring.Guru

- **Section**: Code Smells
- **Canonical URL**: https://designpattern.fyi/code_smells/

---

## Patterns in this Category


### [Alternative Classes with Different Interfaces](https://designpattern.fyi/code_smells/alternative-classes/)
- **Summary**: Classes that do the same thing but have different interfaces.
- **Subcategory**: oo-abusers


### [Comments](https://designpattern.fyi/code_smells/comments/)
- **Summary**: Excessive comments that should be replaced with better code.
- **Subcategory**: dispensables


### [Data Class](https://designpattern.fyi/code_smells/data-class/)
- **Summary**: Classes that only contain data and no behavior.
- **Subcategory**: dispensables


### [Data Clumps](https://designpattern.fyi/code_smells/data-clumps/)
- **Summary**: Groups of variables that always appear together should be extracted into objects.
- **Subcategory**: bloaters


### [Dead Code](https://designpattern.fyi/code_smells/dead-code/)
- **Summary**: Code that is never executed or used.
- **Subcategory**: dispensables


### [Divergent Change](https://designpattern.fyi/code_smells/divergent-change/)
- **Summary**: One class that needs to be changed for different reasons.
- **Subcategory**: change-preventers


### [Duplicate Code](https://designpattern.fyi/code_smells/duplicate-code/)
- **Summary**: The same or similar code appears in multiple places.
- **Subcategory**: dispensables


### [Feature Envy](https://designpattern.fyi/code_smells/feature-envy/)
- **Summary**: Methods that seem more interested in other objects than the object they&#39;re in.
- **Subcategory**: couplers


### [Inappropriate Intimacy](https://designpattern.fyi/code_smells/inappropriate-intimacy/)
- **Summary**: Classes that know too much about each other&#39;s internal details.
- **Subcategory**: couplers


### [Incomplete Library Class](https://designpattern.fyi/code_smells/incomplete-library/)
- **Summary**: When a library class lacks needed methods.
- **Subcategory**: couplers


### [Large Class](https://designpattern.fyi/code_smells/large-class/)
- **Summary**: Classes that have grown too large and handle too many responsibilities.
- **Subcategory**: bloaters


### [Lazy Class](https://designpattern.fyi/code_smells/lazy-class/)
- **Summary**: Classes that do too little to justify their existence.
- **Subcategory**: dispensables


### [Long Method](https://designpattern.fyi/code_smells/long-method/)
- **Summary**: Methods that are too long and do too many things.
- **Subcategory**: bloaters


### [Long Parameter List](https://designpattern.fyi/code_smells/long-parameter-list/)
- **Summary**: Methods with too many parameters are hard to understand and use.
- **Subcategory**: bloaters


### [Message Chains](https://designpattern.fyi/code_smells/message-chains/)
- **Summary**: Long chains of method calls that make code fragile.
- **Subcategory**: couplers


### [Middle Man](https://designpattern.fyi/code_smells/middle-man/)
- **Summary**: Classes that do nothing but delegate to other objects.
- **Subcategory**: couplers


### [Parallel Inheritance Hierarchies](https://designpattern.fyi/code_smells/parallel-hierarchies/)
- **Summary**: Two or more class hierarchies that grow in parallel.
- **Subcategory**: change-preventers


### [Primitive Obsession](https://designpattern.fyi/code_smells/primitive-obsession/)
- **Summary**: Using primitive types instead of small objects for simple tasks.
- **Subcategory**: bloaters


### [Refused Bequest](https://designpattern.fyi/code_smells/refused-bequest/)
- **Summary**: Subclasses that don&#39;t use methods or properties inherited from parent classes.
- **Subcategory**: oo-abusers


### [Shotgun Surgery](https://designpattern.fyi/code_smells/shotgun-surgery/)
- **Summary**: Making a single change requires modifying many classes.
- **Subcategory**: change-preventers


### [Speculative Generality](https://designpattern.fyi/code_smells/speculative-generality/)
- **Summary**: Code designed for future needs that never materialize.
- **Subcategory**: dispensables


### [Switch Statements](https://designpattern.fyi/code_smells/switch-statements/)
- **Summary**: Complex switch statements that should be replaced with polymorphism.
- **Subcategory**: oo-abusers


### [Temporary Field](https://designpattern.fyi/code_smells/temporary-field/)
- **Summary**: Instance variables that are only used in certain situations.
- **Subcategory**: oo-abusers



---

## Machine-Readable Resources
- **JSON Feed**: https://www.designpattern.fyi/api/patterns.json
- **OpenAPI 3.1**: https://www.designpattern.fyi/api/openapi.json
- **llms.txt**: https://www.designpattern.fyi/llms.txt
