Avoid Dead / Unreachable Code
WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC UNREACHABLERemote Enabled
Overview
Detect unreachable code after jump or exit statements.
ATC Finding Message:
Statement is unreachable
Rationale
Statements after an unconditional RETURN, RAISE EXCEPTION, or EXIT can never execute and often remain from debugging or an earlier design. They mislead maintainers and inflate apparent method size and coverage. Remove the statements or move them before the terminating statement if they are still needed.
Non-Compliant
abap
RETURN.
lv_count = lv_count + 1.Compliant
abap
lv_count = lv_count + 1.
RETURN.Automated QuickFix
This rule provides an automated QuickFix directly in Eclipse ABAP Development Tools (ADT):
- Position the cursor on the flagged statement.
- Press Ctrl + 1 (Quick Assist).
- Select the automated refactoring to apply the clean syntax immediately.
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC UNREACHABLE
" SAP CI_ prefix format:
... "#EC CI_UNREACHABLETechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_UNREACHABLE - Implementation File: zcl_skylint_no_unreachable.clas.abap