Skip to content

Files

Latest commit

 

History

History
13 lines (7 loc) · 478 Bytes

no-magic-numbers.md

File metadata and controls

13 lines (7 loc) · 478 Bytes

Pattern: Use of magic number

Issue: -

Description

Disallows the use of constant number values outside of variable assignments. When no list of allowed values is specified, -1, 0 and 1 are allowed by default.

Rationale: Magic numbers should be avoided as they often lack documentation, forcing them to be stored in variables gives them implicit documentation.

Further Reading