-
Notifications
You must be signed in to change notification settings - Fork 231
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
Fix S1643 FP: should not apply when strings are not aggregated #7711
Fix S1643 FP: should not apply when strings are not aggregated #7711
Conversation
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.
Looks like a nice change. Some more improvements are possible
analyzers/src/SonarAnalyzer.Common/Rules/StringConcatenationInLoopBase.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.Common/Rules/StringConcatenationInLoopBase.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.Common/Rules/StringConcatenationInLoopBase.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.VisualBasic/Rules/StringConcatenationInLoop.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.VisualBasic/Rules/StringConcatenationInLoop.cs
Outdated
Show resolved
Hide resolved
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.
Consider changing the parameter names.
Also: There seem to be FPs in the ITs.
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.
There seem to be FPs in the ITs
Emh, while fixing those FPs I "had" to fix #5521 within the same PR. |
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.
Wating for the equivalence comment to be resolved.
analyzers/src/SonarAnalyzer.CSharp/Rules/StringConcatenationInLoop.cs
Outdated
Show resolved
Hide resolved
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. You can improve coverage with something like
var i = 1 - 1 + 1;
or so.
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
Peach validation:
We need to take another look at this rule before the release. |
I created issue #7722 with the FNs for |
Fixex #5521 + structure refactoring.