Avoid Unused Parameters in Procedures
WarningClean ABAP & Modern Syntax#EC NO_UNUSED_PARAMLocal Only
Overview
Avoid unused parameters in procedures.
ATC Finding Message:
Parameter(s) &1 never used in procedure
Rationale
Methods, form routines, and function modules should not declare parameters that are never accessed or assigned in their implementation. Unused parameters clutter the signature, confuse callers, and may indicate incomplete implementations. If a parameter is intentionally unused, prefix its name with an underscore.
Non-Compliant
abap
METHOD do_work IMPORTING iv_used TYPE i iv_unused TYPE string.
DATA lv_val TYPE i.
lv_val = iv_used.
ENDMETHOD.Compliant
abap
METHOD do_work IMPORTING iv_used TYPE i.
DATA lv_val TYPE i.
lv_val = iv_used.
ENDMETHOD.Configuration & Thresholds
This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:
| Parameter Name | Data Type | Default Value | Description & Guidance |
|---|---|---|---|
CHECK_METHODS | Boolean | true | Check method procedures for unused parameters (defaults to true) |
CHECK_FORMS | Boolean | true | Check form routines for unused parameters (defaults to true) |
CHECK_FUNCS | Boolean | true | Check function modules for unused parameters (defaults to true) |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_UNUSED_PARAM
" SAP CI_ prefix format:
... "#EC CI_NO_UNUSED_PARAMRelated Rules
- Eliminate Unused Local Variables and Symbols —
#EC NO_UNUSED_VARS - Avoid Dead Code with Constant Conditions —
#EC NO_DEAD_CODE
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_UNUSED_PARAM - Implementation File: zcl_skylint_no_unused_param.clas.abap