A function whose body mixes its core responsibility with statements that genuinely vary per caller — different logging contexts, different post-processing, different metric labels.
The agent finds a function body whose statements vary by caller context — logging contexts, post-processing flags, metric labels baked into one body via branches.
Statements that vary by caller move out of the function so each caller chooses its own setup or follow-up.
The function's body addresses one responsibility; callers express their differences at the call site.
Before the refactoring
function emit(line) {log.write(line);metrics.tick();}
After the refactoring
function emit(line) { log.write(line); }emit('startup');metrics.tick();
The function's single responsibility is obscured by per-caller variations baked in; adding a new caller forces extending the function's branches.
Adding a new caller forces extending the function's branches; the agent must reason about which branch applies and verify branch coverage at every site.
If most callers want the moved statements, the change creates duplication — the inverse of Move Statements into Function is only an improvement when callers genuinely differ.
If most callers want the moved statements, the agent now sees duplicated boilerplate at every call site — the inverse smell.
The function's body becomes about its single responsibility; callers express their differences directly.
The function's contract narrows to its single responsibility; callers express variation explicitly; the agent reasons about one body and one branch per caller.
Pushing statements to callers when most callers want them anyway — creates duplication at every call site while the original function was perfectly clear.
Pushing statements to callers when most callers want them creates duplication the agent must keep in sync across every site — substitutes one smell for another.