SAP / SAP/code-pal-for-abap-cloud

Check for self-references does not correctly deal with table expressions

Open
#65 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
ABAP
Stars
55
Forks
15
PR merge metrics
No merged PRs in 30d

Description

Affected Checks
Check for unnecessary self-references

Expectation
If a local variable with the same name exists, the check should not emit findings for accessing an instance variable via me->

Actual Behavior
The check emits a finding for the following code (currently in /CC4A/SCOPE_OF_VARIABLE):

    if me->blocks[ result ]-type = if_ci_atc_source_code_provider=>block_type-sequence.
      result = me->blocks[ result ]-parent.
    endif.

even though a local variable called blocks exists.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementation of the unnecessary self-references check, currently identified as /CC4A/SCOPE_OF_VARIABLE. Reproduce the reported ABAP snippet with a local variable named blocks and inspect why the table expression is treated as an instance-variable access. Done means the check no longer emits a finding for this case while preserving its other self-reference findings.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.