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

Reduce code scanner warnings #625

Merged
merged 4 commits into from
Oct 11, 2020
Merged

Reduce code scanner warnings #625

merged 4 commits into from
Oct 11, 2020

Conversation

MarkEWaite
Copy link
Contributor

Reduce code scanner warnings

Annotate HTTP accessible method with RequirePOST. Since the method is only needed from a POST context, it should be annotated with @RequirePOST. The method does not invoke any risky code that might make it a security risk, but it is not useful as a GET method, so require that it must be called with POST.

Also renames several test methods to avoid warnings due to poorly named test methods.

Checklist

  • I have read the CONTRIBUTING doc
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • I have interactively tested my changes

Types of changes

  • Reduce warnings

Since the method is only needed from a POST context, it should be
annotated with @RequirePOST.  The method does not invoke any risky code
that might make it a security risk, but it is not useful as a GET method,
so require that it must be called with POST.
The doXyz methods may be misinterpreted as Stapler methods.  This is
purely test code, but no reason to use poorly named methods in test
code either.
@MarkEWaite MarkEWaite added the chore Reduces maintenance effort by changes not directly visible to users label Oct 11, 2020
@MarkEWaite MarkEWaite merged commit a1271c0 into master Oct 11, 2020
@MarkEWaite MarkEWaite deleted the resolve-scanner-warnings branch October 11, 2020 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Reduces maintenance effort by changes not directly visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant