unstract icon indicating copy to clipboard operation
unstract copied to clipboard

UN-1720 [FIX] Refactor to resolve SonarQube duplicate return issue

Open athul-rs opened this issue 4 months ago • 3 comments

Summary

  • Fixed SonarQube code smell in FileUpload.jsx where beforeUpload function had multiple identical return false statements
  • 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 beforeUpload function 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

athul-rs avatar Aug 22 '25 09:08 athul-rs