Skip to content

Implement constants instead of numeric literals #74

@alex1ozr

Description

@alex1ozr

Description

Replace numeric literals (magic numbers) in the codebase with well‑named constants to improve readability, maintainability, and reduce the risk of bugs caused by inconsistent values.

Scope of this issue:

  • Identify commonly used numeric literals that have domain meaning (thresholds, limits, coefficients, etc.).
  • Introduce descriptive constants (or enums where appropriate) in a central place or relevant modules.
  • Update existing code to use these constants instead of raw numbers, ensuring no behavior change.
  • Add or update tests if necessary to confirm that refactoring did not alter functionality.
  • Constants should be stored in a structured way rather than in a single “god” constants file: group them by domain, module, or logical area of responsibility, keeping constants close to the code that uses them.

Acceptance criteria:

  • No “magic numbers” remain in the affected modules, except for trivial cases where the meaning is obvious (e.g. 0, 1).
  • All new constants have clear, descriptive names and are documented where appropriate.
  • All tests pass and the behavior of the system remains unchanged.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions