SAP / SAP/code-pal-for-abap-cloud
Check for self-references does not correctly deal with table expressions
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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