-
Notifications
You must be signed in to change notification settings - Fork 56
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
[UI Side] Changes add/remove member request to contain a body #664
[UI Side] Changes add/remove member request to contain a body #664
Conversation
Codacy has issues with the PR. I note that for the injection sync it doesn't have advice. Found this, https://stackoverflow.com/questions/51715616/how-to-fix-codacy-alert-generic-object-injection-sink, which reminds me of a conversation we had a while back, so it might not be the best of advice. |
bc24936
to
9ddde96
Compare
I think we should disable the generic object injection sink because it gives an error anywhere a variable is passed into square brackets. I found that the author of the rule said that the rule is too noisy and it was designed to assist with manual checks: eslint-community/eslint-plugin-security#21 (comment) |
I'm fine with disabling this check. If you have time, can you locate it for me? Otherwise it might be next week before I get to it. This week is a very busy one from hereon. There are other Codacy issues though that should be addressed. |
Here is the link, scroll down to "Detect object injection": https://app.codacy.com/p/383092/patterns/list?engine=f8b29663-2cb2-498d-b923-a10c6a8c05cd&category=2&status=true |
dab2a70
to
fe39542
Compare
fe39542
to
364a1df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why the following. Why is removing 1 handled differently than 2+? Necessary? If so the inline comments should explain since not intuitive.
$scope.membersToModify = []; if (membersToRemove.length > 1) { removeMembers(membersToRemove, listName); } else { $scope.userInput = membersToRemove[0];
As far as the codacy error goes i think they want you to do something like res[parseInt(i)].result; obviously that looks confusing. An alternative you could try is to do a for....of loop. More on for...of loops => https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of |
Given that Codacy doesn't feel like this check meets their standards, maybe to ignore the particular warning for now until we know better what the issue is and how to address it. I'm fine with that strategy for now. |
I think we should try that for...of loop since it seems like codacy is just complaining about accessing the elements in our array with the brackets and our index. The for...of loop essentially does the same thing without needing the index or the brackets and needing to access our elements with [i]. |
364a1df
to
b3df141
Compare
b3df141
to
bfefa3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
Ticket Link
Groupings-1214
List of squashed commits
Test Checklist