@@ -953,6 +953,8 @@ def export(self, export_settings: types.ConfigSettings, settings_list: dict[str,
953953 :return: All project configuration settings
954954 :rtype: dict
955955 """
956+ from sonar import issues
957+
956958 log .info ("Exporting %s" , str (self ))
957959 try :
958960 json_data = self ._json .copy ()
@@ -994,8 +996,16 @@ def export(self, export_settings: types.ConfigSettings, settings_list: dict[str,
994996 "lastTaskWarnings" : last_task .warnings (),
995997 "taskHistory" : [t ._json for t in self .task_history ()],
996998 }
997- json_data ["thirdPartyIssues" ] = self .count_third_party_issues ()
998- log .debug ("%s has %d 3rd party issues" , str (self ), sum (v for v in json_data ["thirdPartyIssues" ].values ()))
999+ tpissues = self .count_third_party_issues ()
1000+ issue_data = {"thirdParty" : tpissues if len (tpissues ) > 0 else 0 }
1001+ if self .endpoint .version () >= (10 , 0 , 0 ):
1002+ issue_data ["falsePositives" ] = issues .count (self .endpoint , components = self .key , issueStatuses = "FALSE_POSITIVE" )
1003+ issue_data ["accepted" ] = issues .count (self .endpoint , components = self .key , issueStatuses = "ACCEPTED" )
1004+ else :
1005+ issue_data ["falsePositives" ] = issues .count (self .endpoint , componentKeys = self .key , resolutions = "FALSE-POSITIVE" )
1006+ issue_data ["wontFix" ] = issues .count (self .endpoint , componentKeys = self .key , resolutions = "WONTFIX" )
1007+ json_data ["issues" ] = issue_data
1008+ log .debug ("%s has these notable issues %s" , str (self ), str (json_data ["issues" ]))
9991009
10001010 settings_dict = settings .get_bulk (endpoint = self .endpoint , component = self , settings_list = settings_list , include_not_set = False )
10011011 # json_data.update({s.to_json() for s in settings_dict.values() if include_inherited or not s.inherited})
0 commit comments