Skip to main content
Back to Tags

Code Smell

20 items tagged with "code-smell"

Filter by type:

Anti-Patterns20

Anti-Pattern

Boolean Trap

Function parameters that take a bare boolean force readers to decode opaque true/false call sites, hiding intent and inviting wrong arguments.

Anti-Pattern

Stringly Typed Code

Using strings to represent data that has real structure or a fixed set of values, discarding type safety and pushing errors to runtime.

Anti-Pattern

Primitive Obsession

Modeling domain concepts with raw primitives like int and string instead of dedicated types, scattering validation and inviting invalid data.

Anti-Pattern

Magic Numbers

Unexplained numeric literals embedded in code, hiding their meaning and duplicating values that must change together.

Anti-Pattern

Magic Strings

Hardcoded string literals that act as keys, flags, or identifiers, with no central definition, inviting typos and silent failures.

Anti-Pattern

Long Method

A single function that does too much and runs for hundreds of lines, mixing many concerns and resisting comprehension, testing, and reuse.

Anti-Pattern

Long Parameter List

A function signature with too many parameters, making calls error-prone, hard to read, and a sign of poorly grouped or missing abstractions.

Anti-Pattern

Data Clumps

The same group of fields or parameters traveling together everywhere, signaling a missing abstraction that should be a single object.

Anti-Pattern

Feature Envy

A method that is more interested in another class's data than its own, repeatedly reaching into that class instead of letting it own the behavior.

Anti-Pattern

Exception Swallowing

Catching exceptions and then ignoring them, hiding failures so that errors pass silently and bugs become nearly impossible to diagnose.

Anti-Pattern

Null Checking Everywhere

Defensive null checks scattered through the codebase to guard against nulls that could be designed away, cluttering logic and still missing cases.

Anti-Pattern

Refused Bequest

A subclass that inherits methods or data it does not want or use, often overriding them to do nothing, signaling a wrong inheritance relationship.

Anti-Pattern

Yo-Yo Problem

An inheritance hierarchy so deep that understanding behavior forces constant scrolling up and down between many classes to trace a single call.

Anti-Pattern

Call Super

A framework requiring subclass overrides to call the parent method, a fragile contract that breaks silently whenever a developer forgets the call.

Anti-Pattern

Temporal Coupling

Methods that must be called in a specific hidden order, where calling them out of sequence silently breaks state with no compiler protection.

Anti-Pattern

Switch Statement Smell

Repeated switch or if-else chains branching on a type code, duplicated across the codebase, that should be replaced by polymorphism.

Anti-Pattern

Poltergeist

A short-lived, do-nothing class that only passes data or calls to other objects, adding indirection and noise without real responsibility.

Anti-Pattern

Sequential Coupling

A class designed so its methods must be invoked in a rigid sequence, with the ordering enforced only by convention rather than by the API itself.

Anti-Pattern

Copy-Paste Programming

Duplicating blocks of code instead of factoring out shared logic, so every fix and change must be repeated across each copy, and some are missed.

Anti-Pattern

Redundant Comments

Comments that merely restate what the code already says, adding noise, drifting out of date, and masking the absence of self-explanatory code.