You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Delete unused variables" rule deletes variable which used in macros. #43
thank you very much for reporting this. Actually, this is a limitation of ABAP cleaner: the tool only works on the code document provided to it, without doing further backend calls. This usually works fine for local variables, but macros are indeed an exception that can't be considered here, especially if the macro definition is 'out of sight'.
I shall therefore restrict the "Delete unused variables" rule to only work on methods that do NOT make use of macros (hopefully you won't find too much usage of macros in the code anyway…)
this issue should now be fixed in the freshly released version 1.3.0, meaning that the rule "Delete unused variables" (as well as "Use FINAL form immutable variables") will now simply skip methods in which macros are used hopefully adding another motivation to replace macros with other constructs :-) Thanks again for pointing this out!
Activity
thebestabapdeveloper commentedon Jun 5, 2023
I temporarily chose the option to 'comment out with "' for local variables that are never used.
jmgrassau commentedon Jun 5, 2023
Hi thebestabapdeveloper :-),
thank you very much for reporting this. Actually, this is a limitation of ABAP cleaner: the tool only works on the code document provided to it, without doing further backend calls. This usually works fine for local variables, but macros are indeed an exception that can't be considered here, especially if the macro definition is 'out of sight'.
I shall therefore restrict the "Delete unused variables" rule to only work on methods that do NOT make use of macros (hopefully you won't find too much usage of macros in the code anyway…)
Kind regards,
Jörg-Michael
fix UnusedVariablesRule and FinalVariableRule for macro usage (SAP#43)
fix UnusedVariablesRule and FinalVariableRule for macro usage (#43)
jmgrassau commentedon Jun 6, 2023
Hi,
this issue should now be fixed in the freshly released version 1.3.0, meaning that the rule "Delete unused variables" (as well as "Use FINAL form immutable variables") will now simply skip methods in which macros are used hopefully adding another motivation to replace macros with other constructs :-) Thanks again for pointing this out!
Kind regards,
Jörg-Michael
thebestabapdeveloper commentedon Aug 14, 2023
Cheers.