Skip to content

Bug: S1125 code fix does not add ! when transforming x == false.#8945

Merged
gregory-paidis-sonarsource merged 2 commits intomasterfrom
greg/fix-S1125-wrong-codefix
Mar 20, 2024
Merged

Bug: S1125 code fix does not add ! when transforming x == false.#8945
gregory-paidis-sonarsource merged 2 commits intomasterfrom
greg/fix-S1125-wrong-codefix

Conversation

@gregory-paidis-sonarsource
Copy link
Contributor

Fixes #7999

if (false != cond) { } // Noncompliant

if (true == cond) { } // Noncompliant
if (true != cond) { } // Noncompliant
Copy link
Contributor Author

Choose a reason for hiding this comment

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

6/8 of these are not impacted, only x == false and false == x has special parsing.
I added all of them because they are best friends and like to hang out together (and I wanted to make sure I did not break them).

Copy link
Member

Choose a reason for hiding this comment

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

LGTM! Please change the regions with comments.

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@sonarqubecloud
Copy link

@gregory-paidis-sonarsource gregory-paidis-sonarsource marked this pull request as ready for review March 20, 2024 12:38
@gregory-paidis-sonarsource gregory-paidis-sonarsource merged commit f031747 into master Mar 20, 2024
@gregory-paidis-sonarsource gregory-paidis-sonarsource deleted the greg/fix-S1125-wrong-codefix branch March 20, 2024 12:38
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.

Bug: S1125 code fix does not add ! when transforming x == false.

2 participants