Home

IF statement conditions should not evaluate unconditionally to TRUE or to FALSE

Rule description

  • IF statement conditions should not evaluate unconditionally to TRUE or to FALSE

 

Non-compliant Code Example

BEGIN
IF TRUE THEN                --Non compliant code
	DBMS_OUTPUT.PUT('Success :)');
ELSIF FALSE THEN            --Non compliant code
	DBMS_OUTPUT.PUT('Failed !!');
END IF;					
END;

Compliant Code Example

BEGIN
IF flag THEN                --Non compliant code
	DBMS_OUTPUT.PUT('Success :)');
ELSIF NOT flag THEN            --Non compliant code
	DBMS_OUTPUT.PUT('Failed !!');
END IF;					
END;
Visual Expert 2020
 VEPLSQLRULE64