A code smell is a characteristic of source code that may indicate a deeper design or maintenance problem. It is a signal to investigate, not proof that the code is bad. section 5.1 section 10.3
Look for these clues when reviewing code:
- Similar function implementations differ only in a value represented by the function name rather than an explicit argument. section 10.1
- Duplication appears in multiple places, such as repeatedly adding an item price to a total. section 5.1
- A business rule depends directly on a lower-level representation such as an array-based shopping cart. section 5.11
Smells guide refactoring. Make hidden values explicit, replace hard-coded differences with arguments, and extract changing behavior into callbacks when appropriate. section 10.1 section 11.1
An implicit argument in a function name
Functions such as setPriceByName, setQuantityByName, setShippingByName, and setTaxByName repeat the same implementation while encoding the changing field in their names. Pass the field as an argument instead, then reuse one implementation. The practical sequence is: identify the implicit argument, add an explicit argument, replace the hard-coded value, and update callers. section 10.3 section 10.1
Separating mixed responsibilities
An update_shipping_icons function can combine DOM access, button iteration, cart operations, and the free-shipping rule. Separating those concerns into functions makes each responsibility clearer, while recognizing that acceptable code may still have further improvements. section 5.11

