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

Improve readability for apache_httpd importer #1109

Open
TG1999 opened this issue Jan 27, 2023 · 0 comments
Open

Improve readability for apache_httpd importer #1109

TG1999 opened this issue Jan 27, 2023 · 0 comments

Comments

@TG1999
Copy link
Contributor

TG1999 commented Jan 27, 2023

          See line 87 above in the importer class, there is a lot of dict/key usage, often several levels like:

for vendor in data["affects"]["vendor"]["vendor_data"] and then again for products in vendor["product"]["product_data"].

Shouldn't we probably use something like the AdvisoryData classes (or a special subclass for that) which would model the advisory data directly, and then use those classes everywhere instead of dicts. This has some advantages:

  1. code would be more pythonic and readable (and better looking)
  2. we can and should test for the advisory format and handle keyerrors gracefully (idk if the data format changes that much at all, but it could in future?)

Originally posted by @AyanSinhaMahapatra in #1102 (comment)

@TG1999 TG1999 changed the title Improve readability for apache_httpd improver Improve readability for apache_httpd importer Jan 27, 2023
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

No branches or pull requests

1 participant