BloatersMedium

Data Clumps: What It Costs and How to Fix It

Groups of data items that repeatedly appear together across multiple classes or method signatures.

Model cost, team of 8$4K-$12K/yr
Severity
3/5
CategoryBloaters
Detection4 tools

What It Is

Data Clumps occur when the same group of variables (for example, street, city, state, ZIP code) appear together in multiple classes, method signatures, or data structures. Each location maintains its own copy of the grouping logic, and any change to the group's structure must be replicated everywhere. The clump should be a first-class object, but instead it exists as a scattered pattern that developers must recognize and maintain by convention.

Threshold: When the same 3+ fields appear together in 3+ locations, extract a class. Even 2 fields that always travel together warrant consideration if they carry domain meaning.

Why It Costs Money

1

Changes to the data group propagate to every location where the clump appears. Adding a country field to an address that exists as 4 separate parameters in 20 functions requires updating all 20 functions and their callers.

2

Validation inconsistency creeps in over time. Each location that handles the clump may validate the data slightly differently, leading to subtle bugs where data passes through one path but fails in another.

3

The missing abstraction prevents useful behaviour. An Address object can calculate shipping zones, validate formats, and format for display. Four separate strings cannot.

Specific Cost Mechanisms

  • ●Change propagation: each structural change to the clump requires updating every place it appears
  • ●Validation inconsistency: different validation rules at different sites cause intermittent bugs
  • ●Missing encapsulation: behaviour that belongs to the concept is scattered across consuming code

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 Medium inputs; mid is halfway. See full methodology.

Team SizeLowMidHigh
3 devs$2K$4K$5K
5 devs$3K$5K$8K
8 devs$4K$8K$12K
10 devs$5K$10K$15K
20 devs$9K$19K$28K

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:S107 / squid:S1448

Repeated parameter groups across methods

CodeClimate
identical-code / similar-code

Detects repeated parameter patterns

PMD
ExcessiveParameterList

Indirect detection through parameter count

IntelliJ IDEA
Data clump inspection

Built-in inspection that detects repeated field groups

Refactoring Patterns

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

Extract Class

The same group of fields appears in multiple classes

Effort (our estimate): 2-4 hours
Impact: Centralises validation and eliminates duplication

Introduce Parameter Object

The same group of parameters appears in multiple method signatures

Effort (our estimate): 1-3 hours
Impact: Simplifies all call sites and enables shared behaviour

Preserve Whole Object

Callers destructure an object only to pass its fields individually

Effort (our estimate): 30-60 minutes per call site
Impact: Reduces parameter count and coupling

Related Smells

Updated November 2026