Exclude Checks for Test Code
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- testing-qa, tooling
Research direction
Start in class Y_CHECK_BASE, inspect INSTANTIATE_OBJECTS and IS_STATEMENT_IN_AUNIT_TAB, and trace how ref_scan and aunit_tab are used for local and global test classes. Verify the behavior for the Empty Catch and Number of Public Attributes checks, ensuring configured unit-test exclusions no longer produce findings.
Written by the indexing model from the issue text.
Description
Check Name
Empty Catch
Number of Public Attributes
Actual Behavior
Although the checks are set up for production code only (we exluded the test code for these checks), we keep receiving findings from unit tests.
Expected Behavior
Exclude unit tests from these checks according to the configuration.
Possible solution
In the method
IS_STATEMENT_IN_AUNIT_TABof the classY_CHECK_BASEit is assumed that the table for unit tests is already filled which is not the case.
TRY.
" Local Test Class
aunit = ref_scan->aunit_tab[ incl_name = include ].
CATCH cx_sy_itab_line_not_found.
" Global Test Class
aunit = ref_scan->aunit_tab[ incl_name = program_name ].
ENDTRY.
One possible solution could be adding
IF ref_scan->aunit_tab_determined = abap_false.
ref_scan->determine_aunit_lines( ).
ENDIF.
into the method INSTANTIATE_OBJECTS of the same class after the verification IF ref_scan IS INITIAL.
- Dominant language
- ABAP
- Stars
- 435
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
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.
More from SAP/code-pal-for-abap
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
SAP/code-pal-for-abap#642 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
SAP/code-pal-for-abap#635 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 38/100
SAP/code-pal-for-abap#624 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 38/100
SAP/code-pal-for-abap#622 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
SAP/code-pal-for-abap#616 · 2 comments ·
All issues in SAP/code-pal-for-abap
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100