-
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
New rule S2589/S2583 for VB.NET #7727
Conversation
23833a6
to
ef300be
Compare
@Tim-Pohlmann Take a first look - implementation + UTs is done. Ignore Reworked secondary locations commit. EDIT: This commit was reverted. |
This reverts commit 4137efa.
7f8ea16
to
1bc0abf
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.
Some polishing required
...Analyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.CSharp9.cs
Show resolved
Hide resolved
...narAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.VB14.vb
Outdated
Show resolved
Hide resolved
...narAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.VB14.vb
Outdated
Show resolved
Hide resolved
...narAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.VB14.vb
Outdated
Show resolved
Hide resolved
...narAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.VB14.vb
Outdated
Show resolved
Hide resolved
...ts/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.vb
Outdated
Show resolved
Hide resolved
...ts/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.vb
Outdated
Show resolved
Hide resolved
...ts/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.vb
Outdated
Show resolved
Hide resolved
...ts/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.vb
Outdated
Show resolved
Hide resolved
...ts/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.vb
Outdated
Show resolved
Hide resolved
If sObj?.str?.Length > 2 Then | ||
' ^^^^ Noncompliant | ||
' ^^^^^^^ Secondary@-1 | ||
' ^^^^^^^^^^^^^^^^^^^^^ Noncompliant@-2 | ||
Console.WriteLine("a") ' Secondary |
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.
The length of the Secondary location is off. But this will be fixed by #7725
Dim sObj = Nothing | ||
Dim x = sObj?.str?.Length > 2 | ||
' ^^^^ Noncompliant | ||
' ^^^^^^^ Secondary@-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.
The length of the Secondary location is off. But this will be fixed by #7725
a = a & true; | ||
if (a) // FN |
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.
This is only an FN because of the compound assignments above. Needs to be separated.
...ts/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.vb
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, only minor nitpicks left.
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
Fixes #7647
Fixes #7648
RSPEC for S2583: SonarSource/rspec#2857
RSPEC for S2589: SonarSource/rspec#2856