strelka icon indicating copy to clipboard operation
strelka copied to clipboard

Update Scanner class to provide options to init()

Open ryanohoro opened this issue 1 year ago • 1 comments

Describe the change

Scanners had an init() function that could be used before the first execution of the scanner, however, it did not have access to the config options, limiting how useful it was.

This PR adds the scanner options to init() and updates all scanners with the new style, or a skeleton function.

Describe testing procedures

Docker container builds properly.

Sample output

N/A

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of and tested my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings

ryanohoro avatar Mar 09 '24 05:03 ryanohoro

FWIW, init wasn't designed to use options (probably because I didn't know a lot about software design at the time). But if you're going to do this, which seems pretty reasonable, then you might as well remove options from the scan methods because init isn't actually doing anything in this PR. I'm not sure how it would break existing deployments but "loading" options on init instead of every scan may save a few micro or milliseconds of runtime for each scan.

jshlbrd avatar Mar 31 '24 01:03 jshlbrd