review: add a terse fix to each smell in the baseline
Each smell now reads what-it-is → how-to-fix, telegraphic style — the fix is the actionable half a reviewer needs, kept to a clause. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cac470445b
commit
0894b3300f
1 changed files with 13 additions and 13 deletions
|
|
@ -40,20 +40,20 @@ On top of whatever the repo documents, the Standards axis always carries the **s
|
||||||
- **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
|
- **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
|
||||||
- **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces.
|
- **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces.
|
||||||
|
|
||||||
Each name carries its own definition; match it against the diff:
|
Each smell reads *what it is* → *how to fix*; match it against the diff:
|
||||||
|
|
||||||
- **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds.
|
- **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
|
||||||
- **Duplicated Code** — the same logic shape appears in more than one hunk or file in the change.
|
- **Duplicated Code** — the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
|
||||||
- **Feature Envy** — a method that reaches into another object's data more than its own.
|
- **Feature Envy** — a method that reaches into another object's data more than its own. → move the method onto the data it envies.
|
||||||
- **Data Clumps** — the same few fields or params keep travelling together (a type wanting to be born).
|
- **Data Clumps** — the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
|
||||||
- **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type.
|
- **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
|
||||||
- **Repeated Switches** — the same `switch`/`if`-cascade on the same type recurs across the change.
|
- **Repeated Switches** — the same `switch`/`if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
|
||||||
- **Shotgun Surgery** — one logical change forces scattered edits across many files in the diff.
|
- **Shotgun Surgery** — one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
|
||||||
- **Divergent Change** — one file or module is edited for several unrelated reasons.
|
- **Divergent Change** — one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
|
||||||
- **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have.
|
- **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
|
||||||
- **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on.
|
- **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
|
||||||
- **Middle Man** — a class or function that mostly just delegates onward.
|
- **Middle Man** — a class or function that mostly just delegates onward. → cut it, call the real target direct.
|
||||||
- **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits.
|
- **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.
|
||||||
|
|
||||||
### 4. Spawn both sub-agents in parallel
|
### 4. Spawn both sub-agents in parallel
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue