OWASP-Benchmark / BenchmarkUtils

OWASP Benchmark Project Utilities - Provides scorecard generation and crawling tools for Benchmark style test suites.
https://owasp.org/www-project-benchmark/
GNU General Public License v3.0
13 stars 48 forks source link

Migrate all SARIF readers to extend from SarifReader #70

Closed darkspirit510 closed 1 month ago

darkspirit510 commented 2 months ago

This PR migrates all SARIF reader classes extending them from SarifReader class. I moved basically all the reader's code to the parent class and used constructor instead of abstract methods. That's why this PR deletes lots of code πŸ™ˆ (Special thanks to @ericwb who "kind of" made me think that way).

PS: I am super sorry for all the contributers of SARIF classes for deleting most of their code, but I think it's way cleaner now. PPS: @ericwb Does Precaution support Java, yet? I was able to verify changes because I do not have a valid result file for Precaution and running it on my own has an empty result set πŸ€·β€β™‚οΈ

davewichers commented 2 months ago

@darkspirit510 - This changes look really good to me, and much cleaner. I'd like to compare the scores this change generates against the scores generated before this merge before I merge it just to make sure that no scores inadvertently change because of all this refactoring. I hope to do that tonight.

ericwb commented 2 months ago

@darkspirit510 Looks great and I see the start and end time are now handled. That was an issue I recently observed.

Precaution definitely does some Java analysis. I put up a PR in BenchmarkJava on how to use. Maybe this will help. https://github.com/OWASP-Benchmark/BenchmarkJava/pull/226

darkspirit510 commented 1 month ago

@davewichers any news on this PR?

davewichers commented 1 month ago

Sorry, I was on holiday for a week and then lost track of this. I just tested and didn't see any score changes so merged. Thanks for doing this!