-
Notifications
You must be signed in to change notification settings - Fork 222
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
ConditionEvaluatesToConstant: SyntaxWalker re-factoring #8215
ConditionEvaluatesToConstant: SyntaxWalker re-factoring #8215
Conversation
29aff2a
to
4ef6d8b
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.
Code looks good, UTs needs some polishing
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Outdated
Show resolved
Hide resolved
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Outdated
Show resolved
Hide resolved
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Outdated
Show resolved
Hide resolved
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Outdated
Show resolved
Hide resolved
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Outdated
Show resolved
Hide resolved
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Outdated
Show resolved
Hide resolved
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Outdated
Show resolved
Hide resolved
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Outdated
Show resolved
Hide resolved
...nalyzer.UnitTest/Rules/SymbolicExecution/ConditionEvaluatesToConstantSyntaxKindWalkerTest.cs
Show resolved
Hide resolved
...yzers/src/SonarAnalyzer.VisualBasic/SymbolicExecution/Roslyn/ConditionEvaluatesToConstant.cs
Show resolved
Hide resolved
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
} | ||
|
||
[DataTestMethod] | ||
[DataRow("""Dim x = 1 And 2""")] |
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 """
could be simplified to "
(except one)
Dim x = From y in New Integer() { } | ||
Where True |
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 can go on a single line, without :
Dim x = From y in New Integer() { } | |
Where True | |
Dim x = From y in New Integer() { } Where True |
See also #8103
This PR fixes the params array allocation caused by
IsAnyKind
and reactors the SyntaxWalker to do the SyntaxKind checks in the dedicated Visit... methods. That way the number of comparisons is reduced.