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

Fix S3655 FN: VB assignments #6976

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

Tim-Pohlmann
Copy link
Contributor

Improves #6795

@Tim-Pohlmann Tim-Pohlmann changed the base branch from master to Tim/S3655-VB-Tests March 22, 2023 14:43
Base automatically changed from Tim/S3655-VB-Tests to feature/SE March 22, 2023 14:44
@Tim-Pohlmann Tim-Pohlmann force-pushed the Tim/S3655-Improve-ShouldExecute branch from 910dee9 to d65405f Compare March 22, 2023 15:04
@Tim-Pohlmann Tim-Pohlmann marked this pull request as ready for review March 22, 2023 15:32
@Tim-Pohlmann Tim-Pohlmann changed the title Improve ShouldExecute for S3655: Empty nullable value should not be accessed Fix S3655 FN: VB assignments Mar 22, 2023
Copy link
Contributor

@antonioaversa antonioaversa left a 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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Pavel Mikula <57188685+pavel-mikula-sonarsource@users.noreply.github.com>
@sonarqubecloud
Copy link

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

@sonarqubecloud
Copy link

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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@pavel-mikula-sonarsource pavel-mikula-sonarsource merged commit 1d1760a into feature/SE Mar 24, 2023
@pavel-mikula-sonarsource pavel-mikula-sonarsource deleted the Tim/S3655-Improve-ShouldExecute branch March 24, 2023 12:41
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.

4 participants