Skip to content

SONARPY-743 Avoid raising FP when 'isinstance' is used#839

Merged
andrea-guarino-sonarsource merged 2 commits intomasterfrom
SONARPY-743b
Aug 18, 2020
Merged

SONARPY-743 Avoid raising FP when 'isinstance' is used#839
andrea-guarino-sonarsource merged 2 commits intomasterfrom
SONARPY-743b

Conversation

@andrea-guarino-sonarsource
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@guillaume-dequenne guillaume-dequenne left a comment

Choose a reason for hiding this comment

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

lgtm, one minor comment about test case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is that correct? Here the last x is independent from the isinstance check.

I see why we'd want to stay conservative here and have x as ANY nevertheless, but I think a test case within the if body would still be useful.

In the future when we have more confidence about isinstance checks, I could see the type of x here remain DECL_INT.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I will add a test to check inside the if branch body. I think it still makes sense to keep this test, so that it will break as soon as we'll implement isinstance properly

@sonarsource-next
Copy link
Copy Markdown

Kudos, SonarQube 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

@andrea-guarino-sonarsource andrea-guarino-sonarsource merged commit ea6bb39 into master Aug 18, 2020
@andrea-guarino-sonarsource andrea-guarino-sonarsource deleted the SONARPY-743b branch August 18, 2020 13:39
hashicorp-vault-sonar-prod Bot pushed a commit that referenced this pull request Feb 10, 2026
GitOrigin-RevId: 65258b5eea4fe2c0cc94f3e4512ee981dbd4cc4f
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.

3 participants