refactor(api): fix sonar S1192 in snapshot endpoint#3076
refactor(api): fix sonar S1192 in snapshot endpoint#3076arkid15r merged 3 commits intoOWASP:mainfrom
Conversation
Signed-off-by: Tejas Tiwari <tt160705@outlook.com>
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 <tt160705@outlook.com> * Update code --------- Signed-off-by: Tejas Tiwari <tt160705@outlook.com> Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>




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