Home

Return of boolean expressions should not be wrapped into an if-then -else statement

Rule description

  • Return of boolean expressions should not be wrapped into an if-then -else statement

 

Non-compliant Code Example

DECLARE flag BOOLEAN := score < 35;
--IF student have score more then 35. 
BEGIN
IF flag THEN                --Non compliant code (Return of boolean expressions is wrapped into an if-then -else statement)
	RETURN FALSE;
ELSE
	RETURN TRUE;
END IF;					
END;

Compliant Code Example

BEGIN
	RETURN score < 35 ;             --Compliant code
END;
Visual Expert 2020
 VEPLSQLRULE127