File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,18 @@ async def nvd_count_metadata(session):
83
83
cve_count [key ["name" ]] = int (key ["count" ])
84
84
return cve_count
85
85
86
+ @staticmethod
87
+ def get_reject_count (fetched_data : Dict ) -> int :
88
+ """Returns total rejected CVE count"""
89
+ all_cve_list = fetched_data ["result" ]["CVE_Items" ]
90
+ reject_count = 0
91
+ for cve_item in all_cve_list :
92
+ if cve_item ["cve" ]["description" ]["description_data" ][0 ][
93
+ "value"
94
+ ].startswith ("** REJECT **" ):
95
+ reject_count += 1
96
+ return reject_count
97
+
86
98
async def get_nvd_params (
87
99
self ,
88
100
time_of_last_update : Union [datetime , None ] = None ,
@@ -169,7 +181,10 @@ async def load_nvd_request(self, start_index):
169
181
170
182
if start_index == 0 :
171
183
# Update total results in case there is discrepancy between NVD dashboard and API
172
- self .total_results = fetched_data ["totalResults" ]
184
+ reject_count = self .get_reject_count (fetched_data )
185
+ self .total_results = (
186
+ fetched_data ["totalResults" ] - reject_count
187
+ )
173
188
self .all_cve_entries .extend (fetched_data ["result" ]["CVE_Items" ])
174
189
175
190
elif response .status == 503 :
You can’t perform that action at this time.
0 commit comments