-
-
Notifications
You must be signed in to change notification settings - Fork 295
Open
Labels
Description
Description
Extract hardcoded numbers to named constants at module level to improve code readability and maintainability.
Estimated Effort
1 story point
Files
backend/apps/github/models/mixins/*.pybackend/apps/owasp/models/mixins/*.py
Task Details
Many methods in model mixins use magic numbers (hardcoded numeric values) that should be extracted to named constants for better code clarity and maintainability.
Example
# At module level
ISSUES_LIMIT = 6
RELEASES_LIMIT = 6
TOP_CONTRIBUTORS_LIMIT = 6
# In method
def get_top_contributors(self):
return self.contributors[:TOP_CONTRIBUTORS_LIMIT]Implementation Notes
- Find all hardcoded numbers in the mixin files
- Extract them to module-level constants with descriptive names
- Replace the hardcoded values with the constants
- Ensure tests still pass after the refactoring
- Run
make check-testlocally before submitting
Getting Started
- Comment on this issue to indicate you'd like to work on it
- Review the contributing guidelines
- Create a feature branch and submit a PR when ready
- Reference this issue in your PR description
Related
- Parent issue: Good First Issues: 10 Beginner-Friendly Tasks for Backend & Frontend #2628
- Requested by: @arkid15r
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo