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

New Rule: no inversion of boolean checks #44

Closed
silviomarghitola opened this issue Jun 5, 2019 · 1 comment · Fixed by #86
Closed

New Rule: no inversion of boolean checks #44

silviomarghitola opened this issue Jun 5, 2019 · 1 comment · Fixed by #86
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@silviomarghitola
Copy link

silviomarghitola commented Jun 5, 2019

Language Usage / Control Structures / CASE ...
Avoid inverting boolean checks

from SonarQube

Boolean checks should not be inverted

It is needlessly complex to invert the result of a boolean comparison. The opposite comparison should be made instead.

Noncompliant Code Example

IF NOT x <> y THEN
  -- ...
END IF;

Compliant Solution

IF x = y THEN
  -- ...
END IF;
@PhilippSalvisberg
Copy link
Collaborator

I agree, the compliant solution is much easier to read.

@PhilippSalvisberg PhilippSalvisberg added the enhancement New feature or request label Jun 5, 2019
@PhilippSalvisberg PhilippSalvisberg added this to the v4.0 milestone Jun 5, 2019
@kibeha kibeha self-assigned this Sep 16, 2020
kibeha added a commit to kibeha/plsql-and-sql-coding-guidelines that referenced this issue Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants