Skip to content

Extract magic numbers to named constants for better readability #42

@lak7

Description

@lak7

Summary

The codebase contains hardcoded "magic numbers" that should be extracted into named constants for better readability and maintainability.

Problem

Magic numbers are numeric literals used directly in code without explanation. They make code harder to understand and maintain.

Examples to Address

  • Timeouts and delays (e.g., setTimeout(..., 5000))
  • Size limits and thresholds
  • Retry counts
  • Dimension values

Files to Review

  • src/app/project/[projectId]/page.tsx
  • src/inngest/functions.ts
  • actions/*.ts files
  • Limits.ts (ensure all limits are properly documented)

Example

// Before
if (userProjects.length >= 5) { ... }

// After
const MAX_PROJECTS_FREE_TIER = 5;
if (userProjects.length >= MAX_PROJECTS_FREE_TIER) { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRestructuring existing code for better readability and maintainability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions