l3r8yJ / oop-cop

The static analysis tool and a Maven plugin that will help you model your objects, classes, methods properly by rejecting your non-perfect code.
https://www.l3r8y.ru/oop-cop/
MIT License
9 stars 5 forks source link

WorkerCheck suppression, messages #113

Closed h1alexbel closed 8 months ago

h1alexbel commented 8 months ago

@l3r8yJ take a look, please closes #38


PR-Codex overview

This PR focuses on adding suppression annotations to the codebase to suppress specific OOP rules.

Detailed summary

The following files were skipped due to too many changes: src/main/java/ru/l3r8y/parser/IsSuppressed.java, src/test/java/ru/l3r8y/parser/IsSuppressedTest.java, src/test/java/ru/l3r8y/parser/ClassNamesTest.java, src/main/java/ru/l3r8y/parser/SuppressedChecks.java

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

zoeself commented 8 months ago

@h1alexbel thank you for your Pull Request. I'll assign someone to review it soon.

If this PR solves a todo from the code, please don't forget to remove it.

zoeself commented 8 months ago

@l3r8yJ please review this Pull Request. Deadline (when it should be merged or closed) is 2024-01-06T08:30:25.223586.

You should check if the requirements have been implemented (partially or in full), if there are unit tests covering the changes and if the CI build passes. Feel free to reject the PR or ask for changes if it's too big or not clear enough.

Estimation here is 30 minutes, that's how much you will be paid. You will be paid even if this PR gets rejected.

codecov-commenter commented 8 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

:exclamation: No coverage uploaded for pull request base (master@b301169). Click here to learn what that means.

Files Patch % Lines
...rc/main/java/ru/l3r8y/parser/SuppressedChecks.java 88.00% 1 Missing and 2 partials :warning:
src/main/java/ru/l3r8y/parser/IsSuppressed.java 85.71% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #113 +/- ## ========================================= Coverage ? 76.99% Complexity ? 70 ========================================= Files ? 18 Lines ? 226 Branches ? 8 ========================================= Hits ? 174 Misses ? 46 Partials ? 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

h1alexbel commented 8 months ago

@l3r8yJ fully agree, but for now I don't know how to do it in a right way, any ideas?

h1alexbel commented 8 months ago

as far as I know, I can check that annotation @SuppressWarnings exists on top of class, but how to check its value (rule name)?

l3r8yJ commented 8 months ago

@l3r8yJ fully agree, but for now I don't know how to do it in a right way, any ideas?

You can look at jtcop implementation of this, I haven't seen it, but I assume there is some object that scans the project only for these exclusions and then during the validation phase just skips these exclusions It's probably similar to a pattern strategy where Map<Rule, List<Exclusion>> has a list of class/method names to be skipped in Map<Rule, List<Exclusion>> against the rule

We can also ask @volodya-lombrozo directly how best to do this?

h1alexbel commented 8 months ago

@l3r8yJ I'm finishing my own implementation, very soon I will submit it

l3r8yJ commented 8 months ago

as far as I know, I can check that annotation @SuppressWarnings exists on top of class, but how to check its value (rule name)?

I think only with CGLIB or Reflections,

h1alexbel commented 8 months ago

@l3r8yJ take a look, please

l3r8yJ commented 8 months ago

@h1alexbel can you please ask for review after all commits? It's a bit struggling to refresh page and look for new diff during review process

sonarcloud[bot] commented 8 months ago

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

8 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

h1alexbel commented 8 months ago

@l3r8yJ take a look, please

l3r8yJ commented 8 months ago

@rultor merge

rultor commented 8 months ago

@rultor merge

@l3r8yj OK, I'll try to merge now. You can check the progress of the merge here

rultor commented 8 months ago

@rultor merge

@l3r8yj Done! FYI, the full log is here (took me 2min)

zoeself commented 8 months ago

@l3r8yJ thank you for resolving this ticket. I've just added it to your active invoice. You can always check all your invoices and more on the Contributor Dashboard.