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 S2259 FN: FlowCaptures in Field/PropertyReference.Instance #8335

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

Tim-Pohlmann
Copy link
Contributor

Make TrackedSymbol capable of resolving FlowCaptures and Conversions in Field/PropertyReference.Instance
Fixes:

class Sample
{
    private object _foo1;

    void ConditionalThisFieldAccess()
    {
        this._foo1 = null;
        this?._foo1.ToString(); // FN
    }
}

@Tim-Pohlmann Tim-Pohlmann added Type: False Negative Rule is NOT triggered when it should be. Area: CFG/SE CFG and SE related issues. Area: C# C# rules related issues. labels Nov 8, 2023
@Tim-Pohlmann Tim-Pohlmann added this to the 9.14 milestone Nov 8, 2023
Copy link

sonarcloud bot commented Nov 8, 2023

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

Copy link

sonarcloud bot commented Nov 8, 2023

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

Copy link
Contributor

@mary-georgiou-sonarsource mary-georgiou-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM

@mary-georgiou-sonarsource mary-georgiou-sonarsource merged commit 3609646 into master Nov 8, 2023
28 checks passed
@mary-georgiou-sonarsource mary-georgiou-sonarsource deleted the Tim/ImproveTrackedSymbol branch November 8, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Area: CFG/SE CFG and SE related issues. Type: False Negative Rule is NOT triggered when it should be.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants