Skip to content
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

Missing return statement on line 175 of packages/components/src/drop-zone/provider.js #13952

Closed
jasonculligan opened this issue Feb 19, 2019 · 5 comments · Fixed by #13953
Closed
Labels
[Type] Code Quality Issues or PRs that relate to code quality

Comments

@jasonculligan
Copy link

Should there be a return statement in the toUpdate.map callback at line 175 of packages/components/src/drop-zone/provider.js ?

@jorgefilipecosta
Copy link
Member

Hi @jasonculligan, thank you for opening this issue 👍 In PR #13953 I describe what happened and I added a change to make sure future people reading the code don't get the same perception.

@aduth
Copy link
Member

aduth commented Feb 19, 2019

If possible, it would be worth exploring a lint rule which enforces an assumption that Array#map would always be either used as the value of a return statement, or as the initializer to a variable declaration.

@aduth
Copy link
Member

aduth commented Feb 19, 2019

@jasonculligan Out of curiosity, did you come across the error as the result of some automated tooling, or just by glancing over the code?

@jorgefilipecosta
Copy link
Member

If possible, it would be worth exploring a lint rule which enforces an assumption that Array#map would always be either used as the value of a return statement, or as the initializer to a variable declaration.

Nice idea I will look into having a rule implemented.

@jasonculligan
Copy link
Author

@aduth I used SonarCube Community Edition Version 7.6 (build 21501) which reported the find as a blocker type bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants