QUAL008infoPro

magic-number

Magic numbers make code hard to understand and maintain

Applies to: Go, JAVA, JavaScript, Python, Ruby, Rust, TypeScript

Why this matters

Numbers like 86400, 3.14159, or 1024 scattered in code are confusing. What does 86400 mean? (It's seconds in a day.) Named constants like SECONDS_PER_DAY = 86400 make code self-documenting and easier to update.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, QUAL008 includedstablestack explain QUAL008

QUAL008 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: QUAL008