-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check 95: Add filter so that some classes can be ignored. #1165
Comments
Why though? Is it because CX_ROOT has method parameters that are named exactly like attributes? If so, then that might be more sensible than defining filters on class name level 😉 |
Hum, well, I have this exception class which I think was generated by ABAP: CLASS zcx_coot DEFINITION
PUBLIC
INHERITING FROM cx_static_check
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_t100_dyn_msg .
INTERFACES if_t100_message .
METHODS constructor
IMPORTING
!textid LIKE if_t100_message=>t100key OPTIONAL
!previous LIKE previous OPTIONAL .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcx_coot IMPLEMENTATION.
METHOD constructor ##ADT_SUPPRESS_GENERATION.
CALL METHOD super->constructor
EXPORTING
previous = previous.
CLEAR me->textid.
IF textid IS NOT INITIAL.
if_t100_message~t100key = textid.
ENDIF.
ENDMETHOD.
ENDCLASS. The I agree that having method parameters shadow class attributes is a bad idea but this is code generated by SAP. What would you do in this case? |
Personally, I think My suggestion would be to adapt check 95 to not raise an error if there is shadowing. Check 46 already has shadowing detection, so you might be able to extract the logic from there. |
That makes total sense. Perfect. I'll try to implement it. Thanks! |
I want to flag the use of
me->
everywhere except in exception classes.It would be great if a filter could be added so I could set it to ignore
zcx_*
.I will try to implement this myself.
The text was updated successfully, but these errors were encountered: