Home

CASE should be used for sequences of simple tests

Rule description

  • CASE should be used for sequences of simple tests

 

Non-compliant Code Example

function string TestFunctionCall (string cnt, boolean exp )

  IF x = 0 THEN        //Non compliant code (Instead of IF and ELSEIF use Case clause)            
        cnt = "x = 0";
  ELSEIF x = 1 THEN
        cnt = "x = 1";
            ELSE
                  cnt = "else";
            END IF;

            return cnt

end function
Visual Expert 2020
 VEPBRULE69