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

To be discussed: Insert TODO-statement when CLEAR of EXPORTING-Parameter is missing? #392

Open
vonglan opened this issue Dec 23, 2024 · 0 comments

Comments

@vonglan
Copy link

vonglan commented Dec 23, 2024

I think this might prevent some bugs.
We would not want ABAPCleaner to directly insert the CLEAR, because this would change the logic.

https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#clear-or-overwrite-exporting-reference-parameters
"Generally, it is a good idea to clear the parameter as a first thing in the method after type and data declarations."

Disadvantages:

  • The TODO-comment is ugly if it is left in the code
  • For "false positives" (where the Exporting-Parameter is intentionally and correctly not CLEARed), ABAPCleaner would need some pseudocomment
  • You might argue that this should be an ATC check (or even retrofitted into ABAP syntax ;-)) . I suppose it is NOT an ATC check because of the high percentage of false positives (which are difficult to detect by ATC).

What is your opinion?

Best regards,
Edo

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

1 participant