From 8813940ef5844073d252e204f4ba31e60567d686 Mon Sep 17 00:00:00 2001 From: "sonarqube-agent[bot]" <210722872+sonarqube-agent[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 09:03:14 +0000 Subject: [PATCH] fix: Address 5 SonarQube issues Fixed issues: - AZZjJguBOPkSvG45yH0A for python:S1481 rule - AZsscXh1O4taz47D25oW for python:S7504 rule - AZZjJgrBOPkSvG45yHzr for python:S117 rule - AZZjJgrBOPkSvG45yHzq for python:S1854 rule - AZZjJgrBOPkSvG45yHzp for python:S1066 rule Generated by SonarQube Agent (task: 2a431088-b488-4bf3-8a78-0d9dfd837983) --- PlantUML/construct.py | 22 ++++++++++------------ PlantUML/construct_mapping_global.py | 1 - PlantUML/construct_mappings.py | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/PlantUML/construct.py b/PlantUML/construct.py index 94497c5..c2822ba 100644 --- a/PlantUML/construct.py +++ b/PlantUML/construct.py @@ -53,16 +53,16 @@ def write_to_plantuml_file(data, file_path): f.write("hide class fields\n") f.write("\npackage IG #DDDDDD{\n") resource = "" - cptClass = 0 + cpt_class = 0 f.write("\n package Profiles #DDDDDD{\n") for count,row in enumerate(data): if(row[2]!='Extension'): if(resource!=row[0]) : - if(cptClass !=0) : + if(cpt_class !=0) : f.write( "\n } \n") f.write( "\n class " + row[0] +"{\n") - cptClass = cptClass + 1 + cpt_class = cpt_class + 1 if(row[2] != row[3]) : f.write("\n "+ row[4] ) f.write(" => "); @@ -80,26 +80,25 @@ def write_to_plantuml_file(data, file_path): #Ecritures des dépendances avec les extension resource = "" - cptClass = 0 + cpt_class = 0 for count,row in enumerate(data): if(row[2]!='Extension'): if((row[2] != row[3]) and (str(row[13]) != 'None')) : if( "extension:" in row[4]) : f.write('\n ' + row[0] + ' -[#black,dashed,thickness=2]-> ' + str(row[13]) +"") - resource = row[0] f.write("\n") resource = "" - cptClass = 0 + cpt_class = 0 for count,row in enumerate(data): if(row[2] =='Extension'): if(resource!=row[0]) : - if(cptClass !=0) : + if(cpt_class !=0) : f.write( "\n } ") f.write( "\n class " + str(row[0]) +"{\n") - cptClass = cptClass + 1 + cpt_class = cpt_class + 1 if(row[2] != row[3]) : f.write("\n " +row[4] ) f.write(" => "); @@ -122,10 +121,9 @@ def write_to_plantuml_file(data, file_path): resource = "" for count,row in enumerate(data): - if(resource!=row[0]) : - if(row[2] != 'Extension') : - f.write( '\n class "' + row[2] +'" as ' + f"class{hashlib.md5(row[2].encode()).hexdigest()}" +" \n") - f.write( "\n " + f"class{hashlib.md5((row[2].encode())).hexdigest()}" + " --> " + row[0] +"\n") + if(resource!=row[0]) and (row[2] != 'Extension') : + f.write( '\n class "' + row[2] +'" as ' + f"class{hashlib.md5(row[2].encode()).hexdigest()}" +" \n") + f.write( "\n " + f"class{hashlib.md5((row[2].encode())).hexdigest()}" + " --> " + row[0] +"\n") resource = row[0] f.write("}") diff --git a/PlantUML/construct_mapping_global.py b/PlantUML/construct_mapping_global.py index d50505f..a7604c3 100644 --- a/PlantUML/construct_mapping_global.py +++ b/PlantUML/construct_mapping_global.py @@ -93,7 +93,6 @@ def generate_plantuml_global(extracted_data, output_path, colors): color = '' if profil in colors.keys(): color = ' #' + colors[profil]['header'] - mapping_ids = [] for mapping in profil_infos['mapping']: mapping_id = keep_alnum(mapping) # Un rectangle par classe fonctionnelle (avec un couleur par profil FHIR) diff --git a/PlantUML/construct_mappings.py b/PlantUML/construct_mappings.py index 5f89048..bf21e02 100644 --- a/PlantUML/construct_mappings.py +++ b/PlantUML/construct_mappings.py @@ -128,7 +128,7 @@ def extract_data(data): def structure_data(extracted_data): structured_data = {} # Itération sur les mappings (il peut y en avoir plusieurs par ressource) - for mapping in list(extracted_data['resources'].values()): + for mapping in extracted_data['resources'].values(): resource_fhir = mapping['resource'] class_func = mapping['class'] elements = mapping['elements']