@@ -353,7 +353,7 @@ def download_dca_databases(
353
353
)
354
354
targets = response ["targets" ]
355
355
project_map = {project ["name" ]: project for project in projects }
356
- artifact_map = {}
356
+ analyzed_databases = {}
357
357
for data in targets .values ():
358
358
downloads = data ["downloads" ]
359
359
analyzed_database = downloads ["analyzed_database" ]
@@ -364,12 +364,12 @@ def download_dca_databases(
364
364
print (f"Skipping { pretty_name } as it is not in the list of projects" )
365
365
continue
366
366
367
- if pretty_name in artifact_map :
367
+ if pretty_name in analyzed_databases :
368
368
print (
369
- f"Skipping previous database { artifact_map [pretty_name ]['artifact_name' ]} for { pretty_name } "
369
+ f"Skipping previous database { analyzed_databases [pretty_name ]['artifact_name' ]} for { pretty_name } "
370
370
)
371
371
372
- artifact_map [pretty_name ] = analyzed_database
372
+ analyzed_databases [pretty_name ] = analyzed_database
373
373
374
374
def download_and_decompress (analyzed_database : dict ) -> str :
375
375
artifact_name = analyzed_database ["artifact_name" ]
@@ -397,8 +397,7 @@ def download_and_decompress(analyzed_database: dict) -> str:
397
397
shutil .rmtree (artifact_unzipped_location , ignore_errors = True )
398
398
# And then we extract it to build_dir/artifact_name
399
399
zip_ref .extractall (artifact_unzipped_location )
400
- # And then we iterate over the contents of the extracted directory
401
- # and extract the language tar.gz file inside it
400
+ # And then we extract the language tar.gz file inside it
402
401
artifact_tar_location = os .path .join (
403
402
artifact_unzipped_location , f"{ language } .tar.gz"
404
403
)
@@ -411,7 +410,7 @@ def download_and_decompress(analyzed_database: dict) -> str:
411
410
412
411
results = run_in_parallel (
413
412
download_and_decompress ,
414
- list (artifact_map .values ()),
413
+ list (analyzed_databases .values ()),
415
414
on_error = lambda db , exc : print (
416
415
f"ERROR: Failed to download and decompress { db ["artifact_name" ]} : { exc } "
417
416
),
@@ -422,7 +421,7 @@ def download_and_decompress(analyzed_database: dict) -> str:
422
421
423
422
print (f"\n === Fetched { len (results )} databases ===" )
424
423
425
- return [(project_map [n ], r ) for n , r in zip (artifact_map , results )]
424
+ return [(project_map [n ], r ) for n , r in zip (analyzed_databases , results )]
426
425
427
426
428
427
def get_mad_destination_for_project (config , name : str ) -> str :
0 commit comments