Skip to content

Commit

Permalink
Merge pull request #43 from Yuanruitao/bugfix_42
Browse files Browse the repository at this point in the history
bugfix: 简介过长 & 按钮国际化名称不正确 #42
  • Loading branch information
Yuanruitao authored Aug 15, 2023
2 parents 808cbee + 6361b5b commit cb3a27d
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 17 deletions.
62 changes: 62 additions & 0 deletions docs/desc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 插件功能

支持Linux、MacOS、Windows系统下执行所有CodeCC代码检查工具,包括代码缺陷(bkcheck等)、安全漏洞(敏感信息、高危组件等)、代码规范(CppLint、CheckStyle等)、圈复杂度、重复率等。

# 适用场景

## Linux:
公共构建机(已预装Docker)
私有构建机(需安装Docker)
私有构建集群(需安装Docker)

## MacOS:
私有构建机(需安装Docker)
私有构建集群(需安装Docker)

## Windows(win10及以上):
私有构建机(需安装Docker)
私有构建集群(需安装Docker)

# 使用限制和受限解决方案
私有构建机需要安装Docker


# CodeCC特色功能
CodeCC是腾讯领先的代码分析平台,提供专业的代码检查解决方案及服务,为产品质量保驾护航。

- 目前已集成十余款含商用、开源、自研的代码检查工具,覆盖代码缺陷、安全漏洞、编码规范、圈复杂度、代码重复率五大维度;

- 支持规则开发框架和工具开发框架,可自主将开发的规则或工具集成到CodeCC平台;

- 自研bkcheck缺陷检查工具,可以支持游戏C++后台、Unreal客户端、Unity客户端的缺陷检查;

- 与蓝盾流水线进行了深度整合,通过质量红线服务,可以在流水线中使用CodeCC的检查结果来控制代码库MR/PR、转测、部署等流程,从而使得每一阶段的流水线产出都符合质量标准。

# CodeCC能发现什么代码问题

## 发现代码缺陷

代表工具:ClangWarning、Clang
代表规则:API使用、内存非法访问、程序卡死、资源泄露、空指针、性能低效……

## 发现安全漏洞

代表工具:敏感信息、高危组件
代表规则:密码/密钥等信息泄露、加密风险、XSS、CSRF、注入攻击……

## 代码规范,检查一些逻辑错误

代表工具:CppLint、CheckStyle、ESLint、StyleCop、Gometalinter、detekt、PHPCS、PyLint等
代表规则:注释、空代码块、异常处理、命名、格式化、风格……

## 控制复杂度
代表工具:圈复杂度
代表规则:函数圈复杂度>=20

## 检测重复率
代表工具:重复率
代表规则:文件代码重复率>=5%

## 统计代码行数
代表工具:代码统计
代表规则:统计代码中各类语言代码行、注释行、空白行的情况
62 changes: 62 additions & 0 deletions docs/desc_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Plugin function

Support all CodeCC code inspection tools under Linux, MacOS, and Windows systems, including code defects (bkcheck, etc.), security vulnerabilities (sensitive information, high-risk components, etc.), code specifications (CppLint, CheckStyle, etc.), cyclomatic complexity, repetition rate, etc. .

# Applicable scene

## Linux:
Public build machine (with Docker pre-installed)
Private build machine (docker needs to be installed)
Build a cluster privately (Docker needs to be installed)

## MacOS:
Private build machine (docker needs to be installed)
Build a cluster privately (Docker needs to be installed)

## Windows (win10 and above):
Private build machine (docker needs to be installed)
Build a cluster privately (Docker needs to be installed)

# Use restricted and restricted solutions
Private build machines need to install Docker


# CodeCC Features
CodeCC is Tencent's leading code analysis platform, providing professional code inspection solutions and services to protect product quality.

- At present, more than ten code inspection tools including commercial, open source, and self-developed have been integrated, covering five dimensions of code defects, security vulnerabilities, coding standards, cyclomatic complexity, and code repetition rate;

- Support rule development framework and tool development framework, and can independently integrate the developed rules or tools into the CodeCC platform;

- Self-developed bkcheck defect inspection tool, which can support defect inspection of game C++ background, Unreal client, and Unity client;

- Deeply integrated with the Blue Shield pipeline, through the quality red line service, you can use the inspection results of CodeCC in the pipeline to control the code base MR/PR, transfer test, deployment and other processes, so that the output of each stage of the pipeline can meet the Quality Standard.

# CodeCC can find what code problems

## Find code bugs

Representative tools: ClangWarning, Clang
Representative rules: API usage, illegal memory access, program freezes, resource leaks, null pointers, inefficient performance...

## Security vulnerabilities found

Representative tools: sensitive information, high-risk components
Representative rules: information leakage such as passwords/keys, encryption risks, XSS, CSRF, injection attacks...

## Code specification, check some logic errors

Representative tools: CppLint, CheckStyle, ESLint, StyleCop, Gometalinter, detekt, PHPCS, PyLint, etc.
Representative rules: comments, empty code blocks, exception handling, naming, formatting, style...

## Control complexity
Representative Tool: Cyclomatic Complexity
Representative rules: function cyclomatic complexity>=20

## Detect repetition rate
Rep Tool: Repetition Rate
Representative rule: file code repetition rate>=5%

## Count the number of lines of code
Representative Tool: Code Statistics
Representative rules: Statistical code lines, comment lines, and blank lines of various languages in the code.
2 changes: 1 addition & 1 deletion src/backend/core/task_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
"jobType": "AGENT",
"os": ["LINUX", "MACOS", "WINDOWS"],
"labelCodes": [],
"summary":"Support all CodeCC code inspection tools under Linux, MacOS, and Windows systems, including code defects (bkcheck, etc.), security vulnerabilities (sensitive information, high-risk components, etc.), code specifications (CppLint, CheckStyle, etc.), cyclomatic complexity, repetition rate, etc. .",
"summary":"Support all CodeCC code-check tools, including code defects (bkcheck, etc.), security vulnerabilities (sensitive infomation, etc.), code style (CppLint, etc.), ccn, duplicated rate, etc. .",
"description": "${{indexFile(\"docs/desc_en.md\")}}",
"configInfo": {
"frontendType": "SPECIAL"
Expand Down
32 changes: 16 additions & 16 deletions src/frontend/src/i18n/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,42 @@
"日": "Sun",
"收起": "Fold",
"展开": "Unfold",
"路径白名单": "Whitelist path",
"路径黑名单": "Blacklist path",
"路径白名单": "Whitelist Path",
"路径黑名单": "Blacklist Path",
"Linux私有构建机/Mac/Win10需安装docker,Win7仅支持Coverity。": "Linux private build machine/Mac/Win10 needs to install docker, and Win7 only supports Coverity.",
"具体请见": "For details, please see",
"在此处关闭规则集弹框": "Close the rule set pop-up here",
"该规则集不适用于当前插件": "The rule set is not applicable to the current plugin",
"该规则集不适用于当前插件已选择的语言": "The rule set is not applicable to the language selected by the current plugin",
"我知道了": "I got it!",
"快速搜索": "Quick search",
"暂无描述": "No description",
"快速搜索": "Quick Search",
"暂无描述": "No Description",
"暂无数据": "Empty",
"创建规则集": "New rule set",
"由x发布": "Published by {name}",
"共x条规则": "{sum} rules in total",
"规则集": "Rule set",
"规则集": "Rule Set",
"获取规则集失败": "Failed to get rule set",
"编译脚本": "Compile script",
"涉及工具": "Tools involved",
"所有": "All",
"安装": "Install",
"安装成功": "Install succeeded",
"安装失败": "Install failed",
"安装成功": "Install Succeeded",
"安装失败": "Install Failed",
"取消选中": "Uncheck",
"已选中": "Selected",
"选择": "Select",
"请选择": "Please select",
"研发商店": "R&D store",
"请选择": "Please Select",
"研发商店": "R&D Store",
"精选": "Picked",
"推荐": "Recommend",
"正在加载中": "Loading",
"无匹配数据": "No matching data",
"新增任务": "New task",
"新增路径": "New path",
"原处理人": "Original handler",
"目标处理人": "Target handler",
"添加处理人转换": "Configure handler conversion",
"新增任务": "New Task",
"新增路径": "New Path",
"原处理人": "Original Handler",
"目标处理人": "Target Handler",
"添加处理人转换": "Configure Handler Conversion",
"选择规则集": "Please select rule set",
"请选择语言": "Please select languages",
"字段只能包含字母": "Field can only contain letters",
Expand All @@ -66,6 +66,6 @@
"如流水线配置了质量红线请谨慎使用异步功能,可能会由于结果异步输出导致红线拦截": "If the pipeline is configured with a quality red line, please use the asynchronous function carefully. The red line may be blocked due to the asynchronous output of the result",
"以绝对路径/data/landun/workspace/CodeCCTest/cpp/为例:\n扫描相对路径可输入/CodeCCTest/cpp/,只输入/cpp/不会生效\n扫描某类文件如protobuffer生成的*.pb.cc,可以输入.*/.*\\.pb\\.cc\n扫描工作空间中某个文件夹如P2PLive,可以输入.*/P2PLive/.* \n只扫描某个文件夹下某类文件如P2PLive下*.c,可以输入.*/P2PLive/.*\\.c\n若一行中输入多个路径或路径匹配式可用英文逗号分隔\n支持流水线变量": "Take the absolute path /data/landun/workspace/CodeCCTest/cpp/\nas an example: The scan relative path can be entered /CodeCCTest/cpp/\nBut only /cpp/ will not take effect. Scan a certain type of file,\nSuch as *.pb.cc generated by protobuffer, and you can enter .*/.*\\.Pb\\.cc\nScan a folder in the workspace, such as P2PLive, you can enter. */P2PLive/*\nOnly scan a certain type of file under a folder, such as *.c under P2PLive,\nyou can enter .*/P2PLive/.*\\.c\nIf multiple paths are entered in a line or path matching can be separated by\nEnglish commas, and pipeline variables are supported",
"屏蔽某类文件如protobuffer生成的*.pb.cc,可以输入.*/.*\\.pb\\.cc\n屏蔽所有分支中某个文件夹如P2PLive,可以输入.*/P2PLive/.* \n屏蔽某个文件夹下某类文件如P2PLive下*.c,可以输入.*/P2PLive/.*\\.c\n若一行中输入多个路径匹配式可用英文逗号分隔\n支持流水线变量": "Exclude a certain type of file, such as *.pb.cc generated by protobuffer,\nand you can enter .*/.*\\.pb\\.cc\nMask a folder in all branches, such as P2PLive, you can enter .*/P2PLive/*\nExclude a certain type of file under a folder, such as *.c under P2PLive,\nyou can enter .*/P2PLive/.*\\.c\nIf multiple path matching types are entered in a line, they can be separated\nby English commas, and pipeline variables are supported",
"# Coverity/Klocwork将通过调用编译脚本来编译您的代码,以追踪深层次的缺陷\n# 请使用依赖的构建工具如maven/cmake等写一个编译脚本build.bat\n# 确保build.bat能够编译代码\n# cd path/to/build.bat\n# call build.bat": "#Coverage/Klocwork will compile your code by calling the compilation script to track the deep-seated defects\n#Please use a dependent build tool such as maven/make to write a build script build.bat\n#Ensure that build.bat can compile code\n# cd path/to/build.bat\n# call build.bat",
"# Coverity/Klocwork将通过调用编译脚本来编译您的代码,以追踪深层次的缺陷\n# 请使用依赖的构建工具如maven/cmake等写一个编译脚本build.sh\n# 确保build.sh能够编译代码\n# cd path/to/build.sh\n# sh build.sh": "#Coverage/Klocwork will compile your code by calling the compilation script to track the deep-seated defects.\n# Please write a compilation script build.sh using a dependent build tool such as maven/make\n# Ensure that build.sh can compile the code\n# cd path/to/build.sh\n# sh build.sh"
"# Coverity/Klocwork将通过调用编译脚本来编译您的代码,以追踪深层次的缺陷\n# 请使用依赖的构建工具如maven/cmake等写一个编译脚本build.bat\n# 确保build.bat能够编译代码\n# cd path/to/build.bat\n# call build.bat": "#Code Check Tools that depend on compilation will compile your code by calling the compilation script to track the deep-seated defects\n#Please use a dependent build tool such as maven/make to write a build script build.bat\n#Ensure that build.bat can compile code\n# cd path/to/build.bat\n# call build.bat",
"# Coverity/Klocwork将通过调用编译脚本来编译您的代码,以追踪深层次的缺陷\n# 请使用依赖的构建工具如maven/cmake等写一个编译脚本build.sh\n# 确保build.sh能够编译代码\n# cd path/to/build.sh\n# sh build.sh": "#Code Check Tools that depend on compilation will compile your code by calling the compilation script to track the deep-seated defects.\n# Please write a compilation script build.sh using a dependent build tool such as maven/make\n# Ensure that build.sh can compile the code\n# cd path/to/build.sh\n# sh build.sh"
}

0 comments on commit cb3a27d

Please sign in to comment.