How ejaaskel/yocto-cve-parser works
Project type and purpose
• This is a standalone, open-source, command-line tool written in Python.
• Purpose: parse Yocto’s CVE checker JSON output, apply filters/sorting, and display a human-readable report.
File structure
• Top level:
• README.md – project description, usage guide
• cve-parser.py – all code resides in a single script
• No subdirectories, no external services, no databases – this is a simple CLI utility.
README for additional insights
• The script reads a JSON file generated by Yocto (via cve-check), then:
• Parses the JSON
• Applies filters (by CVSS score, status, etc.)
• Sorts and formats the results
• Prints output to stdout
• All configuration is passed via CLI flags (-f, ‑ms, ‑Ms, ‑vs, etc.).
a. User / CLI Interface
b. Input JSON File (Yocto CVE summary)
c. Parser Module (JSON loader → internal data structures)
d. Filter Module (applies score/status filters)
e. Sort Module (orders results per user flags)
f. Formatter / Output Module (formats to table/text and writes to console)
g. External dependency: Python runtime (3.x)
Relationships and interactions
• User invokes python3 cve-parser.py with flags → CLI Interface
• CLI Interface reads the JSON file path → passes to Parser
• Parser emits a list of CVE objects → fed into Filter
• Filter applies user-specified criteria → filtered list → goes to Sort
• Sort orders the list → passes to Formatter
• Formatter sends formatted text to stdout
Architectural patterns and design principles
• Single-entry script → procedural / modular design
• Separation of concerns: parsing, filtering, sorting, formatting all distinct
• Extensibility: new filters or output formats can be added as separate functions or classes
Detail without overcomplication
• Flags or configuration points as annotations near the CLI or Filter module
• Python version or libraries (e.g., built-in json module) as small text under relevant modules
• Where future extensions (new filters or output formats) would plug in