Home

Redundant pairs of parentheses should be removed

Rule description

  • Redundant pairs of parentheses should be removed

 

Non-compliant Code Example

BEGIN
IF score > 70 THEN 
	DBMS_OUTPUT.PUT('Grade A');
ELSIF (((score > 50)) AND score < 70) THEN       --Non compliant code (Condition with redundant parentheses)
	DBMS_OUTPUT.PUT('Grade B');
ELSIF score > 35 AND score < 50 THEN 
	DBMS_OUTPUT.PUT('Grade C');
ELSE 
	DBMS_OUTPUT.PUT('Grade D');
END IF;					
END;

Compliant Code Example

BEGIN
IF score > 70 THEN 
	DBMS_OUTPUT.PUT('Grade A');
ELSIF (score > 50 AND score < 70) THEN       --Non compliant code (Condition without redundant parentheses)
	DBMS_OUTPUT.PUT('Grade B');
ELSIF score > 35 AND score < 50 THEN 
	DBMS_OUTPUT.PUT('Grade C');
ELSE 
	DBMS_OUTPUT.PUT('Grade D');
END IF;					
END;
Visual Expert 2020
 VEPLSQLRULE104