Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M2218

Code Smell

Code Smell
BusinessHigh supportManagement
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

In computer programming, a code smell is any characteristic of source code that hints at a deeper problem. Determining what a code smell is and is not is subjective, and varies by language, developer, and development methodology. The term was popularized by Kent Beck on WardsWiki in the late 1990s. …

Definition

A characteristic in code that is not superficially a bug but hints at deeper design problems (e.g., overly long functions, messy variable names). It smells 'off,' and if not addressed, it will rot into bigger problems in the future. Scaffold use: - Intuitive diagnosis: not only for code. Management also has 'smells' (e.g., meetings always without conclusions, employees avoiding eye contact). Don't wait for an accident to fix; when you smell a smell, refactor the process immediately.

How to use

- Intuitive diagnosis: not only for code. Management also has 'smells' (e.g., meetings always without conclusions, employees avoiding eye contact). Don't wait for an accident to fix; when you smell a smell, refactor the process immediately.

Mechanism

Certain code structure characteristics (overly long functions, duplicated code, too many parameters, large classes, confusing naming) do not immediately cause failures, but they indicate fragile design, high coupling, or unclear responsibilities, which over time evolve into defects. Smells are early signals of maintainability issues, not functional bugs.

Practice

In progress 0/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • A 2000-line 'god function'; variable names like a/b/c that are hard to understand; in management, 'meetings always without conclusions, employees avoiding eye contact' as organizational smells.

Common pitfalls

  • Overhauling upon smelling a smell can introduce new bugs; or completely ignoring small smells until the system rots; equating smells with bugs (though they are not functional failures).
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    en.wikipedia.orghttps://en.wikipedia.org/wiki/Code_smellZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS