# Shotgun Surgery

> A defect in which one responsibility is scattered so that a single change needs edits in many files.

Record: `architecture:shotgun-surgery`
Kind: anti-pattern
Layer: [Enforcement Core](https://banes-lab.com/records/layer/enforcement-core.md)
Severity: discouraged
Scope: modularity
Canonical: https://banes-lab.com/ontology#architecture-shotgun-surgery

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Distributed Monolith](https://banes-lab.com/records/architecture/distributed-monolith.md) and before [Divergent Change](https://banes-lab.com/records/architecture/divergent-change.md).

## Repair

- Refactored by: centralize_rule, extract_module, move_behavior_to_owner, add_single_source_of_truth
- Detected by: same_change_touches_many_files, repeated_commit_cochanges, duplicated_rule_fragments
- Violated by: Scatter one conceptual responsibility across many files so one change requires many coordinated edits.
- Measured by: files touched per logical change, co-change frequency
- Enforced by: duplication detection, change-coupling review

## Severity

- [discouraged](https://banes-lab.com/records/vocabulary/severity-discouraged.md)

## Category

- [Anti-patterns](https://banes-lab.com/records/architecture-category/anti-patterns.md)

## Force

- [Modularity](https://banes-lab.com/records/force/modularity.md)

## Negated by

- [High Cohesion](https://banes-lab.com/records/architecture/high-cohesion.md)

## Linked from

- [An anti-pattern is a decay path](https://banes-lab.com/software-architecture/decay/an-anti-pattern-is-a-decay-path.md)
- [Anti-patterns](https://banes-lab.com/ontology/principles/architecture-category-anti-patterns.md)
- [Core Modular Design](https://banes-lab.com/ontology/principles/architecture-category-core-modular-design.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The forces](https://banes-lab.com/ontology/schema/the-forces.md)
