-
Notifications
You must be signed in to change notification settings - Fork 232
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
New rule S6640: Allowing unsafe code is security-sensitive #7474
Conversation
cb5e1a8
to
9ce1782
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.
RSpec needs an update for the quickfix field.
public static class SyntaxTokenListExtensions | ||
{ | ||
public static SyntaxToken? Find(this SyntaxTokenList tokenList, SyntaxKind kind) => | ||
tokenList.IndexOf(kind) is var index && index != -1 |
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.
Alternative (I'm not sure whether it is better, so the change is optional):
tokenList.IndexOf(kind) is var index && index != -1 | |
tokenList.IndexOf(kind) is >= 0 and var index |
analyzers/tests/SonarAnalyzer.UnitTest/TestCases/Hotspots/UnsafeCodeBlocks.cs
Show resolved
Hide resolved
analyzers/rspec/cs/S6640.json
Outdated
"ruleSpecification": "RSPEC-6640", | ||
"sqKey": "S6640", | ||
"scope": "All", | ||
"quickfix": "unknown" |
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.
Should be infeasible.
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
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.
LGTM. Make sure the RSpec is up-to-date with master as the RSpec change PR is merged now.
"ruleSpecification": "RSPEC-6640", | ||
"sqKey": "S6640", | ||
"scope": "All", | ||
"quickfix": "infeasible" |
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.
Your RSpec change was merged by me. You may want to run the update script again against RSpec master, just to make sure everything is as expected
Fixes #7290