Skip to content

Warning "TODO: variable is assigned but never used (ABAP cleaner)" is simply not true! ;-) #257

Closed

Description

@VladGhitulescu

Hey,

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:

CleanShot 2024-02-24 at 21 27 49

Do I miss something here?

Thanks!

Regards,
Vlad

Activity

  1. jmgrassau commented on Feb 25, 2024

    @jmgrassau
    Member

    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:

    image

    and otherwise, the TODO is not introduced anymore with the MOVE-CORRESPONDING line:

    image

    image

    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

  2. VladGhitulescu commented on Feb 25, 2024

    @VladGhitulescu
    Author

    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

  3. self-assigned this
    on Feb 27, 2024
  4. jmgrassau commented on Feb 27, 2024

    @jmgrassau
    Member

    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

  5. jmgrassau commented on Feb 27, 2024

    @jmgrassau
    Member

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions