Home

Unused labels should be removed

Description

    This PowerBuilder code rule states that any labels which are no longer used in the code should be removed. This helps to ensure that the code is organized and easy to read, and that any unnecessary code is removed. Unused labels can be identified by searching the code for any labels which are not referenced anywhere else in the code. Once identified, these labels can be removed to help keep the code clean and organized.

Key Benefits

  • Reduced clutter: Unused labels should be removed to reduce clutter and confusion.
  • Easier navigation: Removing unused labels makes it easier for users to find what they are looking for.
  • Improved performance: Unused labels can slow down performance, so removing them can improve the overall experience.

 

Non-compliant Code Example

function string testFunctionCall (string cnt)

restart1:  //Non compliant code (Unused label)
if cnt > 0 then
	messagebox('Success','is greater than 0 found ')
end if

return cnt

end function

Compliant Code Example

function string testFunctionCall (string cnt)

if cnt > 0 then 
	messagebox('Success','is greater than 0 found ')
end if

return cnt

end function
Visual Expert 2024
 VEPBRULE54