Avoid Boolean Flag Importing Parameters
WarningClean ABAP & Modern Syntax#EC NO_BOOL_BLINDNESSRemote Enabled
Overview
Avoid boolean flag importing parameters.
ATC Finding Message:
Boolean importing parameters hide intent; use dedicated methods or a typed flag
Rationale
A boolean importing parameter turns a method call into a positional switch: callers write do_work( abap_true ) and readers cannot tell what true means without opening the signature. Boolean blindness also pushes every new variation into the same method instead of a dedicated, well-named API. Expose the alternatives as separate methods or as a meaningful typed flag, and keep abap_bool flags out of method interfaces.
Non-Compliant
abap
METHODS save_order
IMPORTING iv_send_mail TYPE abap_bool.Compliant
abap
METHODS save_order.
METHODS save_and_send_order.Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_BOOL_BLINDNESS
" SAP CI_ prefix format:
... "#EC CI_NO_BOOL_BLINDNESSRelated Rules
- Use Predicate Naming for Boolean Methods (is_, has_, can_) —
#EC PREF_PRED_NAME - Avoid Comparing to abap_true / abap_false —
#EC NO_BOOL_COMPARE - Limit Method Parameter Count and Require Multi-Line Signatures —
#EC MAX_PARAMS_COUNT
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_BOOL_BLINDNESS - Implementation File: zcl_skylint_no_bool_blindness.clas.abap