-
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 S3655 FN: VB assignments #6976
Fix S3655 FN: VB assignments #6976
Conversation
910dee9
to
d65405f
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.
In itself this PR looks good to me.
However, I have stumbled upon the following false negative:
Sub Assignment()
Dim nullable As Integer? = Nothing
Dim x As Integer = nullable
End Sub
It differs from your scenario because the Nothing
is assigned inline, and not on a dedicated statement.
You may want to investigate and open another PR in case, further refining the detection of assignments.
Or move this one to draft and keep working on it - as you think it's best.
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 not sufficient IMO.
analyzers/src/SonarAnalyzer.VisualBasic/SymbolicExecution/Roslyn/EmptyNullableValueAccess.cs
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
.../tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/EmptyNullableValueAccess.vb
Outdated
Show resolved
Hide resolved
Co-authored-by: Pavel Mikula <57188685+pavel-mikula-sonarsource@users.noreply.github.com>
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
Improves #6795