@@ -186,6 +186,15 @@ def format_data(self, all_cve_entries):
186186 return cve_data , affects_data
187187
188188 def parse_node (self , node : dict [str , list [dict [str , str ]]]) -> list [dict [str , str ]]:
189+ """
190+ Parses a node from the NVD data to extract affected vendor, product, and version information.
191+
192+ Args:
193+ node (dict): A dictionary representing a node in the NVD data.
194+
195+ Returns:
196+ list[dict]: A list of dictionaries containing vendor, product, and version information.
197+ """
189198 affects_list = []
190199 if "cpe_match" in node :
191200 vulnerable_matches = (m for m in node ["cpe_match" ] if m ["vulnerable" ])
@@ -350,6 +359,15 @@ def format_data_api2(self, all_cve_entries):
350359 def parse_node_api2 (
351360 self , node : dict [str , list [dict [str , str ]]]
352361 ) -> list [dict [str , str ]]:
362+ """
363+ Parses a node from the NVD API 2.0 data to extract affected vendor, product, and version information.
364+
365+ Args:
366+ node (dict): A dictionary representing a node in the NVD API 2.0 data.
367+
368+ Returns:
369+ list[dict]: A list of dictionaries containing vendor, product, and version information.
370+ """
353371 affects_list = []
354372 if "cpeMatch" in node :
355373 vulnerable_matches = (m for m in node ["cpeMatch" ] if m ["vulnerable" ])
@@ -462,6 +480,16 @@ async def nist_fetch_using_api(self) -> list:
462480 async def getmeta (
463481 self , session : RateLimiter , meta_url : str
464482 ) -> tuple [str , dict [str , str ]]:
483+ """
484+ Retrieves metadata for a given URL.
485+
486+ Args:
487+ session (RateLimiter): The session used to make HTTP requests.
488+ meta_url (str): The URL to fetch metadata from.
489+
490+ Returns:
491+ tuple: A tuple containing the URL for the JSON data and a dictionary of metadata.
492+ """
465493 async with await session .get (meta_url ) as response :
466494 response .raise_for_status ()
467495 return (
@@ -476,6 +504,15 @@ async def getmeta(
476504 )
477505
478506 async def nist_scrape (self , session : RateLimiter ):
507+ """
508+ Scrapes the NVD feed page to get metadata links for CVE data.
509+
510+ Args:
511+ session (RateLimiter): The session used to make HTTP requests.
512+
513+ Returns:
514+ dict: A dictionary containing metadata links and their corresponding SHA values.
515+ """
479516 async with await session .get (self .feed ) as response :
480517 response .raise_for_status ()
481518 page = await response .text ()
0 commit comments