Back to Catalog
Code Smells
Couplers
Feature Envy
Methods that seem more interested in other objects than the object they're in.
Intent & Description
'
🎯 Intent
Identify methods that extensively use another object’s data and methods.
📋 Context
A method calls many methods on another object, seemingly more interested in that object than its own class.
💡 Solution
Move the method to the class it’s most interested in using Move Method refactoring.'
Real-world Use Case
Use when a method heavily uses another object’s data and behavior.
Source
📌 TL;DR
Methods that prefer other objects should be moved to those objects. Follow the data.