08
Shotgun Surgery
Symptom
A single conceptual change forces edits in many small places — adding a logging field means touching 17 files.
Goal
All code that varies together lives together. Adding a new field is one change in one module.
Smellier version
// Five files each have:
log(`event=${event}, user=${user}`);Fresher version// One file:
function logEvent({ event, user }) {
// one place to evolve
}Savings
Change cost becomes proportional to the conceptual change, not to how widely the concept was scattered.
Note
Easy to miss a site; reviewers can't easily verify completeness; small changes feel disproportionately risky.