-
-
Notifications
You must be signed in to change notification settings - Fork 392
refactor(api): fix sonar S1192 in snapshot endpoint #3076
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
Conversation
Signed-off-by: Tejas Tiwari <[email protected]>
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughExtracted the repeated string "Ordering field" into a new public constant Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks 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 |
|
Thanks @arkid15r for pointing this out. It wasn’t intentional |
|
* Refactor snapshot API to remove duplicated ordering description Signed-off-by: Tejas Tiwari <[email protected]> * Update code --------- Signed-off-by: Tejas Tiwari <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]>




Proposed change
Resolves #3039
This PR fixes a SonarCloud code smell (rule
python:S1192) inbackend/apps/api/rest/v0/snapshot.pyby removing duplicated string literalsand extracting them into a shared constant.
Summary of changes
Motivation
The duplicated literal was flagged by SonarCloud as a maintainability issue.
This refactor aligns the code with OWASP Nest quality standards and makes future
changes easier and safer.
Testing
python -m compileallmake check-testpnpmin local environmentChecklist
make check-testlocally and all tests passed