File tree Expand file tree Collapse file tree 3 files changed +41
-8
lines changed Expand file tree Collapse file tree 3 files changed +41
-8
lines changed Original file line number Diff line number Diff line change @@ -212,15 +212,12 @@ def parse_findings(
212
212
"""
213
213
Determine how to parse the findings based on the presence of the
214
214
`get_tests` function on the parser object
215
+
216
+ This function will vary by importer, so it is marked as
217
+ abstract with a prohibitive exception raised if the
218
+ method is attempted to to be used by the BaseImporter class
215
219
"""
216
- # Attempt any preprocessing before generating findings
217
- if len (self .parsed_findings ) == 0 or self .test is None :
218
- scan = self .process_scan_file (scan )
219
- if hasattr (parser , 'get_tests' ):
220
- self .parsed_findings = self .parse_findings_dynamic_test_type (scan , parser )
221
- else :
222
- self .parsed_findings = self .parse_findings_static_test_type (scan , parser )
223
- return self .parsed_findings
220
+ self .check_child_implementation_exception ()
224
221
225
222
def sync_process_findings (
226
223
self ,
Original file line number Diff line number Diff line change @@ -293,6 +293,24 @@ def close_old_findings(
293
293
294
294
return old_findings
295
295
296
+ def parse_findings (
297
+ self ,
298
+ scan : TemporaryUploadedFile ,
299
+ parser : Parser ,
300
+ ) -> List [Finding ]:
301
+ """
302
+ Determine how to parse the findings based on the presence of the
303
+ `get_tests` function on the parser object
304
+ """
305
+ # Attempt any preprocessing before generating findings
306
+ if len (self .parsed_findings ) == 0 and self .test is None :
307
+ scan = self .process_scan_file (scan )
308
+ if hasattr (parser , 'get_tests' ):
309
+ self .parsed_findings = self .parse_findings_dynamic_test_type (scan , parser )
310
+ else :
311
+ self .parsed_findings = self .parse_findings_static_test_type (scan , parser )
312
+ return self .parsed_findings
313
+
296
314
def parse_findings_static_test_type (
297
315
self ,
298
316
scan : TemporaryUploadedFile ,
Original file line number Diff line number Diff line change @@ -277,6 +277,24 @@ def close_old_findings(
277
277
278
278
return mitigated_findings
279
279
280
+ def parse_findings (
281
+ self ,
282
+ scan : TemporaryUploadedFile ,
283
+ parser : Parser ,
284
+ ) -> List [Finding ]:
285
+ """
286
+ Determine how to parse the findings based on the presence of the
287
+ `get_tests` function on the parser object
288
+ """
289
+ # Attempt any preprocessing before generating findings
290
+ if len (self .parsed_findings ) == 0 or self .test is None :
291
+ scan = self .process_scan_file (scan )
292
+ if hasattr (parser , 'get_tests' ):
293
+ self .parsed_findings = self .parse_findings_dynamic_test_type (scan , parser )
294
+ else :
295
+ self .parsed_findings = self .parse_findings_static_test_type (scan , parser )
296
+ return self .parsed_findings
297
+
280
298
def parse_findings_static_test_type (
281
299
self ,
282
300
scan : TemporaryUploadedFile ,
You can’t perform that action at this time.
0 commit comments