Skip to content

Fix S2259 FN: FlowCaptures in Field/PropertyReference.Instance#8335

Merged
mary-georgiou-sonarsource merged 1 commit intomasterfrom
Tim/ImproveTrackedSymbol
Nov 8, 2023
Merged

Fix S2259 FN: FlowCaptures in Field/PropertyReference.Instance#8335
mary-georgiou-sonarsource merged 1 commit intomasterfrom
Tim/ImproveTrackedSymbol

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 False Negative Rule is NOT triggered when it should be. Area: CFG/SE labels Nov 8, 2023
@Tim-Pohlmann Tim-Pohlmann added this to the 9.14 milestone Nov 8, 2023
@sonarqubecloud
Copy link

sonarqubecloud 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

@sonarqubecloud
Copy link

sonarqubecloud 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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