Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M0040

Shotgun Surgery

Shotgun Surgery
DecidemediumDecision Science
Included
account_tree

Version 1.0.0 · Updated 2026-07-30

CORE DEFINITION

Shotgun surgery is a code smell in which one conceptually focused change requires coordinated small edits across many classes or modules, often because one responsibility is scattered. It is the opposite direction from divergent change, where one class changes for many different reasons. The name is a software-maintenance metaphor, not a medical procedure.

SCAFFOLDING EFFECT

psychology

Reduce cognitive load

Inspect change history for code repeatedly edited together and consider consolidating a shared responsibility. Multi-department approvals are an organizational analogy requiring separate analysis; necessary review procedures are not automatically architectural errors.

anchor

Anchor fast decisions

A responsibility scattered across locations forces maintainers to remember every coordinated edit; an omission can create inconsistency. Moving related behavior to an appropriate home reduces that coordination, aiming for cohesion rather than one class containing all code.

MINIMUM ACTION

In progress 0/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more

Source support: Explicit

  • link
    refactoring.guruhttps://refactoring.guru/smells/shotgun-surgeryEN · Explicit
    verified

RELATED MODELS