N near-duplicate method definitions the agent must verify match on every edit. The single difference between them is mechanical; the rest is copy-pasted. The agent must re-read all N to verify a change in one was correctly propagated.
One method the agent reads once; callers supply the varying value at the call site. Verification of behaviour reduces from N×assertion to 1×assertion + parameter coverage tests.
Before the refactoring
// Three near-identical methods, differing only by which book field they search.class BookSearch {constructor(repo) {this.repo = repo;}searchByAuthor(query) {return this.repo.where(book => book.author.toLowerCase().includes(query.toLowerCase()));}searchByTitle(query) {return this.repo.where(book => book.title.toLowerCase().includes(query.toLowerCase()));}searchByPublisher(query) {return this.repo.where(book => book.publisher.toLowerCase().includes(query.toLowerCase()));}}
After the refactoring
// One method; the varying field is a parameter.class BookSearch {constructor(repo) {this.repo = repo;}searchBy(field, query) {return this.repo.where(book => book[field].toLowerCase().includes(query.toLowerCase()));}}
Per-method duplication multiplies the agent's edit cost on every shared-logic change. The agent's static reasoning cannot guarantee that N copies of a closure stayed identical without re-inspecting each.
A parameterized method obscures static call-graph analysis — the agent cannot tell from the call site alone which behaviour fires. Stringy parameters (`'author'`) defeat static type-checking; misspellings ship to runtime.
Shared logic lives at one method body the agent reads once; the parameter holds the per-call variation, and tests cover the variants through a table the agent reads as one block instead of N near-identical test methods.
Replacing N methods with a method that takes a stringy parameter pushes the type information out of the type system and into runtime. The agent must verify caller intent by tracing the literal across files, which costs more context than reading N distinct method names.