larshp/abapOpenChecks

AOC_SUPER: Check for generated object does not handle ODATA artifacts

abap-weasel opened this issue · 3 comments

Generated classes for OData artificats which are generated via SEGW transaction are not covered by check for generated objects:

METHOD is_generated.
DATA lv_genflag TYPE tadir-genflag.
SELECT SINGLE genflag
FROM tadir
INTO lv_genflag
WHERE pgmid = 'R3TR'
AND object = object_type
AND obj_name = object_name
AND genflag = abap_true.
rv_generated = boolc( sy-subrc = 0 ).
ENDMETHOD.

TADIR-GENFLAG is not set for them.

It looks like a check for this is implemented in CodePal:
https://github.com/SAP/code-pal-for-abap/blob/65c008f75d4d2453c6994c57dc03741862c1d510/src/foundation/y_exemption_of_class.clas.abap#L151-L158

Can we add the same check in AOC? (If yes: I am not sure about open source approach for that... Would we just copy this from CodePal or how is the proper way to handle that? 😬)

I think it's okay to use a similar SELECT statement, note it won't be the same since the naming of variables is different

also note the code in

* skip classes generated by Gateway Builder/SEGW
IF ( lv_abstract = abap_true AND object_name CP '*_DPC' )
OR object_name CP '*_MPC'. "#EC CI_NOORDER
SELECT SINGLE refclsname FROM seometarel INTO lv_super
WHERE clsname = object_name AND reltype = '2'.
IF sy-subrc = 0
AND ( lv_super = '/IWBEP/CL_MGW_PUSH_ABS_MODEL'
OR lv_super = '/IWBEP/CL_MGW_PUSH_ABS_DATA' ).
rv_skip = abap_true.
RETURN.
ENDIF.
ENDIF.

my fault, someone else changed our default check variant to inlude extended checks from standard instead AOC and I thought unwanted findings are coming from AOC. Existing check works as expected and no error in AOC. => Closed.