Avoid Duplicate Branch Conditions
WarningAnti-Patterns & Bad Practices#EC DUP_CONDRemote Enabled
Overview
Avoid duplicate branch conditions in IF and CASE.
ATC Finding Message:
Identical condition in branch; duplicate branch is unreachable
Rationale
A repeated IF/ELSEIF or WHEN condition can never be reached because the earlier branch already handles it. This is usually a copy-paste error and can leave the intended branch permanently dead. Remove the duplicate or correct the condition so every branch has a distinct purpose.
Non-Compliant
abap
IF lv_status = 'A'.
process_a( ).
ELSEIF lv_status = 'A'.
process_b( ).
ENDIF.Compliant
abap
IF lv_status = 'A'.
process_a( ).
ELSEIF lv_status = 'B'.
process_b( ).
ENDIF.Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC DUP_COND
" SAP CI_ prefix format:
... "#EC CI_DUP_CONDTechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_DUP_COND - Implementation File: zcl_skylint_no_dup_cond.clas.abap