aboutcode-org / aboutcode-org/vulnerablecode

Improve readability for apache_httpd importer

未关闭
#1,109 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
702
派生
328
平均合并
3 天 8 小时
30 天内合并 PR
3

描述

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 https://github.com/nexB/vulnerablecode/pull/1102#discussion_r1088817834_

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。