@@ -403,7 +403,7 @@ def find_files(path: str) -> list:
403
403
"""
404
404
log .debug ("Starting Find Files" )
405
405
start_time = time .time ()
406
- files = []
406
+ files = set ()
407
407
for ecosystem in socket_globs :
408
408
patterns = socket_globs [ecosystem ]
409
409
for file_name in patterns :
@@ -415,7 +415,7 @@ def find_files(path: str) -> list:
415
415
glob_files = glob (file_path , recursive = True )
416
416
for glob_file in glob_files :
417
417
if glob_file not in files :
418
- files .append (glob_file )
418
+ files .add (glob_file )
419
419
glob_end = time .time ()
420
420
glob_total_time = glob_end - glob_start
421
421
log .debug (f"Glob for pattern { file_path } took { glob_total_time :.2f} seconds" )
@@ -424,7 +424,7 @@ def find_files(path: str) -> list:
424
424
end_time = time .time ()
425
425
total_time = end_time - start_time
426
426
log .info (f"Found { len (files )} in { total_time :.2f} seconds" )
427
- return files
427
+ return list ( files )
428
428
429
429
@staticmethod
430
430
def create_full_scan (files : list , params : FullScanParams , workspace : str ) -> FullScan :
@@ -582,13 +582,13 @@ def compare_sboms(new_scan: list, head_scan: list) -> Diff:
582
582
head_packages = Core .create_sbom_dict (head_scan )
583
583
new_scan_alerts = {}
584
584
head_scan_alerts = {}
585
- consolidated = []
585
+ consolidated = set ()
586
586
for package_id in new_packages :
587
587
purl , package = Core .create_purl (package_id , new_packages )
588
588
base_purl = f"{ purl .ecosystem } /{ purl .name } @{ purl .version } "
589
589
if package_id not in head_packages and package .direct and base_purl not in consolidated :
590
590
diff .new_packages .append (purl )
591
- consolidated .append (base_purl )
591
+ consolidated .add (base_purl )
592
592
new_scan_alerts = Core .create_issue_alerts (package , new_scan_alerts , new_packages )
593
593
for package_id in head_packages :
594
594
purl , package = Core .create_purl (package_id , head_packages )
0 commit comments