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
Warning "TODO: variable is assigned but never used (ABAP cleaner)" is simply not true! ;-) #257
I've just got the warning "TODO: variable is assigned but never used (ABAP cleaner)" re one variable (ls_pm_b_iloa) that I use just a couple of lines further in MOVE-CORRESPONDING:
hm, my impression is that this comment is somehow a leftover of earlier cleanup runs (and maybe it was true at that point, before the MOVE-CORRESPONDING line was added?): These TODOs are only generated above declaration lines, so I'd suppose this initially read SELECT SINGLE ... INTO @DATA(ls_pm_b_iloa) ..., but then the inline declaration was manually changed to an upfront declaration.
With an inline declaration, ABAP cleaner (at least in its current version) would remove the TODO:
and otherwise, the TODO is not introduced anymore with the MOVE-CORRESPONDING line:
Maybe you could check that. In any case, the question remains whether ABAP cleaner should nevertheless look for such leftover TODOs and clean them away, even if they are no more located above declaration lines.
If it's a leftover it was a sticky one: Even after a few logoffs from & logins into the developer-system, a couple of Eclipse restarts, a shut-down over the night, a reboot of my Mac this morning AND further development (= ABAP cleaner runs, compilations and transports) the TODO-comment line was still there.
It finally disappeared only after I manually deleted it.
After this running ABAP cleaner didn't resurrect ;-) it.
I'm naturally happy with the end-result now.
Nevertheless I think that it must be a bug: The comment shouldn't persist after a new ABAP cleaner run IMHO.
well, this has nothing to do with logins or restarts, because the TODO comment is not dynamically displayed or stored in some kind of buffer – it is really inserted into the code. However, cleaning it away definitely makes sense, so I just added this to the implementation.
thanks again for reporting this – with version 1.13.2, which was just released, ABAP cleaner should now clean up obsolete comments, even if they have become detached from declaration statements (for whatever reason).
Activity
jmgrassau commentedon Feb 25, 2024
Hi Vlad,
hm, my impression is that this comment is somehow a leftover of earlier cleanup runs (and maybe it was true at that point, before the MOVE-CORRESPONDING line was added?): These TODOs are only generated above declaration lines, so I'd suppose this initially read
SELECT SINGLE ... INTO @DATA(ls_pm_b_iloa) ..., but then the inline declaration was manually changed to an upfront declaration.With an inline declaration, ABAP cleaner (at least in its current version) would remove the TODO:
and otherwise, the TODO is not introduced anymore with the MOVE-CORRESPONDING line:
Maybe you could check that. In any case, the question remains whether ABAP cleaner should nevertheless look for such leftover TODOs and clean them away, even if they are no more located above declaration lines.
Kind regards,
Jörg-Michael
VladGhitulescu commentedon Feb 25, 2024
Hi JM
and thanks for the weekend-reply ;-)
If it's a leftover it was a sticky one: Even after a few logoffs from & logins into the developer-system, a couple of Eclipse restarts, a shut-down over the night, a reboot of my Mac this morning AND further development (= ABAP cleaner runs, compilations and transports) the TODO-comment line was still there.
It finally disappeared only after I manually deleted it.
After this running ABAP cleaner didn't resurrect ;-) it.
I'm naturally happy with the end-result now.
Nevertheless I think that it must be a bug: The comment shouldn't persist after a new ABAP cleaner run IMHO.
What do you think?
Thanks again!
Regards,
Vlad
jmgrassau commentedon Feb 27, 2024
Hi Vlad,
well, this has nothing to do with logins or restarts, because the TODO comment is not dynamically displayed or stored in some kind of buffer – it is really inserted into the code. However, cleaning it away definitely makes sense, so I just added this to the implementation.
Kind regards,
Jörg-Michael
enhance UnusedVariablesRule to clean up obsolete comments (SAP#257)
enhance UnusedVariablesRule to clean up obsolete comments (#257)
jmgrassau commentedon Feb 27, 2024
Hi Vlad,
thanks again for reporting this – with version 1.13.2, which was just released, ABAP cleaner should now clean up obsolete comments, even if they have become detached from declaration statements (for whatever reason).
Kind regards,
Jörg-Michael