@@ -415,7 +415,7 @@ def find_files(path: str) -> list:
415
415
"""
416
416
log .debug ("Starting Find Files" )
417
417
start_time = time .time ()
418
- files = []
418
+ files = set ()
419
419
for ecosystem in socket_globs :
420
420
patterns = socket_globs [ecosystem ]
421
421
for file_name in patterns :
@@ -427,7 +427,7 @@ def find_files(path: str) -> list:
427
427
glob_files = glob (file_path , recursive = True )
428
428
for glob_file in glob_files :
429
429
if glob_file not in files :
430
- files .append (glob_file )
430
+ files .add (glob_file )
431
431
glob_end = time .time ()
432
432
glob_total_time = glob_end - glob_start
433
433
log .debug (f"Glob for pattern { file_path } took { glob_total_time :.2f} seconds" )
@@ -436,7 +436,7 @@ def find_files(path: str) -> list:
436
436
end_time = time .time ()
437
437
total_time = end_time - start_time
438
438
log .info (f"Found { len (files )} in { total_time :.2f} seconds" )
439
- return files
439
+ return list ( files )
440
440
441
441
@staticmethod
442
442
def create_full_scan (files : list , params : FullScanParams , workspace : str ) -> FullScan :
@@ -594,13 +594,13 @@ def compare_sboms(new_scan: list, head_scan: list) -> Diff:
594
594
head_packages = Core .create_sbom_dict (head_scan )
595
595
new_scan_alerts = {}
596
596
head_scan_alerts = {}
597
- consolidated = []
597
+ consolidated = set ()
598
598
for package_id in new_packages :
599
599
purl , package = Core .create_purl (package_id , new_packages )
600
600
base_purl = f"{ purl .ecosystem } /{ purl .name } @{ purl .version } "
601
601
if package_id not in head_packages and package .direct and base_purl not in consolidated :
602
602
diff .new_packages .append (purl )
603
- consolidated .append (base_purl )
603
+ consolidated .add (base_purl )
604
604
new_scan_alerts = Core .create_issue_alerts (package , new_scan_alerts , new_packages )
605
605
for package_id in head_packages :
606
606
purl , package = Core .create_purl (package_id , head_packages )
0 commit comments