华为云用户手册

  • URI GET /v2/{project_id}/ruleset/{ruleset_id}/rules 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID ruleset_id 是 String 规则集ID 表2 Query参数 参数 是否必选 参数类型 描述 types 是 String 规则状态 '1查询全部,2已启动,3未启用' 缺省值:1 languages 否 String 规则语言 tags 否 String 规则所属标签 offset 否 Integer 分页索引,偏移量 最小值:0 缺省值:0 limit 否 Integer 每页显示的数量 最小值:1 最大值:1000 缺省值:100
  • 响应示例 状态码: 200 Request succeeded! { "task_id" : "435b58ecf7f54c45907c1384d01c94a6", "task_name" : "CSharp_02201119", "creator_id" : "ecadebb5041146cc96f9780f3d905e20", "git_url" : "git@****_02201119.git", "git_branch" : "master", "last_check_time" : "2020-02-20 11:37:46", "last_exec_time" : "2020-02-20 11:37:46", "check_type" : "source", "created_at" : "2020-02-20 11:21:11", "metric_info" : { "code_size" : "133426.00", "raw_lines" : "182082.00", "methods_total" : "6840.00", "cyclomatic_complexity_total" : "27435.00", "cyclomatic_complexity_per_method" : "7.43", "maximum_cyclomatic_complexity" : "346.00", "huge_cyclomatic_complexity_total" : "167.00", "huge_cyclomatic_complexity_ratio" : "4.13", "cca_cyclomatic_complexity_total" : "26693.00", "cca_cyclomatic_complexity_per_method" : "7.25", "maximum_cca_cyclomatic_complexity" : "342.00", "huge_cca_cyclomatic_complexity_total" : "148.00", "cyclomatic_complexity_adequacy" : "21.00", "maximum_depth" : "333.00", "huge_depth_total" : "8.85", "huge_depth_ratio" : "91546.00", "method_lines" : "24.91", "lines_per_method" : "8.04", "huge_method_total" : "12300", "huge_method_ratio" : "12300", "files_total" : "629.00", "folders_total" : "426.00", "lines_per_file" : "12300", "huge_headerfile_total" : "12300", "huge_headerfile_ratio" : "12300", "huge_non_headerfile_total" : "12300", "huge_non_headerfile_ratio" : "12300", "huge_folder_total" : "12300", "huge_folder_ratio" : "12300", "file_duplication_total" : "12300", "file_duplication_ratio" : "12300", "non_hfile_duplication_total" : "12300", "non_hfile_duplication_ratio" : "12300", "code_duplication_total" : "3.28", "code_duplication_ratio" : "11782.00", "non_hfile_code_duplication_total" : "8.59", "non_hfile_code_duplication_ratio" : "11782.00", "unsafe_functions_total" : "17.17", "unsafe_functions_kloc" : "0.00", "redundant_code_total" : "0.00", "redundant_code_kloc" : "674.00", "warning_suppression_total" : "17.00", "warning_suppression_kloc" : "0.45" } } 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 task_id String 任务id task_name String 任务名字 creator_id String 创建者id git_url String 代码仓地址 git_branch String 代码仓分支 last_check_time String 上一次检查时间 last_exec_time String 上次执行时间 check_type String 检查类型 created_at String 创建时间 metric_info MetricInfo object 度量项 表4 MetricInfo 参数 参数类型 描述 code_size String 代码规模 raw_lines String 原始代码行数 methods_total String 函数总数 cyclomatic_complexity_total String 圈复杂度总数 cyclomatic_complexity_per_method String 平均圈复杂度 maximum_cyclomatic_complexity String 最大圈复杂度 huge_cyclomatic_complexity_total String 超大圈复杂度数 huge_cyclomatic_complexity_ratio String 超大圈复杂度比例 cca_cyclomatic_complexity_total String cca圈复杂度总数 cca_cyclomatic_complexity_per_method String cca平均圈复杂度 maximum_cca_cyclomatic_complexity String cca最大圈复杂度 huge_cca_cyclomatic_complexity_total String 超大圈复杂度函数总数 cyclomatic_complexity_adequacy String 圈复杂度满足度 maximum_depth String 最大深度 huge_depth_total String 超大深度数 huge_depth_ratio String 超大深度占比 method_lines String 函数总行数 lines_per_method String 函数平均代码行 huge_method_total String 超大函数数 huge_method_ratio String 超大函数占比 files_total String 文件总数 folders_total String 目录总数 lines_per_file String 文件平均代码行 huge_headerfile_total String 超大头文件数 huge_headerfile_ratio String 超大头文件占比 huge_non_headerfile_total String 超大源文件数 huge_non_headerfile_ratio String 超大源文件占比 huge_folder_total String 超大目录数 huge_folder_ratio String 超大目录占比 file_duplication_total String 重复文件数 file_duplication_ratio String 文件重复率 non_hfile_duplication_total String 重复源文件数 non_hfile_duplication_ratio String 源文件重复率 code_duplication_total String 代码重复数 code_duplication_ratio String 代码重复率 non_hfile_code_duplication_total String 源文件代码重复数 non_hfile_code_duplication_ratio String 源文件代码重复率 unsafe_functions_total String 危险函数总数 unsafe_functions_kloc String 危险函数密度 redundant_code_total String 冗余代码数 redundant_code_kloc String 冗余代码块密度 warning_suppression_total String 抑制告警数 warning_suppression_kloc String 抑制告警密度 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 请求示例 任务配置屏蔽目录:文件路径为.LAST_RELEASE,检查状态为all POST https://{endpoint}/v2/{project_id}/tasks/{task_id}/config-ignorepath { "ignore_path_settings" : [ { "file_path" : ".LAST_RELEASE", "checkbox_status" : "all" } ] }
  • 响应示例 状态码: 200 Request succeeded! null 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:1 最大长度:100000 Content-Type 是 String 设置媒体类型和编码格式 表3 请求Body参数 参数 是否必选 参数类型 描述 ignore_path_settings 是 Array of IgnorePathSettingItem objects 屏蔽目录的节点信息列表 表4 IgnorePathSettingItem 参数 是否必选 参数类型 描述 file_path 是 String 目录或文件路径 checkbox_status 是 String 屏蔽状态,包括unchecked(不屏蔽)、all(全屏蔽)、half(半屏蔽)
  • 基本概念 账号 用户注册华为云时的账号,账号对其所拥有的资源及云服务具有完全的访问权限,可以重置用户密码、分配用户权限等。由于账号是付费主体,为了确保账号安全,建议您不要直接使用账号进行日常管理工作,而是创建用户并使用他们进行日常管理工作。 用户 由账号在IAM中创建的用户,是云服务的使用人员,具有身份凭证(密码和访问密钥)。 在我的凭证下,您可以查看账号ID和用户ID。通常在调用API的鉴权过程中,您需要用到账号、用户和密码等信息。 区域(Region) 从地理位置和网络时延维度划分,同一个Region内共享弹性计算、块存储、对象存储、VPC网络、弹性公网IP、镜像等公共服务。Region分为通用Region和专属Region。 通用Region指面向公共租户提供通用云服务的Region。 专属Region指只承载同一类业务或只面向特定租户提供业务服务的专用Region。 可用区(AZ,Availability Zone) 一个AZ是一个或多个物理数据中心的集合,有独立的风火水电,AZ内逻辑上再将计算、网络、存储等资源划分成多个集群。一个Region中的多个AZ间通过高速光纤相连,以满足用户跨AZ构建高可用性系统的需求。 企业项目 企业项目是项目的升级版,针对企业不同项目间资源的分组和管理,是逻辑隔离。企业项目中可以包含多个区域的资源,且项目中的资源可以迁入迁出。 关于企业项目ID的获取及企业项目特性的详细信息,请参见《企业管理服务用户指南》。 父主题: 使用前必读
  • 响应示例 状态码: 200 Request succeeded! { "info" : [ { "file_name" : ".LAST_RELEASE", "file_path" : ".LAST_RELEASE", "is_leaf" : true, "checkbox_status" : "unchecked" } ], "total" : 1 } 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" }
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 info Array of TreeNode objects 任务的目录树信息 total Integer 数目 表4 TreeNode 参数 参数类型 描述 file_name String 目录或文件名 file_path String 目录或文件路径 is_leaf Boolean 是否为叶子节点,true是,false不是 checkbox_status String 屏蔽状态,包括unchecked(不屏蔽)、all(全屏蔽)、half(半屏蔽) 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • URI GET /v2/{project_id}/tasks/{task_id}/listpathtree 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目id task_id 是 String 任务id 表2 Query参数 参数 是否必选 参数类型 描述 current_path 否 String 目录或文件的路径 offset 否 Integer 分页索引,偏移量 最小值:0 缺省值:0 limit 否 Integer 每页显示的数量,每页最多显示1000条 最小值:1 最大值:1000 缺省值:10
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 [数组元素] Array of TaskCheckParamters objects Request succeeded! 表5 TaskCheckParamters 参数 参数类型 描述 check_id Integer 检查工具ID name String 编译参数名称 checker_configs Array of CheckConfigInfo objects 检查参数配置信息 表6 CheckConfigInfo 参数 参数类型 描述 name String 检查参数名称 cfg_key String 检查参数对应的key值 default_value String 检查参数默认值 option_value String 检查参数可选项 is_required Integer 0:非必填,1:必填 description String 检查参数说明 type Integer 参数类型,0:文本,2:有可选项 status String 参数状态,on:启用,off:未启用 value String 检查参数值 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 Request succeeded! [ { "check_id" : 0, "name" : "compile_tool", "check_configs" : [ { "value" : "", "name" : "编译命令", "cfg_key" : "", "default_value" : "", "option_value" : "", "is_required" : 0, "description" : "编译命令", "type" : 0, "status" : "on" } ] } ] 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • URI GET /v2/{project_id}/tasks/{task_id}/ruleset/{ruleset_id}/check-parameters 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID task_id 是 String 任务ID ruleset_id 是 String 规则集ID 表2 Query参数 参数 是否必选 参数类型 描述 language 是 String 规则集语言
  • 响应示例 状态码: 200 Request succeeded! { "defects" : [ { "line_number" : "81", "defect_id" : "5b71a4594bcb4a69a33f576c3564e6cc", "rule_system_tags" : "fossscan", "rule_id" : "111", "rule_name" : "FossScan.1 OpenSource Software", "defect_checker_name" : "Disallow fallthrough of `case` statements", "defect_status" : "0", "defect_content" : "Update or refactor this function so that its implementation doesn't duplicate the one on line 60.", "defect_level" : "1", "file_path" : "code/types/functions.ts", "created_at" : "2020-07-21T02:12:01Z", "issue_key" : "AA76E96XXXXXXXXXXXXXXXXXCAAE5", "fragment" : [ { "line_num" : "78", "line_content" : "    export function padding(all: number);", "start_offset" : -1, "end_offset" : -1 }, { "line_num" : "79", "line_content" : "    export function padding(topAndBottom: number, leftAndRight: number);", "start_offset" : -1, "end_offset" : -1 }, { "line_num" : "80", "line_content" : "    export function padding(top: number, right: number, bottom: number, left: number);", "start_offset" : -1, "end_offset" : -1 }, { "line_num" : "81", "line_content" : "    export function padding(a: number, b?: number, c?: number, d?: number) {", "start_offset" : 11, "end_offset" : 19 }, { "line_num" : "82", "line_content" : "        if (b === undefined && c === undefined && d === undefined) {", "start_offset" : -1, "end_offset" : -1 } ] }, { "line_number" : "190", "defect_id" : "5b71a4594wtrfsgrew546t466c3564e6cc", "rule_system_tags" : "fossscan", "rule_id" : "112", "rule_name" : "FossScan.1 OpenSource Software", "defect_checker_name" : "Disallow fallthrough of `case` statements", "defect_status" : "0", "defect_content" : "Update or refactor this function so that its implementation doesn't duplicate the one on line 173.", "defect_level" : "1", "file_path" : "code/types/types.ts", "created_at" : "2020-07-21T02:12:01Z", "issue_key" : "AA76E96XXXXXXXXXXXXXXXXXFE3B6", "fragment" : [ { "line_num" : "187", "line_content" : "    var _value;", "start_offset" : -1, "end_offset" : -1 }, { "line_num" : "188", "line_content" : "    function getOrSet(): number;", "start_offset" : -1, "end_offset" : -1 }, { "line_num" : "189", "line_content" : "    function getOrSet(value: number);", "start_offset" : -1, "end_offset" : -1 }, { "line_num" : "190", "line_content" : " \"    function getOrSet(value?: number) {\"", "start_offset" : 4, "end_offset" : 12 }, { "line_num" : "191", "line_content" : " \"        if (value === undefined) {\"", "start_offset" : -1, "end_offset" : -1 } ] } ], "total" : 2 } 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 defects Array of DefectInfoV2 objects 缺陷详情信息 total Integer 总数 表5 DefectInfoV2 参数 参数类型 描述 defect_id String 缺陷的id defect_checker_name String 缺陷对应检查项的名称 defect_status String 缺陷的状态0为解决 1已解决 2已忽略 rule_system_tags String 规则标签,多个标签用逗号隔开 rule_id String 规则id rule_name String 规则名 line_number String 缺陷所在文件行号 defect_content String 缺陷描述 defect_level String 缺陷等级,0致命,1严重,2一般,3提示 file_path String 缺陷文件路径 created_at String 创建时间 issue_key String 问题唯一标识 fragment Array of DefectFragmentV2 objects 缺陷代码片段详情 events Array of DefectEvents objects 调用链信息 表6 DefectFragmentV2 参数 参数类型 描述 line_num String 行号 line_content String 该行代码内容 start_offset Integer 缺陷开始列号 end_offset Integer 缺陷结束列号 表7 DefectEvents 参数 参数类型 描述 events Array of DefectEvents objects 调用链信息 description String 描述 fix_suggestions Array of strings 修复建议 line Integer 缺陷所在行 end_line Integer 缺陷结束行 code_context_start_line Integer 缺陷开始行 main Boolean 代码片段 path String 路径 tag String 标签 main_buggy_code String 主事件对应的代码片段 code_context String 代码上下文 状态码: 400 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • URI GET /v2/tasks/{task_id}/defects-detail 表1 路径参数 参数 是否必选 参数类型 描述 task_id 是 String 任务ID 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 Integer 分页索引,偏移量 最小值:0 缺省值:0 limit 否 Integer 每页显示的数量,每页最多显示100条 最小值:1 最大值:100 缺省值:10 status_ids 否 String 问题状态筛选 severity 否 String 严重级别,0致命,1严重,2一般,3提示
  • 响应示例 状态码: 200 Request succeeded! null 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 task_status Integer 任务状态,0表示检查中,1表示检查失败,2表示检查成功,3表示任务中止 progress ProgressDetailV2 object 检查进度 表4 ProgressDetailV2 参数 参数类型 描述 ratio String 进度百分比 info String 进度信息 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 Request succeeded! { "task_status" : 0, "progress" : { "ratio" : "50%", "info" : "执行检查中" } } 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • URI GET /v2/{project_id}/tasks/{task_id}/checkrecord 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID task_id 是 String 任务ID 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 Integer 分页索引,偏移量 最小值:0 缺省值:0 limit 否 Integer 每页显示的数量,每页最多显示1000条 最小值:1 最大值:1000 缺省值:10 start_time 否 String 过滤开始时间,根据任务检查开始时间过滤 end_time 否 String 过滤结束时间,根据任务检查结束时间过滤
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 data Array of CheckRecordDataInfo objects 历史记录数据 total Integer 总数 表5 CheckRecordDataInfo 参数 参数类型 描述 check_time String 检查任务执行开始时间 check_end_time String 检查任务执行结束时间 issue_counts CheckRecordIssueCountsInfo object 严重程度 表6 CheckRecordIssueCountsInfo 参数 参数类型 描述 critical Integer 致命问题 serious Integer 严重问题 normal Integer 常规问题 prompt Integer 提示问题 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 Request succeeded! { "total" : 100, "data" : [ { "check_time" : "2020-02-20 11:37:46", "check_end_time" : "2020-02-20 11:47:46", "issue_counts" : { "critical" : 0, "serious" : 1, "normal" : 2, "prompt" : 3 } }, { "check_time" : "2020-02-20 11:37:46", "check_end_time" : "2020-02-20 11:47:46", "issue_counts" : { "critical" : 0, "serious" : 1, "normal" : 2, "prompt" : 3 } } ] } 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 [数组元素] Array of TaskRulesetInfo objects Request succeeded! 表4 TaskRulesetInfo 参数 参数类型 描述 template_id String 规则集id language String 规则集语言 template_name String 规则集名称 type String 规则集状态optional:可选,selected:已选 status String 规则集属性0 是默认用户规则集,1 是系统默认规则集 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 Request succeeded! [ { "template_id" : "396e1c2511744f6fa199d33b26038edd", "language" : "Java", "template_name" : "Java_cmetrics", "type" : "selected", "status" : "0" }, { "template_id" : "4e988c481b4c46d0a3297fbe343a662d", "language" : "html", "template_name" : "通用检查规则集", "type" : "optional", "status" : "1" } ] 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • 响应示例 状态码: 200 Request succeeded! null 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:1 最大长度:100000 Content-Type 是 String 设置媒体类型和编码格式 表3 请求Body参数 参数 是否必选 参数类型 描述 task_advanced_settings 是 Array of TaskAdvancedSettingsItem objects 高级选项参数的相关信息 表4 TaskAdvancedSettingsItem 参数 是否必选 参数类型 描述 key 是 String 高级选项对应的名称 最小长度:1 最大长度:50 value 是 String 高级选项对应的取值 最小长度:1 最大长度:1000
  • 响应示例 状态码: 200 Request succeeded! { "param_info" : { "url" : "git@xxxxxx_only00001/file.git", "branch" : "master", "language" : "language", "exclude_dir" : "aa", "encode" : "", "compile_config" : "xxx", "rule_template" : "" }, "log_info" : [ { "log" : "2023-01-04 14:31:33 Running on server:10.75.***.***\n2023-01-04 14:31:34 waiting subJob to execute\n2023-01-04 14:33:38 flush redis cache successfully!\n2023-01-04 14:33:38 all subJob finish!", "level" : "", "analysis" : "2023-01-04 14:31:33 Running on server:10.75.***.***\n2023-01-04 14:31:34 waiting subJob to execute\n2023-01-04 14:33:38 flush redis cache successfully!\n2023-01-04 14:33:38 all subJob finish!", "faq" : "", "display_name" : "" } ] } 状态码: 400 Bad Request { "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" } 状态码: 401 Unauthorized { "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 param_info ParamInfo object 任务详情 log_info Array of LogInfo objects 日志信息 表5 ParamInfo 参数 参数类型 描述 url String 仓库地址 branch String 仓库分支 language String 仓库语言 exclude_dir String 排除的目录 encode String 编码格式 compile_config String 编译配置信息 rule_template String 规则集名称 表6 LogInfo 参数 参数类型 描述 display_name String 日志标题 log String 日志内容 level String 日志级别 analysis String 日志分析 faq String 常见问题解答 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 概述 代码检查是基于云端实现代码质量管理的服务,软件开发者可在编码完成后执行多语言的代码静态检查和安全检查,获取全面的质量报告,并提供缺陷的分组查看与改进建议,有效管控代码质量,帮助产品成功。 您可以使用本文档提供API对代码检查进行相关操作,如创建、删除、查询任务等。支持的全部操作请参见API概览。 在调用代码检查API之前,请确保已经充分了解代码检查基本概念。详细信息请参见产品介绍。 父主题: 使用前必读
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 设置媒体类型和编码格式 X-Auth-Token 是 String 用户Token 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:1 最大长度:100000 表3 请求Body参数 参数 是否必选 参数类型 描述 [数组元素] 是 Array of UpdateTaskRulesetItem objects 修改规则集信息 表4 UpdateTaskRulesetItem 参数 是否必选 参数类型 描述 language 是 String 规则集语言 最小长度:1 最大长度:128 rule_set_id 是 String 规则集ID,通过调用ListTaskRuleset接口,根据响应参数中的template_id获得 最小长度:1 最大长度:50 if_use 是 String 任务语言和规则集的关系是否启用,1是启用,0是未启用 最小长度:1 最大长度:1 status 是 String 新/老数据表示,默认1 最小长度:1 最大长度:1
共100000条