Skip to content

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):

  1. Position the cursor on the flagged statement.
  2. Press Ctrl + 1 (Quick Assist).
  3. 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_UNREACHABLE

Technical Details ​

Released under the MIT License.