Insufficient Isolation of Symbolic Constant Definitions

Incomplete Base
Structure: Simple
Description

This weakness occurs when a codebase uses symbolic constants (like named values for numbers or strings) but scatters their definitions across many files instead of centralizing them in one isolated location, such as a dedicated configuration file or module.

Extended Description

Scattering symbolic constants throughout your code creates a significant maintenance burden. When a value needs to be updated—for example, a timeout duration, a file path, or a magic number—developers must hunt through numerous source files to find every instance. This process is error-prone, time-consuming, and increases the risk of missing a definition, leading to inconsistent behavior and potential bugs. From a security perspective, this poor isolation indirectly weakens your application's defenses. It slows down vulnerability patching because identifying and updating all relevant code locations takes longer. It also makes it easier to accidentally introduce new vulnerabilities during maintenance, as developers might overlook a critical constant or update it incorrectly. Centralizing these definitions is a foundational practice for secure, maintainable code.

Common Consequences 1
Scope: Other

Impact: Reduce Maintainability

References 1
Providing a Framework for Effective Software Quality Assessment
Robert A. Martin and Lawrence H. Shafer
07-1996
ID: REF-963