Home

String literals should not be duplicated

Rule description

  • String literals should not be duplicated

 

Non-compliant Code Example

function string TestFunctionCall (int cnt)

smallint @count  

if cnt < 1 then
	messagebox('SuccessTest','less than 1 found ') //Non compliant code (String literals duplicated below)
end if

messagebox('SuccessTest','test finished') //Non compliant code (String literals duplicated above)
@count = 1 


return "

end function

Compliant Code Example

function string TestFunctionCall (int cnt)

smallint @count  

if cnt < 1 then
	messagebox('FailedTest','less than 1 found ') //Compliant code
end if

messagebox('SuccessTest','test finished') //Compliant code
@count = 1 

return "

end function
Visual Expert 2020
 VEPBRULE36