code pal for ABAP > Documentation > Method Return Bool Check
This check searches for methods that return a boolean value whose name does not indicate that they return a boolean. In particular in the case of predicative method calls it is important that such methods are named in a way that expresses the boolean nature of their return value clearly.
The check searches for method declarations whose returning parameter has the type ABAP_BOOL and reports a finding if the method does not either start with any of the following strings:
is_has_are_try_can_have_starts_ends_must_should_was_were_
or contains one of the following words:
existequalcontain
Rename the method to properly reflect the boolean nature of its return value.
In exceptional cases, you can suppress this finding by using the pseudo comment "#EC METH_RET_BOOL:
METHODS calc
IMPORTING
number TYPE i
RETURNING
VALUE(result) TYPE abap_bool. "#EC METH_RET_BOOL