Retour au glossaire
Code Review & QualitePopular

Code Smell

A surface indication in the source code that usually corresponds to a deeper problem in the system. Not a bug itself, but a sign that refactoring may be needed.

Definition

The term "code smell" was coined by Kent Beck and popularized by Martin Fowler. Common code smells include: Long Methods (functions doing too much), God Classes (classes with too many responsibilities), Duplicate Code (copy-pasted logic), Feature Envy (methods that use another class's data more than their own), and Magic Numbers (unexplained numeric literals).

Pourquoi c'est important

Code smells indicate potential maintainability problems. While they don't prevent code from working, they make it harder to understand, modify, and extend. Studies show that code with multiple smells has 2-3x higher defect rates. Addressing smells early prevents technical debt accumulation.

Exemple

A method has 200 lines and 15 parameters — this is a "Long Method" code smell. It suggests the method should be broken into smaller, focused functions.

Termes lies

code smellwhat is code smellcode smells examplescode smell definition

Automatisez le Code Review avec diffray

Systeme d'IA multi-agent pour code review. Trouve automatiquement bugs, vulnerabilites de securite et problemes d'architecture.