Code Smells

Code Smells / Couplers / Feature Envy

Feature Envy code smell icon

Feature Envy

Feature Envy occurs when a method is overly reliant on another class.

This is an indication that the feature of the other class could be defined in a better location, such as in the envious method’s class, a super class of both classes, or another unrelated class.

Feature Envy is a method overly reliant on a class. For a class overly reliant on another class, check out Inappropriate Intimacy.

Left chevron Right chevron

Books about code smells

Learn to write better smelling code.

Refactoring: Improving the Design of Existing Code book cover

Refactoring: Improving the Design of Existing Code

Code smells: A Predictor of Remarkable Quality Improvement book cover

Code smells: A Predictor of Remarkable Quality Improvement

Clean Code: A Handbook of Agile Software Craftsmanship book cover

Clean Code: A Handbook of Agile Software Craftsmanship

I receive a commission on sales made from the above affiliate links.