Skip to content

SONARPY-744 Avoid FP when subscription object is used inside 'in expr…#861

Merged
andrea-guarino-sonarsource merged 1 commit intomasterfrom
SONARPY-744-c
Aug 28, 2020
Merged

SONARPY-744 Avoid FP when subscription object is used inside 'in expr…#861
andrea-guarino-sonarsource merged 1 commit intomasterfrom
SONARPY-744-c

Conversation

@andrea-guarino-sonarsource
Copy link
Contributor

…essions'

@sonarsource-next
Copy link

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

Copy link
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, 1 minor comment


private static boolean isRightOperandInExpression(Tree tree) {
Tree parent = tree.parent();
if (parent instanceof InExpression) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: I think you can use Tree::is here instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you don't mind, I'd prefer to use instanceof here so that it will also work in case of parent being null

@andrea-guarino-sonarsource andrea-guarino-sonarsource merged commit 529b9f3 into master Aug 28, 2020
@andrea-guarino-sonarsource andrea-guarino-sonarsource deleted the SONARPY-744-c branch August 28, 2020 12:10
hashicorp-vault-sonar-prod bot pushed a commit that referenced this pull request Feb 17, 2026
…anguage is specified (#861)

GitOrigin-RevId: 881c30a7a345a4b76abb562a5da18965e90d75f1
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

Comments