Home

Boolean literals should not be redundant

Rule description

  • Boolean literals should not be redundant

 

Non-compliant Code Example

function string TestFunctionCall (BOOLEAN isValid)

BOOLEAN flag = true;

if flag = False then //Non compliant code
	messagebox('is false')
end if

if isValid = True then //Non compliant code
	messagebox('is true')
end if

if Not isValid then
	messagebox('not')
end if

return "

end function

Compliant Code Example

function string TestFunctionCall (BOOLEAN isValid)

BOOLEAN flag = true;

if Not flag then //compliant code
	messagebox('is false')
end if

if isValid then //compliant code
	messagebox('is true')
end if

if Not isValid then
	messagebox('not')
end if

return "

end function
Visual Expert 2020
 VEPBRULE61