nahsra / WebGoat_12_23

Other
0 stars 2 forks source link

(Sonar) Fixed finding: "`@Override` should be used on overriding and implementing methods" #33

Closed pixeebot[bot] closed 1 month ago

pixeebot[bot] commented 1 month ago

Remediation

This change fixes "@Override should be used on overriding and implementing methods" (id = java:S1161) identified by Sonar.

Details

This change adds missing @Override to known subclasses. Documenting inheritance will help readers and static analysis tools understand the code better, spot bugs easier, and in general lead to more efficient and effective review.

Our changes look something like this:

  interface AcmeParent {
     void doThing();
  } 

  class AcmeChild implements AcmeParent {

+   @Override
    void doThing() {
      thing();
    }

  }
More reading * [https://rules.sonarsource.com/java/RSPEC-1161/](https://rules.sonarsource.com/java/RSPEC-1161/)

I have additional improvements ready for this repo! If you want to see them, leave the comment:

@pixeebot next

... and I will open a new PR right away!

🧚🤖 Powered by Pixeebot

Feedback | Community | Docs | Codemod ID: sonar:java/add-missing-override-s1161

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
E Security Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint