abapOpenChecks icon indicating copy to clipboard operation
abapOpenChecks copied to clipboard

CHECK outside of loop (CHECK 02) should be more smart

Open alezhu opened this issue 2 years ago • 1 comments

CHECK 02 does not allow CHECK for exit from block except loops. It required RETURN for this. And it used Programming Guideline Only use RETURN to exit procedures) to justify it.

BUT! That guideline has Exception section:

An exception to the rule to only use RETURN to exit procedures are CHECK statements that are located at the beginning of a procedure and that check the prerequisites for the execution of the procedure there. Using the CHECK statement in such a way does not impair the legibility and is thus allowed. However, this exception does not apply to other positions within a procedure and outside loops.

alezhu avatar Dec 15 '22 09:12 alezhu

thanks, pull requests welcome

larshp avatar Dec 15 '22 09:12 larshp