MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / get_data_from_result

Method get_data_from_result

client/util/api/dogapi.py:39–53  ·  view source on GitHub ↗

Analysis返回格式调整,不具备通用性,需要特殊适配

(self, response)

Source from the content-addressed store, hash-verified

37 self._server_url = server_url
38
39 def get_data_from_result(self, response):
40 """
41 Analysis返回格式调整,不具备通用性,需要特殊适配
42 """
43 return_data = response.read()
44 return_str = return_data.decode("utf8")
45 # 可能为空字符串,直接返回,不需要转换json
46 if not return_str:
47 return return_str
48 result = json.loads(return_str)
49 if isinstance(result, dict):
50 if result.get("data") is not None and result.get("code") is not None \
51 and result.get("status_code") is not None:
52 return result["data"]
53 return result
54
55 def job_heart_beat(self, org_sid, team_name, repo_id, project_id, job_id):
56 """任务心跳上报

Callers 15

get_proj_confMethod · 0.95
init_jobMethod · 0.95
send_proj_resultMethod · 0.95
get_proj_infoMethod · 0.95
create_projMethod · 0.95
get_privete_taskMethod · 0.95
get_scan_resultMethod · 0.95
get_lintscan_resultMethod · 0.95
get_latest_scm_scanMethod · 0.95
is_repo_existedMethod · 0.95

Calls 2

readMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected