Skip to content
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

ATC Check 69: If no routine using/changing/tables parameter prefix is defined, then local prefixes are used #1047

Open
cavabap opened this issue Oct 1, 2021 · 2 comments

Comments

@cavabap
Copy link
Contributor

cavabap commented Oct 1, 2021

In our system we have no guidelines for prefixing of routine variables. Actually routines shouldn't be used...
There we don't want to check the FORM prefixes. However when we supply no rule, then local prefixes are being used,

grafik
This leads to false positives.
grafik

according to my debugging (and I don't know the code well) it seems that if no scope (which are the parameters we configured) then the scope is determined. And for FORM the scope is always locals. The keyword is never considered - because it is always FORM and not USING/CHANGING/TABLES?

This determination seems to happen, whenever the scope is initial.
adt:///sap/bc/adt/oo/classes/zcl_aoc_check_69/source/main#start=978,0;end=982,10
While the decision that any form is local happens here.
adt://
/sap/bc/adt/oo/classes/zcl_aoc_check_69/source/main#start=1003,4;end=1006,40

At first I thought a workaround is to provide an explicit scope of '*' - but this causes the regex to raise an exception and its looks no further ATC coding scanning occurs. My current workaround to supply all kind of sensible prefixes - but this isn't ideal.

Also this doesn't seem to be required elsewhere (such as in the statics section). This is because in determine_scope_prefix there is an exception for lv_keyword = 'STATICS'. However for FORMS the keyword USING is not available for consideration.

@cavabap cavabap changed the title ATC Check 69: If no routine using/changing/tables parameter prefix is defined, then local prefixes are using ATC Check 69: If no routine using/changing/tables parameter prefix is defined, then local prefixes are used Oct 1, 2021
@cavabap
Copy link
Contributor Author

cavabap commented Oct 4, 2021

How are you test these checks? Are there default test programs your using?

@larshp
Copy link
Owner

larshp commented Oct 4, 2021

manually 😓

some of this is difficult to test, as I dont want to install bad/example/test code in the target systems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants