refactor: remove redundant character classes in slugify regex#3484
refactor: remove redundant character classes in slugify regex#3484arkid15r merged 2 commits intoOWASP:mainfrom
Conversation
Summary by CodeRabbit
No user-facing changes in this release. ✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughModified regex patterns in the slugify utility function to simplify leading and trailing hyphen trimming. Changed character class notation Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3484 +/- ##
=======================================
Coverage 85.60% 85.60%
=======================================
Files 461 461
Lines 14222 14222
Branches 1894 1894
=======================================
Hits 12175 12175
Misses 1678 1678
Partials 369 369
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>



Resolves #3464
I have implemented a fix for this code smell identified by SonarCloud:
https://sonarcloud.io/project/issues?open=AZefK916gjv1QELYFTBo&id=OWASP_Nest
Proposed changes in
frontend/src/utils/slugify.ts:.replace(/^[-]+/, '')to.replace(/^-+/, '').replace(/-+$/, '')to.replace(/-+$/, '')Checklist
make check-testlocally: all warnings resolved, tests passed