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

Code cleanup in UsrGrpAdminServlet #4485

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

ckelleyRH
Copy link
Contributor

  • Make logger final and log errors instead of stack traces
  • Reorder modifiers to match the JLS
  • Move array designators to the type
  • Remove unnecessary Boolean literals and control flow jumps
  • Remove commented out code
  • Use pattern-matching instanceof
  • Simplify logic by flattening/inverting negated ifs/unnecessary elses
  • Remove declarations for exceptions that cannot be thrown

I expect this will also bump the Sonar Cloud Security Review score up from E to D, which is nice 😃

* Make logger final and log errors instead of stack traces
* Reorder modifiers to match the JLS
* Move array designators to the type
* Remove unnecessary Boolean literals and control flow jumps
* Remove commented out code
* Use pattern-matching instanceof
* Simplify logic by flattening/inverting negated ifs/unnecessary elses
* Remove declarations for exceptions that cannot be thrown
Copy link
Member

@fmarco76 fmarco76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonarcloud
Copy link

sonarcloud bot commented Jun 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
3.4% 3.4% Duplication

@ckelleyRH ckelleyRH merged commit 76d8332 into dogtagpki:master Jun 22, 2023
133 of 137 checks passed
@ckelleyRH ckelleyRH deleted the UsrGrpAdminServlet branch June 22, 2023 11:37
@ckelleyRH
Copy link
Contributor Author

Thanks @fmarco76 !

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

Successfully merging this pull request may close these issues.

2 participants