Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

New Rule: no comparison of boolean variables #45

Closed
Assignees
kibeha
Labels
enhancementNew feature or request
Milestone
@silviomarghitola

Description

@silviomarghitola

Language Usage / Control Structures / CASE ...
Avoid comparing boolean variables or colums with TRUE or FALSE

fromSonarQube

Boolean literals should not be redundant

Redundant Boolean literals should be removed from expressions to improve readability.

Noncompliant Code Example

DECLARE  fooBOOLEAN := TRUE;BEGIN  IF foo= FALSE THENDBMS_OUTPUT.PUT_LINE('foo = false!');  ELSIF foo= TRUE THENDBMS_OUTPUT.PUT_LINE('foo = true!');  END IF;END;

Compliant Solution

DECLARE  fooBOOLEAN := TRUE;BEGIN  IF NOT foo THENDBMS_OUTPUT.PUT_LINE('foo = false!');  ELSIF foo THENDBMS_OUTPUT.PUT_LINE('foo = true!');  END IF;END;

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp