-
-
Notifications
You must be signed in to change notification settings - Fork 311
refactor: Extract hardcoded numbers to named constants in model mixins #2769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor: Extract hardcoded numbers to named constants in model mixins #2769
Conversation
- Extracted DEFAULT_HEALTH_SCORE = 100 in project.py - Extracted DESCRIPTION_MAX_LENGTH = 1000 in release.py Fixes OWASP#2649
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughTwo files extract hardcoded magic numbers to named constants: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)backend/apps/github/models/mixins/release.py (1)
backend/apps/owasp/models/mixins/project.py (1)
🔇 Additional comments (2)
Tip ✨ Issue Enrichment is now available for GitHub issues!CodeRabbit can now help you manage issues more effectively:
Disable automatic issue enrichmentTo disable automatic issue enrichment, add the following to your issue_enrichment:
auto_enrich:
enabled: falseThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
FYI: Some flaky frontend e2e tests exist, unrelated to these changes. |



Description
This PR addresses the task of extracting hardcoded numbers (magic numbers) to named constants at module level to improve code readability and maintainability across model mixins.
Changes Made
Files Modified
backend/apps/owasp/models/mixins/project.pyDEFAULT_HEALTH_SCORE = 100100withDEFAULT_HEALTH_SCOREinidx_health_scorepropertybackend/apps/github/models/mixins/release.pyDESCRIPTION_MAX_LENGTH = 10001000withDESCRIPTION_MAX_LENGTHinidx_descriptionpropertyImplementation Notes
Testing
make check-testRelated Issue
Closes #2649