Skip to main content

Table 2 Types of code smell

From: On the identification of design problems in stinky code: experiences and tool support

Type

Description

God class

Long and complex class that centralizes the intelligence of the system

Brain method

Long and complex method that centralizes the intelligence of a class

Data class

Class that contains data but not behavior related to the data

Dispersed coupling

The case of an operation which is excessively tied to many other operations in the system, and additionally these provider methods that are dispersed among many classes

Feature envy

Method that calls more methods of a single external class than the internal methods of its own inner class

Intensive coupling

When a method is tied to many other operations in the system, whereby these provider operations are dispersed only into one or a few classes

Refused bequest

Subclass that does not use the protected methods of its superclass

Shotgun surgery

This smell is evident when you must change lots of pieces of code in different places simply to add a new or extended piece of behavior

Tradition breaker

Subclass that provides a large set of services that are unrelated to services provided by the superclass