unstract
unstract copied to clipboard
UN-1720 [FIX] Refactor to resolve SonarQube duplicate return issue
Summary
- Fixed SonarQube code smell in
FileUpload.jsxwherebeforeUploadfunction had multiple identicalreturn falsestatements - Consolidated logic to use a single return statement with proper conditional handling
- Added explanatory comment for why the function always returns false (to prevent automatic upload in Ant Design)
Changes
- Refactored
beforeUploadfunction in/frontend/src/components/agency/file-upload/FileUpload.jsx - Used if-else structure instead of multiple returns
- No functional changes - behavior remains the same
Test Plan
- [ ] File upload still works as expected
- [ ] Files are added to list when under the limit
- [ ] Error message appears when max files exceeded
- [ ] Manual upload on submit still functions correctly
🤖 Generated with Claude Code