DispensablesLow

Lazy Class: What It Costs and How to Fix It

A class that does too little to justify its existence, adding complexity without proportionate value.

Model cost, team of 8$2K-$6K/yr
Severity
2/5
CategoryDispensables
Detection4 tools

What It Is

A Lazy Class is a class that was created with good intentions (perhaps during an earlier refactoring or in anticipation of future needs) but does not carry enough behaviour or data to justify its existence. It might be a wrapper around a single method, a data class with no behaviour, or a class that was trimmed down during refactoring until only a shell remained. Every class has a maintenance cost: it must be understood, documented, tested, and navigated past. If the class does not earn its keep, that cost is pure waste.

Threshold: Classes with fewer than 3 methods and fewer than 20 lines that are not data transfer objects warrant review. If the class can be described as 'a wrapper around X,' it is probably lazy.

Why It Costs Money

1

Navigation overhead. Every extra class is one more file to open, one more import to manage, and one more name to remember. In IDEs with 'find references' and 'go to definition,' lazy classes add unnecessary hops.

2

Conceptual weight. Each class represents a concept that developers must understand. A lazy class that wraps a single method forces developers to understand the wrapper's purpose (is it for testing? extensibility? legacy reasons?) before they can understand the code that uses it.

3

Maintenance cost is real even when the class does nothing meaningful. When the underlying concept changes, the lazy class must be updated even though it adds no value.

Specific Cost Mechanisms

  • ●Navigation overhead: time spent navigating through unnecessary abstractions
  • ●Conceptual confusion: new developers spend time understanding why the class exists
  • ●Maintenance drag: each refactoring must account for the lazy class even when it adds no value

Estimated Annual Cost

Cost of one instance a year by team size, from our model at $180K fully-loaded cost per engineer. Low and high use the bottom and top of the Low inputs; mid is halfway. See full methodology.

Team SizeLowMidHigh
3 devs$700$2K$3K
5 devs$1K$3K$4K
8 devs$2K$4K$6K
10 devs$2K$5K$7K
20 devs$5K$9K$14K

These are model outputs, not measurements. Every input is on the cost model page, and the same model produces the figures on the 22 smells page. Put in your own team and cost in the smell profile calculator.

How to Detect It

Specific rules and thresholds for automated detection. See full tool comparison.

SonarQube
squid:S1609 / squid:S2094

Empty class body, single abstract method

CodeClimate
method-count / file-lines

Classes with < 3 methods or < 20 lines

PMD
EmptyMethodInAbstractClassShouldBeAbstract

Abstract classes with empty method bodies

Manual
Inline class candidate analysis

Classes referenced in only 1-2 locations

Refactoring Patterns

Proven techniques to eliminate this smell. See all refactoring patterns.

Inline Class

The class has one caller and adds no independent value

Effort (our estimate): 30-60 minutes
Impact: Removes one navigation hop and one concept to understand

Collapse Hierarchy

A subclass adds nothing to its parent

Effort (our estimate): 1-2 hours
Impact: Simplifies the inheritance tree

Merge Module

A module contains only one or two trivial classes

Effort (our estimate): 30-90 minutes
Impact: Reduces file count and navigation complexity

Related Smells

Updated November 2026