Home

Functions should end with RETURN statements

Rule description

  • Functions should end with RETURN statements

 

Non-compliant Code Example

function string TestFunctionCall1 (string cnt)

return cnt;

@count = 1  //Non compliant code (As function is having some statements after return statement)

end function

Compliant Code Example

function string TestFunctionCall1 (string cnt)

return cnt;  //Compliant code

end function
function int TestFunctionCall2()

int @count = 1 

if aa_value1 < aa_value2 then
	return @count
elseif aa_value1 = aa_value2 then
	return @count
else
	return @count
end if

end function
Visual Expert 2020
 VEPBRULE32