aboutcode-org / aboutcode-org/vulnerablecode

Improve readability for apache_httpd importer

Abierto
#1,109 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
702
Forks
328
Merge medio
3 d 8 h
PR fusionados (30 d)
3

Descripción

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_

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.