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

New rule S6640: Allowing unsafe code is security-sensitive #7474

Merged
merged 5 commits into from
Jun 21, 2023

Conversation

Tim-Pohlmann
Copy link
Contributor

Fixes #7290

@Tim-Pohlmann Tim-Pohlmann force-pushed the Tim/S6640 branch 2 times, most recently from cb5e1a8 to 9ce1782 Compare June 21, 2023 08:48
Copy link
Contributor

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

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):

Suggested change
tokenList.IndexOf(kind) is var index && index != -1
tokenList.IndexOf(kind) is >= 0 and var index

"ruleSpecification": "RSPEC-6640",
"sqKey": "S6640",
"scope": "All",
"quickfix": "unknown"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be infeasible.

@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

96.0% 96.0% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

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"

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

@Tim-Pohlmann Tim-Pohlmann merged commit b76da2c into master Jun 21, 2023
25 checks passed
@Tim-Pohlmann Tim-Pohlmann deleted the Tim/S6640 branch June 21, 2023 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New rule S6640: Allowing unsafe code is security-sensitive
2 participants