diff --git a/404.html b/404.html new file mode 100644 index 000000000..555099b10 --- /dev/null +++ b/404.html @@ -0,0 +1,33 @@ + + + + + + + + + 腾讯云代码分析 + + + + +

404

看起来我们进入了错误的链接
返回首页
+ + + diff --git a/assets/404.html-0a2717d4.js b/assets/404.html-0a2717d4.js new file mode 100644 index 000000000..0f8cc9d84 --- /dev/null +++ b/assets/404.html-0a2717d4.js @@ -0,0 +1 @@ +import{_ as e,o as c,c as t}from"./app-2a91d8ab.js";const _={};function o(r,n){return c(),t("div")}const a=e(_,[["render",o],["__file","404.html.vue"]]);export{a as default}; diff --git a/assets/404.html-f9875e7b.js b/assets/404.html-f9875e7b.js new file mode 100644 index 000000000..5a0b8dedc --- /dev/null +++ b/assets/404.html-f9875e7b.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-3706649a","path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{t as data}; diff --git "a/assets/API\347\232\204\344\270\252\344\272\272\344\273\244\347\211\214-01c8b1a8.png" "b/assets/API\347\232\204\344\270\252\344\272\272\344\273\244\347\211\214-01c8b1a8.png" new file mode 100644 index 000000000..27ce1635c Binary files /dev/null and "b/assets/API\347\232\204\344\270\252\344\272\272\344\273\244\347\211\214-01c8b1a8.png" differ diff --git "a/assets/API\347\232\204\344\270\252\344\272\272\344\273\244\347\211\214-d33dd7b6.js" "b/assets/API\347\232\204\344\270\252\344\272\272\344\273\244\347\211\214-d33dd7b6.js" new file mode 100644 index 000000000..968cb125d --- /dev/null +++ "b/assets/API\347\232\204\344\270\252\344\272\272\344\273\244\347\211\214-d33dd7b6.js" @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/API的个人令牌-01c8b1a8.png";export{s as _}; diff --git a/assets/AddRule-868e55e0.png b/assets/AddRule-868e55e0.png new file mode 100644 index 000000000..a8d26ca31 Binary files /dev/null and b/assets/AddRule-868e55e0.png differ diff --git a/assets/AddRule2-84297356.png b/assets/AddRule2-84297356.png new file mode 100644 index 000000000..facf51a29 Binary files /dev/null and b/assets/AddRule2-84297356.png differ diff --git a/assets/AddRule3-9d6ed3bf.js b/assets/AddRule3-9d6ed3bf.js new file mode 100644 index 000000000..022cace35 --- /dev/null +++ b/assets/AddRule3-9d6ed3bf.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/AddRule-868e55e0.png",e="/CodeAnalysis/assets/AddRule2-84297356.png",a="/CodeAnalysis/assets/AddRule3-c3402a44.png";export{s as _,e as a,a as b}; diff --git a/assets/AddRule3-c3402a44.png b/assets/AddRule3-c3402a44.png new file mode 100644 index 000000000..6b3e9dd2d Binary files /dev/null and b/assets/AddRule3-c3402a44.png differ diff --git a/assets/Error-Prone.html-81fc48a5.js b/assets/Error-Prone.html-81fc48a5.js new file mode 100644 index 000000000..b4218604a --- /dev/null +++ b/assets/Error-Prone.html-81fc48a5.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-61b23c38","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone.html","title":"Error Prone 使用手册","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"Error Prone 介绍","slug":"error-prone-介绍","link":"#error-prone-介绍","children":[]},{"level":2,"title":"TCA使用指引","slug":"tca使用指引","link":"#tca使用指引","children":[]},{"level":2,"title":"Error Prone 配置","slug":"error-prone-配置","link":"#error-prone-配置","children":[{"level":3,"title":"通过Bazel构建","slug":"通过bazel构建","link":"#通过bazel构建","children":[]},{"level":3,"title":"Maven 配置 Error Prone","slug":"maven-配置-error-prone","link":"#maven-配置-error-prone","children":[]},{"level":3,"title":"其他配置和注意事项","slug":"其他配置和注意事项","link":"#其他配置和注意事项","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/工具/Error-Prone.md"}');export{e as data}; diff --git a/assets/Error-Prone.html-8bdd0b5f.js b/assets/Error-Prone.html-8bdd0b5f.js new file mode 100644 index 000000000..d58a652ca --- /dev/null +++ b/assets/Error-Prone.html-8bdd0b5f.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2b72915d","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone.html","title":"Error Prone 使用手册","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Error Prone 介绍","slug":"error-prone-介绍","link":"#error-prone-介绍","children":[]},{"level":2,"title":"TCA使用指引","slug":"tca使用指引","link":"#tca使用指引","children":[]},{"level":2,"title":"Error Prone 配置","slug":"error-prone-配置","link":"#error-prone-配置","children":[{"level":3,"title":"通过Bazel构建","slug":"通过bazel构建","link":"#通过bazel构建","children":[]},{"level":3,"title":"Maven 配置 Error Prone","slug":"maven-配置-error-prone","link":"#maven-配置-error-prone","children":[]},{"level":3,"title":"其他配置和注意事项","slug":"其他配置和注意事项","link":"#其他配置和注意事项","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/工具/Error-Prone.md"}');export{e as data}; diff --git a/assets/Error-Prone.html-93c2d746.js b/assets/Error-Prone.html-93c2d746.js new file mode 100644 index 000000000..b600142ee --- /dev/null +++ b/assets/Error-Prone.html-93c2d746.js @@ -0,0 +1,58 @@ +import{_ as s,r as l,o as d,c as t,a as e,b as r,d as n,w as c,e as a}from"./app-2a91d8ab.js";const v={},u=a('

Error Prone 使用手册

Error Prone 介绍

Error Prone是google开源的Java编译时检测工具,将常见的Java错误捕获为编译时错误,增强对java代码的类型分析,从而让开发人员及时发现问题

TCA使用指引

TCA原有编译时检测工具JavaWarning获取java代码编译时的告警信息,现集成Error Prone规则至JavaWarning工具以增加获取Error Prone的错误告警信息。

',5),m=e("li",null,"在规则包中添加JavaWarning工具的Error Prone规则(可通过规则解决方法进行区分);",-1),p=e("li",null,"客户端启动分析,在TCA Web页面上查看问题。",-1),g=e("h2",{id:"error-prone-配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#error-prone-配置","aria-hidden":"true"},"#"),r(" Error Prone 配置")],-1),b=e("h3",{id:"通过bazel构建",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#通过bazel构建","aria-hidden":"true"},"#"),r(" 通过Bazel构建")],-1),h=e("li",null,[r("Bazel在构建java项目时,默认打开了Error Prone,所以在本地配置Bazel环境,编写Bazel构建文件,"),e("code",null,"bazel build :project"),r("构建项目即可。")],-1),_={href:"https://bazel.build/?hl=zh-cn",target:"_blank",rel:"noopener noreferrer"},E=a(`

Maven 配置 Error Prone

编辑pom.xml文件将设置添加到maven-compiler-plugin,例如:

<build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.8.0</version>
+        <configuration>
+          <source>8</source>
+          <target>8</target>
+          <encoding>UTF-8</encoding>
+          <compilerArgs>
+            <arg>-XDcompilePolicy=simple</arg>
+            <arg>-Xplugin:ErrorProne</arg>
+          </compilerArgs>
+          <annotationProcessorPaths>
+            <path>
+              <groupId>com.google.errorprone</groupId>
+              <artifactId>error_prone_core</artifactId>
+              <version>\${error-prone.version}</version>
+            </path>
+            <!-- Other annotation processors go here.
+
+            If 'annotationProcessorPaths' is set, processors will no longer be
+            discovered on the regular -classpath; see also 'Using Error Prone
+            together with other annotation processors' below. -->
+          </annotationProcessorPaths>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+

对于JDK 16或更高的版本,需要将以下内容--add-exports--add-opens标志添加到.mvn/jvm.config文件中:

--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
+

###命令行 Error Prone 支持com.sun.source.util.PluginAPI,并且可以通过将 Error Prone 添加到-processorpath并设置-Xplugin标志来与JDK 9及更高版本一起使用:

wget https://repo1.maven.org/maven2/com/google/errorprone/error_prone_core/\${EP_VERSION?}/error_prone_core-\${EP_VERSION?}-with-dependencies.jar
+wget https://repo1.maven.org/maven2/org/checkerframework/dataflow-errorprone/3.15.0/dataflow-errorprone-3.15.0.jar
+javac \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \\
+  -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \\
+  -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \\
+  -XDcompilePolicy=simple \\
+  -processorpath error_prone_core-\${EP_VERSION?}-with-dependencies.jar:dataflow-errorprone-3.15.0.jar \\
+  '-Xplugin:ErrorProne -XepDisableAllChecks -Xep:CollectionIncompatibleType:ERROR' \\
+  Example.java
+
`,7),A=e("li",null,[r("对于"),e("code",null,"JDK 16"),r("以及更高的版本"),e("code",null,"--add-exports"),r("和"),e("code",null,"--add-opens"),r("参数是必须的")],-1),j=e("code",null,"JDK 8",-1),N={href:"https://github.com/google/error-prone/blob/f8e33bc460be82ab22256a7ef8b979d7a2cacaba/docs/installation.md",target:"_blank",rel:"noopener noreferrer"},L=e("h3",{id:"其他配置和注意事项",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#其他配置和注意事项","aria-hidden":"true"},"#"),r(" 其他配置和注意事项")],-1),f={href:"https://errorprone.info/docs/installation",target:"_blank",rel:"noopener noreferrer"},x={href:"https://github.com/google/error-prone/blob/f8e33bc460be82ab22256a7ef8b979d7a2cacaba/docs/installation.md",target:"_blank",rel:"noopener noreferrer"};function k(P,D){const i=l("RouterLink"),o=l("ExternalLinkIcon");return d(),t("div",null,[u,e("ul",null,[m,e("li",null,[r("采用"),n(i,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html"},{default:c(()=>[r("TCA Client")]),_:1}),r("模式,根据客户端环境配置工具和编译命令,详情参考下文;")]),p]),g,b,e("ul",null,[h,e("li",null,[r("详情请参考"),e("a",_,[r("Bazel官方文档"),n(o)])])]),E,e("ul",null,[A,e("li",null,[r("对于"),j,r(",请参考"),e("a",N,[r("旧版本安装说明"),n(o)])])]),L,e("ul",null,[e("li",null,[r("Error Prone还支持通过Gradle和Ant配置,详情参考"),e("a",f,[r("Error Prone官方配置文档"),n(o)])]),e("li",null,[r("不同JDK版本参数有所不同,详情参考"),e("a",x,[r("旧版本安装说明"),n(o)])])])])}const M=s(v,[["render",k],["__file","Error-Prone.html.vue"]]);export{M as default}; diff --git a/assets/Error-Prone.html-dfd35ccd.js b/assets/Error-Prone.html-dfd35ccd.js new file mode 100644 index 000000000..79d6a5603 --- /dev/null +++ b/assets/Error-Prone.html-dfd35ccd.js @@ -0,0 +1,58 @@ +import{_ as s,r as l,o as d,c as t,a as e,b as r,d as n,w as c,e as a}from"./app-2a91d8ab.js";const v={},u=a('

Error Prone 使用手册

Error Prone 介绍

Error Prone是google开源的Java编译时检测工具,将常见的Java错误捕获为编译时错误,增强对java代码的类型分析,从而让开发人员及时发现问题

TCA使用指引

TCA原有编译时检测工具JavaWarning获取java代码编译时的告警信息,现集成Error Prone规则至JavaWarning工具以增加获取Error Prone的错误告警信息。

',5),m=e("li",null,"在规则包中添加JavaWarning工具的Error Prone规则(可通过规则解决方法进行区分);",-1),p=e("li",null,"客户端启动分析,在TCA Web页面上查看问题。",-1),g=e("h2",{id:"error-prone-配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#error-prone-配置","aria-hidden":"true"},"#"),r(" Error Prone 配置")],-1),b=e("h3",{id:"通过bazel构建",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#通过bazel构建","aria-hidden":"true"},"#"),r(" 通过Bazel构建")],-1),h=e("li",null,[r("Bazel在构建java项目时,默认打开了Error Prone,所以在本地配置Bazel环境,编写Bazel构建文件,"),e("code",null,"bazel build :project"),r("构建项目即可。")],-1),_={href:"https://bazel.build/?hl=zh-cn",target:"_blank",rel:"noopener noreferrer"},E=a(`

Maven 配置 Error Prone

编辑pom.xml文件将设置添加到maven-compiler-plugin,例如:

<build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.8.0</version>
+        <configuration>
+          <source>8</source>
+          <target>8</target>
+          <encoding>UTF-8</encoding>
+          <compilerArgs>
+            <arg>-XDcompilePolicy=simple</arg>
+            <arg>-Xplugin:ErrorProne</arg>
+          </compilerArgs>
+          <annotationProcessorPaths>
+            <path>
+              <groupId>com.google.errorprone</groupId>
+              <artifactId>error_prone_core</artifactId>
+              <version>\${error-prone.version}</version>
+            </path>
+            <!-- Other annotation processors go here.
+
+            If 'annotationProcessorPaths' is set, processors will no longer be
+            discovered on the regular -classpath; see also 'Using Error Prone
+            together with other annotation processors' below. -->
+          </annotationProcessorPaths>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+

对于JDK 16或更高的版本,需要将以下内容--add-exports--add-opens标志添加到.mvn/jvm.config文件中:

--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
+

###命令行 Error Prone 支持com.sun.source.util.PluginAPI,并且可以通过将 Error Prone 添加到-processorpath并设置-Xplugin标志来与JDK 9及更高版本一起使用:

wget https://repo1.maven.org/maven2/com/google/errorprone/error_prone_core/\${EP_VERSION?}/error_prone_core-\${EP_VERSION?}-with-dependencies.jar
+wget https://repo1.maven.org/maven2/org/checkerframework/dataflow-errorprone/3.15.0/dataflow-errorprone-3.15.0.jar
+javac \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \\
+  -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \\
+  -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \\
+  -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \\
+  -XDcompilePolicy=simple \\
+  -processorpath error_prone_core-\${EP_VERSION?}-with-dependencies.jar:dataflow-errorprone-3.15.0.jar \\
+  '-Xplugin:ErrorProne -XepDisableAllChecks -Xep:CollectionIncompatibleType:ERROR' \\
+  Example.java
+
`,7),A=e("li",null,[r("对于"),e("code",null,"JDK 16"),r("以及更高的版本"),e("code",null,"--add-exports"),r("和"),e("code",null,"--add-opens"),r("参数是必须的")],-1),j=e("code",null,"JDK 8",-1),N={href:"https://github.com/google/error-prone/blob/f8e33bc460be82ab22256a7ef8b979d7a2cacaba/docs/installation.md",target:"_blank",rel:"noopener noreferrer"},L=e("h3",{id:"其他配置和注意事项",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#其他配置和注意事项","aria-hidden":"true"},"#"),r(" 其他配置和注意事项")],-1),f={href:"https://errorprone.info/docs/installation",target:"_blank",rel:"noopener noreferrer"},x={href:"https://github.com/google/error-prone/blob/f8e33bc460be82ab22256a7ef8b979d7a2cacaba/docs/installation.md",target:"_blank",rel:"noopener noreferrer"};function k(P,D){const i=l("RouterLink"),o=l("ExternalLinkIcon");return d(),t("div",null,[u,e("ul",null,[m,e("li",null,[r("采用"),n(i,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html"},{default:c(()=>[r("TCA Client")]),_:1}),r("模式,根据客户端环境配置工具和编译命令,详情参考下文;")]),p]),g,b,e("ul",null,[h,e("li",null,[r("详情请参考"),e("a",_,[r("Bazel官方文档"),n(o)])])]),E,e("ul",null,[A,e("li",null,[r("对于"),j,r(",请参考"),e("a",N,[r("旧版本安装说明"),n(o)])])]),L,e("ul",null,[e("li",null,[r("Error Prone还支持通过Gradle和Ant配置,详情参考"),e("a",f,[r("Error Prone官方配置文档"),n(o)])]),e("li",null,[r("不同JDK版本参数有所不同,详情参考"),e("a",x,[r("旧版本安装说明"),n(o)])])])])}const M=s(v,[["render",k],["__file","Error-Prone.html.vue"]]);export{M as default}; diff --git a/assets/FAQ.html-687658b7.js b/assets/FAQ.html-687658b7.js new file mode 100644 index 000000000..3bd66b8b9 --- /dev/null +++ b/assets/FAQ.html-687658b7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-023e8091","path":"/en/quickStarted/FAQ.html","title":"FAQ","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Server常见问题与处理方法","slug":"server常见问题与处理方法","link":"#server常见问题与处理方法","children":[{"level":3,"title":"1. 环境部署","slug":"_1-环境部署","link":"#_1-环境部署","children":[]},{"level":3,"title":"2. 服务启动与初始化","slug":"_2-服务启动与初始化","link":"#_2-服务启动与初始化","children":[]},{"level":3,"title":"3. 平台使用","slug":"_3-平台使用","link":"#_3-平台使用","children":[]}]},{"level":2,"title":"CodeAnalysis仓库文件问题","slug":"codeanalysis仓库文件问题","link":"#codeanalysis仓库文件问题","children":[{"level":3,"title":"1. clone到本地时相关md文件内资源图片无法显示","slug":"_1-clone到本地时相关md文件内资源图片无法显示","link":"#_1-clone到本地时相关md文件内资源图片无法显示","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/FAQ.md"}');export{e as data}; diff --git a/assets/FAQ.html-7682a4cb.js b/assets/FAQ.html-7682a4cb.js new file mode 100644 index 000000000..4fb555d47 --- /dev/null +++ b/assets/FAQ.html-7682a4cb.js @@ -0,0 +1,62 @@ +import{_ as s,r,o as t,c as p,a as e,b as o,d as i,w as l,e as c}from"./app-2a91d8ab.js";const u={},h=e("h1",{id:"faq",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#faq","aria-hidden":"true"},"#"),o(" FAQ")],-1),m={class:"custom-container tip"},v=e("p",{class:"custom-container-title"},"TIP",-1),b=e("p",null,"该Q&A文档会持续更新,非常欢迎您的建议与共建!",-1),g={class:"table-of-contents"},_=c(`

Server常见问题与处理方法

1. 环境部署

1.1 pypi下载超时或失败

如果在执行pip install环节出现以下错误,可以调整一下镜像源:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted. org', port=443): Read timed out.(read timeout=15)") '
+

该错误是访问官方pypi下载源时网络不通或者不稳定导致,可以通过以下方式调整:

本地部署时,调整pypi下载源配置方式:

mkdir ~/.pip/
+echo "[global]\\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
+

Docker-Compose部署时,调整pypi下载源配置方式:

vi server/dockerconfs/Dockerfile-common
+

调整文件中最后一行 RUN指令

RUN mkdir -p log/ && \\
+    mkdir ~/.pip/ && \\
+    echo "[global]\\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf && \\
+    pip install -U setuptools pip && \\
+    pip install -r requirements.txt
+

注:如果需要指定其他pypi下载源,可以将https://mirrors.cloud.tencent.com/pypi/simple进行替换

如果出现以下错误:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f6d4ac24910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
+

该错误是无法正常解析pypi访问域名,需要检查一下本地的dns配置是否正常

1.2 Docker未安装或版本过低

TCA Server使用Docker-Compose依赖的Docker版本需要是1.13.0及以上,可以执行以下命令查看Docker版本

$ docker --version
+Docker version 18.09.7, build 2d0083d
+

文档相关:

`,20),f={href:"https://docs.docker.com/compose/compose-file/compose-versioning/",target:"_blank",rel:"noopener noreferrer"},x={href:"https://docs.docker.com/engine/install/centos/",target:"_blank",rel:"noopener noreferrer"},y={href:"https://docs.docker.com/engine/install/ubuntu/",target:"_blank",rel:"noopener noreferrer"},k=c(`

1.3 Docker-Compose启动失败

如果启动Docker-Compose输出以下错误:

* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
+* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
+* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
+

问题原因:可能镜像构建目录权限不足,导致异常。 解决方案:

  1. 执行docker-compose build可以通过日志查看是哪个镜像构建异常
  2. 切换到具体目录执行docker build .可以看到详细错误信息,结合具体错误信息进行处理
  3. 收集常见的错误日志,整理相关解决方案(注:欢迎大家补充)

文档相关:

`,6),E={href:"https://docs.docker.com/compose/install/",target:"_blank",rel:"noopener noreferrer"},R={href:"https://docs.docker.com/compose/cli-command/",target:"_blank",rel:"noopener noreferrer"},C=c(`

1.4 Docker镜像源下载超时或失败

目前TCA基础镜像是使用python:3.7.12-slim,该镜像是基于debian bullseye(debian 11)版本构建的,对应的源需要选择 bullseye 版本的源。

如果使用默认的下载源会报错或访问速度比较慢,可以调整server/dockerconfs/Dockerfile-common,指定其他国内下载源:

# FROM python:3.7.12-slim
+
+# 增加一下内容用于指定下载源
+RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \\
+    echo 'deb http://mirrors.tencent.com/debian/ bullseye main non-free contrib' > /etc/apt/sources.list && \\
+    echo 'deb http://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib' >> /etc/apt/sources.list && \\
+    echo 'deb http://mirrors.tencent.com/debian-security bullseye-security main non-free contrib' >> /etc/apt/sources.list
+
+# ARG EXTRA_TOOLS=...
+

如果出现以下错误:E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages 可以做以下检查,确认是什么原因:

  1. 检查一下本地服务器的时间配置是否正常
  2. 调整下载源

1.5 Python安装或执行失败

使用Python执行时提示ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory,该如何处理

  1. 在本地安装Python的目录中查找该文件,比如Python的安装目录是/usr/local/python3,可以执行find /usr/local/python3 -name "libpython3.7m.so.1.0",确认本地是否存在该文件

  2. 如果本地存在该文件,则执行以下命令:(注:需要将/usr/local/python3调整为本地实际的Python3安装路径)

    # 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +
  3. 如果本地不存在该文件,则可能需要重新安装Python3:(注:以下是将Python安装到/usr/local/python3,可以根据实际情况进行调整)

    # 编译前配置,注意重点:需要加上参数 --enable-shared
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +

文档相关:

`,10),T={href:"https://github.com/Tencent/CodeAnalysis/blob/main/doc/references/install_python37_on_centos.md",target:"_blank",rel:"noopener noreferrer"},D={href:"https://github.com/Tencent/CodeAnalysis/blob/main/doc/references/install_python37_on_ubuntu.md",target:"_blank",rel:"noopener noreferrer"},j=c(`

1.6 执行compose_init.sh脚本的pip install提示sha256不匹配错误

在构建镜像的pip install步骤提示以下报错时:

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
+    setuptools from https://mirrors.cloud.tencent.com/pypi/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8:
+        Expected sha256 26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8
+             Got        ddaacc49de5c08c09d744573240a9a49f24f65c5c72380e972433784caa68d98
+

可以执行export ORIGIN=normal,然后再执行./compose_init.sh

注:执行export命令的作用是调整为pypi默认官方下载源进行pip install

1.7 MacBook M1 使用 Docker-Compose报错

在M1机器上使用默认配置启动docker-compose,会出现mysqlscmproxy服务启动失败,需要做以下两步调整

  1. 调整docker-compose.yml文件,修改MySQL的镜像版本:

    # 默认:
    +image: mysql:5.7.24
    +
    +# 调整后:
    +image: mariadb:10.5.8
    +
  2. 调整server/dockerconfs/Dockerfile-common文件,修改Python的镜像版本:

    # 默认:
    +FROM python:3.7.12-slim
    +
    +# 调整后:
    +FROM amd64/python:3.7.12-slim
    +

1.8 celery、gunicorn命令找不到

如果启动服务时,提示:celery could not be foundgunicorn could not be found,需要做以下检查

  1. 执行python -v检查输出,确认当前python版本是否为python3.7
  2. 执行pip install celerypip install gunicorn检查celery和gunicorn是否已经安装
  3. 如果已经安装,可以执行以下命令建立软链:(注:需要将/usr/local/python3调整为本地实际的Python3安装路径)
ln -s /usr/local/python3/bin/gunicorn /usr/local/bin/gunicorn
+ln -s /usr/local/python3/bin/celery /usr/local/bin/celery
+

2. 服务启动与初始化

2.1 服务占用端口异常

TCA 本地部署启动后,会监听多个端口:

如果出现端口占用冲突,建议采用以下方式解决:

  1. 调整其他程序监听的端口号,避免跟上述TCA服务的端口号出现冲突
  2. 采用Docker-Compose方式启动TCA,仅监听80端口

不推荐调整TCA指定服务的端口号,需要调整多处配置,以及可能会影响到后续服务的升级

2.2 服务输出日志找不到

本地部署输出的日志位置:

  1. main服务输出的日志目录:server/projects/main/log
  2. analysis服务输出的日志目录:server/projects/analysis/log
  3. login服务输出的日志目录:server/projects/login/log
  4. file服务输出的日志目录:server/projects/file/log
  5. scmproxy服务输出的日志目录:server/projects/scmproxy/logs

3. 平台使用

3.1 平台登录的默认账号密码是什么?

默认账号: CodeDog,密码: admin

3.2 平台默认的API Token是什么?

默认Token是0712b895f30c5e958ec71a7c22e1b1a2ad1d5c6b

如果在平台上刷新了CodeDog用户的Token,需要将刷新后的Token填写到以下文件中:

  1. server/scripts/config.sh文件
  2. server/dockerconfs/.env.local文件

然后重启服务。

  1. 本地部署:

    cd server/
    +./scripts/deploy.sh start
    +
  2. docker-compose部署:

    $ docker-compose stop
    +# 稍等片刻
    +$ docker-compose up -d
    +

3.3 代码库登记出错,出现代码库及账号不匹配

该错误出现可能有以下几个原因:

`,33),S=e("li",null,"账号密码不准确或登记的代码库地址不存在",-1),N=e("code",null,"github",-1),A={href:"https://github.com/settings/tokens",target:"_blank",rel:"noopener noreferrer"},O=e("code",null,"personal access token",-1),L=c("
  • scmproxy服务启动失败
  • scmproxy所在的机器/容器因为网络问题无法访问对应的代码库
  • scmproxy所在的机器git版本较低,出现unknown option `local` 错误
  • ",3),P=c(`

    3.4 查看问题文件提示获取代码信息耗时较久,请稍后再试

    出现该提示的原因是,代码库偏大或clone代码库时间较长,可以稍等一会再刷新重试

    3.5 客户端访问文件服务器,提示method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)

    出现这种错误,可能是本地配置异常或token配置有问题,检查方式如下:

    1. 检查客户端的config.ini文件配置的URL是否为当前Server部署的地址:(xxx需要调整为实际的路径)

      [SERVER_URL]
      +URL=http://xxx/server/main/
      +[FILE_SERVER]
      +URL=http:/xxx/server/files/
      +

      如果xxx不一致需要调整为一致

      注: xxx地址与在浏览器访问平台的xxx地址是一致的,不需要区分端口

    2. 检查客户端访问Server是否能通:

      curl -v http://xxx/server/main/
      +

      如果不通,则需要检查客户端机器访问Server机器是否有网络限制

    3. 检查当前在codedog.ini-[config]tokenconfig.ini文件配置的[FILE_SERVER]TOKEN是否一致,如果不一致需要调整为一致

    4. 检查用户CodeDogToken是否被刷新了然后没有更新到配置文件中

    3.6 客户端访问文件服务器,提示Connection timed out

    本地客户端执行过程提示method (upload file) call fails on error: <urlopen error [Errno 110] Connection timed out> 该如何处理? 一般情况下,这个问题是客户端与Server之间网络不通导致,可以检查一下是否有防火墙限制或者配置的URL是内部IP或地址,可以通过以下方式检查

    1. 检查客户端的config.ini文件配置的URL是否为当前Server部署的地址:(xxx需要调整为实际的路径)

      [SERVER_URL]
      +URL=http://xxx/server/main/
      +[FILE_SERVER]
      +URL=http:/xxx/server/files/
      +
    2. 检查客户端访问Server是否能通:

      curl -v http://xxx/server/main/
      +

      如果不通,则需要检查客户端机器访问Server机器是否有网络限制

    3.7 任务执行结果异常,提示第三方依赖文件服务器异常

    出现该错误提示,一般是访问文件器出错或文件服务器本身有问题,可以通过以下方式检查: 需要检查analysis-worker的日志(本地部署:server/projects/analysis/log/celery.log,docker-compose部署:docker-compose exec analysis-worker /bin/bash进入容器后访问log/celery.log查看具体错误原因

    如果提示no route to host可能是当前机器/容器无法访问当前宿主机的IP,可以检查一下当前防火墙的设置,是否限制了analysis-worker来源的访问

    3.8 客户端执行时提示工具(xxx)扫描进程为空,请联系管理员配置工具进程!

    出现该错误提示,一般是Server未进行初始化,可以通过执行以下命令初始化后再启动测试

    CodeAnalysis仓库文件问题

    1. clone到本地时相关md文件内资源图片无法显示

    为防止国内用户访问CodeAnalysis Github首页时图片资源加载失败,目前各个md文件中的图片资源引用地址调整增加了URL前缀https://tencent.github.io/CodeAnalysis/

    用户下载代码库到本地后,发现无法访问资源文件时,请检查本地网络是否能够连通外网,如果无法连通外网,可以在文档引入资源地址中进行相对路径替换,调整各个资源文件的链接。

    `,19);function I(F,U){const a=r("RouterLink"),n=r("router-link"),d=r("ExternalLinkIcon");return t(),p("div",null,[h,e("div",m,[v,b,e("p",null,[o("如果您遇到任何未在此处列出的部署或使用问题,请在 GitHub issue 系统中进行搜索。如果仍未找到该错误消息,您可以通过"),i(a,{to:"/en/community/joingroup.html"},{default:l(()=>[o("社区")]),_:1}),o("提出问题,获得帮助。")])]),e("nav",g,[e("ul",null,[e("li",null,[i(n,{to:"#server常见问题与处理方法"},{default:l(()=>[o("Server常见问题与处理方法")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_1-环境部署"},{default:l(()=>[o("1. 环境部署")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_1-1-pypi下载超时或失败"},{default:l(()=>[o("1.1 pypi下载超时或失败")]),_:1})]),e("li",null,[i(n,{to:"#_1-2-docker未安装或版本过低"},{default:l(()=>[o("1.2 Docker未安装或版本过低")]),_:1})]),e("li",null,[i(n,{to:"#_1-3-docker-compose启动失败"},{default:l(()=>[o("1.3 Docker-Compose启动失败")]),_:1})]),e("li",null,[i(n,{to:"#_1-4-docker镜像源下载超时或失败"},{default:l(()=>[o("1.4 Docker镜像源下载超时或失败")]),_:1})]),e("li",null,[i(n,{to:"#_1-5-python安装或执行失败"},{default:l(()=>[o("1.5 Python安装或执行失败")]),_:1})]),e("li",null,[i(n,{to:"#_1-6-执行compose-init-sh脚本的pip-install提示sha256不匹配错误"},{default:l(()=>[o("1.6 执行compose_init.sh脚本的pip install提示sha256不匹配错误")]),_:1})]),e("li",null,[i(n,{to:"#_1-7-macbook-m1-使用-docker-compose报错"},{default:l(()=>[o("1.7 MacBook M1 使用 Docker-Compose报错")]),_:1})]),e("li",null,[i(n,{to:"#_1-8-celery、gunicorn命令找不到"},{default:l(()=>[o("1.8 celery、gunicorn命令找不到")]),_:1})])])]),e("li",null,[i(n,{to:"#_2-服务启动与初始化"},{default:l(()=>[o("2. 服务启动与初始化")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_2-1-服务占用端口异常"},{default:l(()=>[o("2.1 服务占用端口异常")]),_:1})]),e("li",null,[i(n,{to:"#_2-2-服务输出日志找不到"},{default:l(()=>[o("2.2 服务输出日志找不到")]),_:1})])])]),e("li",null,[i(n,{to:"#_3-平台使用"},{default:l(()=>[o("3. 平台使用")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_3-1-平台登录的默认账号密码是什么"},{default:l(()=>[o("3.1 平台登录的默认账号密码是什么?")]),_:1})]),e("li",null,[i(n,{to:"#_3-2-平台默认的api-token是什么"},{default:l(()=>[o("3.2 平台默认的API Token是什么?")]),_:1})]),e("li",null,[i(n,{to:"#_3-3-代码库登记出错-出现代码库及账号不匹配"},{default:l(()=>[o("3.3 代码库登记出错,出现代码库及账号不匹配")]),_:1})]),e("li",null,[i(n,{to:"#_3-4-查看问题文件提示获取代码信息耗时较久-请稍后再试"},{default:l(()=>[o("3.4 查看问题文件提示获取代码信息耗时较久,请稍后再试")]),_:1})]),e("li",null,[i(n,{to:"#_3-5-客户端访问文件服务器-提示method-upload-file-call-fails-on-error-expecting-value-line-1-column-1-char-0"},{default:l(()=>[o("3.5 客户端访问文件服务器,提示method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)")]),_:1})]),e("li",null,[i(n,{to:"#_3-6-客户端访问文件服务器-提示connection-timed-out"},{default:l(()=>[o("3.6 客户端访问文件服务器,提示Connection timed out")]),_:1})]),e("li",null,[i(n,{to:"#_3-7-任务执行结果异常-提示第三方依赖文件服务器异常"},{default:l(()=>[o("3.7 任务执行结果异常,提示第三方依赖文件服务器异常")]),_:1})]),e("li",null,[i(n,{to:"#_3-8-客户端执行时提示工具-xxx-扫描进程为空-请联系管理员配置工具进程"},{default:l(()=>[o("3.8 客户端执行时提示工具(xxx)扫描进程为空,请联系管理员配置工具进程!")]),_:1})])])])])]),e("li",null,[i(n,{to:"#codeanalysis仓库文件问题"},{default:l(()=>[o("CodeAnalysis仓库文件问题")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_1-clone到本地时相关md文件内资源图片无法显示"},{default:l(()=>[o("1. clone到本地时相关md文件内资源图片无法显示")]),_:1})])])])])]),_,e("ul",null,[e("li",null,[e("a",f,[o("Compose文件版本与对应的Docker版本说明文档"),i(d)])]),e("li",null,[e("a",x,[o("CentOS安装Docker官方文档"),i(d)])]),e("li",null,[e("a",y,[o("Ubuntu安装Docker文档"),i(d)])])]),k,e("ul",null,[e("li",null,[e("a",E,[o("Docker-Compose官方安装文档"),i(d)])]),e("li",null,[e("a",R,[o("Docker-ComposeV2官方安装文档"),i(d)])])]),C,e("ul",null,[e("li",null,[e("a",T,[o("CentOS安装Python3.7文档"),i(d)])]),e("li",null,[e("a",D,[o("Ubuntu安装Python3.7文档"),i(d)])])]),j,e("ol",null,[S,e("li",null,[o("登记"),N,o("使用的密码需要使用"),e("a",A,[O,i(d)])]),L]),P])}const w=s(u,[["render",I],["__file","FAQ.html.vue"]]);export{w as default}; diff --git a/assets/FAQ.html-8873eb25.js b/assets/FAQ.html-8873eb25.js new file mode 100644 index 000000000..bc6dd2b3d --- /dev/null +++ b/assets/FAQ.html-8873eb25.js @@ -0,0 +1,64 @@ +import{_ as s,r as a,o as t,c as p,a as e,b as o,d as i,w as l,e as c}from"./app-2a91d8ab.js";const u={},h=e("h1",{id:"faq",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#faq","aria-hidden":"true"},"#"),o(" FAQ")],-1),m={class:"custom-container tip"},v=e("p",{class:"custom-container-title"},"提示",-1),b=e("p",null,"该Q&A文档会持续更新,非常欢迎您的建议与共建!",-1),g={class:"table-of-contents"},_=c(`

    Server常见问题与处理方法

    1. 环境部署

    1.1 pypi下载超时或失败

    如果在执行pip install环节出现以下错误,可以调整一下镜像源:

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted. org', port=443): Read timed out.(read timeout=15)") '
    +

    该错误是访问官方pypi下载源时网络不通或者不稳定导致,可以通过以下方式调整:

    本地部署时,调整pypi下载源配置方式:

    mkdir ~/.pip/
    +echo "[global]\\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +

    Docker-Compose部署时,调整pypi下载源配置方式:

    vi server/dockerconfs/Dockerfile-common
    +

    调整文件中最后一行 RUN指令

    RUN mkdir -p log/ && \\
    +    mkdir ~/.pip/ && \\
    +    echo "[global]\\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf && \\
    +    pip install -U setuptools pip && \\
    +    pip install -r requirements.txt
    +

    注:如果需要指定其他pypi下载源,可以将https://mirrors.cloud.tencent.com/pypi/simple进行替换

    如果出现以下错误:

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f6d4ac24910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
    +

    该错误是无法正常解析pypi访问域名,需要检查一下本地的dns配置是否正常

    1.2 Docker未安装或版本过低

    TCA Server使用Docker-Compose依赖的Docker版本需要是1.13.0及以上,可以执行以下命令查看Docker版本

    $ docker --version
    +Docker version 18.09.7, build 2d0083d
    +

    文档相关:

    `,20),f={href:"https://docs.docker.com/compose/compose-file/compose-versioning/",target:"_blank",rel:"noopener noreferrer"},x={href:"https://docs.docker.com/engine/install/centos/",target:"_blank",rel:"noopener noreferrer"},y={href:"https://docs.docker.com/engine/install/ubuntu/",target:"_blank",rel:"noopener noreferrer"},k=c(`

    1.3 Docker-Compose启动失败

    如果启动Docker-Compose输出以下错误:

    * Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +

    问题原因:可能镜像构建目录权限不足,导致异常。 解决方案:

    1. 执行docker-compose build可以通过日志查看是哪个镜像构建异常
    2. 切换到具体目录执行docker build .可以看到详细错误信息,结合具体错误信息进行处理
    3. 收集常见的错误日志,整理相关解决方案(注:欢迎大家补充)

    文档相关:

    `,6),E={href:"https://docs.docker.com/compose/install/",target:"_blank",rel:"noopener noreferrer"},R={href:"https://docs.docker.com/compose/cli-command/",target:"_blank",rel:"noopener noreferrer"},C=c(`

    1.4 Docker镜像源下载超时或失败

    目前TCA基础镜像是使用python:3.7.12-slim,该镜像是基于debian bullseye(debian 11)版本构建的,对应的源需要选择 bullseye 版本的源。

    如果使用默认的下载源会报错或访问速度比较慢,可以调整server/dockerconfs/Dockerfile-common,指定其他国内下载源:

    # FROM python:3.7.12-slim
    +
    +# 增加一下内容用于指定下载源
    +RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \\
    +    echo 'deb http://mirrors.tencent.com/debian/ bullseye main non-free contrib' > /etc/apt/sources.list && \\
    +    echo 'deb http://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib' >> /etc/apt/sources.list && \\
    +    echo 'deb http://mirrors.tencent.com/debian-security bullseye-security main non-free contrib' >> /etc/apt/sources.list
    +
    +# ARG EXTRA_TOOLS=...
    +

    如果出现以下错误:E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages 可以做以下检查,确认是什么原因:

    1. 检查一下本地服务器的时间配置是否正常
    2. 调整下载源

    1.5 Python安装或执行失败

    使用Python执行时提示ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory,该如何处理

    1. 在本地安装Python的目录中查找该文件,比如Python的安装目录是/usr/local/python3,可以执行find /usr/local/python3 -name "libpython3.7m.so.1.0",确认本地是否存在该文件

    2. 如果本地存在该文件,则执行以下命令:(注:需要将/usr/local/python3调整为本地实际的Python3安装路径)

      # 链接构建产出的Python动态库
      +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
      +# 配置动态库
      +$ ldconfig
      +
    3. 如果本地不存在该文件,则可能需要重新安装Python3:(注:以下是将Python安装到/usr/local/python3,可以根据实际情况进行调整)

      # 编译前配置,注意重点:需要加上参数 --enable-shared
      +$ ./configure prefix=/usr/local/python3 --enable-shared
      +

    文档相关:

    `,10),L={href:"https://github.com/Tencent/CodeAnalysis/blob/main/doc/references/install_python37_on_centos.md",target:"_blank",rel:"noopener noreferrer"},S={href:"https://github.com/Tencent/CodeAnalysis/blob/main/doc/references/install_python37_on_ubuntu.md",target:"_blank",rel:"noopener noreferrer"},T=c(`

    1.6 执行compose_init.sh脚本的pip install提示sha256不匹配错误

    在构建镜像的pip install步骤提示以下报错时:

    ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    +    setuptools from https://mirrors.cloud.tencent.com/pypi/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8:
    +        Expected sha256 26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8
    +             Got        ddaacc49de5c08c09d744573240a9a49f24f65c5c72380e972433784caa68d98
    +

    可以执行export ORIGIN=normal,然后再执行./compose_init.sh

    注:执行export命令的作用是调整为pypi默认官方下载源进行pip install

    1.7 MacBook M1 使用 Docker-Compose报错

    在M1机器上使用默认配置启动docker-compose,会出现mysqlscmproxy服务启动失败,需要做以下两步调整

    1. 调整docker-compose.yml文件,修改MySQL的镜像版本:

      # 默认:
      +image: mysql:5.7.24
      +
      +# 调整后:
      +image: mariadb:10.5.8
      +
    2. 调整server/dockerconfs/Dockerfile-common文件,修改Python的镜像版本:

      # 默认:
      +FROM python:3.7.12-slim
      +
      +# 调整后:
      +FROM amd64/python:3.7.12-slim
      +

    1.8 celery、gunicorn命令找不到

    如果启动服务时,提示:celery could not be foundgunicorn could not be found,需要做以下检查

    1. 执行python -v检查输出,确认当前python版本是否为python3.7
    2. 执行pip install celerypip install gunicorn检查celery和gunicorn是否已经安装
    3. 如果已经安装,可以执行以下命令建立软链:(注:需要将/usr/local/python3调整为本地实际的Python3安装路径)
    ln -s /usr/local/python3/bin/gunicorn /usr/local/bin/gunicorn
    +ln -s /usr/local/python3/bin/celery /usr/local/bin/celery
    +

    1.9 脚本安装过程报错,出现格式问题

    使用docker方式部署项目时,提示

    fatal: 无法访问 'https://git.code.tencent.com/TCA/tca-tools/tca_lib.git/': URL using bad/illegal format or missing URL.
    +Download lib failed
    +

    该如何处理。

    出错原因可能是Windows系统、和macOs系统、linux系统的行分隔符不同,可以先查看当前文件的换行符是 CRLF 还是LF, 如果要部署在Windows系统系统上,行分隔符应该为CRLF格式,部署在linux和macOS系统预期是LF格式,如果不一致需要进行手动修改。

    修改方式可以选择: 1、使用pycharm打开项目,依次点击”File”->”Settings”->”Editor”->”Code Style”->”General” 在面板中,可以找到”Line separator”选项,根据要部署的系统选择行分隔符格式。 2、也可以使用dos2unix、unix2dos等转换命令,例如从Windows系统打包到Linux系统,当前行分隔符为CRLF,需要对脚本执行 dos2unix fileName指令进行转换 ,注意使用该指令前需要先进行安装。

    完成以上操作之后再对代码进行打包,即可部署运行。

    2. 服务启动与初始化

    2.1 服务占用端口异常

    TCA 本地部署启动后,会监听多个端口:

    如果出现端口占用冲突,建议采用以下方式解决:

    1. 调整其他程序监听的端口号,避免跟上述TCA服务的端口号出现冲突
    2. 采用Docker-Compose方式启动TCA,仅监听80端口

    不推荐调整TCA指定服务的端口号,需要调整多处配置,以及可能会影响到后续服务的升级

    2.2 服务输出日志找不到

    本地部署输出的日志位置:

    1. main服务输出的日志目录:server/projects/main/log
    2. analysis服务输出的日志目录:server/projects/analysis/log
    3. login服务输出的日志目录:server/projects/login/log
    4. file服务输出的日志目录:server/projects/file/log
    5. scmproxy服务输出的日志目录:server/projects/scmproxy/logs

    2.3 服务启动失败

    1. 启动服务报错 json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    3. 平台使用

    3.1 平台登录的默认账号密码是什么?

    默认账号: CodeDog,密码: admin

    3.2 平台默认的API Token是什么?

    默认Token是0712b895f30c5e958ec71a7c22e1b1a2ad1d5c6b

    如果在平台上刷新了CodeDog用户的Token,需要将刷新后的Token填写到以下文件中:

    1. server/scripts/config.sh文件
    2. server/dockerconfs/.env.local文件

    然后重启服务。

    1. 本地部署:

      cd server/
      +./scripts/deploy.sh start
      +
    2. docker-compose部署:

      $ docker-compose stop
      +# 稍等片刻
      +$ docker-compose up -d
      +

    3.3 代码库登记出错,出现代码库及账号不匹配

    该错误出现可能有以下几个原因:

    `,42),D=e("li",null,"账号密码不准确或登记的代码库地址不存在",-1),j=e("code",null,"github",-1),N={href:"https://github.com/settings/tokens",target:"_blank",rel:"noopener noreferrer"},A=e("code",null,"personal access token",-1),O=c("
  • scmproxy服务启动失败
  • scmproxy所在的机器/容器因为网络问题无法访问对应的代码库
  • scmproxy所在的机器git版本较低,出现unknown option `local` 错误
  • ",3),F=c(`

    3.3.2 代码库登记成功后,开启第一次代码分析时,出现代码库及账号不匹配

    该错误出现可能有以下几个原因:

    1. 代码仓库地址不支持https访问,但分析时请求的https访问

    3.4 查看问题文件提示获取代码信息耗时较久,请稍后再试

    出现该提示的原因是,代码库偏大或clone代码库时间较长,可以稍等一会再刷新重试

    3.5 客户端访问文件服务器,提示method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)

    出现这种错误,可能是本地配置异常或token配置有问题,检查方式如下:

    1. 检查客户端的config.ini文件配置的URL是否为当前Server部署的地址:(xxx需要调整为实际的路径)

      [SERVER_URL]
      +URL=http://xxx/server/main/
      +[FILE_SERVER]
      +URL=http:/xxx/server/files/
      +

      如果xxx不一致需要调整为一致

      注: xxx地址与在浏览器访问平台的xxx地址是一致的,不需要区分端口

    2. 检查客户端访问Server是否能通:

      curl -v http://xxx/server/main/
      +

      如果不通,则需要检查客户端机器访问Server机器是否有网络限制

    3. 检查当前在codedog.ini-[config]tokenconfig.ini文件配置的[FILE_SERVER]TOKEN是否一致,如果不一致需要调整为一致

    4. 检查用户CodeDogToken是否被刷新了然后没有更新到配置文件中

    3.6 客户端访问文件服务器,提示Connection timed out

    本地客户端执行过程提示method (upload file) call fails on error: <urlopen error [Errno 110] Connection timed out> 该如何处理? 一般情况下,这个问题是客户端与Server之间网络不通导致,可以检查一下是否有防火墙限制或者配置的URL是内部IP或地址,可以通过以下方式检查

    1. 检查客户端的config.ini文件配置的URL是否为当前Server部署的地址:(xxx需要调整为实际的路径)

      [SERVER_URL]
      +URL=http://xxx/server/main/
      +[FILE_SERVER]
      +URL=http:/xxx/server/files/
      +
    2. 检查客户端访问Server是否能通:

      curl -v http://xxx/server/main/
      +

      如果不通,则需要检查客户端机器访问Server机器是否有网络限制

    3.7 任务执行结果异常,提示第三方依赖文件服务器异常

    出现该错误提示,一般是访问文件器出错或文件服务器本身有问题,可以通过以下方式检查: 需要检查analysis-worker的日志(本地部署:server/projects/analysis/log/celery.log,docker-compose部署:docker-compose exec analysis-worker /bin/bash进入容器后访问log/celery.log查看具体错误原因

    如果提示no route to host可能是当前机器/容器无法访问当前宿主机的IP,可以检查一下当前防火墙的设置,是否限制了analysis-worker来源的访问

    3.8 客户端执行时提示工具(xxx)扫描进程为空,请联系管理员配置工具进程!

    出现该错误提示,一般是Server未进行初始化,可以通过执行以下命令初始化后再启动测试

    CodeAnalysis仓库文件问题

    1. clone到本地时相关md文件内资源图片无法显示

    为防止国内用户访问CodeAnalysis Github首页时图片资源加载失败,目前各个md文件中的图片资源引用地址调整增加了URL前缀https://tencent.github.io/CodeAnalysis/

    用户下载代码库到本地后,发现无法访问资源文件时,请检查本地网络是否能够连通外网,如果无法连通外网,可以在文档引入资源地址中进行相对路径替换,调整各个资源文件的链接。

    `,22);function U(P,I){const r=a("RouterLink"),n=a("router-link"),d=a("ExternalLinkIcon");return t(),p("div",null,[h,e("div",m,[v,b,e("p",null,[o("如果您遇到任何未在此处列出的部署或使用问题,请在 GitHub issue 系统中进行搜索。如果仍未找到该错误消息,您可以通过"),i(r,{to:"/zh/community/joingroup.html"},{default:l(()=>[o("社区")]),_:1}),o("提出问题,获得帮助。")])]),e("nav",g,[e("ul",null,[e("li",null,[i(n,{to:"#server常见问题与处理方法"},{default:l(()=>[o("Server常见问题与处理方法")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_1-环境部署"},{default:l(()=>[o("1. 环境部署")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_1-1-pypi下载超时或失败"},{default:l(()=>[o("1.1 pypi下载超时或失败")]),_:1})]),e("li",null,[i(n,{to:"#_1-2-docker未安装或版本过低"},{default:l(()=>[o("1.2 Docker未安装或版本过低")]),_:1})]),e("li",null,[i(n,{to:"#_1-3-docker-compose启动失败"},{default:l(()=>[o("1.3 Docker-Compose启动失败")]),_:1})]),e("li",null,[i(n,{to:"#_1-4-docker镜像源下载超时或失败"},{default:l(()=>[o("1.4 Docker镜像源下载超时或失败")]),_:1})]),e("li",null,[i(n,{to:"#_1-5-python安装或执行失败"},{default:l(()=>[o("1.5 Python安装或执行失败")]),_:1})]),e("li",null,[i(n,{to:"#_1-6-执行compose-init-sh脚本的pip-install提示sha256不匹配错误"},{default:l(()=>[o("1.6 执行compose_init.sh脚本的pip install提示sha256不匹配错误")]),_:1})]),e("li",null,[i(n,{to:"#_1-7-macbook-m1-使用-docker-compose报错"},{default:l(()=>[o("1.7 MacBook M1 使用 Docker-Compose报错")]),_:1})]),e("li",null,[i(n,{to:"#_1-8-celery、gunicorn命令找不到"},{default:l(()=>[o("1.8 celery、gunicorn命令找不到")]),_:1})]),e("li",null,[i(n,{to:"#_1-9-脚本安装过程报错-出现格式问题"},{default:l(()=>[o("1.9 脚本安装过程报错,出现格式问题")]),_:1})])])]),e("li",null,[i(n,{to:"#_2-服务启动与初始化"},{default:l(()=>[o("2. 服务启动与初始化")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_2-1-服务占用端口异常"},{default:l(()=>[o("2.1 服务占用端口异常")]),_:1})]),e("li",null,[i(n,{to:"#_2-2-服务输出日志找不到"},{default:l(()=>[o("2.2 服务输出日志找不到")]),_:1})]),e("li",null,[i(n,{to:"#_2-3-服务启动失败"},{default:l(()=>[o("2.3 服务启动失败")]),_:1})])])]),e("li",null,[i(n,{to:"#_3-平台使用"},{default:l(()=>[o("3. 平台使用")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_3-1-平台登录的默认账号密码是什么"},{default:l(()=>[o("3.1 平台登录的默认账号密码是什么?")]),_:1})]),e("li",null,[i(n,{to:"#_3-2-平台默认的api-token是什么"},{default:l(()=>[o("3.2 平台默认的API Token是什么?")]),_:1})]),e("li",null,[i(n,{to:"#_3-3-代码库登记出错-出现代码库及账号不匹配"},{default:l(()=>[o("3.3 代码库登记出错,出现代码库及账号不匹配")]),_:1})]),e("li",null,[i(n,{to:"#_3-3-2-代码库登记成功后-开启第一次代码分析时-出现代码库及账号不匹配"},{default:l(()=>[o("3.3.2 代码库登记成功后,开启第一次代码分析时,出现代码库及账号不匹配")]),_:1})]),e("li",null,[i(n,{to:"#_3-4-查看问题文件提示获取代码信息耗时较久-请稍后再试"},{default:l(()=>[o("3.4 查看问题文件提示获取代码信息耗时较久,请稍后再试")]),_:1})]),e("li",null,[i(n,{to:"#_3-5-客户端访问文件服务器-提示method-upload-file-call-fails-on-error-expecting-value-line-1-column-1-char-0"},{default:l(()=>[o("3.5 客户端访问文件服务器,提示method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)")]),_:1})]),e("li",null,[i(n,{to:"#_3-6-客户端访问文件服务器-提示connection-timed-out"},{default:l(()=>[o("3.6 客户端访问文件服务器,提示Connection timed out")]),_:1})]),e("li",null,[i(n,{to:"#_3-7-任务执行结果异常-提示第三方依赖文件服务器异常"},{default:l(()=>[o("3.7 任务执行结果异常,提示第三方依赖文件服务器异常")]),_:1})]),e("li",null,[i(n,{to:"#_3-8-客户端执行时提示工具-xxx-扫描进程为空-请联系管理员配置工具进程"},{default:l(()=>[o("3.8 客户端执行时提示工具(xxx)扫描进程为空,请联系管理员配置工具进程!")]),_:1})])])])])]),e("li",null,[i(n,{to:"#codeanalysis仓库文件问题"},{default:l(()=>[o("CodeAnalysis仓库文件问题")]),_:1}),e("ul",null,[e("li",null,[i(n,{to:"#_1-clone到本地时相关md文件内资源图片无法显示"},{default:l(()=>[o("1. clone到本地时相关md文件内资源图片无法显示")]),_:1})])])])])]),_,e("ul",null,[e("li",null,[e("a",f,[o("Compose文件版本与对应的Docker版本说明文档"),i(d)])]),e("li",null,[e("a",x,[o("CentOS安装Docker官方文档"),i(d)])]),e("li",null,[e("a",y,[o("Ubuntu安装Docker文档"),i(d)])])]),k,e("ul",null,[e("li",null,[e("a",E,[o("Docker-Compose官方安装文档"),i(d)])]),e("li",null,[e("a",R,[o("Docker-ComposeV2官方安装文档"),i(d)])])]),C,e("ul",null,[e("li",null,[e("a",L,[o("CentOS安装Python3.7文档"),i(d)])]),e("li",null,[e("a",S,[o("Ubuntu安装Python3.7文档"),i(d)])])]),T,e("ol",null,[D,e("li",null,[o("登记"),j,o("使用的密码需要使用"),e("a",N,[A,i(d)])]),O]),F])}const w=s(u,[["render",U],["__file","FAQ.html.vue"]]);export{w as default}; diff --git a/assets/FAQ.html-da55be4f.js b/assets/FAQ.html-da55be4f.js new file mode 100644 index 000000000..91cfc3f53 --- /dev/null +++ b/assets/FAQ.html-da55be4f.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-1d94bd54","path":"/zh/quickStarted/FAQ.html","title":"FAQ","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"Server常见问题与处理方法","slug":"server常见问题与处理方法","link":"#server常见问题与处理方法","children":[{"level":3,"title":"1. 环境部署","slug":"_1-环境部署","link":"#_1-环境部署","children":[]},{"level":3,"title":"2. 服务启动与初始化","slug":"_2-服务启动与初始化","link":"#_2-服务启动与初始化","children":[]},{"level":3,"title":"3. 平台使用","slug":"_3-平台使用","link":"#_3-平台使用","children":[]}]},{"level":2,"title":"CodeAnalysis仓库文件问题","slug":"codeanalysis仓库文件问题","link":"#codeanalysis仓库文件问题","children":[{"level":3,"title":"1. clone到本地时相关md文件内资源图片无法显示","slug":"_1-clone到本地时相关md文件内资源图片无法显示","link":"#_1-clone到本地时相关md文件内资源图片无法显示","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/FAQ.md"}');export{e as data}; diff --git a/assets/Fork-95d411e9.png b/assets/Fork-95d411e9.png new file mode 100644 index 000000000..99895e1b4 Binary files /dev/null and b/assets/Fork-95d411e9.png differ diff --git a/assets/Jenkins_Plugin.html-6d1bdd5f.js b/assets/Jenkins_Plugin.html-6d1bdd5f.js new file mode 100644 index 000000000..85c3d2ed2 --- /dev/null +++ b/assets/Jenkins_Plugin.html-6d1bdd5f.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-7fa74610","path":"/zh/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin.html","title":"Jenkins插件使用说明","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用前准备","slug":"使用前准备","link":"#使用前准备","children":[{"level":3,"title":"获取Jenkins插件","slug":"获取jenkins插件","link":"#获取jenkins插件","children":[]},{"level":3,"title":"在Jenkins安装插件","slug":"在jenkins安装插件","link":"#在jenkins安装插件","children":[]},{"level":3,"title":"完善启动客户端的环境","slug":"完善启动客户端的环境","link":"#完善启动客户端的环境","children":[]}]},{"level":2,"title":"使用插件","slug":"使用插件","link":"#使用插件","children":[{"level":3,"title":"在 TCA 创建团队和项目","slug":"在-tca-创建团队和项目","link":"#在-tca-创建团队和项目","children":[]},{"level":3,"title":"配置Jenkins环境变量","slug":"配置jenkins环境变量","link":"#配置jenkins环境变量","children":[]},{"level":3,"title":"配置 TCA 插件","slug":"配置-tca-插件","link":"#配置-tca-插件","children":[]},{"level":3,"title":"启动构建并查看结果","slug":"启动构建并查看结果","link":"#启动构建并查看结果","children":[]}]},{"level":2,"title":"设置质量门禁","slug":"设置质量门禁","link":"#设置质量门禁","children":[{"level":3,"title":"可视化界面使用质量门禁","slug":"可视化界面使用质量门禁","link":"#可视化界面使用质量门禁","children":[]},{"level":3,"title":"pipeline脚本使用质量门禁","slug":"pipeline脚本使用质量门禁","link":"#pipeline脚本使用质量门禁","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/插件/Jenkins_Plugin.md"}');export{l as data}; diff --git a/assets/Jenkins_Plugin.html-9a064624.js b/assets/Jenkins_Plugin.html-9a064624.js new file mode 100644 index 000000000..950391b79 --- /dev/null +++ b/assets/Jenkins_Plugin.html-9a064624.js @@ -0,0 +1,41 @@ +import{_ as d,a as c,b as r,c as t,d as l,e as o,f as h,g as p,h as u,i as m,j as b,k as v,l as g}from"./jenkins_shell-131e349c.js";import{_,r as x,o as A,c as f,a,b as e,d as s,e as i}from"./app-2a91d8ab.js";const C={},k=i('

    Jenkins插件使用说明

    提示

    以下说明以 Jenkins 2.361.2 版本为例。

    使用前准备

    获取Jenkins插件

    Jenkins插件有以下两种获取方式:

    方式一:在 TCA 源码的plugin/jenkins_plugin目录下,执行命令mvn package -DskipTests,打包完成后进入target目录会看到tca_jenkins_plugin.hpi 的安装包。

    ',6),T=a("strong",null,"方式二",-1),y=a("code",null,"jenkins_plugin.hpi",-1),I={href:"https://github.com/Tencent/CodeAnalysis/releases",target:"_blank",rel:"noopener noreferrer"},j=i('

    在Jenkins安装插件

    在Jenkins中通过【Manage Plugin】-> 【Advanced】->【Deploy plugin】的方式选择 Jenkins_plugin.hpi文件上传安装,并重启Jenkins。

    最终在【Installed】里搜索出【TCA】代表插件安装成功。

    完善启动客户端的环境

    在CodeAnalysis目录下执行代码

    bash ./scripts/base/install_bin.sh
    +

    client目录下的config.ini文件中的<Server IP地址>替换为部署的开源版TCA的IP地址(可包含端口号)

    使用插件

    在 TCA 创建团队和项目

    如已创建后待使用的团队和项目,可跳过此步。

    进入已部署好的TCA页面,点击【创建团队】,成功后【创建项目】。

    配置Jenkins环境变量

    进入Jenkins设置界面,在【Manage Jenkins】->【Configure System】->【Global properties】中添加环境变量:
    Name:PYTHONPATH Value:xxxx(路径不包含python3)
    Value:GITPATH Value:xxxx(路径不包含git)

    配置 TCA 插件

    方式一:可视化界面配置 TCA 插件

    创建一个构建任务,配置代码库信息,进入Jenkins,通过【New Item】创建一个空白任务,在任务配置中【Source Code Management】配置待分析的代码库地址和凭证。
    Repository URL: 填入远端仓库地址
    Credentials: 添加仓库的用户名和密码作为凭证,如果是公开仓库,可以不设置仓库凭证

    在构建任务的【Build】中选择【TCA】插件并配置以下参数:

    CodeAnalysis目录绝对路径: 拉取到本地的CodeAnalysis开源仓库目录的绝对路径(例如:/data/CodeAnalysis/)
    团队ID: 在 TCA 中创建的团队的标识ID,可在TCA【团队概览】中获取“团队唯一标识”
    项目名称: 在 TCA 中创建的项目的标识ID,可在TCA【项目概览】中获取“项目唯一标识”
    Token: 在 TCA 的【个人中心】->【个人令牌】中获取
    分支名称: 需要扫描的代码分支名称
    语言类别: 项目需要扫描的语言
    分析方案模板ID: 需要使用的分析方案模板ID,在分析方案模板的“基础属性”中获取,将根据此模板创建分析方案(选填)
    分析方案名称: 指定创建出来的分析方案的名称(选填)
    全量扫描: 不勾选默认启动增量扫描
    质量门禁: 设置质量门禁值,配置和使用参考 设置质量门禁

    配置完成后点击【Save】保存。

    方式二:pipeline语法配置 TCA 插件

    ',23),q={href:"https://github.com/Tencent/CodeAnalysis/issues/1150",target:"_blank",rel:"noopener noreferrer"},J=i(`
    pipeline{
    +  agent any
    +
    +    stages{
    +      stage('Build'){
    +        steps{
    +            TCA(codeAnalysisPath: '/data/CodeAnalysis/', teamId: 'xxxx', projectName: 'demo', token: 'xxxxxxxxxxxx', branchName: 'master', languageType: 'Java', refSchemeID: '1', scanPlan: 'model', threshold: '90', total:true)
    +        }
    +      }
    +    }
    +}
    +
    +

    codeAnalysisPath: 拉取到本地的CodeAnalysis开源仓库目录的绝对路径(例如:/data/CodeAnalysis/)
    teamId:团队ID
    projectName: 项目名称
    token: 在 TCA 的【个人中心】->【个人令牌】中获取
    branchName: 需要扫描的代码分支名称
    languageType: 项目需要扫描的语言
    refSchemeID: 需要使用的分析方案模板ID,在分析方案模板的“基础属性”中获取,将根据此模板创建分析方案(选填)
    scanPlan: 指定创建出来的分析方案的名称(选填)
    threshold: 设置质量门禁值
    total: 是否全量扫描,填ture为全量扫描,不填或填false为增量扫描

    启动构建并查看结果

    点击【Build Now】启动构建。
    进入构建任务,在【Console Output】中查看执行过程。
    执行完成后,可在下方看到代码分析的结果链接,也可在【代码分析报告】中获取代码分析的json报告。

    设置质量门禁

    在上述 TCA 插件配置部分填写质量门禁参数,需要填写一个整数,即当前分支的扫描问题量大于该质量门禁值时,判断为不通过;否则为通过。完成后会将TCA结果状态(success|failure)输出到工作空间下的tca_threshold.txt文件中,供后续步骤判断和终止流水线。

    可视化界面使用质量门禁

    在TCA插件后增加shell命令步骤,输入以下脚本内容:

    tca_status=\`cat tca_threshold.txt\`
    +if [ "\${tca_status}" == "success" ]; then
    +  echo ">> tca scan pass!"
    +else
    +  echo ">> tca scan fail! exit code 255"
    +  exit 255
    +fi
    +

    当质量门禁不通过时,会终止流水线(退出码:255)。

    pipeline脚本使用质量门禁

    以下是pipeline脚本使用质量门禁进行相应操作的示例,你可以在if和else部分写入你想要运行的脚本

    pipeline{
    +  agent any
    +
    +    stages{
    +      stage('Build'){
    +        steps{
    +            TCA(codeAnalysisPath: '/data/CodeAnalysis/', teamId: 'xxxx', projectName: 'demo', token: 'xxxxxxxxxxxx', branchName: 'master', languageType: 'Java', refSchemeID: '1', scanPlan: 'model', threshold: '90', total:true)
    +            script{
    +                def tca_status = readFile('tca_threshold.txt')
    +                if (tca_status == "success") {
    +                    echo ">> tca scan pass!"
    +                } else {
    +                    echo ">> tca scan fail! exit code 255"
    +                    error("TCA scan failed. Terminating pipeline.")
    +                }
    +            }
    +        }
    +      }
    +    }
    +}
    +
    `,14);function N(P,D){const n=x("ExternalLinkIcon");return A(),f("div",null,[k,a("p",null,[T,e(":从TCA release 安装包中,获取"),y,e(":"),a("a",I,[e("https://github.com/Tencent/CodeAnalysis/releases"),s(n)]),e("。")]),j,a("p",null,[e("在步骤中添加TCA插件参数配置语句,下面的配置语句可作为参考;注意:如果是release版本v1.11.0及之前的老版本(包含源代码构建生成和release获取)插件,语法参数略有差别,请参考"),a("a",q,[e("issue1150"),s(n)])]),J])}const S=_(C,[["render",N],["__file","Jenkins_Plugin.html.vue"]]);export{S as default}; diff --git a/assets/Jenkins_Plugin.html-c5bed20a.js b/assets/Jenkins_Plugin.html-c5bed20a.js new file mode 100644 index 000000000..1d6a88fa4 --- /dev/null +++ b/assets/Jenkins_Plugin.html-c5bed20a.js @@ -0,0 +1,41 @@ +import{_ as d,a as c,b as r,c as t,d as l,e as o,f as h,g as p,h as u,i as m,j as b,k as v,l as g}from"./jenkins_shell-131e349c.js";import{_,r as x,o as A,c as f,a,b as e,d as s,e as i}from"./app-2a91d8ab.js";const C={},k=i('

    Jenkins插件使用说明

    TIP

    以下说明以 Jenkins 2.361.2 版本为例。

    使用前准备

    获取Jenkins插件

    Jenkins插件有以下两种获取方式:

    方式一:在 TCA 源码的plugin/jenkins_plugin目录下,执行命令mvn package -DskipTests,打包完成后进入target目录会看到tca_jenkins_plugin.hpi 的安装包。

    ',6),T=a("strong",null,"方式二",-1),y=a("code",null,"jenkins_plugin.hpi",-1),I={href:"https://github.com/Tencent/CodeAnalysis/releases",target:"_blank",rel:"noopener noreferrer"},j=i('

    在Jenkins安装插件

    在Jenkins中通过【Manage Plugin】-> 【Advanced】->【Deploy plugin】的方式选择 Jenkins_plugin.hpi文件上传安装,并重启Jenkins。

    最终在【Installed】里搜索出【TCA】代表插件安装成功。

    完善启动客户端的环境

    在CodeAnalysis目录下执行代码

    bash ./scripts/base/install_bin.sh
    +

    client目录下的config.ini文件中的<Server IP地址>替换为部署的开源版TCA的IP地址(可包含端口号)

    使用插件

    在 TCA 创建团队和项目

    如已创建后待使用的团队和项目,可跳过此步。

    进入已部署好的TCA页面,点击【创建团队】,成功后【创建项目】。

    配置Jenkins环境变量

    进入Jenkins设置界面,在【Manage Jenkins】->【Configure System】->【Global properties】中添加环境变量:
    Name:PYTHONPATH Value:xxxx(路径不包含python3)
    Value:GITPATH Value:xxxx(路径不包含git)

    配置 TCA 插件

    方式一:可视化界面配置 TCA 插件

    创建一个构建任务,配置代码库信息,进入Jenkins,通过【New Item】创建一个空白任务,在任务配置中【Source Code Management】配置待分析的代码库地址和凭证。
    Repository URL: 填入远端仓库地址
    Credentials: 添加仓库的用户名和密码作为凭证,如果是公开仓库,可以不设置仓库凭证

    在构建任务的【Build】中选择【TCA】插件并配置以下参数:

    CodeAnalysis目录绝对路径: 拉取到本地的CodeAnalysis开源仓库目录的绝对路径(例如:/data/CodeAnalysis/)
    团队ID: 在 TCA 中创建的团队的标识ID,可在TCA【团队概览】中获取“团队唯一标识”
    项目名称: 在 TCA 中创建的项目的标识ID,可在TCA【项目概览】中获取“项目唯一标识”
    Token: 在 TCA 的【个人中心】->【个人令牌】中获取
    分支名称: 需要扫描的代码分支名称
    语言类别: 项目需要扫描的语言
    分析方案模板ID: 需要使用的分析方案模板ID,在分析方案模板的“基础属性”中获取,将根据此模板创建分析方案(选填)
    分析方案名称: 指定创建出来的分析方案的名称(选填)
    全量扫描: 不勾选默认启动增量扫描
    质量门禁: 设置质量门禁值,配置和使用参考 设置质量门禁

    配置完成后点击【Save】保存。

    方式二:pipeline语法配置 TCA 插件

    ',23),q={href:"https://github.com/Tencent/CodeAnalysis/issues/1150",target:"_blank",rel:"noopener noreferrer"},J=i(`
    pipeline{
    +  agent any
    +
    +    stages{
    +      stage('Build'){
    +        steps{
    +            TCA(codeAnalysisPath: '/data/CodeAnalysis/', teamId: 'xxxx', projectName: 'demo', token: 'xxxxxxxxxxxx', branchName: 'master', languageType: 'Java', refSchemeID: '1', scanPlan: 'model', threshold: '90', total:true)
    +        }
    +      }
    +    }
    +}
    +
    +

    codeAnalysisPath: 拉取到本地的CodeAnalysis开源仓库目录的绝对路径(例如:/data/CodeAnalysis/)
    teamId:团队ID
    projectName: 项目名称
    token: 在 TCA 的【个人中心】->【个人令牌】中获取
    branchName: 需要扫描的代码分支名称
    languageType: 项目需要扫描的语言
    refSchemeID: 需要使用的分析方案模板ID,在分析方案模板的“基础属性”中获取,将根据此模板创建分析方案(选填)
    scanPlan: 指定创建出来的分析方案的名称(选填)
    threshold: 设置质量门禁值
    total: 是否全量扫描,填ture为全量扫描,不填或填false为增量扫描

    启动构建并查看结果

    点击【Build Now】启动构建。
    进入构建任务,在【Console Output】中查看执行过程。
    执行完成后,可在下方看到代码分析的结果链接,也可在【代码分析报告】中获取代码分析的json报告。

    设置质量门禁

    在上述 TCA 插件配置部分填写质量门禁参数,需要填写一个整数,即当前分支的扫描问题量大于该质量门禁值时,判断为不通过;否则为通过。完成后会将TCA结果状态(success|failure)输出到工作空间下的tca_threshold.txt文件中,供后续步骤判断和终止流水线。

    可视化界面使用质量门禁

    在TCA插件后增加shell命令步骤,输入以下脚本内容:

    tca_status=\`cat tca_threshold.txt\`
    +if [ "\${tca_status}" == "success" ]; then
    +  echo ">> tca scan pass!"
    +else
    +  echo ">> tca scan fail! exit code 255"
    +  exit 255
    +fi
    +

    当质量门禁不通过时,会终止流水线(退出码:255)。

    pipeline脚本使用质量门禁

    以下是pipeline脚本使用质量门禁进行相应操作的示例,你可以在if和else部分写入你想要运行的脚本

    pipeline{
    +  agent any
    +
    +    stages{
    +      stage('Build'){
    +        steps{
    +            TCA(codeAnalysisPath: '/data/CodeAnalysis/', teamId: 'xxxx', projectName: 'demo', token: 'xxxxxxxxxxxx', branchName: 'master', languageType: 'Java', refSchemeID: '1', scanPlan: 'model', threshold: '90', total:true)
    +            script{
    +                def tca_status = readFile('tca_threshold.txt')
    +                if (tca_status == "success") {
    +                    echo ">> tca scan pass!"
    +                } else {
    +                    echo ">> tca scan fail! exit code 255"
    +                    error("TCA scan failed. Terminating pipeline.")
    +                }
    +            }
    +        }
    +      }
    +    }
    +}
    +
    `,14);function P(N,D){const n=x("ExternalLinkIcon");return A(),f("div",null,[k,a("p",null,[T,e(":从TCA release 安装包中,获取"),y,e(":"),a("a",I,[e("https://github.com/Tencent/CodeAnalysis/releases"),s(n)]),e("。")]),j,a("p",null,[e("在步骤中添加TCA插件参数配置语句,下面的配置语句可作为参考;注意:如果是release版本v1.11.0及之前的老版本(包含源代码构建生成和release获取)插件,语法参数略有差别,请参考"),a("a",q,[e("issue1150"),s(n)])]),J])}const S=_(C,[["render",P],["__file","Jenkins_Plugin.html.vue"]]);export{S as default}; diff --git a/assets/Jenkins_Plugin.html-d89ff0ac.js b/assets/Jenkins_Plugin.html-d89ff0ac.js new file mode 100644 index 000000000..c7dcb654c --- /dev/null +++ b/assets/Jenkins_Plugin.html-d89ff0ac.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-356f7475","path":"/en/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin.html","title":"Jenkins插件使用说明","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"使用前准备","slug":"使用前准备","link":"#使用前准备","children":[{"level":3,"title":"获取Jenkins插件","slug":"获取jenkins插件","link":"#获取jenkins插件","children":[]},{"level":3,"title":"在Jenkins安装插件","slug":"在jenkins安装插件","link":"#在jenkins安装插件","children":[]},{"level":3,"title":"完善启动客户端的环境","slug":"完善启动客户端的环境","link":"#完善启动客户端的环境","children":[]}]},{"level":2,"title":"使用插件","slug":"使用插件","link":"#使用插件","children":[{"level":3,"title":"在 TCA 创建团队和项目","slug":"在-tca-创建团队和项目","link":"#在-tca-创建团队和项目","children":[]},{"level":3,"title":"配置Jenkins环境变量","slug":"配置jenkins环境变量","link":"#配置jenkins环境变量","children":[]},{"level":3,"title":"配置 TCA 插件","slug":"配置-tca-插件","link":"#配置-tca-插件","children":[]},{"level":3,"title":"启动构建并查看结果","slug":"启动构建并查看结果","link":"#启动构建并查看结果","children":[]}]},{"level":2,"title":"设置质量门禁","slug":"设置质量门禁","link":"#设置质量门禁","children":[{"level":3,"title":"可视化界面使用质量门禁","slug":"可视化界面使用质量门禁","link":"#可视化界面使用质量门禁","children":[]},{"level":3,"title":"pipeline脚本使用质量门禁","slug":"pipeline脚本使用质量门禁","link":"#pipeline脚本使用质量门禁","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/插件/Jenkins_Plugin.md"}');export{e as data}; diff --git a/assets/NewPullRequest-be23e5af.png b/assets/NewPullRequest-be23e5af.png new file mode 100644 index 000000000..ad6b12ebb Binary files /dev/null and b/assets/NewPullRequest-be23e5af.png differ diff --git a/assets/Nodemanagement-f5415093.png b/assets/Nodemanagement-f5415093.png new file mode 100644 index 000000000..dd566582e Binary files /dev/null and b/assets/Nodemanagement-f5415093.png differ diff --git "a/assets/OAuth\347\256\241\347\220\206.html-1bfab8bb.js" "b/assets/OAuth\347\256\241\347\220\206.html-1bfab8bb.js" new file mode 100644 index 000000000..64daf4eed --- /dev/null +++ "b/assets/OAuth\347\256\241\347\220\206.html-1bfab8bb.js" @@ -0,0 +1 @@ +import{_ as l,a as r}from"./manage_oauth_02-fc66f681.js";import{_ as a,r as s,o as i,c,a as t,b as e,d as n}from"./app-2a91d8ab.js";const h={},u=t("h1",{id:"oauth管理",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#oauth管理","aria-hidden":"true"},"#"),e(" OAuth管理")],-1),_=t("li",null,[t("p",null,[e("可"),t("strong",null,"创建"),e("、"),t("strong",null,"编辑"),e("、"),t("strong",null,"清除"),e("主流代码托管平台的Oauth应用配置,为使用者提供OAuth授权支持。")])],-1),p=t("p",null,"支持平台及如何创建OAuth应用:",-1),d={href:"https://code.tencent.com/help/oauth2/",target:"_blank",rel:"noopener noreferrer"},m={href:"https://docs.github.com/cn/developers/apps/building-oauth-apps/creating-an-oauth-app",target:"_blank",rel:"noopener noreferrer"},f={href:"https://gitee.com/api/v5/oauth_doc#/list-item-3",target:"_blank",rel:"noopener noreferrer"},g={href:"https://docs.gitlab.com/ee/integration/oauth_provider.html",target:"_blank",rel:"noopener noreferrer"},A=t("p",null,[t("img",{src:l,alt:"OAuth管理"})],-1),O=t("p",null,[t("img",{src:r,alt:"OAuth管理"})],-1),b=t("div",{class:"custom-container tip"},[t("p",{class:"custom-container-title"},"提示"),t("p",null,"配置OAuth应用时,回调地址栏需填入当前TCA平台配置的域名或IP地址(如当前页面非80端口,需要显式指定端口号),作为Git平台上OAuth应用的回调地址。")],-1);function k(v,x){const o=s("ExternalLinkIcon");return i(),c("div",null,[u,t("ul",null,[_,t("li",null,[p,t("ul",null,[t("li",null,[e("腾讯工蜂:"),t("a",d,[e("创建 OAuth 应用程序"),n(o)])]),t("li",null,[e("GitHub:"),t("a",m,[e("创建 OAuth 应用程序"),n(o)])]),t("li",null,[e("Gitee:"),t("a",f,[e("创建 OAuth 应用程序"),n(o)])]),t("li",null,[e("GitLab:"),t("a",g,[e("创建 OAuth 应用程序"),n(o)])])])])]),A,O,b])}const E=a(h,[["render",k],["__file","OAuth管理.html.vue"]]);export{E as default}; diff --git "a/assets/OAuth\347\256\241\347\220\206.html-5142cdcf.js" "b/assets/OAuth\347\256\241\347\220\206.html-5142cdcf.js" new file mode 100644 index 000000000..0e2e1fbef --- /dev/null +++ "b/assets/OAuth\347\256\241\347\220\206.html-5142cdcf.js" @@ -0,0 +1 @@ +import{_ as l,a as r}from"./manage_oauth_02-fc66f681.js";import{_ as a,r as s,o as i,c,a as t,b as e,d as n}from"./app-2a91d8ab.js";const h={},u=t("h1",{id:"oauth管理",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#oauth管理","aria-hidden":"true"},"#"),e(" OAuth管理")],-1),_=t("li",null,[t("p",null,[e("可"),t("strong",null,"创建"),e("、"),t("strong",null,"编辑"),e("、"),t("strong",null,"清除"),e("主流代码托管平台的Oauth应用配置,为使用者提供OAuth授权支持。")])],-1),p=t("p",null,"支持平台及如何创建OAuth应用:",-1),d={href:"https://code.tencent.com/help/oauth2/",target:"_blank",rel:"noopener noreferrer"},m={href:"https://docs.github.com/cn/developers/apps/building-oauth-apps/creating-an-oauth-app",target:"_blank",rel:"noopener noreferrer"},f={href:"https://gitee.com/api/v5/oauth_doc#/list-item-3",target:"_blank",rel:"noopener noreferrer"},g={href:"https://docs.gitlab.com/ee/integration/oauth_provider.html",target:"_blank",rel:"noopener noreferrer"},A=t("p",null,[t("img",{src:l,alt:"OAuth管理"})],-1),O=t("p",null,[t("img",{src:r,alt:"OAuth管理"})],-1),b=t("div",{class:"custom-container tip"},[t("p",{class:"custom-container-title"},"TIP"),t("p",null,"配置OAuth应用时,回调地址栏需填入当前TCA平台配置的域名或IP地址(如当前页面非80端口,需要显式指定端口号),作为Git平台上OAuth应用的回调地址。")],-1);function k(v,x){const o=s("ExternalLinkIcon");return i(),c("div",null,[u,t("ul",null,[_,t("li",null,[p,t("ul",null,[t("li",null,[e("腾讯工蜂:"),t("a",d,[e("创建 OAuth 应用程序"),n(o)])]),t("li",null,[e("GitHub:"),t("a",m,[e("创建 OAuth 应用程序"),n(o)])]),t("li",null,[e("Gitee:"),t("a",f,[e("创建 OAuth 应用程序"),n(o)])]),t("li",null,[e("GitLab:"),t("a",g,[e("创建 OAuth 应用程序"),n(o)])])])])]),A,O,b])}const B=a(h,[["render",k],["__file","OAuth管理.html.vue"]]);export{B as default}; diff --git "a/assets/OAuth\347\256\241\347\220\206.html-d1cc69ce.js" "b/assets/OAuth\347\256\241\347\220\206.html-d1cc69ce.js" new file mode 100644 index 000000000..acf8d34a3 --- /dev/null +++ "b/assets/OAuth\347\256\241\347\220\206.html-d1cc69ce.js" @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-01483471","path":"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86.html","title":"OAuth管理","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/后台管理/OAuth管理.md"}');export{t as data}; diff --git "a/assets/OAuth\347\256\241\347\220\206.html-f4f4e374.js" "b/assets/OAuth\347\256\241\347\220\206.html-f4f4e374.js" new file mode 100644 index 000000000..c4dba3e91 --- /dev/null +++ "b/assets/OAuth\347\256\241\347\220\206.html-f4f4e374.js" @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-fb758c14","path":"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86.html","title":"OAuth管理","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/后台管理/OAuth管理.md"}');export{t as data}; diff --git a/assets/PR-0dfd4e5a.png b/assets/PR-0dfd4e5a.png new file mode 100644 index 000000000..5321bc135 Binary files /dev/null and b/assets/PR-0dfd4e5a.png differ diff --git a/assets/PR-48d0e900.js b/assets/PR-48d0e900.js new file mode 100644 index 000000000..7fb15b59b --- /dev/null +++ b/assets/PR-48d0e900.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/Welcome-e497e1a9.png",e="/CodeAnalysis/assets/Fork-95d411e9.png",a="/CodeAnalysis/assets/fork1-f2dae6f2.png",o="/CodeAnalysis/assets/NewPullRequest-be23e5af.png",t="/CodeAnalysis/assets/PR-0dfd4e5a.png";export{s as _,e as a,a as b,o as c,t as d}; diff --git a/assets/ProcessConfiguration2-b0d699f7.png b/assets/ProcessConfiguration2-b0d699f7.png new file mode 100644 index 000000000..0b283f7d9 Binary files /dev/null and b/assets/ProcessConfiguration2-b0d699f7.png differ diff --git a/assets/ProcessConfiguration2-c60284cc.js b/assets/ProcessConfiguration2-c60284cc.js new file mode 100644 index 000000000..d68d39e12 --- /dev/null +++ b/assets/ProcessConfiguration2-c60284cc.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/Nodemanagement-f5415093.png",o="/CodeAnalysis/assets/ProcessConfiguration2-b0d699f7.png";export{s as _,o as a}; diff --git a/assets/ScriptAPI_guide.html-a6789fea.js b/assets/ScriptAPI_guide.html-a6789fea.js new file mode 100644 index 000000000..540938947 --- /dev/null +++ b/assets/ScriptAPI_guide.html-a6789fea.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-55b96640","path":"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/ScriptAPI_guide.html","title":"API调用脚本使用指引","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"操作步骤","slug":"操作步骤","link":"#操作步骤","children":[]},{"level":2,"title":"方法总览","slug":"方法总览","link":"#方法总览","children":[]},{"level":2,"title":"API详细信息","slug":"api详细信息","link":"#api详细信息","children":[{"level":3,"title":"一、创建代码库","slug":"一、创建代码库","link":"#一、创建代码库","children":[]},{"level":3,"title":"二、设置指定代码库的指定方案的代码度量配置","slug":"二、设置指定代码库的指定方案的代码度量配置","link":"#二、设置指定代码库的指定方案的代码度量配置","children":[]},{"level":3,"title":"三、创建分析项目","slug":"三、创建分析项目","link":"#三、创建分析项目","children":[]},{"level":3,"title":"四、启动任务","slug":"四、启动任务","link":"#四、启动任务","children":[]},{"level":3,"title":"五、轮询任务结果","slug":"五、轮询任务结果","link":"#五、轮询任务结果","children":[]},{"level":3,"title":"六、获取分析概览","slug":"六、获取分析概览","link":"#六、获取分析概览","children":[]},{"level":3,"title":"七、查看扫描问题列表","slug":"七、查看扫描问题列表","link":"#七、查看扫描问题列表","children":[]},{"level":3,"title":"八、查看问题详情","slug":"八、查看问题详情","link":"#八、查看问题详情","children":[]},{"level":3,"title":"九、查看指定项目的圈复杂度问题列表","slug":"九、查看指定项目的圈复杂度问题列表","link":"#九、查看指定项目的圈复杂度问题列表","children":[]},{"level":3,"title":"十、查看指定项目的重复文件列表","slug":"十、查看指定项目的重复文件列表","link":"#十、查看指定项目的重复文件列表","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/服务端/ScriptAPI_guide.md"}');export{l as data}; diff --git a/assets/ScriptAPI_guide.html-fd6383b9.js b/assets/ScriptAPI_guide.html-fd6383b9.js new file mode 100644 index 000000000..7d38beb3d --- /dev/null +++ b/assets/ScriptAPI_guide.html-fd6383b9.js @@ -0,0 +1 @@ +import{_ as t,o as d,c as e,e as a}from"./app-2a91d8ab.js";const r={},i=a('

    API调用脚本使用指引

    操作步骤

    1. 修改脚本api_invoke.py的内部参数,填写个人令牌mytoken

    2. 部署代码分析服务

    3. 进入项目根目录

    4. 检查requests 模块是否安装,如未安装,可执行下列安装指令。

    pip install requests\n

    5. 设置参数method,选择要执行的api接口,并根据接口添加所需参数。

    6. 执行脚本python ScriptsAPI.py

    方法总览

    method类型
    create_repository创建代码库
    update_scheme_settings设置指定代码库的指定方案的代码度量配置
    create_project创建分析项目
    create_scans启动任务
    get_scan_cons轮询任务结果
    get_overview获取分析概览
    get_issues查看扫描问题列表
    get_issue_detail查看问题详情
    get_ccissues查看指定项目的圈复杂度问题列表
    get_dupfiles查看指定项目的重复文件列表

    API详细信息

    一、创建代码库

    1. url请求

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,create_repository
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    scm_urlstr代码库地址
    scm_typestr填git或svn
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=create_repository --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --scm_url=${TCA_SCM_URL} --scm_type=${TCA_SCM_TYPE}\n

    二、设置指定代码库的指定方案的代码度量配置

    1. url请求

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,update_scheme_settings
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    scheme_idstr扫描方案id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=update_scheme_settings --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --scheme_id=${TCA_SCHEME_ID}\n

    三、创建分析项目

    1. url请求

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,create_repository
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    scan_scheme_idint和global_scheme_id二选一进行填写,当前代码库的扫描方案编号
    global_scheme_idint和scan_scheme_id二选一进行填写,扫描方案模板编号
    branchstr分支
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=create_project --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --scan_scheme_id=${TCA_SCAN_SCHEME_ID} --branch=${TCA_BRANCH}\n

    四、启动任务

    1. url请求

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/scans/create/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,create_scans
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=create_scans --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}\n

    五、轮询任务结果

    1. url请求

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/<job_id>/detail/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_scan_cons
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"
    sleeptimeint轮询间隔的时间

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_scan_cons --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID} --job_id=${TCA_JOB_ID}\n

    六、获取分析概览

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_overview
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_overview --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}\n

    七、查看扫描问题列表

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_issues
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_issues --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}\n

    八、查看问题详情

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/<issue_id>/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_issue_detail
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    issue_idstr问题id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_issue_detail --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID} --issue_id=${TCA_ISSUE_ID}\n

    九、查看指定项目的圈复杂度问题列表

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccissues/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_ccissues
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_ccissues --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}\n

    十、查看指定项目的重复文件列表

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/\n

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_dupfiles
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_dupfiles --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}\n
    ',112),h=[i];function s(n,l){return d(),e("div",null,h)}const c=t(r,[["render",s],["__file","ScriptAPI_guide.html.vue"]]);export{c as default}; diff --git a/assets/TCA-Armory-C1.html-0c581c74.js b/assets/TCA-Armory-C1.html-0c581c74.js new file mode 100644 index 000000000..6b546b096 --- /dev/null +++ b/assets/TCA-Armory-C1.html-0c581c74.js @@ -0,0 +1,86 @@ +import{_ as d,r as s,o as t,c as h,a as e,b as a,d as r,e as i}from"./app-2a91d8ab.js";const c={},l=i('

    TCA-Armory-C1 使用手册

    TCA-Armory-C1 属于 TCA 的增强分析模块。

    功能

    准备

    ',5),o={href:"https://tencent.github.io/CodeAnalysis/zh/quickStarted/enhanceDeploy.html",target:"_blank",rel:"noopener noreferrer"},u=i('

    规则介绍

    CmdInject

    概述

    支持的语言:Java

    ',4),b={href:"https://owasp.org/www-community/attacks/Command_Injection",target:"_blank",rel:"noopener noreferrer"},v=e("code",null,"命令行注入漏洞",-1),p=i(`

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String cmd = req.getParameter("cmd");
    +    Runtime rt = Runtime.getRuntime();
    +    rt.exec(cmd); // 触发规则
    +}
    +

    修复建议

    需要评估 childprocess 等模块执行命令的使用,应限定或校验命令和参数的内容。

    PathTraversal

    概述

    支持的语言:Java

    `,9),m={href:"https://owasp.org/www-community/attacks/Path_Traversal",target:"_blank",rel:"noopener noreferrer"},g=e("code",null,"路径穿越漏洞",-1),f=i(`

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String image = req.getParameter("image");
    +    File file = new File("resources/images/", image); // 触发规则
    +
    +    if (!file.exists()) {
    +        return Response.status(Status.NOT_FOUND).build();
    +    }
    +
    +    return Response.ok().entity(new FileInputStream(file)).build();
    +}
    +

    修复建议

    按业务需求,使用白名单限定后缀范围,校验并限定文件路径范围。

    SQLInject

    概述

    支持的语言:Java

    `,9),x={href:"https://en.wikipedia.org/wiki/SQL_injection",target:"_blank",rel:"noopener noreferrer"},C=e("code",null,"SQL注入漏洞",-1),j=i(`

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String id = req.getParameter("id");
    +    Connection conn = null;
    +    Statement statement = null;
    +    ResultSet rs = null;
    +
    +    Class.forName("com.mysql.cj.jdbc.Driver");
    +    conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/sec_sql", "root", "admin888");
    +    String sql = "select * from userinfo where id = " + id;
    +    statement = conn.createStatement();
    +    statement.executeUpdate(sql); // 触发规则
    +}
    +

    修复建议

    SQL 语句默认使用预编译并绑定变量,使用安全的ORM操作。

    SSRF

    概述

    支持的语言:Java

    `,9),_={href:"https://en.wikipedia.org/wiki/Server-side_request_forgery",target:"_blank",rel:"noopener noreferrer"},S=e("code",null,"服务端请求伪造漏洞 SSRF(Server-side request forgery)",-1),q=i(`

    参数设置

    示例

    import org.springframework.context.annotation.Configuration;
    +import org.springframework.security.config.annotation.web.builders.HttpSecurity;
    +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
    +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
    +
    +@EnableWebSecurity
    +@Configuration
    +public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    +  @Override
    +  protected void configure(HttpSecurity http) throws Exception {
    +    http
    +      .csrf(csrf ->
    +        csrf.disable() // 触发规则
    +      );
    +  }
    +}
    +

    修复建议

    限定访问网络资源地址范围,请求网络资源应加密传输。

    XSS

    概述

    支持的语言:Java

    `,9),O={href:"https://en.wikipedia.org/wiki/Cross-site_scripting",target:"_blank",rel:"noopener noreferrer"},P=e("code",null,"跨站脚本攻击漏洞 XSS(Cross-site scripting)",-1),y=i(`

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String id = request.getParameter("id") != null ? request.getParameter("id") : "0";
    +    Doc doc = getdetailsById(id);    
    +    byte[] b = doc.getUploaded();        
    +    try {
    +        response.setContentType("APPLICATION/OCTET-STREAM");
    +        String disHeader = "Attachment;Filename=" + doc.getName();
    +        response.setHeader("Content-Disposition", disHeader);
    +        ServletOutputStream out = response.getOutputStream();
    +        out.print(b); // 触发规则
    +    }
    +}
    +

    修复建议

    在输出所有用户可控的数据时, 对数据做转义或者编码。

    概述

    检查 Objective-C/C++ 代码文件的copyright信息。

    参数设置

    示例

    // 触发规则
    +@interface Test : NSObject
    +@end
    +
    +

    修复建议

    在代码文件头部添加 Copyright 信息。比如:

    // Copyright (c) xxxx Tencent. All rights reserved.
    +//
    +
    +@interface Test : NSObject
    +@end
    +
    +

    ObjectiveC/Indent

    概述

    检查 Objective-C/C++ 代码文件的缩进。

    参数设置

    参考以下示例:

    IndentStyle=spaces
    +IndentSize=4
    +

    示例

    for (int i = 0; i < 10; i++) {
    +  doThings(); // 触发规则
    +}
    +

    修复建议

    调整为对应的缩进方式。比如默认是4个空格缩进。

    for (int i = 0; i < 10; i++) {
    +    doThings(); // 触发规则
    +}
    +

    ObjectiveC/MaxLinesPerFunction

    概述

    检查 Objective-C/C++ 代码中超出行数长度阈值的函数。

    参数设置

    参考以下示例:

    LineThreshold=100
    +

    示例

    修复建议

    可以基于单一职责原则拆分函数,缩减函数长度。

    ObjectiveC/MissingDocInterface

    概述

    检查 Objective-C/C++ 代码中 interface 是否有注释信息。

    参数设置

    示例

    修复建议

    为 inferface 增加注释。

    ObjectiveC/MissingDocProperty

    概述

    检查 Objective-C/C++ 代码中 Property 是否有注释信息。

    参数设置

    示例

    修复建议

    为 Property 增加注释。

    ObjectiveC/MissingDocProtocol

    概述

    检查 Objective-C/C++ 代码中 Protocol 是否有注释信息。

    参数设置

    示例

    修复建议

    为 Protocol 增加注释。

    ObjectiveC/ParameterCount

    概述

    检查 Objective-C/C++ 代码中方法的参数个数是否超过阈值。

    参数设置

    参考以下示例:

    Max=6
    +

    示例

    无。

    修复建议

    参数个数越少越好,多于 6 个参数时建议考虑重构。

    ObjectiveC/ClassNaming

    概述

    检查 Objective-C/C++ 代码中 class 名称是否符合命名规范。

    参数设置

    参考以下示例:

    ClassCase=CamelCase
    +

    示例

    无。

    修复建议

    修改 class 名称符合命名规范。

    ObjectiveC/FunctionNaming

    概述

    检查 Objective-C/C++ 代码中 Function 名称是否符合命名规范。

    参数设置

    参考以下示例:

    FunctionCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Function 名称符合命名规范。

    ObjectiveC/GlobalVariableNaming

    概述

    检查 Objective-C/C++ 代码中 GlobalVariable 名称是否符合命名规范。

    参数设置

    参考以下示例:

    GlobalVariablePrefix=g
    +GlobalVariableCase=camelBack
    +

    示例

    无。

    修复建议

    修改 GlobalVariable 名称符合命名规范。

    ObjectiveC/LocalVariableNaming

    概述

    检查 Objective-C/C++ 代码中 LocalVariable 名称是否符合命名规范。

    参数设置

    参考以下示例:

    LocalVariableCase=camelBack
    +

    示例

    无。

    修复建议

    修改 LocalVariable 名称符合命名规范。

    ObjectiveC/MacroNaming

    概述

    检查 Objective-C/C++ 代码中 Macro 名称是否符合命名规范。

    参数设置

    参考以下示例:

    MacroCase=UPPER_CASE
    +

    示例

    无。

    修复建议

    修改 Macro 名称符合命名规范。

    ObjectiveC/MethodNaming

    概述

    检查 Objective-C/C++ 代码中 Method 名称是否符合命名规范。

    参数设置

    参考以下示例:

    MethodCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Method 名称符合命名规范。

    ObjectiveC/ParameterNaming

    概述

    检查 Objective-C/C++ 代码中 Parameter 名称是否符合命名规范。

    参数设置

    参考以下示例:

    ParameterCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Parameter 名称符合命名规范。

    ObjectiveC/MaxLineLength

    概述

    检查 Objective-C/C++ 代码中一行长度是否超过阈值。

    参数设置

    参考以下示例:

    tabWidth=4
    +MaxLineLength=150
    +

    示例

    无。

    修复建议

    通过换行、优化逻辑等方式,缩减一行长度。

    `,165);function k(E,R){const n=s("ExternalLinkIcon");return t(),h("div",null,[l,e("ul",null,[e("li",null,[a("需要事先部署好 "),e("a",o,[a("CLS 微服务"),r(n)])])]),u,e("p",null,[a("CmdInject 规则用于检查代码中是否存在"),e("a",b,[v,r(n)]),a("。 当使用 childprocess 等模块执行命令时,拼接了用户可控的输入,会导致命令执行漏洞。攻击者利用漏洞可以控制目标主机或者容器。")]),p,e("p",null,[a("PathTraversal 规则用于检查代码中是否存在"),e("a",m,[g,r(n)]),a("。 操作文件时,应该限定文件的路径范围,如果拼接用户输入到文件路径,可能导致路径穿越漏洞。攻击者利用漏洞可以访问到文件系统上的任意文件,这可能导致信息泄漏等问题。")]),f,e("p",null,[a("SQLInject 规则用于检查代码中是否存在"),e("a",x,[C,r(n)]),a("。 错误的拼接用户可控的值到 sql 语句,可能导致 sql 注入漏洞。攻击者可以修改 sql 语法来更改查询的目标或结果,泄露数据库敏感信息,也可以使用SQL文件操作攻击底层Web服务器。如果使用该 sql 查询进行授权认证,攻击者还可以用于提权。")]),j,e("p",null,[a("SSRF 规则用于检查代码中是否存在"),e("a",_,[S,r(n)]),a("。 攻击者在未能取得服务器所有权限时,利用服务器漏洞以服务器的身份发送一条构造好的请求给服务器所在内网。")]),q,e("p",null,[a("XSS 规则用于检查代码中是否存在"),e("a",O,[P,r(n)]),a("。 如果 web 页面在动态展示数据时使用了用户的输入内容,没有对输入的内容过滤或者进行转义,黑客可以通过参数传入恶意代码,当用户浏览该页面时恶意代码会被执行。")]),y])}const L=d(c,[["render",k],["__file","TCA-Armory-C1.html.vue"]]);export{L as default}; diff --git a/assets/TCA-Armory-C1.html-5177716b.js b/assets/TCA-Armory-C1.html-5177716b.js new file mode 100644 index 000000000..9426295ab --- /dev/null +++ b/assets/TCA-Armory-C1.html-5177716b.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-1cf92e76","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html","title":"TCA-Armory-C1 使用手册","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"功能","slug":"功能","link":"#功能","children":[]},{"level":2,"title":"准备","slug":"准备","link":"#准备","children":[]},{"level":2,"title":"规则介绍","slug":"规则介绍","link":"#规则介绍","children":[{"level":3,"title":"CmdInject","slug":"cmdinject","link":"#cmdinject","children":[]},{"level":3,"title":"PathTraversal","slug":"pathtraversal","link":"#pathtraversal","children":[]},{"level":3,"title":"SQLInject","slug":"sqlinject","link":"#sqlinject","children":[]},{"level":3,"title":"SSRF","slug":"ssrf","link":"#ssrf","children":[]},{"level":3,"title":"XSS","slug":"xss","link":"#xss","children":[]},{"level":3,"title":"ObjectiveC/Copyright","slug":"objectivec-copyright","link":"#objectivec-copyright","children":[]},{"level":3,"title":"ObjectiveC/Indent","slug":"objectivec-indent","link":"#objectivec-indent","children":[]},{"level":3,"title":"ObjectiveC/MaxLinesPerFunction","slug":"objectivec-maxlinesperfunction","link":"#objectivec-maxlinesperfunction","children":[]},{"level":3,"title":"ObjectiveC/MissingDocInterface","slug":"objectivec-missingdocinterface","link":"#objectivec-missingdocinterface","children":[]},{"level":3,"title":"ObjectiveC/MissingDocProperty","slug":"objectivec-missingdocproperty","link":"#objectivec-missingdocproperty","children":[]},{"level":3,"title":"ObjectiveC/MissingDocProtocol","slug":"objectivec-missingdocprotocol","link":"#objectivec-missingdocprotocol","children":[]},{"level":3,"title":"ObjectiveC/ParameterCount","slug":"objectivec-parametercount","link":"#objectivec-parametercount","children":[]},{"level":3,"title":"ObjectiveC/ClassNaming","slug":"objectivec-classnaming","link":"#objectivec-classnaming","children":[]},{"level":3,"title":"ObjectiveC/FunctionNaming","slug":"objectivec-functionnaming","link":"#objectivec-functionnaming","children":[]},{"level":3,"title":"ObjectiveC/GlobalVariableNaming","slug":"objectivec-globalvariablenaming","link":"#objectivec-globalvariablenaming","children":[]},{"level":3,"title":"ObjectiveC/LocalVariableNaming","slug":"objectivec-localvariablenaming","link":"#objectivec-localvariablenaming","children":[]},{"level":3,"title":"ObjectiveC/MacroNaming","slug":"objectivec-macronaming","link":"#objectivec-macronaming","children":[]},{"level":3,"title":"ObjectiveC/MethodNaming","slug":"objectivec-methodnaming","link":"#objectivec-methodnaming","children":[]},{"level":3,"title":"ObjectiveC/ParameterNaming","slug":"objectivec-parameternaming","link":"#objectivec-parameternaming","children":[]},{"level":3,"title":"ObjectiveC/MaxLineLength","slug":"objectivec-maxlinelength","link":"#objectivec-maxlinelength","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/工具/TCA-Armory-C1.md"}');export{e as data}; diff --git a/assets/TCA-Armory-C1.html-9ef6db9a.js b/assets/TCA-Armory-C1.html-9ef6db9a.js new file mode 100644 index 000000000..49875d89b --- /dev/null +++ b/assets/TCA-Armory-C1.html-9ef6db9a.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7c0ce2de","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html","title":"TCA-Armory-C1 使用手册","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"功能","slug":"功能","link":"#功能","children":[]},{"level":2,"title":"准备","slug":"准备","link":"#准备","children":[]},{"level":2,"title":"规则介绍","slug":"规则介绍","link":"#规则介绍","children":[{"level":3,"title":"CmdInject","slug":"cmdinject","link":"#cmdinject","children":[]},{"level":3,"title":"PathTraversal","slug":"pathtraversal","link":"#pathtraversal","children":[]},{"level":3,"title":"SQLInject","slug":"sqlinject","link":"#sqlinject","children":[]},{"level":3,"title":"SSRF","slug":"ssrf","link":"#ssrf","children":[]},{"level":3,"title":"XSS","slug":"xss","link":"#xss","children":[]},{"level":3,"title":"ObjectiveC/Copyright","slug":"objectivec-copyright","link":"#objectivec-copyright","children":[]},{"level":3,"title":"ObjectiveC/Indent","slug":"objectivec-indent","link":"#objectivec-indent","children":[]},{"level":3,"title":"ObjectiveC/MaxLinesPerFunction","slug":"objectivec-maxlinesperfunction","link":"#objectivec-maxlinesperfunction","children":[]},{"level":3,"title":"ObjectiveC/MissingDocInterface","slug":"objectivec-missingdocinterface","link":"#objectivec-missingdocinterface","children":[]},{"level":3,"title":"ObjectiveC/MissingDocProperty","slug":"objectivec-missingdocproperty","link":"#objectivec-missingdocproperty","children":[]},{"level":3,"title":"ObjectiveC/MissingDocProtocol","slug":"objectivec-missingdocprotocol","link":"#objectivec-missingdocprotocol","children":[]},{"level":3,"title":"ObjectiveC/ParameterCount","slug":"objectivec-parametercount","link":"#objectivec-parametercount","children":[]},{"level":3,"title":"ObjectiveC/ClassNaming","slug":"objectivec-classnaming","link":"#objectivec-classnaming","children":[]},{"level":3,"title":"ObjectiveC/FunctionNaming","slug":"objectivec-functionnaming","link":"#objectivec-functionnaming","children":[]},{"level":3,"title":"ObjectiveC/GlobalVariableNaming","slug":"objectivec-globalvariablenaming","link":"#objectivec-globalvariablenaming","children":[]},{"level":3,"title":"ObjectiveC/LocalVariableNaming","slug":"objectivec-localvariablenaming","link":"#objectivec-localvariablenaming","children":[]},{"level":3,"title":"ObjectiveC/MacroNaming","slug":"objectivec-macronaming","link":"#objectivec-macronaming","children":[]},{"level":3,"title":"ObjectiveC/MethodNaming","slug":"objectivec-methodnaming","link":"#objectivec-methodnaming","children":[]},{"level":3,"title":"ObjectiveC/ParameterNaming","slug":"objectivec-parameternaming","link":"#objectivec-parameternaming","children":[]},{"level":3,"title":"ObjectiveC/MaxLineLength","slug":"objectivec-maxlinelength","link":"#objectivec-maxlinelength","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/工具/TCA-Armory-C1.md"}');export{e as data}; diff --git a/assets/TCA-Armory-C1.html-f73f9e95.js b/assets/TCA-Armory-C1.html-f73f9e95.js new file mode 100644 index 000000000..6b546b096 --- /dev/null +++ b/assets/TCA-Armory-C1.html-f73f9e95.js @@ -0,0 +1,86 @@ +import{_ as d,r as s,o as t,c as h,a as e,b as a,d as r,e as i}from"./app-2a91d8ab.js";const c={},l=i('

    TCA-Armory-C1 使用手册

    TCA-Armory-C1 属于 TCA 的增强分析模块。

    功能

    准备

    ',5),o={href:"https://tencent.github.io/CodeAnalysis/zh/quickStarted/enhanceDeploy.html",target:"_blank",rel:"noopener noreferrer"},u=i('

    规则介绍

    CmdInject

    概述

    支持的语言:Java

    ',4),b={href:"https://owasp.org/www-community/attacks/Command_Injection",target:"_blank",rel:"noopener noreferrer"},v=e("code",null,"命令行注入漏洞",-1),p=i(`

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String cmd = req.getParameter("cmd");
    +    Runtime rt = Runtime.getRuntime();
    +    rt.exec(cmd); // 触发规则
    +}
    +

    修复建议

    需要评估 childprocess 等模块执行命令的使用,应限定或校验命令和参数的内容。

    PathTraversal

    概述

    支持的语言:Java

    `,9),m={href:"https://owasp.org/www-community/attacks/Path_Traversal",target:"_blank",rel:"noopener noreferrer"},g=e("code",null,"路径穿越漏洞",-1),f=i(`

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String image = req.getParameter("image");
    +    File file = new File("resources/images/", image); // 触发规则
    +
    +    if (!file.exists()) {
    +        return Response.status(Status.NOT_FOUND).build();
    +    }
    +
    +    return Response.ok().entity(new FileInputStream(file)).build();
    +}
    +

    修复建议

    按业务需求,使用白名单限定后缀范围,校验并限定文件路径范围。

    SQLInject

    概述

    支持的语言:Java

    `,9),x={href:"https://en.wikipedia.org/wiki/SQL_injection",target:"_blank",rel:"noopener noreferrer"},C=e("code",null,"SQL注入漏洞",-1),j=i(`

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String id = req.getParameter("id");
    +    Connection conn = null;
    +    Statement statement = null;
    +    ResultSet rs = null;
    +
    +    Class.forName("com.mysql.cj.jdbc.Driver");
    +    conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/sec_sql", "root", "admin888");
    +    String sql = "select * from userinfo where id = " + id;
    +    statement = conn.createStatement();
    +    statement.executeUpdate(sql); // 触发规则
    +}
    +

    修复建议

    SQL 语句默认使用预编译并绑定变量,使用安全的ORM操作。

    SSRF

    概述

    支持的语言:Java

    `,9),_={href:"https://en.wikipedia.org/wiki/Server-side_request_forgery",target:"_blank",rel:"noopener noreferrer"},S=e("code",null,"服务端请求伪造漏洞 SSRF(Server-side request forgery)",-1),q=i(`

    参数设置

    示例

    import org.springframework.context.annotation.Configuration;
    +import org.springframework.security.config.annotation.web.builders.HttpSecurity;
    +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
    +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
    +
    +@EnableWebSecurity
    +@Configuration
    +public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    +  @Override
    +  protected void configure(HttpSecurity http) throws Exception {
    +    http
    +      .csrf(csrf ->
    +        csrf.disable() // 触发规则
    +      );
    +  }
    +}
    +

    修复建议

    限定访问网络资源地址范围,请求网络资源应加密传输。

    XSS

    概述

    支持的语言:Java

    `,9),O={href:"https://en.wikipedia.org/wiki/Cross-site_scripting",target:"_blank",rel:"noopener noreferrer"},P=e("code",null,"跨站脚本攻击漏洞 XSS(Cross-site scripting)",-1),y=i(`

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String id = request.getParameter("id") != null ? request.getParameter("id") : "0";
    +    Doc doc = getdetailsById(id);    
    +    byte[] b = doc.getUploaded();        
    +    try {
    +        response.setContentType("APPLICATION/OCTET-STREAM");
    +        String disHeader = "Attachment;Filename=" + doc.getName();
    +        response.setHeader("Content-Disposition", disHeader);
    +        ServletOutputStream out = response.getOutputStream();
    +        out.print(b); // 触发规则
    +    }
    +}
    +

    修复建议

    在输出所有用户可控的数据时, 对数据做转义或者编码。

    概述

    检查 Objective-C/C++ 代码文件的copyright信息。

    参数设置

    示例

    // 触发规则
    +@interface Test : NSObject
    +@end
    +
    +

    修复建议

    在代码文件头部添加 Copyright 信息。比如:

    // Copyright (c) xxxx Tencent. All rights reserved.
    +//
    +
    +@interface Test : NSObject
    +@end
    +
    +

    ObjectiveC/Indent

    概述

    检查 Objective-C/C++ 代码文件的缩进。

    参数设置

    参考以下示例:

    IndentStyle=spaces
    +IndentSize=4
    +

    示例

    for (int i = 0; i < 10; i++) {
    +  doThings(); // 触发规则
    +}
    +

    修复建议

    调整为对应的缩进方式。比如默认是4个空格缩进。

    for (int i = 0; i < 10; i++) {
    +    doThings(); // 触发规则
    +}
    +

    ObjectiveC/MaxLinesPerFunction

    概述

    检查 Objective-C/C++ 代码中超出行数长度阈值的函数。

    参数设置

    参考以下示例:

    LineThreshold=100
    +

    示例

    修复建议

    可以基于单一职责原则拆分函数,缩减函数长度。

    ObjectiveC/MissingDocInterface

    概述

    检查 Objective-C/C++ 代码中 interface 是否有注释信息。

    参数设置

    示例

    修复建议

    为 inferface 增加注释。

    ObjectiveC/MissingDocProperty

    概述

    检查 Objective-C/C++ 代码中 Property 是否有注释信息。

    参数设置

    示例

    修复建议

    为 Property 增加注释。

    ObjectiveC/MissingDocProtocol

    概述

    检查 Objective-C/C++ 代码中 Protocol 是否有注释信息。

    参数设置

    示例

    修复建议

    为 Protocol 增加注释。

    ObjectiveC/ParameterCount

    概述

    检查 Objective-C/C++ 代码中方法的参数个数是否超过阈值。

    参数设置

    参考以下示例:

    Max=6
    +

    示例

    无。

    修复建议

    参数个数越少越好,多于 6 个参数时建议考虑重构。

    ObjectiveC/ClassNaming

    概述

    检查 Objective-C/C++ 代码中 class 名称是否符合命名规范。

    参数设置

    参考以下示例:

    ClassCase=CamelCase
    +

    示例

    无。

    修复建议

    修改 class 名称符合命名规范。

    ObjectiveC/FunctionNaming

    概述

    检查 Objective-C/C++ 代码中 Function 名称是否符合命名规范。

    参数设置

    参考以下示例:

    FunctionCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Function 名称符合命名规范。

    ObjectiveC/GlobalVariableNaming

    概述

    检查 Objective-C/C++ 代码中 GlobalVariable 名称是否符合命名规范。

    参数设置

    参考以下示例:

    GlobalVariablePrefix=g
    +GlobalVariableCase=camelBack
    +

    示例

    无。

    修复建议

    修改 GlobalVariable 名称符合命名规范。

    ObjectiveC/LocalVariableNaming

    概述

    检查 Objective-C/C++ 代码中 LocalVariable 名称是否符合命名规范。

    参数设置

    参考以下示例:

    LocalVariableCase=camelBack
    +

    示例

    无。

    修复建议

    修改 LocalVariable 名称符合命名规范。

    ObjectiveC/MacroNaming

    概述

    检查 Objective-C/C++ 代码中 Macro 名称是否符合命名规范。

    参数设置

    参考以下示例:

    MacroCase=UPPER_CASE
    +

    示例

    无。

    修复建议

    修改 Macro 名称符合命名规范。

    ObjectiveC/MethodNaming

    概述

    检查 Objective-C/C++ 代码中 Method 名称是否符合命名规范。

    参数设置

    参考以下示例:

    MethodCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Method 名称符合命名规范。

    ObjectiveC/ParameterNaming

    概述

    检查 Objective-C/C++ 代码中 Parameter 名称是否符合命名规范。

    参数设置

    参考以下示例:

    ParameterCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Parameter 名称符合命名规范。

    ObjectiveC/MaxLineLength

    概述

    检查 Objective-C/C++ 代码中一行长度是否超过阈值。

    参数设置

    参考以下示例:

    tabWidth=4
    +MaxLineLength=150
    +

    示例

    无。

    修复建议

    通过换行、优化逻辑等方式,缩减一行长度。

    `,165);function k(E,R){const n=s("ExternalLinkIcon");return t(),h("div",null,[l,e("ul",null,[e("li",null,[a("需要事先部署好 "),e("a",o,[a("CLS 微服务"),r(n)])])]),u,e("p",null,[a("CmdInject 规则用于检查代码中是否存在"),e("a",b,[v,r(n)]),a("。 当使用 childprocess 等模块执行命令时,拼接了用户可控的输入,会导致命令执行漏洞。攻击者利用漏洞可以控制目标主机或者容器。")]),p,e("p",null,[a("PathTraversal 规则用于检查代码中是否存在"),e("a",m,[g,r(n)]),a("。 操作文件时,应该限定文件的路径范围,如果拼接用户输入到文件路径,可能导致路径穿越漏洞。攻击者利用漏洞可以访问到文件系统上的任意文件,这可能导致信息泄漏等问题。")]),f,e("p",null,[a("SQLInject 规则用于检查代码中是否存在"),e("a",x,[C,r(n)]),a("。 错误的拼接用户可控的值到 sql 语句,可能导致 sql 注入漏洞。攻击者可以修改 sql 语法来更改查询的目标或结果,泄露数据库敏感信息,也可以使用SQL文件操作攻击底层Web服务器。如果使用该 sql 查询进行授权认证,攻击者还可以用于提权。")]),j,e("p",null,[a("SSRF 规则用于检查代码中是否存在"),e("a",_,[S,r(n)]),a("。 攻击者在未能取得服务器所有权限时,利用服务器漏洞以服务器的身份发送一条构造好的请求给服务器所在内网。")]),q,e("p",null,[a("XSS 规则用于检查代码中是否存在"),e("a",O,[P,r(n)]),a("。 如果 web 页面在动态展示数据时使用了用户的输入内容,没有对输入的内容过滤或者进行转义,黑客可以通过参数传入恶意代码,当用户浏览该页面时恶意代码会被执行。")]),y])}const L=d(c,[["render",k],["__file","TCA-Armory-C1.html.vue"]]);export{L as default}; diff --git a/assets/TCA-Armory-Q1.html-08aa80f4.js b/assets/TCA-Armory-Q1.html-08aa80f4.js new file mode 100644 index 000000000..f651d0f0f --- /dev/null +++ b/assets/TCA-Armory-Q1.html-08aa80f4.js @@ -0,0 +1,367 @@ +import{_ as e,o as i,c as n,e as d}from"./app-2a91d8ab.js";const l={},a=d(`

    TCA-Armory-Q1工具介绍

    TCA-Armory-Q1, 又名 tca_ql_cpp 主要用于分析Cpp质量问题。

    规则详情

    线程锁检查

    包含规则:

    在使用多线程对文件全局变量或类成员在进行读写时,工具会对未正确的进行上锁操作和上锁异常而引发死锁的情况进行检查。

    支持的多线程标准库库包括(若有其他库需求可提issue):

    missing_lock

    missing_lock 如果发现多线程中某个全局变量在未持有锁便更新时,则会上报错误。

    代码示例

    以下提供一个或多个 missing_loc 案例 在下面代码中,函数 increase1, increase2 皆以将 counter 加到 1000 为目的。如果使用 increase1 函数则有可能多个线程皆在 1000 时进入循环导致最后 counter结果大于 1000

    int counter = 0;
    +std::mutex mtx;  // 保护counter
    +void increase1() {
    +    while (1) {
    +        if (counter <= 1000)
    +            counter++;  // defect: missing_lock
    +        else
    +            break;
    +    }
    +}
    +void increase2() {
    +    while (1) {
    +        mtx.lock();  // example_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx.unlock();  // example_release
    +    }
    +}
    +

    dead_lock

    dead_lock 如果发现文件内存在 mtx1 -> mtx2 的上锁顺序时,另存在mtx2 -> mtx1 的上锁顺序,视为死锁或存在死锁的可能,则会上报错误。 死锁发生时程序将会卡死无法正常执行。

    规则参数
    代码示例

    以下提供一个或多个 dead_lock 案例

    在下面代码中,函数 increase 以将 counter 加到 1000 为目的。但在线程 1 中第一次释放 mtx 后,线程 2 的 mtx 上锁,此时线程1等待线程2释放mtx,线程2等待线程1释放mtx2,形成死锁,程序卡死。

    int counter = 0;
    +std::mutex mtx;
    +std::mutex mtx2;
    +void increase() {
    +    while (1) {
    +        mtx.lock();
    +        mtx2.lock();
    +        mtx.unlock();
    +        mtx.lock();  // defect: dead_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +

    在下面代码中 线程函数increase1存在mtx -> mtx2 的顺序,increase2顺序为 mtx2 -> mtx;视为出现死锁。

    void increase1() {
    +    while (1) {
    +        mtx.lock();
    +        mtx2.lock();
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +void increase2() {
    +    while (1) {
    +        mtx2.lock();
    +        mtx.lock();  // defect: dead_lock; 
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +

    以下案例在better-lock参数为True时将会生效 使用better-lock规则会检查在上锁期间若调用其他函数时将视为可能会出现预期之外的异常,且上锁期间应只做对全局变量操作以提升性能

    void increase1() {
    +    while (1) {
    +        mtx.lock();
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        read_counter(counter);  // defect: dead_lock
    +        mtx.unlock()
    +    }
    +}
    +void read_counter(counter){
    +    std::cout << counter << std::endl;
    +    do_something_more();
    +}
    +void increase1() {
    +    while (1) {
    +        std::lock_guard<std::mutex> lk(mtx);  // good: 使用lock_guard会自动上锁解锁将不会检查dead_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        read_counter(counter);
    +    }
    +}
    +

    资源泄漏检查

    包含规则

    resource_leak

    resource_leak 在程序申请了资源但并未按时释放时上报错误 目前场景包括:句柄打开时未关闭,指针分配内存后没有及时释放

    代码示例

    以下将提供一个或多个resource_leak案例

    int leak_example1(int c) {
    +    void *p = malloc(10); 
    +    if(c)
    +        return -1; // defect: if c "p" is leaked
    +    free(p);
    +    return 0;
    +}
    +
    +int leak_example2() {
    +    void *p = malloc(10);
    +    void *q = malloc(20);
    +    if(!p || !q)
    +        return -1; // defect: "p" or "q" may be leaked if the other is NULL 
    +    /*...*/
    +    free(q);
    +    free(p);
    +    return 0;
    +}
    +
    +void leak_example3(int c) {
    +    FILE *p = fopen("starwar.anakin", "rb");
    +    if(c)
    +        return;       // defect: leaking file pointer "p"
    +    fclose(p);
    +}
    +

    无效值检查

    包含规则

    unused_value

    unused_value 检查那些赋予给变量的值是否正确被使用,存在连续两次赋予变量值的情况,视为第一次赋予的值未被正确使用,报出错误。 两次连续赋值可能存在条件控制语句出现错误、变量名拼写错误等情况。

    代码示例

    以下提供一个或多个unused_value案例

    以下函数会因为key的不同去不一样的神明,但实际上 Zeus Hades却永远不会使用到。

    const char* key_value(const int key) {
    +    const char * value = 0;
    +    if (key != 0) {
    +        value = "Zeus";
    +    } else if (key != 1) {
    +        value = "Hades";
    +    } 
    +    if (key != 2) { // Should be 'else if' here.
    +        value = "Poseidon";  // defect: unused_value Zeus Hades  never used
    +    }
    +    else {
    +        value = "Unknow
    +    }
    +    return result;
    +}
    +

    以下继续提供几个unused_value代码

    const char* key_value1(const int key) {
    +    const char * value = 0;
    +    value = "Zeus";  // defect: Zeus never used
    +    if (key == 1) {
    +        value = "Hades;
    +    } else if (key == 2) {
    +        value = "Poseidon";
    +    } else {  // May else need not be here
    +        value = "Unknow";
    +    }
    +    return value
    +}
    +
    +const char* key_value2(const int key) {
    +    const char * value = 0;
    +    value = "Zeus";  // better Zeus used
    +    if (key == 1) {
    +        value = "Hades;
    +    } else if (key == 2) {
    +        value = "Poseidon";
    +    }
    +    return value
    +}
    +
    +const char* key_value3(const int key) {
    +    const char * value = 0;
    +    if (key == 1) {
    +        value = "Hades;
    +    } else {
    +        value = "Poseidon";
    +    }
    +    value = "Zeus";  // defect: Hades Poseidon never used
    +    return value
    +}
    +

    数组溢出检查

    包含规则

    array_overflow

    array_overflow 检查数组越界的情况。不正确的缓存区访问可能损坏内存,导致程序崩溃或读取到权限外的内存。

    代码示例

    以下提供一个或多个array_overflow案例

    void foo() {
    +    int array[10];
    +    int i = get();
    +    // i = 9;
    +    if (i > 8 && i <= length(array)) {  // Shoud be i < length(array)
    +        array[i] = 1;  // defect: array[10] overflow
    +    }
    +    array[i] = 1;  // defect: array[10] overflow
    +}
    +
    +
    +void test(int i) {
    +    int n= 10;
    +    char *p = malloc(sizeof(int) * 10);
    +    int y = n;
    +    p[y] = 'a'; // defect: writing to buffer[y] overflow
    +}
    +

    buff_overflow

    buff_overflow 检查strcpy,strcat字符串复制/拼接过程中长度不当导致的溢出, 同样gets scanf函数也视为不安全

    代码示例

    以下提供一个或多个buff_overflow案例

    void overflow1() {
    +
    +    char a[4]={0};
    +        strcpy(a, "Poseidon");  // defect: len("Poseidon") > 4 strncpy is better
    +    return;
    +}
    +
    +void overflow2() {
    +    char s1[10] = "1";
    +    char s2[] = "1234567890";
    +    strcat(s1, s2);  // defect: len(s1 + s2) > 10
    +    // strncat(s1, s2, 6)  // strncat is better
    +    return 0;
    +}
    +
    +

    指针检查

    包含规则

    func_ret_null

    func_ret_null 函数返回值可能为nullpointer,但是调用该函数时指针未经判空便进行使用
    在选用func_ret_null_full 时, 检查器会在项目内全局搜索空指针函数的调用情况,否则只会在相关文件内进行检查。

    代码示例

    以下提供一个或多个func_ret_null代码案例

    在下面代码中test函数中调用get_name可能返回空指针,在后续使用name指针前应该判断是否为空指针

    // name.hpp
    +
    +char* get_name(int id) {
    +    char* name = 0;
    +    if (id == 1) {
    +        name = "Zeus";
    +    } else if (id == 2) {
    +        name = "Hades"
    +    } else {
    +        return nullpointer;
    +    }
    +    return name;
    +}
    +
    +void test(int i) {
    +    char* name = get_name(i);
    +    dosomething(name);  // defect: name may nullpointer should check it
    +    if (name != nullpointer) {
    +        dosomething(name);  // good
    +    }
    +}
    +
    +

    在选用full_ret_null_full时,将会全局分析函数get_name调用情况

    // third.cpp
    +# include "name.h"
    +
    +void name_test(int i) {
    +    char* name = get_name(i);
    +    dosomething(name); // defect
    +}
    +

    use_after_free

    use_after_free 检查当指针已经被释放但在后续仍然使用该指针的情况。

    代码示例

    以下提供一个或多个use_after_free代码案例

    通常情况下已经释放的指针只允许置空或重新指向新的值,不允许存在读取或作为函数参数使用。

    
    +void UAR() {
    +    int* p = new int[];
    +    p = get_array();
    +    dosomething(p);
    +    delete p;
    +    p = NULL;  // allow
    +    p = get_array();  // allow: get array again
    +    delete p;
    +    dosomething(p);  // defect: use as param
    +    std::cout << "p[0] = " << p[0] << std::endl;  // defect: read p
    +}
    +

    forward_null

    forward_null 检查可能导致程序终止或运行时异常的错误。它查找指针或引用被检查是否为 null 或被赋值为 null,且之后被解引用的很多情况。

    规则参数
    代码示例

    以下提供一个或多个forward_null代码案例

    指针曾经有过检查null的操作则会视为有可能为空指针,之后在未被确认为非空指针情况下直接使用。将会视为forward_null错误

    void forward_null_1() {
    +    int * p;
    +    p = get_int_pointer();
    +    dosomething(p);
    +    if (p == NULL) {
    +        std::cout << "Null Pointer Find" << srd::endl;
    +        // return;      // prefer: if return here
    +    } else {
    +        dosomething(p);     // good: p is not NULL
    +    }
    +    dosomething(p);     // defect forward_null: p may NULL
    +}
    +
    +
    +void forward_null_2(int *p) {
    +    dosomething(p);
    +    if (p == NULL) {
    +        return;
    +    } else {
    +        dosomething(p);     // good: p is not NULL
    +    }
    +    dosomething(p);     // good
    +    ...
    +    if (p != NULL) {    // means p may nullpointer here
    +        dosomething(p);
    +    }
    +    dosomething(p);     // defect forward_null:p may NULL
    +}
    +

    以下案例在设置trust_paramFalse时将会生效,其将会默认认为函数参数存在空指针可能,必须确认无空指针可能时方可使用

    void forward_null_2(int *p) {
    +    dosomething(p);     // defect: param p may NULL
    +    if (p != NULL) {    // means p may nullpointer here
    +        dosomething(p);
    +    }
    +    dosomething(p);     // defect forward_null:p may NULL
    +}
    +

    reverse_null

    reverse_null 检查已经使用过指针,但在后续又对指针进行了判空操作;会被认为之前使用指针也有可能是空指针。

    代码示例

    以下将提供一个或多个reverse_null案例

    void reverse_null(int *p) {
    +    dosomething(p);      // use p
    +    if (p != NULL) {    // defect reverse_null: It means p may NULL
    +        dosomething(p);
    +    }
    +    ...
    +

    glob_null_pointer

    glob_null_pointer 检查文件内全局指针是否为空,指针赋值将会被认为不为空指针,但检测到空指针判断则视为指针此时可能为空,如果在可能为空时使用则会报错

    代码示例

    以下将提供一个或多个glob_null_pointer案例

    int *p;
    +
    +
    +void thread1() {
    +    p = get_int_pointer();      // p is not NULL
    +    dosomething(p);     // good
    +    if (p != NULL) {
    +        something(p);   // good
    +    }
    +    something(p);  // defect: p may NULL, because check p before
    +}
    +
    +
    +void thread2() {
    +    *p = 6;     // defect: p may NULL
    +    if (p != NULL) {
    +        something(p);   // good
    +    }
    +    something(p);  // defect: p may NULL
    +}
    +

    函数重写

    包含规则

    仅类虚拟函数允许重写。

    function_override

    function_override 检查非虚拟函数重写的情况。

    代码示例

    以下提供一个或多个function_override代码案例

    
    +
    +class father{
    +    public:
    +        father(){};
    +        ~father(){};
    +    
    +    private:
    +        virtual void test(){};
    +        void test2(){ std::cout<<"hello";};
    +};
    +
    +class man{};
    +
    +
    +class son: public father, public man{
    +    public:
    +        son(){};
    +        ~son(){};
    +    private:
    +        void test(){ std::cout<<"hello";};  // allow: virtual function override
    +        void test2(){ std::cout<<"hello";};  // defect: bad override
    +};
    +

    死代码检查

    dead_code

    dead_code 检查永远不会执行到的代码,主要为在同一作用域内 return, break 后的代码

    代码示例

    以下提供一个或多个dead_code代码案例

    // C/Cpp
    +void dead_code(int t) {
    +    int sum = 0;
    +    for (int i = 1; i <= 100; i++) {
    +        if (i == t) {
    +            break;
    +            sum = t;    // Defect: dead_code
    +        }
    +        sum += i;
    +    }
    +}
    +

    dead_branch

    dead_branch 检查永远不会被执行到的分支代码,其原因可能是具有相同效果的控制语句或某些条件在特定情况下永远不会执行。

    代码示例

    以下提供一个或多个dead_branch代码案例

    
    +void dead_branch(int i) {
    +    if (i < 100) {
    +        if ( i > 100) {     // Defect: dead_branch, i 属于 (-inf, 100) 不存在 (100, inf)的可能
    +            dosomething() ;
    +        }
    +        return;
    +    } else if (i >= 100) {
    +        if ( i < 99 ) {     // Defect: dead_branch, i 属于[100, inf) 不存在 (-inf, 99)的可能
    +            dosomething();
    +        }
    +        return;
    +    } else if (i < 10){     // Defect: dead_branch, 在前面分支中已经包含了所有i的可能,这里已经不存在 (-inf, 10)的可能
    +        dosomething();
    +    }
    +    else {                  // Defect: dead_branch, 在前面分支中已经包含了所有i的可能
    +        dosomething();
    +    }
    +    return;
    +}
    +
    +

    变量初始化检查

    包含规则

    uinit

    uinit 检查变量在定义后直接使用,却没有初始化的场景;使用未初始化的变量 可能导致无法预测的行为、崩溃和安全漏洞。

    规则参数
    代码示例

    以下提供一个或多个 uinit 代码案例

    
    +void test(char* t) {
    +    std::cout<< t << std::endl;     // Defect: p 作为函数参数,此处未初始化。
    +    return;
    +}
    +
    +
    +int uinit(int i) {
    +    int a;
    +    char * p;
    +    test(p);    // deep_level = true
    +    if (i < 10)
    +        a = 1;
    +    else
    +        i = 1;
    +    return a;   // Defect: i大于10时,a并未赋值
    +}
    +
    `,125),s=[a];function r(v,u){return i(),n("div",null,s)}const t=e(l,[["render",r],["__file","TCA-Armory-Q1.html.vue"]]);export{t as default}; diff --git a/assets/TCA-Armory-Q1.html-188dfbc4.js b/assets/TCA-Armory-Q1.html-188dfbc4.js new file mode 100644 index 000000000..ba964691b --- /dev/null +++ b/assets/TCA-Armory-Q1.html-188dfbc4.js @@ -0,0 +1,318 @@ +import{_ as e,o as i,c as n,e as l}from"./app-2a91d8ab.js";const d={},a=l(`

    TCA-Armory-Q1工具介绍

    TCA-Armory-Q1, 又名 tca_ql_cpp 主要用于分析Cpp质量问题。

    规则详情

    线程锁检查

    包含规则:

    在使用多线程对文件全局变量或类成员在进行读写时,工具会对未正确的进行上锁操作和上锁异常而引发死锁的情况进行检查。

    支持的多线程标准库库包括(若有其他库需求可提issue):

    missing_lock

    missing_lock 如果发现多线程中某个全局变量在未持有锁便更新时,则会上报错误。

    代码示例

    以下提供一个或多个 missing_loc 案例 在下面代码中,函数 increase1, increase2 皆以将 counter 加到 1000 为目的。如果使用 increase1 函数则有可能多个线程皆在 1000 时进入循环导致最后 counter结果大于 1000

    int counter = 0;
    +std::mutex mtx;  // 保护counter
    +void increase1() {
    +    while (1) {
    +        if (counter <= 1000)
    +            counter++;  // defect: missing_lock
    +        else
    +            break;
    +    }
    +}
    +void increase2() {
    +    while (1) {
    +        mtx.lock();  // example_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx.unlock();  // example_release
    +    }
    +}
    +

    dead_lock

    dead_lock 如果发现文件内存在 mtx1 -> mtx2 的上锁顺序时,另存在mtx2 -> mtx1 的上锁顺序,视为死锁或存在死锁的可能,则会上报错误。 死锁发生时程序将会卡死无法正常执行。

    规则参数
    代码示例

    以下提供一个或多个 dead_lock 案例

    在下面代码中,函数 increase 以将 counter 加到 1000 为目的。但在线程 1 中第一次释放 mtx 后,线程 2 的 mtx 上锁,此时线程1等待线程2释放mtx,线程2等待线程1释放mtx2,形成死锁,程序卡死。

    int counter = 0;
    +std::mutex mtx;
    +std::mutex mtx2;
    +void increase() {
    +    while (1) {
    +        mtx.lock();
    +        mtx2.lock();
    +        mtx.unlock();
    +        mtx.lock();  // defect: dead_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +

    在下面代码中 线程函数increase1存在mtx -> mtx2 的顺序,increase2顺序为 mtx2 -> mtx;视为出现死锁。

    void increase1() {
    +    while (1) {
    +        mtx.lock();
    +        mtx2.lock();
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +void increase2() {
    +    while (1) {
    +        mtx2.lock();
    +        mtx.lock();  // defect: dead_lock; 
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +

    以下案例在better-lock参数为True时将会生效 使用better-lock规则会检查在上锁期间若调用其他函数时将视为可能会出现预期之外的异常,且上锁期间应只做对全局变量操作以提升性能

    void increase1() {
    +    while (1) {
    +        mtx.lock();
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        read_counter(counter);  // defect: dead_lock
    +        mtx.unlock()
    +    }
    +}
    +void read_counter(counter){
    +    std::cout << counter << std::endl;
    +    do_something_more();
    +}
    +void increase1() {
    +    while (1) {
    +        std::lock_guard<std::mutex> lk(mtx);  // good: 使用lock_guard会自动上锁解锁将不会检查dead_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        read_counter(counter);
    +    }
    +}
    +

    资源泄漏检查

    包含规则

    resource_leak

    resource_leak 在程序申请了资源但并未按时释放时上报错误 目前场景包括:句柄打开时未关闭,指针分配内存后没有及时释放

    代码示例

    以下将提供一个或多个resource_leak案例

    int leak_example1(int c) {
    +    void *p = malloc(10); 
    +    if(c)
    +        return -1; // defect: if c "p" is leaked
    +    free(p);
    +    return 0;
    +}
    +
    +int leak_example2() {
    +    void *p = malloc(10);
    +    void *q = malloc(20);
    +    if(!p || !q)
    +        return -1; // defect: "p" or "q" may be leaked if the other is NULL 
    +    /*...*/
    +    free(q);
    +    free(p);
    +    return 0;
    +}
    +
    +void leak_example3(int c) {
    +    FILE *p = fopen("starwar.anakin", "rb");
    +    if(c)
    +        return;       // defect: leaking file pointer "p"
    +    fclose(p);
    +}
    +
    TODO

    指针为返回值目前不会进行上报与检查,需要后期增加对返回值是否释放的检查

    无效值检查

    包含规则

    unused_value

    unused_value 检查那些赋予给变量的值是否正确被使用,存在连续两次赋予变量值的情况,视为第一次赋予的值未被正确使用,报出错误。 两次连续赋值可能存在条件控制语句出现错误、变量名拼写错误等情况。

    代码示例

    以下提供一个或多个unused_value案例

    以下函数会因为key的不同去不一样的神明,但实际上 Zeus Hades却永远不会使用到。

    const char* key_value(const int key) {
    +    const char * value = 0;
    +    if (key != 0) {
    +        value = "Zeus";
    +    } else if (key != 1) {
    +        value = "Hades";
    +    } 
    +    if (key != 2) { // Should be 'else if' here.
    +        value = "Poseidon";  // defect: unused_value Zeus Hades  never used
    +    }
    +    else {
    +        value = "Unknow
    +    }
    +    return result;
    +}
    +

    以下继续提供几个unused_value代码

    const char* key_value1(const int key) {
    +    const char * value = 0;
    +    value = "Zeus";  // defect: Zeus never used
    +    if (key == 1) {
    +        value = "Hades;
    +    } else if (key == 2) {
    +        value = "Poseidon";
    +    } else {  // May else need not be here
    +        value = "Unknow";
    +    }
    +    return value
    +}
    +
    +const char* key_value2(const int key) {
    +    const char * value = 0;
    +    value = "Zeus";  // better Zeus used
    +    if (key == 1) {
    +        value = "Hades;
    +    } else if (key == 2) {
    +        value = "Poseidon";
    +    }
    +    return value
    +}
    +
    +const char* key_value3(const int key) {
    +    const char * value = 0;
    +    if (key == 1) {
    +        value = "Hades;
    +    } else {
    +        value = "Poseidon";
    +    }
    +    value = "Zeus";  // defect: Hades Poseidon never used
    +    return value
    +}
    +

    数组溢出检查

    包含规则

    array_overflow

    array_overflow 检查数组越界的情况。不正确的缓存区访问可能损坏内存,导致程序崩溃或读取到权限外的内存。

    代码示例

    以下提供一个或多个array_overflow案例

    void foo() {
    +    int array[10];
    +    int i = get();
    +    // i = 9;
    +    if (i > 8 && i <= length(array)) {  // Shoud be i < length(array)
    +        array[i] = 1;  // defect: array[10] overflow
    +    }
    +    array[i] = 1;  // defect: array[10] overflow
    +}
    +
    +
    +void test(int i) {
    +    int n= 10;
    +    char *p = malloc(sizeof(int) * 10);
    +    int y = n;
    +    p[y] = 'a'; // defect: writing to buffer[y] overflow
    +}
    +
    TODO

    buff_overflow

    buff_overflow 检查strcpy,strcat字符串复制/拼接过程中长度不当导致的溢出, 同样gets scanf函数也视为不安全

    代码示例

    以下提供一个或多个buff_overflow案例

    void overflow1() {
    +
    +    char a[4]={0};
    +        strcpy(a, "Poseidon");  // defect: len("Poseidon") > 4 strncpy is better
    +    return;
    +}
    +
    +void overflow2() {
    +    char s1[10] = "1";
    +    char s2[] = "1234567890";
    +    strcat(s1, s2);  // defect: len(s1 + s2) > 10
    +    // strncat(s1, s2, 6)  // strncat is better
    +    return 0;
    +}
    +
    +

    指针检查

    包含规则

    func_ret_null

    func_ret_null 函数返回值可能为nullpointer,但是调用该函数时指针未经判空便进行使用
    在选用func_ret_null_full 时, 检查器会在项目内全局搜索空指针函数的调用情况,否则只会在相关文件内进行检查。

    代码示例

    以下提供一个或多个func_ret_null代码案例

    在下面代码中test函数中调用get_name可能返回空指针,在后续使用name指针前应该判断是否为空指针

    // name.hpp
    +
    +char* get_name(int id) {
    +    char* name = 0;
    +    if (id == 1) {
    +        name = "Zeus";
    +    } else if (id == 2) {
    +        name = "Hades"
    +    } else {
    +        return nullpointer;
    +    }
    +    return name;
    +}
    +
    +void test(int i) {
    +    char* name = get_name(i);
    +    dosomething(name);  // defect: name may nullpointer should check it
    +    if (name != nullpointer) {
    +        dosomething(name);  // good
    +    }
    +}
    +
    +

    在选用full_ret_null_full时,将会全局分析函数get_name调用情况

    // third.cpp
    +# include "name.h"
    +
    +void name_test(int i) {
    +    char* name = get_name(i);
    +    dosomething(name); // defect
    +}
    +

    use_after_free

    use_after_free 检查当指针已经被释放但在后续仍然使用该指针的情况。

    代码示例

    以下提供一个或多个use_after_free代码案例

    通常情况下已经释放的指针只允许置空或重新指向新的值,不允许存在读取或作为函数参数使用。

    
    +void UAR() {
    +    int* p = new int[];
    +    p = get_array();
    +    dosomething(p);
    +    delete p;
    +    p = NULL;  // allow
    +    p = get_array();  // allow: get array again
    +    delete p;
    +    dosomething(p);  // defect: use as param
    +    std::cout << "p[0] = " << p[0] << std::endl;  // defect: read p
    +}
    +

    forward_null

    forward_null 检查可能导致程序终止或运行时异常的错误。它查找指针或引用被检查是否为 null 或被赋值为 null,且之后被解引用的很多情况。

    规则参数
    代码示例

    以下提供一个或多个forward_null代码案例

    指针曾经有过检查null的操作则会视为有可能为空指针,之后在未被确认为非空指针情况下直接使用。将会视为forward_null错误

    void forward_null_1() {
    +    int * p;
    +    p = get_int_pointer();
    +    dosomething(p);
    +    if (p == NULL) {
    +        std::cout << "Null Pointer Find" << srd::endl;
    +        // return;      // prefer: if return here
    +    } else {
    +        dosomething(p);     // good: p is not NULL
    +    }
    +    dosomething(p);     // defect forward_null: p may NULL
    +}
    +
    +
    +void forward_null_2(int *p) {
    +    dosomething(p);
    +    if (p == NULL) {
    +        return;
    +    } else {
    +        dosomething(p);     // good: p is not NULL
    +    }
    +    dosomething(p);     // good
    +    ...
    +    if (p != NULL) {    // means p may nullpointer here
    +        dosomething(p);
    +    }
    +    dosomething(p);     // defect forward_null:p may NULL
    +}
    +

    以下案例在设置trust_paramFalse时将会生效,其将会默认认为函数参数存在空指针可能,必须确认无空指针可能时方可使用

    void forward_null_2(int *p) {
    +    dosomething(p);     // defect: param p may NULL
    +    if (p != NULL) {    // means p may nullpointer here
    +        dosomething(p);
    +    }
    +    dosomething(p);     // defect forward_null:p may NULL
    +}
    +

    reverse_null

    reverse_null 检查已经使用过指针,但在后续又对指针进行了判空操作;会被认为之前使用指针也有可能是空指针。

    代码示例

    以下将提供一个或多个reverse_null案例

    void reverse_null(int *p) {
    +    dosomething(p);      // use p
    +    if (p != NULL) {    // defect reverse_null: It means p may NULL
    +        dosomething(p);
    +    }
    +    ...
    +

    glob_null_pointer

    glob_null_pointer 检查文件内全局指针是否为空,指针赋值将会被认为不为空指针,但检测到空指针判断则视为指针此时可能为空,如果在可能为空时使用则会报错

    代码示例

    以下将提供一个或多个glob_null_pointer案例

    int *p;
    +
    +
    +void thread1() {
    +    p = get_int_pointer();      // p is not NULL
    +    dosomething(p);     // good
    +    if (p != NULL) {
    +        something(p);   // good
    +    }
    +    something(p);  // defect: p may NULL, because check p before
    +}
    +
    +
    +void thread2() {
    +    *p = 6;     // defect: p may NULL
    +    if (p != NULL) {
    +        something(p);   // good
    +    }
    +    something(p);  // defect: p may NULL
    +}
    +

    函数重写

    包含规则

    仅类虚拟函数允许重写。

    function_override

    function_override 检查非虚拟函数重写的情况。

    代码示例

    以下提供一个或多个function_override代码案例

    
    +
    +class father{
    +    public:
    +        father(){};
    +        ~father(){};
    +    
    +    private:
    +        virtual void test(){};
    +        void test2(){ std::cout<<"hello";};
    +};
    +
    +class man{};
    +
    +
    +class son: public father, public man{
    +    public:
    +        son(){};
    +        ~son(){};
    +    private:
    +        void test(){ std::cout<<"hello";};  // allow: virtual function override
    +        void test2(){ std::cout<<"hello";};  // defect: bad override
    +};
    +
    `,109),s=[a];function r(u,v){return i(),n("div",null,s)}const t=e(d,[["render",r],["__file","TCA-Armory-Q1.html.vue"]]);export{t as default}; diff --git a/assets/TCA-Armory-Q1.html-20e46388.js b/assets/TCA-Armory-Q1.html-20e46388.js new file mode 100644 index 000000000..7e65dbc59 --- /dev/null +++ b/assets/TCA-Armory-Q1.html-20e46388.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-b2de67c2","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html","title":"TCA-Armory-Q1工具介绍","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"线程锁检查","slug":"线程锁检查","link":"#线程锁检查","children":[]},{"level":2,"title":"资源泄漏检查","slug":"资源泄漏检查","link":"#资源泄漏检查","children":[]},{"level":2,"title":"无效值检查","slug":"无效值检查","link":"#无效值检查","children":[]},{"level":2,"title":"数组溢出检查","slug":"数组溢出检查","link":"#数组溢出检查","children":[]},{"level":2,"title":"指针检查","slug":"指针检查","link":"#指针检查","children":[]},{"level":2,"title":"函数重写","slug":"函数重写","link":"#函数重写","children":[]},{"level":2,"title":"死代码检查","slug":"死代码检查","link":"#死代码检查","children":[]},{"level":2,"title":"变量初始化检查","slug":"变量初始化检查","link":"#变量初始化检查","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/工具/TCA-Armory-Q1.md"}');export{l as data}; diff --git a/assets/TCA-Armory-Q1.html-bb42cfff.js b/assets/TCA-Armory-Q1.html-bb42cfff.js new file mode 100644 index 000000000..88633d38c --- /dev/null +++ b/assets/TCA-Armory-Q1.html-bb42cfff.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-01906c04","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html","title":"TCA-Armory-Q1工具介绍","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"线程锁检查","slug":"线程锁检查","link":"#线程锁检查","children":[]},{"level":2,"title":"资源泄漏检查","slug":"资源泄漏检查","link":"#资源泄漏检查","children":[]},{"level":2,"title":"无效值检查","slug":"无效值检查","link":"#无效值检查","children":[]},{"level":2,"title":"数组溢出检查","slug":"数组溢出检查","link":"#数组溢出检查","children":[]},{"level":2,"title":"指针检查","slug":"指针检查","link":"#指针检查","children":[]},{"level":2,"title":"函数重写","slug":"函数重写","link":"#函数重写","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/工具/TCA-Armory-Q1.md"}');export{e as data}; diff --git a/assets/TCA-Armory-R.html-024d2d34.js b/assets/TCA-Armory-R.html-024d2d34.js new file mode 100644 index 000000000..06da996cd --- /dev/null +++ b/assets/TCA-Armory-R.html-024d2d34.js @@ -0,0 +1 @@ +import{_ as i,a}from"./createcustomrule-3919c596.js";import{_ as d,a as h}from"./scheme_codelint_03-5bcd9286.js";import{_,r as s,o as p,c as u,a as e,b as o,d as t,w as c,e as l}from"./app-2a91d8ab.js";const g={},x=l('

    TCA-Armory-R 使用手册

    TCA独立工具TCA-Armory-R,别名RegexScanner,正则匹配工具,支持扫描文件名称和文本内容,支持页面直接自定义创建规则

    适用场景

    对比RegexScan、RegexFileScan

    ',5),m=e("li",null,"单个工具即可完成文件名和文件内容的检查",-1),f=e("li",null,"扫描速度更快,大概减少60%的耗时",-1),A=e("li",null,"单条规则内支持多条正则表达式",-1),k=e("li",null,"支持正则过滤",-1),b=e("li",null,"支持匹配分组和熵检测",-1),y={href:"https://pkg.go.dev/regexp/syntax",target:"_blank",rel:"noopener noreferrer"},E=e("h2",{id:"快速接入",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#快速接入","aria-hidden":"true"},"#"),o(" 快速接入")],-1),T=e("p",null,"以下是接入步骤:",-1),C=e("li",null,"在代码分析创建项目,自定义规则包里添加想要进行扫描的TCA-Armory-R规则",-1),v=e("li",null,"启动分析即可",-1),R=l('

    自定义规则

    1. 开放支持自定义规则权限

    开放支持自定义规则权限,需平台管理员在管理入口-工具管理中找到TCA-Armory-R工具,并将其权限状态调整为支持自定义规则

    ',3),B=l('

    2. 添加规则

    进入工具管理入口,进入TCA-Armory-R工具页面,选择上方的“自定义规则”,然后点击“添加规则”:

    添加自定义规则

    3. 填写规则信息

    进入“创建规则”页面,按照需求填写相关信息,完成后,点击页面最后的“确定”按钮提交。

    规则示例:

    规则扫描场景:扫描代码中的 github token,如果token以明文形式写在源码文件中,会造成隐私泄露,可能造成严重的安全事故。

    正则表达式:匹配 github token 字符串,根据github token的一般形式,可以推断出正则表达式 ((ghp|gho|ghu|ghs)_[0-9a-zA-Z]{36})。

    ',8),N={class:"custom-container tip"},z=e("p",{class:"custom-container-title"},"提示",-1),F={href:"https://pkg.go.dev/regexp/syntax",target:"_blank",rel:"noopener noreferrer"},S=l('

    建议先测试好正则表达式是否正确,正则表达式测试网站推荐:http://tool.oschina.net/regex

    填写自定义规则

    字段解释

    规则名称、前端展示名称:建议使用单词首字母大写的格式,如 DetectedGithubToken

    规则简述:作为扫描出来到问题标题

    规则参数:

    提示

    规则参数中的(3)(4)(5)属于新功能,需要将客户端client和工具库TCA-Armory更新到最新版本

    ',7),j=e("li",null,[e("p",null,"(1) 参数格式类似ini的格式, 也就是key = value的格式")],-1),q=e("code",null,"regex",-1),w=e("code",null,"regex=((ghp|gho|ghu|ghs)_[0-9a-zA-Z]{36})",-1),Z={href:"https://pkg.go.dev/regexp/syntax",target:"_blank",rel:"noopener noreferrer"},L={href:"http://tool.oschina.net/regex",target:"_blank",rel:"noopener noreferrer"},V=l("
  • (3) [可选] regex{N} 参数,只有在已有regex参数情况下生效,用于扩展扫描的正则表达式,其中 N 从1开始计数,例如: regex1=EAAAACZAVC6ygB[0-9A-Za-z]+, regex2=EAAAAZAw4[0-9A-Za-z]+regex{N}regex的表达式均为关系,每一个匹配结果上报一个问题。

  • (4) [可选] regex_not 参数,用于指定正则过滤表达式,例如: regex_not=(?i)example。可以对(2)(3)中regex匹配的字符串进行筛选,如果匹配则过滤该结果,不予上报。

  • (5) [可选] regex_not{N} 参数,只有在已有regex_not参数情况下生效,用于扩展正则过滤表达式,其中 N 从1开始计数,例如: regex_not1=(?i)test, regex_not2=(?i)fakeregex_not{N}regex_not的表达式均为关系。

  • (6) [必选] msg 参数,用于展现issue说明, 例如: msg=检测到高危函数%s,建议替换。

  • (7) [可选] ignore_comment 参数,用于指定是否忽略注释代码,可选值:True、true、False、false 。例如: ignore_comment=True, 默认是False

  • (8) [可选] file_scan 参数,用于指定是否扫描文件名称,可选值:True、true、False、false 。例如: file_scan=True, 默认是False

  • (9) [可选] include 参数,用于指定只扫描的文件匹配范围,基于相对路径,使用通配符格式,多项使用英文分号(;)隔开。例如: include=src/test;src/main.*;*.cpp

  • ",7),G=e("p",null,[o("(10) [可选] "),e("code",null,"exclude"),o(" 参数,用于指定不扫描的文件匹配范围,格式同include参数,例如: "),e("code",null,"exclude=tests;*.json")],-1),D=e("code",null,"exclude",-1),I=e("code",null,"include",-1),M={href:"https://pkg.go.dev/path/filepath#Match",target:"_blank",rel:"noopener noreferrer"},H=e("code",null,"**",-1),J=e("strong",null,"默认匹配前后目录",-1),K=l("
    1. exclude=*.py 会忽略以下文件: main.py, src/main.py, main.py/install.sh
    2. exclude=tests 会忽略以下文件: tests/test.py, a/tests/b/test.py
    3. include=main.* 会只扫描以下文件: src/main.py, app/main.go
    4. include=srcexclude=src/lib 会只扫描以下文件: src/main.py, src/project/proj.py; 忽略以下文件: src/lib/lib.py, src/lib/package/pack.js
    ",1),O=e("li",null,[e("p",null,[o("(11)[可选] "),e("code",null,"match_group"),o(" 参数,用于指定正则匹配的分组,数值不能大于正则匹配分组数,例如: "),e("code",null,"regex=(aws_account_id)\\s{0,50}(:|=>|=)\\s{0,50}([0-9]{12})"),e("code",null,"match_group=3"),o(",匹配到第3个分组"),e("code",null,"([0-9]{12})")])],-1),P=e("p",null,[o("(12)[可选] "),e("code",null,"entropy"),o(" 参数,用于指定正则匹配结果的最小信息熵,例如:"),e("code",null,"entropy=3"),o(",熵不大于3的匹配结果将被过滤")],-1),Q={href:"https://zh.wikipedia.org/wiki/%E7%86%B5_(%E4%BF%A1%E6%81%AF%E8%AE%BA)",target:"_blank",rel:"noopener noreferrer"},U=e("h3",{id:"_4-将自定义规则添加到项目分析方案中",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#_4-将自定义规则添加到项目分析方案中","aria-hidden":"true"},"#"),o(" 4. 将自定义规则添加到项目分析方案中")],-1),W=e("p",null,"进入 代码分析 - 分析方案 - 代码检查 - 自定义规则包 - 查看详细规则,添加规则。",-1),X=e("p",null,[e("img",{src:d,alt:"点击自定义规则包"})],-1),Y=e("p",null,[e("img",{src:h,alt:"添加规则"})],-1);function $(ee,oe){const n=s("ExternalLinkIcon"),r=s("RouterLink");return p(),u("div",null,[x,e("ul",null,[m,f,A,k,b,e("li",null,[e("em",null,[o("只支持"),e("a",y,[o("go的正则语法"),t(n)])])])]),E,T,e("ol",null,[e("li",null,[o("属于增强分析模块,需要先"),t(r,{to:"/zh/quickStarted/enhanceDeploy.html"},{default:c(()=>[o("部署CLS")]),_:1})]),C,v]),R,e("p",null,[o("规则权限详见"),t(r,{to:"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.html"},{default:c(()=>[o("自定义规则权限说明")]),_:1})]),B,e("div",N,[z,e("p",null,[e("strong",null,[o("只支持go正则语法: "),e("a",F,[o("regexp"),t(n)])])])]),S,e("ul",null,[j,e("li",null,[e("p",null,[o("(2) [必选] "),q,o(" 参数,用于指定扫描的正则表达式,例如: "),w,o("。"),e("strong",null,[o("只支持go正则语法: "),e("a",Z,[o("regexp"),t(n)])]),o("。建议先测试好正则表达式是否正确,正则表达式测试网站推荐:"),e("a",L,[o("http://tool.oschina.net/regex"),t(n)])])]),V,e("li",null,[G,e("blockquote",null,[e("p",null,[o("路径过滤("),D,o(", "),I,o(")采用Glob-Style的匹配模式,详见 "),e("a",M,[o("Go-filepath-Match"),t(n)]),o(", 除了 "),H,o(" 用来匹配零或多个目录,本工具会"),J,o("。举例:")]),K])]),O,e("li",null,[P,e("blockquote",null,[e("p",null,[o("信息熵:"),e("a",Q,[o("熵(信息论)"),t(n)]),o(" 可用于敏感信息(密钥、token)的检测 含义:可以理解为字符串的混乱程度,字符越随机,熵越大。因此,设置合适的熵,可以过滤掉一些误报或者人为测试用例。")])])])]),U,W,X,Y])}const re=_(g,[["render",$],["__file","TCA-Armory-R.html.vue"]]);export{re as default}; diff --git a/assets/TCA-Armory-R.html-0470623e.js b/assets/TCA-Armory-R.html-0470623e.js new file mode 100644 index 000000000..f786690b9 --- /dev/null +++ b/assets/TCA-Armory-R.html-0470623e.js @@ -0,0 +1 @@ +import{_ as i,a}from"./createcustomrule-3919c596.js";import{_ as d,a as h}from"./scheme_codelint_03-5bcd9286.js";import{_,r as s,o as p,c as u,a as e,b as o,d as t,w as c,e as l}from"./app-2a91d8ab.js";const g={},x=l('

    TCA-Armory-R 使用手册

    TCA独立工具TCA-Armory-R,别名RegexScanner,正则匹配工具,支持扫描文件名称和文本内容,支持页面直接自定义创建规则

    适用场景

    对比RegexScan、RegexFileScan

    ',5),m=e("li",null,"单个工具即可完成文件名和文件内容的检查",-1),f=e("li",null,"扫描速度更快,大概减少60%的耗时",-1),A=e("li",null,"单条规则内支持多条正则表达式",-1),k=e("li",null,"支持正则过滤",-1),b=e("li",null,"支持匹配分组和熵检测",-1),y={href:"https://pkg.go.dev/regexp/syntax",target:"_blank",rel:"noopener noreferrer"},E=e("h2",{id:"快速接入",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#快速接入","aria-hidden":"true"},"#"),o(" 快速接入")],-1),T=e("p",null,"以下是接入步骤:",-1),C=e("li",null,"在代码分析创建项目,自定义规则包里添加想要进行扫描的TCA-Armory-R规则",-1),v=e("li",null,"启动分析即可",-1),R=l('

    自定义规则

    1. 开放支持自定义规则权限

    开放支持自定义规则权限,需平台管理员在管理入口-工具管理中找到TCA-Armory-R工具,并将其权限状态调整为支持自定义规则

    ',3),B=l('

    2. 添加规则

    进入工具管理入口,进入TCA-Armory-R工具页面,选择上方的“自定义规则”,然后点击“添加规则”:

    添加自定义规则

    3. 填写规则信息

    进入“创建规则”页面,按照需求填写相关信息,完成后,点击页面最后的“确定”按钮提交。

    规则示例:

    规则扫描场景:扫描代码中的 github token,如果token以明文形式写在源码文件中,会造成隐私泄露,可能造成严重的安全事故。

    正则表达式:匹配 github token 字符串,根据github token的一般形式,可以推断出正则表达式 ((ghp|gho|ghu|ghs)_[0-9a-zA-Z]{36})。

    ',8),N={class:"custom-container tip"},F=e("p",{class:"custom-container-title"},"TIP",-1),S={href:"https://pkg.go.dev/regexp/syntax",target:"_blank",rel:"noopener noreferrer"},j=l('

    建议先测试好正则表达式是否正确,正则表达式测试网站推荐:http://tool.oschina.net/regex

    填写自定义规则

    字段解释

    规则名称、前端展示名称:建议使用单词首字母大写的格式,如 DetectedGithubToken

    规则简述:作为扫描出来到问题标题

    规则参数:

    TIP

    规则参数中的(3)(4)(5)属于新功能,需要将客户端client和工具库TCA-Armory更新到最新版本

    ',7),q=e("li",null,[e("p",null,"(1) 参数格式类似ini的格式, 也就是key = value的格式")],-1),w=e("code",null,"regex",-1),Z=e("code",null,"regex=((ghp|gho|ghu|ghs)_[0-9a-zA-Z]{36})",-1),z={href:"https://pkg.go.dev/regexp/syntax",target:"_blank",rel:"noopener noreferrer"},L={href:"http://tool.oschina.net/regex",target:"_blank",rel:"noopener noreferrer"},V=l("
  • (3) [可选] regex{N} 参数,只有在已有regex参数情况下生效,用于扩展扫描的正则表达式,其中 N 从1开始计数,例如: regex1=EAAAACZAVC6ygB[0-9A-Za-z]+, regex2=EAAAAZAw4[0-9A-Za-z]+regex{N}regex的表达式均为关系,每一个匹配结果上报一个问题。

  • (4) [可选] regex_not 参数,用于指定正则过滤表达式,例如: regex_not=(?i)example。可以对(2)(3)中regex匹配的字符串进行筛选,如果匹配则过滤该结果,不予上报。

  • (5) [可选] regex_not{N} 参数,只有在已有regex_not参数情况下生效,用于扩展正则过滤表达式,其中 N 从1开始计数,例如: regex_not1=(?i)test, regex_not2=(?i)fakeregex_not{N}regex_not的表达式均为关系。

  • (6) [必选] msg 参数,用于展现issue说明, 例如: msg=检测到高危函数%s,建议替换。

  • (7) [可选] ignore_comment 参数,用于指定是否忽略注释代码,可选值:True、true、False、false 。例如: ignore_comment=True, 默认是False

  • (8) [可选] file_scan 参数,用于指定是否扫描文件名称,可选值:True、true、False、false 。例如: file_scan=True, 默认是False

  • (9) [可选] include 参数,用于指定只扫描的文件匹配范围,基于相对路径,使用通配符格式,多项使用英文分号(;)隔开。例如: include=src/test;src/main.*;*.cpp

  • ",7),I=e("p",null,[o("(10) [可选] "),e("code",null,"exclude"),o(" 参数,用于指定不扫描的文件匹配范围,格式同include参数,例如: "),e("code",null,"exclude=tests;*.json")],-1),G=e("code",null,"exclude",-1),D=e("code",null,"include",-1),M={href:"https://pkg.go.dev/path/filepath#Match",target:"_blank",rel:"noopener noreferrer"},P=e("code",null,"**",-1),H=e("strong",null,"默认匹配前后目录",-1),J=l("
    1. exclude=*.py 会忽略以下文件: main.py, src/main.py, main.py/install.sh
    2. exclude=tests 会忽略以下文件: tests/test.py, a/tests/b/test.py
    3. include=main.* 会只扫描以下文件: src/main.py, app/main.go
    4. include=srcexclude=src/lib 会只扫描以下文件: src/main.py, src/project/proj.py; 忽略以下文件: src/lib/lib.py, src/lib/package/pack.js
    ",1),K=e("li",null,[e("p",null,[o("(11)[可选] "),e("code",null,"match_group"),o(" 参数,用于指定正则匹配的分组,数值不能大于正则匹配分组数,例如: "),e("code",null,"regex=(aws_account_id)\\s{0,50}(:|=>|=)\\s{0,50}([0-9]{12})"),e("code",null,"match_group=3"),o(",匹配到第3个分组"),e("code",null,"([0-9]{12})")])],-1),O=e("p",null,[o("(12)[可选] "),e("code",null,"entropy"),o(" 参数,用于指定正则匹配结果的最小信息熵,例如:"),e("code",null,"entropy=3"),o(",熵不大于3的匹配结果将被过滤")],-1),Q={href:"https://zh.wikipedia.org/wiki/%E7%86%B5_(%E4%BF%A1%E6%81%AF%E8%AE%BA)",target:"_blank",rel:"noopener noreferrer"},U=e("h3",{id:"_4-将自定义规则添加到项目分析方案中",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#_4-将自定义规则添加到项目分析方案中","aria-hidden":"true"},"#"),o(" 4. 将自定义规则添加到项目分析方案中")],-1),W=e("p",null,"进入 代码分析 - 分析方案 - 代码检查 - 自定义规则包 - 查看详细规则,添加规则。",-1),X=e("p",null,[e("img",{src:d,alt:"点击自定义规则包"})],-1),Y=e("p",null,[e("img",{src:h,alt:"添加规则"})],-1);function $(ee,oe){const n=s("ExternalLinkIcon"),r=s("RouterLink");return p(),u("div",null,[x,e("ul",null,[m,f,A,k,b,e("li",null,[e("em",null,[o("只支持"),e("a",y,[o("go的正则语法"),t(n)])])])]),E,T,e("ol",null,[e("li",null,[o("属于增强分析模块,需要先"),t(r,{to:"/en/quickStarted/enhanceDeploy.html"},{default:c(()=>[o("部署CLS")]),_:1})]),C,v]),R,e("p",null,[o("规则权限详见"),t(r,{to:"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.html"},{default:c(()=>[o("自定义规则权限说明")]),_:1})]),B,e("div",N,[F,e("p",null,[e("strong",null,[o("只支持go正则语法: "),e("a",S,[o("regexp"),t(n)])])])]),j,e("ul",null,[q,e("li",null,[e("p",null,[o("(2) [必选] "),w,o(" 参数,用于指定扫描的正则表达式,例如: "),Z,o("。"),e("strong",null,[o("只支持go正则语法: "),e("a",z,[o("regexp"),t(n)])]),o("。建议先测试好正则表达式是否正确,正则表达式测试网站推荐:"),e("a",L,[o("http://tool.oschina.net/regex"),t(n)])])]),V,e("li",null,[I,e("blockquote",null,[e("p",null,[o("路径过滤("),G,o(", "),D,o(")采用Glob-Style的匹配模式,详见 "),e("a",M,[o("Go-filepath-Match"),t(n)]),o(", 除了 "),P,o(" 用来匹配零或多个目录,本工具会"),H,o("。举例:")]),J])]),K,e("li",null,[O,e("blockquote",null,[e("p",null,[o("信息熵:"),e("a",Q,[o("熵(信息论)"),t(n)]),o(" 可用于敏感信息(密钥、token)的检测 含义:可以理解为字符串的混乱程度,字符越随机,熵越大。因此,设置合适的熵,可以过滤掉一些误报或者人为测试用例。")])])])]),U,W,X,Y])}const re=_(g,[["render",$],["__file","TCA-Armory-R.html.vue"]]);export{re as default}; diff --git a/assets/TCA-Armory-R.html-a4907275.js b/assets/TCA-Armory-R.html-a4907275.js new file mode 100644 index 000000000..9835a9293 --- /dev/null +++ b/assets/TCA-Armory-R.html-a4907275.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6d0cdd3c","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html","title":"TCA-Armory-R 使用手册","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"适用场景","slug":"适用场景","link":"#适用场景","children":[]},{"level":2,"title":"对比RegexScan、RegexFileScan","slug":"对比regexscan、regexfilescan","link":"#对比regexscan、regexfilescan","children":[]},{"level":2,"title":"快速接入","slug":"快速接入","link":"#快速接入","children":[]},{"level":2,"title":"自定义规则","slug":"自定义规则","link":"#自定义规则","children":[{"level":3,"title":"1. 开放支持自定义规则权限","slug":"_1-开放支持自定义规则权限","link":"#_1-开放支持自定义规则权限","children":[]},{"level":3,"title":"2. 添加规则","slug":"_2-添加规则","link":"#_2-添加规则","children":[]},{"level":3,"title":"3. 填写规则信息","slug":"_3-填写规则信息","link":"#_3-填写规则信息","children":[]},{"level":3,"title":"规则示例:","slug":"规则示例","link":"#规则示例","children":[]},{"level":3,"title":"字段解释","slug":"字段解释","link":"#字段解释","children":[]},{"level":3,"title":"4. 将自定义规则添加到项目分析方案中","slug":"_4-将自定义规则添加到项目分析方案中","link":"#_4-将自定义规则添加到项目分析方案中","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/工具/TCA-Armory-R.md"}');export{e as data}; diff --git a/assets/TCA-Armory-R.html-d83fb336.js b/assets/TCA-Armory-R.html-d83fb336.js new file mode 100644 index 000000000..5deb050b4 --- /dev/null +++ b/assets/TCA-Armory-R.html-d83fb336.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-027ae47e","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html","title":"TCA-Armory-R 使用手册","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"适用场景","slug":"适用场景","link":"#适用场景","children":[]},{"level":2,"title":"对比RegexScan、RegexFileScan","slug":"对比regexscan、regexfilescan","link":"#对比regexscan、regexfilescan","children":[]},{"level":2,"title":"快速接入","slug":"快速接入","link":"#快速接入","children":[]},{"level":2,"title":"自定义规则","slug":"自定义规则","link":"#自定义规则","children":[{"level":3,"title":"1. 开放支持自定义规则权限","slug":"_1-开放支持自定义规则权限","link":"#_1-开放支持自定义规则权限","children":[]},{"level":3,"title":"2. 添加规则","slug":"_2-添加规则","link":"#_2-添加规则","children":[]},{"level":3,"title":"3. 填写规则信息","slug":"_3-填写规则信息","link":"#_3-填写规则信息","children":[]},{"level":3,"title":"规则示例:","slug":"规则示例","link":"#规则示例","children":[]},{"level":3,"title":"字段解释","slug":"字段解释","link":"#字段解释","children":[]},{"level":3,"title":"4. 将自定义规则添加到项目分析方案中","slug":"_4-将自定义规则添加到项目分析方案中","link":"#_4-将自定义规则添加到项目分析方案中","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/工具/TCA-Armory-R.md"}');export{e as data}; diff --git a/assets/Welcome-e497e1a9.png b/assets/Welcome-e497e1a9.png new file mode 100644 index 000000000..0184d09b4 Binary files /dev/null and b/assets/Welcome-e497e1a9.png differ diff --git a/assets/addcustomrules-220aab00.png b/assets/addcustomrules-220aab00.png new file mode 100644 index 000000000..a6749e7c8 Binary files /dev/null and b/assets/addcustomrules-220aab00.png differ diff --git a/assets/app-2a91d8ab.js b/assets/app-2a91d8ab.js new file mode 100644 index 000000000..bb09ddd32 --- /dev/null +++ b/assets/app-2a91d8ab.js @@ -0,0 +1,10 @@ +const Ys="modulepreload",Xs=function(e){return"/CodeAnalysis/"+e},Jn={},u=function(t,l,i){if(!l||l.length===0)return t();const n=document.getElementsByTagName("link");return Promise.all(l.map(r=>{if(r=Xs(r),r in Jn)return;Jn[r]=!0;const o=r.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!i)for(let d=n.length-1;d>=0;d--){const E=n[d];if(E.href===r&&(!o||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${s}`))return;const c=document.createElement("link");if(c.rel=o?"stylesheet":Ys,o||(c.as="script",c.crossOrigin=""),c.href=r,document.head.appendChild(c),o)return new Promise((d,E)=>{c.addEventListener("load",d),c.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())};function vn(e,t){const l=Object.create(null),i=e.split(",");for(let n=0;n!!l[n.toLowerCase()]:n=>!!l[n]}const ye={},il=[],nt=()=>{},Zs=()=>!1,ea=/^on[^a-z]/,Vl=e=>ea.test(e),fn=e=>e.startsWith("onUpdate:"),Pe=Object.assign,An=(e,t)=>{const l=e.indexOf(t);l>-1&&e.splice(l,1)},ta=Object.prototype.hasOwnProperty,he=(e,t)=>ta.call(e,t),X=Array.isArray,nl=e=>ki(e)==="[object Map]",vo=e=>ki(e)==="[object Set]",re=e=>typeof e=="function",ge=e=>typeof e=="string",gn=e=>typeof e=="symbol",be=e=>e!==null&&typeof e=="object",fo=e=>be(e)&&re(e.then)&&re(e.catch),Ao=Object.prototype.toString,ki=e=>Ao.call(e),la=e=>ki(e).slice(8,-1),go=e=>ki(e)==="[object Object]",mn=e=>ge(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,yl=vn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),bi=e=>{const t=Object.create(null);return l=>t[l]||(t[l]=e(l))},ia=/-(\w)/g,dt=bi(e=>e.replace(ia,(t,l)=>l?l.toUpperCase():"")),na=/\B([A-Z])/g,Jt=bi(e=>e.replace(na,"-$1").toLowerCase()),yi=bi(e=>e.charAt(0).toUpperCase()+e.slice(1)),wi=bi(e=>e?`on${yi(e)}`:""),Pl=(e,t)=>!Object.is(e,t),Si=(e,t)=>{for(let l=0;l{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:l})},ra=e=>{const t=parseFloat(e);return isNaN(t)?e:t},oa=e=>{const t=ge(e)?Number(e):NaN;return isNaN(t)?e:t};let Gn;const Yi=()=>Gn||(Gn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function jl(e){if(X(e)){const t={};for(let l=0;l{if(l){const i=l.split(aa);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function Ue(e){let t="";if(ge(e))t=e;else if(X(e))for(let l=0;lge(e)?e:e==null?"":X(e)||be(e)&&(e.toString===Ao||!re(e.toString))?JSON.stringify(e,_o,2):String(e),_o=(e,t)=>t&&t.__v_isRef?_o(e,t.value):nl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((l,[i,n])=>(l[`${i} =>`]=n,l),{})}:vo(t)?{[`Set(${t.size})`]:[...t.values()]}:be(t)&&!X(t)&&!go(t)?String(t):t;let Qe;class ha{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Qe,!t&&Qe&&(this.index=(Qe.scopes||(Qe.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const l=Qe;try{return Qe=this,t()}finally{Qe=l}}}on(){Qe=this}off(){Qe=this.parent}stop(t){if(this._active){let l,i;for(l=0,i=this.effects.length;l{const t=new Set(e);return t.w=0,t.n=0,t},Bo=e=>(e.w&xt)>0,ko=e=>(e.n&xt)>0,Aa=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let l=0;for(let i=0;i{(d==="length"||d>=a)&&s.push(c)})}else switch(l!==void 0&&s.push(o.get(l)),t){case"add":X(e)?mn(l)&&s.push(o.get("length")):(s.push(o.get(Ut)),nl(e)&&s.push(o.get(Zi)));break;case"delete":X(e)||(s.push(o.get(Ut)),nl(e)&&s.push(o.get(Zi)));break;case"set":nl(e)&&s.push(o.get(Ut));break}if(s.length===1)s[0]&&en(s[0]);else{const a=[];for(const c of s)c&&a.push(...c);en(_n(a))}}function en(e,t){const l=X(e)?e:[...e];for(const i of l)i.computed&&Xn(i);for(const i of l)i.computed||Xn(i)}function Xn(e,t){(e!==lt||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function ma(e,t){var l;return(l=ci.get(e))==null?void 0:l.get(t)}const _a=vn("__proto__,__v_isRef,__isVue"),Fo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(gn)),pa=Bn(),Ba=Bn(!1,!0),ka=Bn(!0),Zn=ba();function ba(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...l){const i=fe(this);for(let r=0,o=this.length;r{e[t]=function(...l){vl();const i=fe(this)[t].apply(this,l);return fl(),i}}),e}function ya(e){const t=fe(this);return We(t,"has",e),t.hasOwnProperty(e)}function Bn(e=!1,t=!1){return function(i,n,r){if(n==="__v_isReactive")return!e;if(n==="__v_isReadonly")return e;if(n==="__v_isShallow")return t;if(n==="__v_raw"&&r===(e?t?Ma:Po:t?To:Co).get(i))return i;const o=X(i);if(!e){if(o&&he(Zn,n))return Reflect.get(Zn,n,r);if(n==="hasOwnProperty")return ya}const s=Reflect.get(i,n,r);return(gn(n)?Fo.has(n):_a(n))||(e||We(i,"get",n),t)?s:Re(s)?o&&mn(n)?s:s.value:be(s)?e?Ml(s):Al(s):s}}const Fa=Do(),Da=Do(!0);function Do(e=!1){return function(l,i,n,r){let o=l[i];if(al(o)&&Re(o)&&!Re(n))return!1;if(!e&&(!ui(n)&&!al(n)&&(o=fe(o),n=fe(n)),!X(l)&&Re(o)&&!Re(n)))return o.value=n,!0;const s=X(l)&&mn(i)?Number(i)e,Fi=e=>Reflect.getPrototypeOf(e);function Kl(e,t,l=!1,i=!1){e=e.__v_raw;const n=fe(e),r=fe(t);l||(t!==r&&We(n,"get",t),We(n,"get",r));const{has:o}=Fi(n),s=i?kn:l?Fn:zl;if(o.call(n,t))return s(e.get(t));if(o.call(n,r))return s(e.get(r));e!==n&&e.get(t)}function Ql(e,t=!1){const l=this.__v_raw,i=fe(l),n=fe(e);return t||(e!==n&&We(i,"has",e),We(i,"has",n)),e===n?l.has(e):l.has(e)||l.has(n)}function Jl(e,t=!1){return e=e.__v_raw,!t&&We(fe(e),"iterate",Ut),Reflect.get(e,"size",e)}function er(e){e=fe(e);const t=fe(this);return Fi(t).has.call(t,e)||(t.add(e),mt(t,"add",e,e)),this}function tr(e,t){t=fe(t);const l=fe(this),{has:i,get:n}=Fi(l);let r=i.call(l,e);r||(e=fe(e),r=i.call(l,e));const o=n.call(l,e);return l.set(e,t),r?Pl(t,o)&&mt(l,"set",e,t):mt(l,"add",e,t),this}function lr(e){const t=fe(this),{has:l,get:i}=Fi(t);let n=l.call(t,e);n||(e=fe(e),n=l.call(t,e)),i&&i.call(t,e);const r=t.delete(e);return n&&mt(t,"delete",e,void 0),r}function ir(){const e=fe(this),t=e.size!==0,l=e.clear();return t&&mt(e,"clear",void 0,void 0),l}function Gl(e,t){return function(i,n){const r=this,o=r.__v_raw,s=fe(o),a=t?kn:e?Fn:zl;return!e&&We(s,"iterate",Ut),o.forEach((c,d)=>i.call(n,a(c),a(d),r))}}function Yl(e,t,l){return function(...i){const n=this.__v_raw,r=fe(n),o=nl(r),s=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,c=n[e](...i),d=l?kn:t?Fn:zl;return!t&&We(r,"iterate",a?Zi:Ut),{next(){const{value:E,done:v}=c.next();return v?{value:E,done:v}:{value:s?[d(E[0]),d(E[1])]:d(E),done:v}},[Symbol.iterator](){return this}}}}function bt(e){return function(...t){return e==="delete"?!1:this}}function xa(){const e={get(r){return Kl(this,r)},get size(){return Jl(this)},has:Ql,add:er,set:tr,delete:lr,clear:ir,forEach:Gl(!1,!1)},t={get(r){return Kl(this,r,!1,!0)},get size(){return Jl(this)},has:Ql,add:er,set:tr,delete:lr,clear:ir,forEach:Gl(!1,!0)},l={get(r){return Kl(this,r,!0)},get size(){return Jl(this,!0)},has(r){return Ql.call(this,r,!0)},add:bt("add"),set:bt("set"),delete:bt("delete"),clear:bt("clear"),forEach:Gl(!0,!1)},i={get(r){return Kl(this,r,!0,!0)},get size(){return Jl(this,!0)},has(r){return Ql.call(this,r,!0)},add:bt("add"),set:bt("set"),delete:bt("delete"),clear:bt("clear"),forEach:Gl(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{e[r]=Yl(r,!1,!1),l[r]=Yl(r,!0,!1),t[r]=Yl(r,!1,!0),i[r]=Yl(r,!0,!0)}),[e,l,t,i]}const[Ra,Oa,Ia,wa]=xa();function bn(e,t){const l=t?e?wa:Ia:e?Oa:Ra;return(i,n,r)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?i:Reflect.get(he(l,n)&&n in i?l:i,n,r)}const Sa={get:bn(!1,!1)},Va={get:bn(!1,!0)},ja={get:bn(!0,!1)},Co=new WeakMap,To=new WeakMap,Po=new WeakMap,Ma=new WeakMap;function $a(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qa(e){return e.__v_skip||!Object.isExtensible(e)?0:$a(la(e))}function Al(e){return al(e)?e:yn(e,!1,Lo,Sa,Co)}function Na(e){return yn(e,!1,za,Va,To)}function Ml(e){return yn(e,!0,Pa,ja,Po)}function yn(e,t,l,i,n){if(!be(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=n.get(e);if(r)return r;const o=qa(e);if(o===0)return e;const s=new Proxy(e,o===2?i:l);return n.set(e,s),s}function rl(e){return al(e)?rl(e.__v_raw):!!(e&&e.__v_isReactive)}function al(e){return!!(e&&e.__v_isReadonly)}function ui(e){return!!(e&&e.__v_isShallow)}function zo(e){return rl(e)||al(e)}function fe(e){const t=e&&e.__v_raw;return t?fe(t):e}function xo(e){return ai(e,"__v_skip",!0),e}const zl=e=>be(e)?Al(e):e,Fn=e=>be(e)?Ml(e):e;function Dn(e){Pt&<&&(e=fe(e),yo(e.dep||(e.dep=_n())))}function Ln(e,t){e=fe(e);const l=e.dep;l&&en(l)}function Re(e){return!!(e&&e.__v_isRef===!0)}function Ae(e){return Oo(e,!1)}function Ro(e){return Oo(e,!0)}function Oo(e,t){return Re(e)?e:new Ha(e,t)}class Ha{constructor(t,l){this.__v_isShallow=l,this.dep=void 0,this.__v_isRef=!0,this._rawValue=l?t:fe(t),this._value=l?t:zl(t)}get value(){return Dn(this),this._value}set value(t){const l=this.__v_isShallow||ui(t)||al(t);t=l?t:fe(t),Pl(t,this._rawValue)&&(this._rawValue=t,this._value=l?t:zl(t),Ln(this))}}function te(e){return Re(e)?e.value:e}const Ua={get:(e,t,l)=>te(Reflect.get(e,t,l)),set:(e,t,l,i)=>{const n=e[t];return Re(n)&&!Re(l)?(n.value=l,!0):Reflect.set(e,t,l,i)}};function Io(e){return rl(e)?e:new Proxy(e,Ua)}class Wa{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:l,set:i}=t(()=>Dn(this),()=>Ln(this));this._get=l,this._set=i}get value(){return this._get()}set value(t){this._set(t)}}function Ka(e){return new Wa(e)}function Di(e){const t=X(e)?new Array(e.length):{};for(const l in e)t[l]=wo(e,l);return t}class Qa{constructor(t,l,i){this._object=t,this._key=l,this._defaultValue=i,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return ma(fe(this._object),this._key)}}class Ja{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Ga(e,t,l){return Re(e)?e:re(e)?new Ja(e):be(e)&&arguments.length>1?wo(e,t,l):Ae(e)}function wo(e,t,l){const i=e[t];return Re(i)?i:new Qa(e,t,l)}class Ya{constructor(t,l,i,n){this._setter=l,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new pn(t,()=>{this._dirty||(this._dirty=!0,Ln(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=i}get value(){const t=fe(this);return Dn(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function Xa(e,t,l=!1){let i,n;const r=re(e);return r?(i=e,n=nt):(i=e.get,n=e.set),new Ya(i,n,r||!n,l)}function zt(e,t,l,i){let n;try{n=i?e(...i):e()}catch(r){$l(r,t,l)}return n}function Ze(e,t,l,i){if(re(e)){const r=zt(e,t,l,i);return r&&fo(r)&&r.catch(o=>{$l(o,t,l)}),r}const n=[];for(let r=0;r>>1;Rl(Me[i])ut&&Me.splice(t,1)}function lc(e){X(e)?ol.push(...e):(!ft||!ft.includes(e,e.allowRecurse?$t+1:$t))&&ol.push(e),Vo()}function nr(e,t=xl?ut+1:0){for(;tRl(l)-Rl(i)),$t=0;$te.id==null?1/0:e.id,ic=(e,t)=>{const l=Rl(e)-Rl(t);if(l===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return l};function jo(e){tn=!1,xl=!0,Me.sort(ic);const t=nt;try{for(ut=0;utge(g)?g.trim():g)),E&&(n=l.map(ra))}let s,a=i[s=wi(t)]||i[s=wi(dt(t))];!a&&r&&(a=i[s=wi(Jt(t))]),a&&Ze(a,e,6,n);const c=i[s+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Ze(c,e,6,n)}}function Mo(e,t,l=!1){const i=t.emitsCache,n=i.get(e);if(n!==void 0)return n;const r=e.emits;let o={},s=!1;if(!re(e)){const a=c=>{const d=Mo(c,t,!0);d&&(s=!0,Pe(o,d))};!l&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!s?(be(e)&&i.set(e,null),null):(X(r)?r.forEach(a=>o[a]=null):Pe(o,r),be(e)&&i.set(e,o),o)}function Ti(e,t){return!e||!Vl(t)?!1:(t=t.slice(2).replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,Jt(t))||he(e,t))}let Se=null,$o=null;function Ei(e){const t=Se;return Se=e,$o=e&&e.type.__scopeId||null,t}function we(e,t=Se,l){if(!t||e._n)return e;const i=(...n)=>{i._d&&Ar(-1);const r=Ei(t);let o;try{o=e(...n)}finally{Ei(r),i._d&&Ar(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Vi(e){const{type:t,vnode:l,proxy:i,withProxy:n,props:r,propsOptions:[o],slots:s,attrs:a,emit:c,render:d,renderCache:E,data:v,setupState:g,ctx:k,inheritAttrs:y}=e;let C,m;const B=Ei(e);try{if(l.shapeFlag&4){const P=n||i;C=tt(d.call(P,P,E,r,g,v,k)),m=a}else{const P=t;C=tt(P.length>1?P(r,{attrs:a,slots:s,emit:c}):P(r,null)),m=t.props?a:rc(a)}}catch(P){Ll.length=0,$l(P,e,1),C=le(Je)}let z=C;if(m&&y!==!1){const P=Object.keys(m),{shapeFlag:W}=z;P.length&&W&7&&(o&&P.some(fn)&&(m=oc(m,o)),z=Ot(z,m))}return l.dirs&&(z=Ot(z),z.dirs=z.dirs?z.dirs.concat(l.dirs):l.dirs),l.transition&&(z.transition=l.transition),C=z,Ei(B),C}const rc=e=>{let t;for(const l in e)(l==="class"||l==="style"||Vl(l))&&((t||(t={}))[l]=e[l]);return t},oc=(e,t)=>{const l={};for(const i in e)(!fn(i)||!(i.slice(9)in t))&&(l[i]=e[i]);return l};function sc(e,t,l){const{props:i,children:n,component:r}=e,{props:o,children:s,patchFlag:a}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(l&&a>=0){if(a&1024)return!0;if(a&16)return i?rr(i,o,c):!!o;if(a&8){const d=t.dynamicProps;for(let E=0;Ee.__isSuspense;function qo(e,t){t&&t.pendingBranch?X(e)?t.effects.push(...e):t.effects.push(e):lc(e)}function uc(e,t){return Tn(e,null,t)}const Xl={};function rt(e,t,l){return Tn(e,t,l)}function Tn(e,t,{immediate:l,deep:i,flush:n,onTrack:r,onTrigger:o}=ye){var s;const a=po()===((s=ze)==null?void 0:s.scope)?ze:null;let c,d=!1,E=!1;if(Re(e)?(c=()=>e.value,d=ui(e)):rl(e)?(c=()=>e,i=!0):X(e)?(E=!0,d=e.some(P=>rl(P)||ui(P)),c=()=>e.map(P=>{if(Re(P))return P.value;if(rl(P))return Ht(P);if(re(P))return zt(P,a,2)})):re(e)?t?c=()=>zt(e,a,2):c=()=>{if(!(a&&a.isUnmounted))return v&&v(),Ze(e,a,3,[g])}:c=nt,t&&i){const P=c;c=()=>Ht(P())}let v,g=P=>{v=B.onStop=()=>{zt(P,a,4)}},k;if(dl)if(g=nt,t?l&&Ze(t,a,3,[c(),E?[]:void 0,g]):c(),n==="sync"){const P=ru();k=P.__watcherHandles||(P.__watcherHandles=[])}else return nt;let y=E?new Array(e.length).fill(Xl):Xl;const C=()=>{if(B.active)if(t){const P=B.run();(i||d||(E?P.some((W,Z)=>Pl(W,y[Z])):Pl(P,y)))&&(v&&v(),Ze(t,a,3,[P,y===Xl?void 0:E&&y[0]===Xl?[]:y,g]),y=P)}else B.run()};C.allowRecurse=!!t;let m;n==="sync"?m=C:n==="post"?m=()=>He(C,a&&a.suspense):(C.pre=!0,a&&(C.id=a.uid),m=()=>Ci(C));const B=new pn(c,m);t?l?C():y=B.run():n==="post"?He(B.run.bind(B),a&&a.suspense):B.run();const z=()=>{B.stop(),a&&a.scope&&An(a.scope.effects,B)};return k&&k.push(z),z}function dc(e,t,l){const i=this.proxy,n=ge(e)?e.includes(".")?No(i,e):()=>i[e]:e.bind(i,i);let r;re(t)?r=t:(r=t.handler,l=t);const o=ze;ul(this);const s=Tn(n,r.bind(i),l);return o?ul(o):Kt(),s}function No(e,t){const l=t.split(".");return()=>{let i=e;for(let n=0;n{Ht(l,t)});else if(go(e))for(const l in e)Ht(e[l],t);return e}function hi(e,t){const l=Se;if(l===null)return e;const i=Ri(l)||l.proxy,n=e.dirs||(e.dirs=[]);for(let r=0;r{e.isMounted=!0}),Nl(()=>{e.isUnmounting=!0}),e}const Ye=[Function,Array],Ho={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ye,onEnter:Ye,onAfterEnter:Ye,onEnterCancelled:Ye,onBeforeLeave:Ye,onLeave:Ye,onAfterLeave:Ye,onLeaveCancelled:Ye,onBeforeAppear:Ye,onAppear:Ye,onAfterAppear:Ye,onAppearCancelled:Ye},hc={name:"BaseTransition",props:Ho,setup(e,{slots:t}){const l=os(),i=Ec();let n;return()=>{const r=t.default&&Wo(t.default(),!0);if(!r||!r.length)return;let o=r[0];if(r.length>1){for(const y of r)if(y.type!==Je){o=y;break}}const s=fe(e),{mode:a}=s;if(i.isLeaving)return ji(o);const c=or(o);if(!c)return ji(o);const d=ln(c,s,i,l);nn(c,d);const E=l.subTree,v=E&&or(E);let g=!1;const{getTransitionKey:k}=c.type;if(k){const y=k();n===void 0?n=y:y!==n&&(n=y,g=!0)}if(v&&v.type!==Je&&(!qt(c,v)||g)){const y=ln(v,s,i,l);if(nn(v,y),a==="out-in")return i.isLeaving=!0,y.afterLeave=()=>{i.isLeaving=!1,l.update.active!==!1&&l.update()},ji(o);a==="in-out"&&c.type!==Je&&(y.delayLeave=(C,m,B)=>{const z=Uo(i,v);z[String(v.key)]=v,C._leaveCb=()=>{m(),C._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=B})}return o}}},vc=hc;function Uo(e,t){const{leavingVNodes:l}=e;let i=l.get(t.type);return i||(i=Object.create(null),l.set(t.type,i)),i}function ln(e,t,l,i){const{appear:n,mode:r,persisted:o=!1,onBeforeEnter:s,onEnter:a,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:E,onLeave:v,onAfterLeave:g,onLeaveCancelled:k,onBeforeAppear:y,onAppear:C,onAfterAppear:m,onAppearCancelled:B}=t,z=String(e.key),P=Uo(l,e),W=(A,H)=>{A&&Ze(A,i,9,H)},Z=(A,H)=>{const j=H[1];W(A,H),X(A)?A.every(J=>J.length<=1)&&j():A.length<=1&&j()},w={mode:r,persisted:o,beforeEnter(A){let H=s;if(!l.isMounted)if(n)H=y||s;else return;A._leaveCb&&A._leaveCb(!0);const j=P[z];j&&qt(e,j)&&j.el._leaveCb&&j.el._leaveCb(),W(H,[A])},enter(A){let H=a,j=c,J=d;if(!l.isMounted)if(n)H=C||a,j=m||c,J=B||d;else return;let L=!1;const O=A._enterCb=I=>{L||(L=!0,I?W(J,[A]):W(j,[A]),w.delayedLeave&&w.delayedLeave(),A._enterCb=void 0)};H?Z(H,[A,O]):O()},leave(A,H){const j=String(e.key);if(A._enterCb&&A._enterCb(!0),l.isUnmounting)return H();W(E,[A]);let J=!1;const L=A._leaveCb=O=>{J||(J=!0,H(),O?W(k,[A]):W(g,[A]),A._leaveCb=void 0,P[j]===e&&delete P[j])};P[j]=e,v?Z(v,[A,L]):L()},clone(A){return ln(A,t,l,i)}};return w}function ji(e){if(ql(e))return e=Ot(e),e.children=null,e}function or(e){return ql(e)?e.children?e.children[0]:void 0:e}function nn(e,t){e.shapeFlag&6&&e.component?nn(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Wo(e,t=!1,l){let i=[],n=0;for(let r=0;r1)for(let r=0;rPe({name:e.name},t,{setup:e}))():e}const sl=e=>!!e.type.__asyncLoader;function _(e){re(e)&&(e={loader:e});const{loader:t,loadingComponent:l,errorComponent:i,delay:n=200,timeout:r,suspensible:o=!0,onError:s}=e;let a=null,c,d=0;const E=()=>(d++,a=null,v()),v=()=>{let g;return a||(g=a=t().catch(k=>{if(k=k instanceof Error?k:new Error(String(k)),s)return new Promise((y,C)=>{s(k,()=>y(E()),()=>C(k),d+1)});throw k}).then(k=>g!==a&&a?a:(k&&(k.__esModule||k[Symbol.toStringTag]==="Module")&&(k=k.default),c=k,k)))};return de({name:"AsyncComponentWrapper",__asyncLoader:v,get __asyncResolved(){return c},setup(){const g=ze;if(c)return()=>Mi(c,g);const k=B=>{a=null,$l(B,g,13,!i)};if(o&&g.suspense||dl)return v().then(B=>()=>Mi(B,g)).catch(B=>(k(B),()=>i?le(i,{error:B}):null));const y=Ae(!1),C=Ae(),m=Ae(!!n);return n&&setTimeout(()=>{m.value=!1},n),r!=null&&setTimeout(()=>{if(!y.value&&!C.value){const B=new Error(`Async component timed out after ${r}ms.`);k(B),C.value=B}},r),v().then(()=>{y.value=!0,g.parent&&ql(g.parent.vnode)&&Ci(g.parent.update)}).catch(B=>{k(B),C.value=B}),()=>{if(y.value&&c)return Mi(c,g);if(C.value&&i)return le(i,{error:C.value});if(l&&!m.value)return le(l)}}})}function Mi(e,t){const{ref:l,props:i,children:n,ce:r}=t.vnode,o=le(e,i,n);return o.ref=l,o.ce=r,delete t.vnode.ce,o}const ql=e=>e.type.__isKeepAlive;function fc(e,t){Ko(e,"a",t)}function Ac(e,t){Ko(e,"da",t)}function Ko(e,t,l=ze){const i=e.__wdc||(e.__wdc=()=>{let n=l;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(Pi(t,i,l),l){let n=l.parent;for(;n&&n.parent;)ql(n.parent.vnode)&&gc(i,t,l,n),n=n.parent}}function gc(e,t,l,i){const n=Pi(t,e,i,!0);zi(()=>{An(i[t],n)},l)}function Pi(e,t,l=ze,i=!1){if(l){const n=l[e]||(l[e]=[]),r=t.__weh||(t.__weh=(...o)=>{if(l.isUnmounted)return;vl(),ul(l);const s=Ze(t,l,e,o);return Kt(),fl(),s});return i?n.unshift(r):n.push(r),r}}const pt=e=>(t,l=ze)=>(!dl||e==="sp")&&Pi(e,(...i)=>t(...i),l),mc=pt("bm"),Ge=pt("m"),_c=pt("bu"),pc=pt("u"),Nl=pt("bum"),zi=pt("um"),Bc=pt("sp"),kc=pt("rtg"),bc=pt("rtc");function yc(e,t=ze){Pi("ec",e,t)}const Qo="components";function _t(e,t){return Dc(Qo,e,!0,t)||e}const Fc=Symbol.for("v-ndc");function Dc(e,t,l=!0,i=!1){const n=Se||ze;if(n){const r=n.type;if(e===Qo){const s=lu(r,!1);if(s&&(s===t||s===dt(t)||s===yi(dt(t))))return r}const o=sr(n[e]||r[e],t)||sr(n.appContext[e],t);return!o&&i?r:o}}function sr(e,t){return e&&(e[t]||e[dt(t)]||e[yi(dt(t))])}function Rt(e,t,l,i){let n;const r=l&&l[i];if(X(e)||ge(e)){n=new Array(e.length);for(let o=0,s=e.length;ot(o,s,void 0,r&&r[s]));else{const o=Object.keys(e);n=new Array(o.length);for(let s=0,a=o.length;sgi(t)?!(t.type===Je||t.type===ke&&!Jo(t.children)):!0)?e:null}const rn=e=>e?ss(e)?Ri(e)||e.proxy:rn(e.parent):null,Fl=Pe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>rn(e.parent),$root:e=>rn(e.root),$emit:e=>e.emit,$options:e=>Pn(e),$forceUpdate:e=>e.f||(e.f=()=>Ci(e.update)),$nextTick:e=>e.n||(e.n=Li.bind(e.proxy)),$watch:e=>dc.bind(e)}),$i=(e,t)=>e!==ye&&!e.__isScriptSetup&&he(e,t),Lc={get({_:e},t){const{ctx:l,setupState:i,data:n,props:r,accessCache:o,type:s,appContext:a}=e;let c;if(t[0]!=="$"){const g=o[t];if(g!==void 0)switch(g){case 1:return i[t];case 2:return n[t];case 4:return l[t];case 3:return r[t]}else{if($i(i,t))return o[t]=1,i[t];if(n!==ye&&he(n,t))return o[t]=2,n[t];if((c=e.propsOptions[0])&&he(c,t))return o[t]=3,r[t];if(l!==ye&&he(l,t))return o[t]=4,l[t];on&&(o[t]=0)}}const d=Fl[t];let E,v;if(d)return t==="$attrs"&&We(e,"get",t),d(e);if((E=s.__cssModules)&&(E=E[t]))return E;if(l!==ye&&he(l,t))return o[t]=4,l[t];if(v=a.config.globalProperties,he(v,t))return v[t]},set({_:e},t,l){const{data:i,setupState:n,ctx:r}=e;return $i(n,t)?(n[t]=l,!0):i!==ye&&he(i,t)?(i[t]=l,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=l,!0)},has({_:{data:e,setupState:t,accessCache:l,ctx:i,appContext:n,propsOptions:r}},o){let s;return!!l[o]||e!==ye&&he(e,o)||$i(t,o)||(s=r[0])&&he(s,o)||he(i,o)||he(Fl,o)||he(n.config.globalProperties,o)},defineProperty(e,t,l){return l.get!=null?e._.accessCache[t]=0:he(l,"value")&&this.set(e,t,l.value,null),Reflect.defineProperty(e,t,l)}};function ar(e){return X(e)?e.reduce((t,l)=>(t[l]=null,t),{}):e}let on=!0;function Cc(e){const t=Pn(e),l=e.proxy,i=e.ctx;on=!1,t.beforeCreate&&cr(t.beforeCreate,e,"bc");const{data:n,computed:r,methods:o,watch:s,provide:a,inject:c,created:d,beforeMount:E,mounted:v,beforeUpdate:g,updated:k,activated:y,deactivated:C,beforeDestroy:m,beforeUnmount:B,destroyed:z,unmounted:P,render:W,renderTracked:Z,renderTriggered:w,errorCaptured:A,serverPrefetch:H,expose:j,inheritAttrs:J,components:L,directives:O,filters:I}=t;if(c&&Tc(c,i,null),o)for(const ne in o){const oe=o[ne];re(oe)&&(i[ne]=oe.bind(l))}if(n){const ne=n.call(l,l);be(ne)&&(e.data=Al(ne))}if(on=!0,r)for(const ne in r){const oe=r[ne],Ve=re(oe)?oe.bind(l,l):re(oe.get)?oe.get.bind(l,l):nt,Ie=!re(oe)&&re(oe.set)?oe.set.bind(l):nt,Ne=$({get:Ve,set:Ie});Object.defineProperty(i,ne,{enumerable:!0,configurable:!0,get:()=>Ne.value,set:je=>Ne.value=je})}if(s)for(const ne in s)Go(s[ne],i,l,ne);if(a){const ne=re(a)?a.call(l):a;Reflect.ownKeys(ne).forEach(oe=>{Wt(oe,ne[oe])})}d&&cr(d,e,"c");function U(ne,oe){X(oe)?oe.forEach(Ve=>ne(Ve.bind(l))):oe&&ne(oe.bind(l))}if(U(mc,E),U(Ge,v),U(_c,g),U(pc,k),U(fc,y),U(Ac,C),U(yc,A),U(bc,Z),U(kc,w),U(Nl,B),U(zi,P),U(Bc,H),X(j))if(j.length){const ne=e.exposed||(e.exposed={});j.forEach(oe=>{Object.defineProperty(ne,oe,{get:()=>l[oe],set:Ve=>l[oe]=Ve})})}else e.exposed||(e.exposed={});W&&e.render===nt&&(e.render=W),J!=null&&(e.inheritAttrs=J),L&&(e.components=L),O&&(e.directives=O)}function Tc(e,t,l=nt){X(e)&&(e=sn(e));for(const i in e){const n=e[i];let r;be(n)?"default"in n?r=Te(n.from||i,n.default,!0):r=Te(n.from||i):r=Te(n),Re(r)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[i]=r}}function cr(e,t,l){Ze(X(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,l)}function Go(e,t,l,i){const n=i.includes(".")?No(l,i):()=>l[i];if(ge(e)){const r=t[e];re(r)&&rt(n,r)}else if(re(e))rt(n,e.bind(l));else if(be(e))if(X(e))e.forEach(r=>Go(r,t,l,i));else{const r=re(e.handler)?e.handler.bind(l):t[e.handler];re(r)&&rt(n,r,e)}}function Pn(e){const t=e.type,{mixins:l,extends:i}=t,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,s=r.get(t);let a;return s?a=s:!n.length&&!l&&!i?a=t:(a={},n.length&&n.forEach(c=>vi(a,c,o,!0)),vi(a,t,o)),be(t)&&r.set(t,a),a}function vi(e,t,l,i=!1){const{mixins:n,extends:r}=t;r&&vi(e,r,l,!0),n&&n.forEach(o=>vi(e,o,l,!0));for(const o in t)if(!(i&&o==="expose")){const s=Pc[o]||l&&l[o];e[o]=s?s(e[o],t[o]):t[o]}return e}const Pc={data:ur,props:dr,emits:dr,methods:bl,computed:bl,beforeCreate:$e,created:$e,beforeMount:$e,mounted:$e,beforeUpdate:$e,updated:$e,beforeDestroy:$e,beforeUnmount:$e,destroyed:$e,unmounted:$e,activated:$e,deactivated:$e,errorCaptured:$e,serverPrefetch:$e,components:bl,directives:bl,watch:xc,provide:ur,inject:zc};function ur(e,t){return t?e?function(){return Pe(re(e)?e.call(this,this):e,re(t)?t.call(this,this):t)}:t:e}function zc(e,t){return bl(sn(e),sn(t))}function sn(e){if(X(e)){const t={};for(let l=0;l1)return l&&re(t)?t.call(i&&i.proxy):t}}function Ic(e,t,l,i=!1){const n={},r={};ai(r,xi,1),e.propsDefaults=Object.create(null),Xo(e,t,n,r);for(const o in e.propsOptions[0])o in n||(n[o]=void 0);l?e.props=i?n:Na(n):e.type.props?e.props=n:e.props=r,e.attrs=r}function wc(e,t,l,i){const{props:n,attrs:r,vnode:{patchFlag:o}}=e,s=fe(n),[a]=e.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const d=e.vnode.dynamicProps;for(let E=0;E{a=!0;const[v,g]=Zo(E,t,!0);Pe(o,v),g&&s.push(...g)};!l&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!r&&!a)return be(e)&&i.set(e,il),il;if(X(r))for(let d=0;d-1,g[1]=y<0||k-1||he(g,"default"))&&s.push(E)}}}const c=[o,s];return be(e)&&i.set(e,c),c}function Er(e){return e[0]!=="$"}function hr(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function vr(e,t){return hr(e)===hr(t)}function fr(e,t){return X(t)?t.findIndex(l=>vr(l,e)):re(t)&&vr(t,e)?0:-1}const es=e=>e[0]==="_"||e==="$stable",zn=e=>X(e)?e.map(tt):[tt(e)],Sc=(e,t,l)=>{if(t._n)return t;const i=we((...n)=>zn(t(...n)),l);return i._c=!1,i},ts=(e,t,l)=>{const i=e._ctx;for(const n in e){if(es(n))continue;const r=e[n];if(re(r))t[n]=Sc(n,r,i);else if(r!=null){const o=zn(r);t[n]=()=>o}}},ls=(e,t)=>{const l=zn(t);e.slots.default=()=>l},Vc=(e,t)=>{if(e.vnode.shapeFlag&32){const l=t._;l?(e.slots=fe(t),ai(t,"_",l)):ts(t,e.slots={})}else e.slots={},t&&ls(e,t);ai(e.slots,xi,1)},jc=(e,t,l)=>{const{vnode:i,slots:n}=e;let r=!0,o=ye;if(i.shapeFlag&32){const s=t._;s?l&&s===1?r=!1:(Pe(n,t),!l&&s===1&&delete n._):(r=!t.$stable,ts(t,n)),o=t}else t&&(ls(e,t),o={default:1});if(r)for(const s in n)!es(s)&&!(s in o)&&delete n[s]};function Ai(e,t,l,i,n=!1){if(X(e)){e.forEach((v,g)=>Ai(v,t&&(X(t)?t[g]:t),l,i,n));return}if(sl(i)&&!n)return;const r=i.shapeFlag&4?Ri(i.component)||i.component.proxy:i.el,o=n?null:r,{i:s,r:a}=e,c=t&&t.r,d=s.refs===ye?s.refs={}:s.refs,E=s.setupState;if(c!=null&&c!==a&&(ge(c)?(d[c]=null,he(E,c)&&(E[c]=null)):Re(c)&&(c.value=null)),re(a))zt(a,s,12,[o,d]);else{const v=ge(a),g=Re(a);if(v||g){const k=()=>{if(e.f){const y=v?he(E,a)?E[a]:d[a]:a.value;n?X(y)&&An(y,r):X(y)?y.includes(r)||y.push(r):v?(d[a]=[r],he(E,a)&&(E[a]=d[a])):(a.value=[r],e.k&&(d[e.k]=a.value))}else v?(d[a]=o,he(E,a)&&(E[a]=o)):g&&(a.value=o,e.k&&(d[e.k]=o))};o?(k.id=-1,He(k,l)):k()}}}let yt=!1;const Zl=e=>/svg/.test(e.namespaceURI)&&e.tagName!=="foreignObject",ei=e=>e.nodeType===8;function Mc(e){const{mt:t,p:l,o:{patchProp:i,createText:n,nextSibling:r,parentNode:o,remove:s,insert:a,createComment:c}}=e,d=(m,B)=>{if(!B.hasChildNodes()){l(null,m,B),di(),B._vnode=m;return}yt=!1,E(B.firstChild,m,null,null,null),di(),B._vnode=m,yt&&console.error("Hydration completed but contains mismatches.")},E=(m,B,z,P,W,Z=!1)=>{const w=ei(m)&&m.data==="[",A=()=>y(m,B,z,P,W,w),{type:H,ref:j,shapeFlag:J,patchFlag:L}=B;let O=m.nodeType;B.el=m,L===-2&&(Z=!1,B.dynamicChildren=null);let I=null;switch(H){case cl:O!==3?B.children===""?(a(B.el=n(""),o(m),m),I=m):I=A():(m.data!==B.children&&(yt=!0,m.data=B.children),I=r(m));break;case Je:O!==8||w?I=A():I=r(m);break;case Dl:if(w&&(m=r(m),O=m.nodeType),O===1||O===3){I=m;const se=!B.children.length;for(let U=0;U{Z=Z||!!B.dynamicChildren;const{type:w,props:A,patchFlag:H,shapeFlag:j,dirs:J}=B,L=w==="input"&&J||w==="option";if(L||H!==-1){if(J&&ct(B,null,z,"created"),A)if(L||!Z||H&48)for(const I in A)(L&&I.endsWith("value")||Vl(I)&&!yl(I))&&i(m,I,null,A[I],!1,void 0,z);else A.onClick&&i(m,"onClick",null,A.onClick,!1,void 0,z);let O;if((O=A&&A.onVnodeBeforeMount)&&Xe(O,z,B),J&&ct(B,null,z,"beforeMount"),((O=A&&A.onVnodeMounted)||J)&&qo(()=>{O&&Xe(O,z,B),J&&ct(B,null,z,"mounted")},P),j&16&&!(A&&(A.innerHTML||A.textContent))){let I=g(m.firstChild,B,m,z,P,W,Z);for(;I;){yt=!0;const se=I;I=I.nextSibling,s(se)}}else j&8&&m.textContent!==B.children&&(yt=!0,m.textContent=B.children)}return m.nextSibling},g=(m,B,z,P,W,Z,w)=>{w=w||!!B.dynamicChildren;const A=B.children,H=A.length;for(let j=0;j{const{slotScopeIds:w}=B;w&&(W=W?W.concat(w):w);const A=o(m),H=g(r(m),B,A,z,P,W,Z);return H&&ei(H)&&H.data==="]"?r(B.anchor=H):(yt=!0,a(B.anchor=c("]"),A,H),H)},y=(m,B,z,P,W,Z)=>{if(yt=!0,B.el=null,Z){const H=C(m);for(;;){const j=r(m);if(j&&j!==H)s(j);else break}}const w=r(m),A=o(m);return s(m),l(null,B,A,w,z,P,Zl(A),W),w},C=m=>{let B=0;for(;m;)if(m=r(m),m&&ei(m)&&(m.data==="["&&B++,m.data==="]")){if(B===0)return r(m);B--}return m};return[d,E]}const He=qo;function $c(e){return qc(e,Mc)}function qc(e,t){const l=Yi();l.__VUE__=!0;const{insert:i,remove:n,patchProp:r,createElement:o,createText:s,createComment:a,setText:c,setElementText:d,parentNode:E,nextSibling:v,setScopeId:g=nt,insertStaticContent:k}=e,y=(h,f,p,b=null,D=null,T=null,M=!1,R=null,V=!!f.dynamicChildren)=>{if(h===f)return;h&&!qt(h,f)&&(b=F(h),je(h,D,T,!0),h=null),f.patchFlag===-2&&(V=!1,f.dynamicChildren=null);const{type:x,ref:G,shapeFlag:K}=f;switch(x){case cl:C(h,f,p,b);break;case Je:m(h,f,p,b);break;case Dl:h==null&&B(f,p,b,M);break;case ke:L(h,f,p,b,D,T,M,R,V);break;default:K&1?W(h,f,p,b,D,T,M,R,V):K&6?O(h,f,p,b,D,T,M,R,V):(K&64||K&128)&&x.process(h,f,p,b,D,T,M,R,V,S)}G!=null&&D&&Ai(G,h&&h.ref,T,f||h,!f)},C=(h,f,p,b)=>{if(h==null)i(f.el=s(f.children),p,b);else{const D=f.el=h.el;f.children!==h.children&&c(D,f.children)}},m=(h,f,p,b)=>{h==null?i(f.el=a(f.children||""),p,b):f.el=h.el},B=(h,f,p,b)=>{[h.el,h.anchor]=k(h.children,f,p,b,h.el,h.anchor)},z=({el:h,anchor:f},p,b)=>{let D;for(;h&&h!==f;)D=v(h),i(h,p,b),h=D;i(f,p,b)},P=({el:h,anchor:f})=>{let p;for(;h&&h!==f;)p=v(h),n(h),h=p;n(f)},W=(h,f,p,b,D,T,M,R,V)=>{M=M||f.type==="svg",h==null?Z(f,p,b,D,T,M,R,V):H(h,f,D,T,M,R,V)},Z=(h,f,p,b,D,T,M,R)=>{let V,x;const{type:G,props:K,shapeFlag:Y,transition:ie,dirs:ae}=h;if(V=h.el=o(h.type,T,K&&K.is,K),Y&8?d(V,h.children):Y&16&&A(h.children,V,null,b,D,T&&G!=="foreignObject",M,R),ae&&ct(h,null,b,"created"),w(V,h,h.scopeId,M,b),K){for(const _e in K)_e!=="value"&&!yl(_e)&&r(V,_e,null,K[_e],T,h.children,b,D,Oe);"value"in K&&r(V,"value",null,K.value),(x=K.onVnodeBeforeMount)&&Xe(x,b,h)}ae&&ct(h,null,b,"beforeMount");const pe=(!D||D&&!D.pendingBranch)&&ie&&!ie.persisted;pe&&ie.beforeEnter(V),i(V,f,p),((x=K&&K.onVnodeMounted)||pe||ae)&&He(()=>{x&&Xe(x,b,h),pe&&ie.enter(V),ae&&ct(h,null,b,"mounted")},D)},w=(h,f,p,b,D)=>{if(p&&g(h,p),b)for(let T=0;T{for(let x=V;x{const R=f.el=h.el;let{patchFlag:V,dynamicChildren:x,dirs:G}=f;V|=h.patchFlag&16;const K=h.props||ye,Y=f.props||ye;let ie;p&&St(p,!1),(ie=Y.onVnodeBeforeUpdate)&&Xe(ie,p,f,h),G&&ct(f,h,p,"beforeUpdate"),p&&St(p,!0);const ae=D&&f.type!=="foreignObject";if(x?j(h.dynamicChildren,x,R,p,b,ae,T):M||oe(h,f,R,null,p,b,ae,T,!1),V>0){if(V&16)J(R,f,K,Y,p,b,D);else if(V&2&&K.class!==Y.class&&r(R,"class",null,Y.class,D),V&4&&r(R,"style",K.style,Y.style,D),V&8){const pe=f.dynamicProps;for(let _e=0;_e{ie&&Xe(ie,p,f,h),G&&ct(f,h,p,"updated")},b)},j=(h,f,p,b,D,T,M)=>{for(let R=0;R{if(p!==b){if(p!==ye)for(const R in p)!yl(R)&&!(R in b)&&r(h,R,p[R],null,M,f.children,D,T,Oe);for(const R in b){if(yl(R))continue;const V=b[R],x=p[R];V!==x&&R!=="value"&&r(h,R,x,V,M,f.children,D,T,Oe)}"value"in b&&r(h,"value",p.value,b.value)}},L=(h,f,p,b,D,T,M,R,V)=>{const x=f.el=h?h.el:s(""),G=f.anchor=h?h.anchor:s("");let{patchFlag:K,dynamicChildren:Y,slotScopeIds:ie}=f;ie&&(R=R?R.concat(ie):ie),h==null?(i(x,p,b),i(G,p,b),A(f.children,p,G,D,T,M,R,V)):K>0&&K&64&&Y&&h.dynamicChildren?(j(h.dynamicChildren,Y,p,D,T,M,R),(f.key!=null||D&&f===D.subTree)&&is(h,f,!0)):oe(h,f,p,G,D,T,M,R,V)},O=(h,f,p,b,D,T,M,R,V)=>{f.slotScopeIds=R,h==null?f.shapeFlag&512?D.ctx.activate(f,p,b,M,V):I(f,p,b,D,T,M,V):se(h,f,V)},I=(h,f,p,b,D,T,M)=>{const R=h.component=Yc(h,b,D);if(ql(h)&&(R.ctx.renderer=S),Xc(R),R.asyncDep){if(D&&D.registerDep(R,U),!h.el){const V=R.subTree=le(Je);m(null,V,f,p)}return}U(R,h,f,p,D,T,M)},se=(h,f,p)=>{const b=f.component=h.component;if(sc(h,f,p))if(b.asyncDep&&!b.asyncResolved){ne(b,f,p);return}else b.next=f,tc(b.update),b.update();else f.el=h.el,b.vnode=f},U=(h,f,p,b,D,T,M)=>{const R=()=>{if(h.isMounted){let{next:G,bu:K,u:Y,parent:ie,vnode:ae}=h,pe=G,_e;St(h,!1),G?(G.el=ae.el,ne(h,G,M)):G=ae,K&&Si(K),(_e=G.props&&G.props.onVnodeBeforeUpdate)&&Xe(_e,ie,G,ae),St(h,!0);const Le=Vi(h),et=h.subTree;h.subTree=Le,y(et,Le,E(et.el),F(et),h,D,T),G.el=Le.el,pe===null&&ac(h,Le.el),Y&&He(Y,D),(_e=G.props&&G.props.onVnodeUpdated)&&He(()=>Xe(_e,ie,G,ae),D)}else{let G;const{el:K,props:Y}=f,{bm:ie,m:ae,parent:pe}=h,_e=sl(f);if(St(h,!1),ie&&Si(ie),!_e&&(G=Y&&Y.onVnodeBeforeMount)&&Xe(G,pe,f),St(h,!0),K&&ue){const Le=()=>{h.subTree=Vi(h),ue(K,h.subTree,h,D,null)};_e?f.type.__asyncLoader().then(()=>!h.isUnmounted&&Le()):Le()}else{const Le=h.subTree=Vi(h);y(null,Le,p,b,h,D,T),f.el=Le.el}if(ae&&He(ae,D),!_e&&(G=Y&&Y.onVnodeMounted)){const Le=f;He(()=>Xe(G,pe,Le),D)}(f.shapeFlag&256||pe&&sl(pe.vnode)&&pe.vnode.shapeFlag&256)&&h.a&&He(h.a,D),h.isMounted=!0,f=p=b=null}},V=h.effect=new pn(R,()=>Ci(x),h.scope),x=h.update=()=>V.run();x.id=h.uid,St(h,!0),x()},ne=(h,f,p)=>{f.component=h;const b=h.vnode.props;h.vnode=f,h.next=null,wc(h,f.props,b,p),jc(h,f.children,p),vl(),nr(),fl()},oe=(h,f,p,b,D,T,M,R,V=!1)=>{const x=h&&h.children,G=h?h.shapeFlag:0,K=f.children,{patchFlag:Y,shapeFlag:ie}=f;if(Y>0){if(Y&128){Ie(x,K,p,b,D,T,M,R,V);return}else if(Y&256){Ve(x,K,p,b,D,T,M,R,V);return}}ie&8?(G&16&&Oe(x,D,T),K!==x&&d(p,K)):G&16?ie&16?Ie(x,K,p,b,D,T,M,R,V):Oe(x,D,T,!0):(G&8&&d(p,""),ie&16&&A(K,p,b,D,T,M,R,V))},Ve=(h,f,p,b,D,T,M,R,V)=>{h=h||il,f=f||il;const x=h.length,G=f.length,K=Math.min(x,G);let Y;for(Y=0;YG?Oe(h,D,T,!0,!1,K):A(f,p,b,D,T,M,R,V,K)},Ie=(h,f,p,b,D,T,M,R,V)=>{let x=0;const G=f.length;let K=h.length-1,Y=G-1;for(;x<=K&&x<=Y;){const ie=h[x],ae=f[x]=V?Lt(f[x]):tt(f[x]);if(qt(ie,ae))y(ie,ae,p,null,D,T,M,R,V);else break;x++}for(;x<=K&&x<=Y;){const ie=h[K],ae=f[Y]=V?Lt(f[Y]):tt(f[Y]);if(qt(ie,ae))y(ie,ae,p,null,D,T,M,R,V);else break;K--,Y--}if(x>K){if(x<=Y){const ie=Y+1,ae=ieY)for(;x<=K;)je(h[x],D,T,!0),x++;else{const ie=x,ae=x,pe=new Map;for(x=ae;x<=Y;x++){const Ke=f[x]=V?Lt(f[x]):tt(f[x]);Ke.key!=null&&pe.set(Ke.key,x)}let _e,Le=0;const et=Y-ae+1;let Xt=!1,Wn=0;const gl=new Array(et);for(x=0;x=et){je(Ke,D,T,!0);continue}let at;if(Ke.key!=null)at=pe.get(Ke.key);else for(_e=ae;_e<=Y;_e++)if(gl[_e-ae]===0&&qt(Ke,f[_e])){at=_e;break}at===void 0?je(Ke,D,T,!0):(gl[at-ae]=x+1,at>=Wn?Wn=at:Xt=!0,y(Ke,f[at],p,null,D,T,M,R,V),Le++)}const Kn=Xt?Nc(gl):il;for(_e=Kn.length-1,x=et-1;x>=0;x--){const Ke=ae+x,at=f[Ke],Qn=Ke+1{const{el:T,type:M,transition:R,children:V,shapeFlag:x}=h;if(x&6){Ne(h.component.subTree,f,p,b);return}if(x&128){h.suspense.move(f,p,b);return}if(x&64){M.move(h,f,p,S);return}if(M===ke){i(T,f,p);for(let K=0;KR.enter(T),D);else{const{leave:K,delayLeave:Y,afterLeave:ie}=R,ae=()=>i(T,f,p),pe=()=>{K(T,()=>{ae(),ie&&ie()})};Y?Y(T,ae,pe):pe()}else i(T,f,p)},je=(h,f,p,b=!1,D=!1)=>{const{type:T,props:M,ref:R,children:V,dynamicChildren:x,shapeFlag:G,patchFlag:K,dirs:Y}=h;if(R!=null&&Ai(R,null,p,h,!0),G&256){f.ctx.deactivate(h);return}const ie=G&1&&Y,ae=!sl(h);let pe;if(ae&&(pe=M&&M.onVnodeBeforeUnmount)&&Xe(pe,f,h),G&6)st(h.component,p,b);else{if(G&128){h.suspense.unmount(p,b);return}ie&&ct(h,null,f,"beforeUnmount"),G&64?h.type.remove(h,f,p,D,S,b):x&&(T!==ke||K>0&&K&64)?Oe(x,f,p,!1,!0):(T===ke&&K&384||!D&&G&16)&&Oe(V,f,p),b&&Bt(h)}(ae&&(pe=M&&M.onVnodeUnmounted)||ie)&&He(()=>{pe&&Xe(pe,f,h),ie&&ct(h,null,f,"unmounted")},p)},Bt=h=>{const{type:f,el:p,anchor:b,transition:D}=h;if(f===ke){kt(p,b);return}if(f===Dl){P(h);return}const T=()=>{n(p),D&&!D.persisted&&D.afterLeave&&D.afterLeave()};if(h.shapeFlag&1&&D&&!D.persisted){const{leave:M,delayLeave:R}=D,V=()=>M(p,T);R?R(h.el,T,V):V()}else T()},kt=(h,f)=>{let p;for(;h!==f;)p=v(h),n(h),h=p;n(f)},st=(h,f,p)=>{const{bum:b,scope:D,update:T,subTree:M,um:R}=h;b&&Si(b),D.stop(),T&&(T.active=!1,je(M,h,f,p)),R&&He(R,f),He(()=>{h.isUnmounted=!0},f),f&&f.pendingBranch&&!f.isUnmounted&&h.asyncDep&&!h.asyncResolved&&h.suspenseId===f.pendingId&&(f.deps--,f.deps===0&&f.resolve())},Oe=(h,f,p,b=!1,D=!1,T=0)=>{for(let M=T;Mh.shapeFlag&6?F(h.component.subTree):h.shapeFlag&128?h.suspense.next():v(h.anchor||h.el),N=(h,f,p)=>{h==null?f._vnode&&je(f._vnode,null,null,!0):y(f._vnode||null,h,f,null,null,null,p),nr(),di(),f._vnode=h},S={p:y,um:je,m:Ne,r:Bt,mt:I,mc:A,pc:oe,pbc:j,n:F,o:e};let Q,ue;return t&&([Q,ue]=t(S)),{render:N,hydrate:Q,createApp:Oc(N,Q)}}function St({effect:e,update:t},l){e.allowRecurse=t.allowRecurse=l}function is(e,t,l=!1){const i=e.children,n=t.children;if(X(i)&&X(n))for(let r=0;r>1,e[l[s]]0&&(t[i]=l[r-1]),l[r]=i)}}for(r=l.length,o=l[r-1];r-- >0;)l[r]=o,o=t[o];return l}const Hc=e=>e.__isTeleport,ke=Symbol.for("v-fgt"),cl=Symbol.for("v-txt"),Je=Symbol.for("v-cmt"),Dl=Symbol.for("v-stc"),Ll=[];let it=null;function q(e=!1){Ll.push(it=e?null:[])}function Uc(){Ll.pop(),it=Ll[Ll.length-1]||null}let Ol=1;function Ar(e){Ol+=e}function ns(e){return e.dynamicChildren=Ol>0?it||il:null,Uc(),Ol>0&&it&&it.push(e),e}function ee(e,t,l,i,n,r){return ns(ve(e,t,l,i,n,r,!0))}function Ce(e,t,l,i,n){return ns(le(e,t,l,i,n,!0))}function gi(e){return e?e.__v_isVNode===!0:!1}function qt(e,t){return e.type===t.type&&e.key===t.key}const xi="__vInternal",rs=({key:e})=>e??null,oi=({ref:e,ref_key:t,ref_for:l})=>(typeof e=="number"&&(e=""+e),e!=null?ge(e)||Re(e)||re(e)?{i:Se,r:e,k:t,f:!!l}:e:null);function ve(e,t=null,l=null,i=0,n=null,r=e===ke?0:1,o=!1,s=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rs(t),ref:t&&oi(t),scopeId:$o,slotScopeIds:null,children:l,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Se};return s?(xn(a,l),r&128&&e.normalize(a)):l&&(a.shapeFlag|=ge(l)?8:16),Ol>0&&!o&&it&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&it.push(a),a}const le=Wc;function Wc(e,t=null,l=null,i=0,n=null,r=!1){if((!e||e===Fc)&&(e=Je),gi(e)){const s=Ot(e,t,!0);return l&&xn(s,l),Ol>0&&!r&&it&&(s.shapeFlag&6?it[it.indexOf(e)]=s:it.push(s)),s.patchFlag|=-2,s}if(iu(e)&&(e=e.__vccOpts),t){t=Kc(t);let{class:s,style:a}=t;s&&!ge(s)&&(t.class=Ue(s)),be(a)&&(zo(a)&&!X(a)&&(a=Pe({},a)),t.style=jl(a))}const o=ge(e)?1:cc(e)?128:Hc(e)?64:be(e)?4:re(e)?2:0;return ve(e,t,l,i,n,o,r,!0)}function Kc(e){return e?zo(e)||xi in e?Pe({},e):e:null}function Ot(e,t,l=!1){const{props:i,ref:n,patchFlag:r,children:o}=e,s=t?cn(i||{},t):i;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:s,key:s&&rs(s),ref:t&&t.ref?l&&n?X(n)?n.concat(oi(t)):[n,oi(t)]:oi(t):n,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ke?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ot(e.ssContent),ssFallback:e.ssFallback&&Ot(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function It(e=" ",t=0){return le(cl,null,e,t)}function Qc(e,t){const l=le(Dl,null,e);return l.staticCount=t,l}function De(e="",t=!1){return t?(q(),Ce(Je,null,e)):le(Je,null,e)}function tt(e){return e==null||typeof e=="boolean"?le(Je):X(e)?le(ke,null,e.slice()):typeof e=="object"?Lt(e):le(cl,null,String(e))}function Lt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ot(e)}function xn(e,t){let l=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(X(t))l=16;else if(typeof t=="object")if(i&65){const n=t.default;n&&(n._c&&(n._d=!1),xn(e,n()),n._c&&(n._d=!0));return}else{l=32;const n=t._;!n&&!(xi in t)?t._ctx=Se:n===3&&Se&&(Se.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else re(t)?(t={default:t,_ctx:Se},l=32):(t=String(t),i&64?(l=16,t=[It(t)]):l=8);e.children=t,e.shapeFlag|=l}function cn(...e){const t={};for(let l=0;lze||Se;let Rn,Zt,gr="__VUE_INSTANCE_SETTERS__";(Zt=Yi()[gr])||(Zt=Yi()[gr]=[]),Zt.push(e=>ze=e),Rn=e=>{Zt.length>1?Zt.forEach(t=>t(e)):Zt[0](e)};const ul=e=>{Rn(e),e.scope.on()},Kt=()=>{ze&&ze.scope.off(),Rn(null)};function ss(e){return e.vnode.shapeFlag&4}let dl=!1;function Xc(e,t=!1){dl=t;const{props:l,children:i}=e.vnode,n=ss(e);Ic(e,l,n,t),Vc(e,i);const r=n?Zc(e,t):void 0;return dl=!1,r}function Zc(e,t){const l=e.type;e.accessCache=Object.create(null),e.proxy=xo(new Proxy(e.ctx,Lc));const{setup:i}=l;if(i){const n=e.setupContext=i.length>1?tu(e):null;ul(e),vl();const r=zt(i,e,0,[e.props,n]);if(fl(),Kt(),fo(r)){if(r.then(Kt,Kt),t)return r.then(o=>{mr(e,o,t)}).catch(o=>{$l(o,e,0)});e.asyncDep=r}else mr(e,r,t)}else as(e,t)}function mr(e,t,l){re(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:be(t)&&(e.setupState=Io(t)),as(e,l)}let _r;function as(e,t,l){const i=e.type;if(!e.render){if(!t&&_r&&!i.render){const n=i.template||Pn(e).template;if(n){const{isCustomElement:r,compilerOptions:o}=e.appContext.config,{delimiters:s,compilerOptions:a}=i,c=Pe(Pe({isCustomElement:r,delimiters:s},o),a);i.render=_r(n,c)}}e.render=i.render||nt}ul(e),vl(),Cc(e),fl(),Kt()}function eu(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,l){return We(e,"get","$attrs"),t[l]}}))}function tu(e){const t=l=>{e.exposed=l||{}};return{get attrs(){return eu(e)},slots:e.slots,emit:e.emit,expose:t}}function Ri(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Io(xo(e.exposed)),{get(t,l){if(l in t)return t[l];if(l in Fl)return Fl[l](e)},has(t,l){return l in t||l in Fl}}))}function lu(e,t=!0){return re(e)?e.displayName||e.name:e.name||t&&e.__name}function iu(e){return re(e)&&"__vccOpts"in e}const $=(e,t)=>Xa(e,t,dl);function ce(e,t,l){const i=arguments.length;return i===2?be(t)&&!X(t)?gi(t)?le(e,null,[t]):le(e,t):le(e,null,t):(i>3?l=Array.prototype.slice.call(arguments,2):i===3&&gi(l)&&(l=[l]),le(e,t,l))}const nu=Symbol.for("v-scx"),ru=()=>Te(nu),ou="3.3.4",su="http://www.w3.org/2000/svg",Nt=typeof document<"u"?document:null,pr=Nt&&Nt.createElement("template"),au={insert:(e,t,l)=>{t.insertBefore(e,l||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,l,i)=>{const n=t?Nt.createElementNS(su,e):Nt.createElement(e,l?{is:l}:void 0);return e==="select"&&i&&i.multiple!=null&&n.setAttribute("multiple",i.multiple),n},createText:e=>Nt.createTextNode(e),createComment:e=>Nt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Nt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,l,i,n,r){const o=l?l.previousSibling:t.lastChild;if(n&&(n===r||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),l),!(n===r||!(n=n.nextSibling)););else{pr.innerHTML=i?`${e}`:e;const s=pr.content;if(i){const a=s.firstChild;for(;a.firstChild;)s.appendChild(a.firstChild);s.removeChild(a)}t.insertBefore(s,l)}return[o?o.nextSibling:t.firstChild,l?l.previousSibling:t.lastChild]}};function cu(e,t,l){const i=e._vtc;i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):l?e.setAttribute("class",t):e.className=t}function uu(e,t,l){const i=e.style,n=ge(l);if(l&&!n){if(t&&!ge(t))for(const r in t)l[r]==null&&un(i,r,"");for(const r in l)un(i,r,l[r])}else{const r=i.display;n?t!==l&&(i.cssText=l):t&&e.removeAttribute("style"),"_vod"in e&&(i.display=r)}}const Br=/\s*!important$/;function un(e,t,l){if(X(l))l.forEach(i=>un(e,t,i));else if(l==null&&(l=""),t.startsWith("--"))e.setProperty(t,l);else{const i=du(e,t);Br.test(l)?e.setProperty(Jt(i),l.replace(Br,""),"important"):e[i]=l}}const kr=["Webkit","Moz","ms"],qi={};function du(e,t){const l=qi[t];if(l)return l;let i=dt(t);if(i!=="filter"&&i in e)return qi[t]=i;i=yi(i);for(let n=0;nNi||(mu.then(()=>Ni=0),Ni=Date.now());function pu(e,t){const l=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=l.attached)return;Ze(Bu(i,l.value),t,5,[i])};return l.value=e,l.attached=_u(),l}function Bu(e,t){if(X(t)){const l=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{l.call(e),e._stopped=!0},t.map(i=>n=>!n._stopped&&i&&i(n))}else return t}const Fr=/^on[a-z]/,ku=(e,t,l,i,n=!1,r,o,s,a)=>{t==="class"?cu(e,i,n):t==="style"?uu(e,l,i):Vl(t)?fn(t)||Au(e,t,l,i,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):bu(e,t,i,n))?hu(e,t,i,r,o,s,a):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),Eu(e,t,i,n))};function bu(e,t,l,i){return i?!!(t==="innerHTML"||t==="textContent"||t in e&&Fr.test(t)&&re(l)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||Fr.test(t)&&ge(l)?!1:t in e}const Ft="transition",ml="animation",Hl=(e,{slots:t})=>ce(vc,yu(e),t);Hl.displayName="Transition";const cs={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Hl.props=Pe({},Ho,cs);const Vt=(e,t=[])=>{X(e)?e.forEach(l=>l(...t)):e&&e(...t)},Dr=e=>e?X(e)?e.some(t=>t.length>1):e.length>1:!1;function yu(e){const t={};for(const L in e)L in cs||(t[L]=e[L]);if(e.css===!1)return t;const{name:l="v",type:i,duration:n,enterFromClass:r=`${l}-enter-from`,enterActiveClass:o=`${l}-enter-active`,enterToClass:s=`${l}-enter-to`,appearFromClass:a=r,appearActiveClass:c=o,appearToClass:d=s,leaveFromClass:E=`${l}-leave-from`,leaveActiveClass:v=`${l}-leave-active`,leaveToClass:g=`${l}-leave-to`}=e,k=Fu(n),y=k&&k[0],C=k&&k[1],{onBeforeEnter:m,onEnter:B,onEnterCancelled:z,onLeave:P,onLeaveCancelled:W,onBeforeAppear:Z=m,onAppear:w=B,onAppearCancelled:A=z}=t,H=(L,O,I)=>{jt(L,O?d:s),jt(L,O?c:o),I&&I()},j=(L,O)=>{L._isLeaving=!1,jt(L,E),jt(L,g),jt(L,v),O&&O()},J=L=>(O,I)=>{const se=L?w:B,U=()=>H(O,L,I);Vt(se,[O,U]),Lr(()=>{jt(O,L?a:r),Dt(O,L?d:s),Dr(se)||Cr(O,i,y,U)})};return Pe(t,{onBeforeEnter(L){Vt(m,[L]),Dt(L,r),Dt(L,o)},onBeforeAppear(L){Vt(Z,[L]),Dt(L,a),Dt(L,c)},onEnter:J(!1),onAppear:J(!0),onLeave(L,O){L._isLeaving=!0;const I=()=>j(L,O);Dt(L,E),Cu(),Dt(L,v),Lr(()=>{L._isLeaving&&(jt(L,E),Dt(L,g),Dr(P)||Cr(L,i,C,I))}),Vt(P,[L,I])},onEnterCancelled(L){H(L,!1),Vt(z,[L])},onAppearCancelled(L){H(L,!0),Vt(A,[L])},onLeaveCancelled(L){j(L),Vt(W,[L])}})}function Fu(e){if(e==null)return null;if(be(e))return[Hi(e.enter),Hi(e.leave)];{const t=Hi(e);return[t,t]}}function Hi(e){return oa(e)}function Dt(e,t){t.split(/\s+/).forEach(l=>l&&e.classList.add(l)),(e._vtc||(e._vtc=new Set)).add(t)}function jt(e,t){t.split(/\s+/).forEach(i=>i&&e.classList.remove(i));const{_vtc:l}=e;l&&(l.delete(t),l.size||(e._vtc=void 0))}function Lr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Du=0;function Cr(e,t,l,i){const n=e._endId=++Du,r=()=>{n===e._endId&&i()};if(l)return setTimeout(r,l);const{type:o,timeout:s,propCount:a}=Lu(e,t);if(!o)return i();const c=o+"end";let d=0;const E=()=>{e.removeEventListener(c,v),r()},v=g=>{g.target===e&&++d>=a&&E()};setTimeout(()=>{d(l[k]||"").split(", "),n=i(`${Ft}Delay`),r=i(`${Ft}Duration`),o=Tr(n,r),s=i(`${ml}Delay`),a=i(`${ml}Duration`),c=Tr(s,a);let d=null,E=0,v=0;t===Ft?o>0&&(d=Ft,E=o,v=r.length):t===ml?c>0&&(d=ml,E=c,v=a.length):(E=Math.max(o,c),d=E>0?o>c?Ft:ml:null,v=d?d===Ft?r.length:a.length:0);const g=d===Ft&&/\b(transform|all)(,|$)/.test(i(`${Ft}Property`).toString());return{type:d,timeout:E,propCount:v,hasTransform:g}}function Tr(e,t){for(;e.lengthPr(l)+Pr(e[i])))}function Pr(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function Cu(){return document.body.offsetHeight}const Tu={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Pu=(e,t)=>l=>{if(!("key"in l))return;const i=Jt(l.key);if(t.some(n=>n===i||Tu[n]===i))return e(l)},mi={beforeMount(e,{value:t},{transition:l}){e._vod=e.style.display==="none"?"":e.style.display,l&&t?l.beforeEnter(e):_l(e,t)},mounted(e,{value:t},{transition:l}){l&&t&&l.enter(e)},updated(e,{value:t,oldValue:l},{transition:i}){!t!=!l&&(i?t?(i.beforeEnter(e),_l(e,!0),i.enter(e)):i.leave(e,()=>{_l(e,!1)}):_l(e,t))},beforeUnmount(e,{value:t}){_l(e,t)}};function _l(e,t){e.style.display=t?e._vod:"none"}const zu=Pe({patchProp:ku},au);let Ui,zr=!1;function xu(){return Ui=zr?Ui:$c(zu),zr=!0,Ui}const Ru=(...e)=>{const t=xu().createApp(...e),{mount:l}=t;return t.mount=i=>{const n=Ou(i);if(n)return l(n,!0,n instanceof SVGElement)},t};function Ou(e){return ge(e)?document.querySelector(e):e}const Iu={"v-8daa1a0e":()=>u(()=>import("./index.html-b85696fd.js"),[]).then(({data:e})=>e),"v-2d0a870d":()=>u(()=>import("./index.html-f6f72dd6.js"),[]).then(({data:e})=>e),"v-2d0ad528":()=>u(()=>import("./index.html-9be1469b.js"),[]).then(({data:e})=>e),"v-2743edae":()=>u(()=>import("./install_mysql_on_centos.html-9000ace5.js"),[]).then(({data:e})=>e),"v-b650f4dc":()=>u(()=>import("./install_nginx_from_source.html-4d670bf5.js"),[]).then(({data:e})=>e),"v-92a2a070":()=>u(()=>import("./install_python37_on_centos.html-406b4dd9.js"),[]).then(({data:e})=>e),"v-07307966":()=>u(()=>import("./install_python37_on_ubuntu.html-e2ed6f5c.js"),[]).then(({data:e})=>e),"v-446601d1":()=>u(()=>import("./install_redis_from_source.html-d680ee1a.js"),[]).then(({data:e})=>e),"v-85814896":()=>u(()=>import("./install_redis_on_centos.html-0830290e.js"),[]).then(({data:e})=>e),"v-5f228e44":()=>u(()=>import("./任务分布式执行.html-ea0b9d04.js"),[]).then(({data:e})=>e),"v-f9c3256c":()=>u(()=>import("./使用自建工具git库.html-787a0684.js"),[]).then(({data:e})=>e),"v-16f1abd8":()=>u(()=>import("./集成代码分析工具.html-ca82af0a.js"),[]).then(({data:e})=>e),"v-075401e2":()=>u(()=>import("./index.html-8632c13c.js"),[]).then(({data:e})=>e),"v-34e7f038":()=>u(()=>import("./代码度量数据模块接口.html-1d4edd49.js"),[]).then(({data:e})=>e),"v-d1cb31be":()=>u(()=>import("./代码扫描数据模块接口.html-4ed0e1d6.js"),[]).then(({data:e})=>e),"v-6981ad02":()=>u(()=>import("./任务管理模块接口.html-ed2aa571.js"),[]).then(({data:e})=>e),"v-2fb80293":()=>u(()=>import("./对象主要字段说明.html-1ec7c601.js"),[]).then(({data:e})=>e),"v-4b0e7010":()=>u(()=>import("./结果概览模块接口.html-6e625e21.js"),[]).then(({data:e})=>e),"v-bb3cf496":()=>u(()=>import("./项目管理模块接口.html-3cef7840.js"),[]).then(({data:e})=>e),"v-ee298290":()=>u(()=>import("./changelog.html-c4b08e96.js"),[]).then(({data:e})=>e),"v-1b714c0e":()=>u(()=>import("./contribute.html-58671db5.js"),[]).then(({data:e})=>e),"v-f6077552":()=>u(()=>import("./joingroup.html-b3d16c20.js"),[]).then(({data:e})=>e),"v-78c226f8":()=>u(()=>import("./pr.html-d341e50b.js"),[]).then(({data:e})=>e),"v-e6412400":()=>u(()=>import("./index.html-b5f8ac0e.js"),[]).then(({data:e})=>e),"v-023e8091":()=>u(()=>import("./FAQ.html-687658b7.js"),[]).then(({data:e})=>e),"v-3c0f9a24":()=>u(()=>import("./index.html-bc147f42.js"),[]).then(({data:e})=>e),"v-64f30f77":()=>u(()=>import("./codeDeploy.html-0291e9cf.js"),[]).then(({data:e})=>e),"v-0967ab59":()=>u(()=>import("./deployClient.html-f23ed8d2.js"),[]).then(({data:e})=>e),"v-0ceb929d":()=>u(()=>import("./deploySever.html-acb534b2.js"),[]).then(({data:e})=>e),"v-2d129638":()=>u(()=>import("./dockerDeploy.html-91ffd251.js"),[]).then(({data:e})=>e),"v-fb43c324":()=>u(()=>import("./dockercomposeDeploy.html-d6c28f23.js"),[]).then(({data:e})=>e),"v-6825e832":()=>u(()=>import("./enhanceDeploy.html-56e5c83c.js"),[]).then(({data:e})=>e),"v-bb3dad6e":()=>u(()=>import("./initRepo.html-dd7f39bb.js"),[]).then(({data:e})=>e),"v-2bb8df5b":()=>u(()=>import("./intro.html-87dabf49.js"),[]).then(({data:e})=>e),"v-1b6d66dd":()=>u(()=>import("./runProject.html-083184d0.js"),[]).then(({data:e})=>e),"v-d29a371a":()=>u(()=>import("./install_mysql_on_centos.html-a68810ef.js"),[]).then(({data:e})=>e),"v-173841d2":()=>u(()=>import("./install_nginx_from_source.html-bbfe6746.js"),[]).then(({data:e})=>e),"v-58ad86e3":()=>u(()=>import("./install_python37_on_centos.html-0777e70c.js"),[]).then(({data:e})=>e),"v-c332cb30":()=>u(()=>import("./install_python37_on_ubuntu.html-bab383eb.js"),[]).then(({data:e})=>e),"v-d81b4954":()=>u(()=>import("./install_redis_from_source.html-215b8bee.js"),[]).then(({data:e})=>e),"v-2cae527a":()=>u(()=>import("./install_redis_on_centos.html-6c713327.js"),[]).then(({data:e})=>e),"v-4b1e72ba":()=>u(()=>import("./任务分布式执行.html-7aaf7465.js"),[]).then(({data:e})=>e),"v-281ecd65":()=>u(()=>import("./使用自建工具git库.html-b41c8e9c.js"),[]).then(({data:e})=>e),"v-331b689a":()=>u(()=>import("./集成代码分析工具.html-5b16521a.js"),[]).then(({data:e})=>e),"v-53f9ca7d":()=>u(()=>import("./index.html-0a8ee588.js"),[]).then(({data:e})=>e),"v-3f0143e9":()=>u(()=>import("./代码度量数据模块接口.html-52fdc1e8.js"),[]).then(({data:e})=>e),"v-1ee0b9b4":()=>u(()=>import("./代码扫描数据模块接口.html-f498f2d3.js"),[]).then(({data:e})=>e),"v-736a6678":()=>u(()=>import("./任务管理模块接口.html-13248996.js"),[]).then(({data:e})=>e),"v-2ac3a5d8":()=>u(()=>import("./对象主要字段说明.html-af9a65f8.js"),[]).then(({data:e})=>e),"v-54f72986":()=>u(()=>import("./结果概览模块接口.html-36bc583e.js"),[]).then(({data:e})=>e),"v-c525ae0c":()=>u(()=>import("./项目管理模块接口.html-73b341fb.js"),[]).then(({data:e})=>e),"v-3179abd3":()=>u(()=>import("./changelog.html-55c50323.js"),[]).then(({data:e})=>e),"v-5b86903e":()=>u(()=>import("./contribute.html-50405d2a.js"),[]).then(({data:e})=>e),"v-2d8ab272":()=>u(()=>import("./joingroup.html-309e7f1e.js"),[]).then(({data:e})=>e),"v-1c31906e":()=>u(()=>import("./pr.html-226d6634.js"),[]).then(({data:e})=>e),"v-47357bdb":()=>u(()=>import("./index.html-91ce084b.js"),[]).then(({data:e})=>e),"v-1d94bd54":()=>u(()=>import("./FAQ.html-da55be4f.js"),[]).then(({data:e})=>e),"v-47cae8b3":()=>u(()=>import("./index.html-3ed6ee07.js"),[]).then(({data:e})=>e),"v-17ff7712":()=>u(()=>import("./codeDeploy.html-fb37d8a4.js"),[]).then(({data:e})=>e),"v-2af89834":()=>u(()=>import("./deployClient.html-26310b53.js"),[]).then(({data:e})=>e),"v-8927c33c":()=>u(()=>import("./deploySever.html-cd918886.js"),[]).then(({data:e})=>e),"v-0b07a1bf":()=>u(()=>import("./dockerDeploy.html-c1c22390.js"),[]).then(({data:e})=>e),"v-1c65d59a":()=>u(()=>import("./dockercomposeDeploy.html-c2efd135.js"),[]).then(({data:e})=>e),"v-78b296b7":()=>u(()=>import("./enhanceDeploy.html-7b9945cc.js"),[]).then(({data:e})=>e),"v-6108bba4":()=>u(()=>import("./initRepo.html-145021f4.js"),[]).then(({data:e})=>e),"v-396ae2e0":()=>u(()=>import("./intro.html-7fd28a67.js"),[]).then(({data:e})=>e),"v-630c6310":()=>u(()=>import("./runProject.html-f5e6a3ca.js"),[]).then(({data:e})=>e),"v-e2e9d388":()=>u(()=>import("./deploySource.html-ef8635a2.js"),[]).then(({data:e})=>e),"v-641bec60":()=>u(()=>import("./web.html-49abd215.js"),[]).then(({data:e})=>e),"v-2aa9208a":()=>u(()=>import("./分析结果查看.html-2dac9266.js"),[]).then(({data:e})=>e),"v-459a75e4":()=>u(()=>import("./添加规则配置.html-65f4adbd.js"),[]).then(({data:e})=>e),"v-4b5d7d25":()=>u(()=>import("./代码度量配置.html-6e7a8634.js"),[]).then(({data:e})=>e),"v-8554b5ae":()=>u(()=>import("./代码检查编译配置.html-b9cea002.js"),[]).then(({data:e})=>e),"v-0b272f8a":()=>u(()=>import("./代码检查规则配置.html-30e38919.js"),[]).then(({data:e})=>e),"v-7f8f12be":()=>u(()=>import("./代码检查配置.html-bfaaf5f0.js"),[]).then(({data:e})=>e),"v-7b5fb5ab":()=>u(()=>import("./分析方案模板说明.html-d6a11aa1.js"),[]).then(({data:e})=>e),"v-592884a3":()=>u(()=>import("./基础属性配置.html-d6db40b1.js"),[]).then(({data:e})=>e),"v-9d3d5372":()=>u(()=>import("./过滤配置.html-98359f35.js"),[]).then(({data:e})=>e),"v-01483471":()=>u(()=>import("./OAuth管理.html-d1cc69ce.js"),[]).then(({data:e})=>e),"v-46f099d9":()=>u(()=>import("./分析记录管理.html-560b2bd2.js"),[]).then(({data:e})=>e),"v-e38c74ec":()=>u(()=>import("./团队管理.html-2e60458d.js"),[]).then(({data:e})=>e),"v-07d72a4a":()=>u(()=>import("./工具管理.html-fb279444.js"),[]).then(({data:e})=>e),"v-b2cd5ac8":()=>u(()=>import("./用户管理.html-4b0db1f4.js"),[]).then(({data:e})=>e),"v-6a752a2e":()=>u(()=>import("./节点管理.html-e16a83ba.js"),[]).then(({data:e})=>e),"v-b2bcdc3c":()=>u(()=>import("./项目管理.html-36cd817e.js"),[]).then(({data:e})=>e),"v-1759972c":()=>u(()=>import("./团队管理.html-9abe4210.js"),[]).then(({data:e})=>e),"v-53d9da54":()=>u(()=>import("./成员权限.html-7a01de0b.js"),[]).then(({data:e})=>e),"v-30ded9c9":()=>u(()=>import("./节点管理.html-de9ab0a5.js"),[]).then(({data:e})=>e),"v-66bece26":()=>u(()=>import("./其他配置.html-5d155cf4.js"),[]).then(({data:e})=>e),"v-78d0e857":()=>u(()=>import("./常驻节点分析.html-449bc857.js"),[]).then(({data:e})=>e),"v-2c3a512d":()=>u(()=>import("./快速扫描模式.html-e7bbd3cb.js"),[]).then(({data:e})=>e),"v-bb7105ba":()=>u(()=>import("./本地分析.html-6a55018a.js"),[]).then(({data:e})=>e),"v-640fd1ac":()=>u(()=>import("./配置说明.html-d33cfc48.js"),[]).then(({data:e})=>e),"v-5b6aff19":()=>u(()=>import("./工具列表.html-4ae75a79.js"),[]).then(({data:e})=>e),"v-781ca92a":()=>u(()=>import("./工具管理说明.html-ed593bde.js"),[]).then(({data:e})=>e),"v-72a0db1d":()=>u(()=>import("./自定义工具.html-02d18eb1.js"),[]).then(({data:e})=>e),"v-66e40bbf":()=>u(()=>import("./自定义规则.html-9dbeac77.js"),[]).then(({data:e})=>e),"v-bbb8ba4e":()=>u(()=>import("./快速启动一次代码分析.html-4a457a00.js"),[]).then(({data:e})=>e),"v-356f7475":()=>u(()=>import("./Jenkins_Plugin.html-d89ff0ac.js"),[]).then(({data:e})=>e),"v-374a553a":()=>u(()=>import("./deploy_with_minio.html-5815abcc.js"),[]).then(({data:e})=>e),"v-5c7ce0e5":()=>u(()=>import("./deploy_without_migrate.html-5b1052ed.js"),[]).then(({data:e})=>e),"v-2b8ad044":()=>u(()=>import("./server.html-56940125.js"),[]).then(({data:e})=>e),"v-b654617e":()=>u(()=>import("./deploySource.html-956fd91c.js"),[]).then(({data:e})=>e),"v-0245ec8a":()=>u(()=>import("./web.html-c0b4826b.js"),[]).then(({data:e})=>e),"v-67ff15d4":()=>u(()=>import("./个人令牌.html-546ba7e4.js"),[]).then(({data:e})=>e),"v-3c5ef996":()=>u(()=>import("./分析结果查看.html-f1a2e8c4.js"),[]).then(({data:e})=>e),"v-d1640082":()=>u(()=>import("./添加规则配置.html-55bd82a5.js"),[]).then(({data:e})=>e),"v-c5ddf200":()=>u(()=>import("./代码度量配置.html-005420db.js"),[]).then(({data:e})=>e),"v-475a8e44":()=>u(()=>import("./代码检查编译配置.html-20064d15.js"),[]).then(({data:e})=>e),"v-d5a7ceb6":()=>u(()=>import("./代码检查规则配置.html-15e89585.js"),[]).then(({data:e})=>e),"v-11ec007c":()=>u(()=>import("./代码检查配置.html-1f9708fb.js"),[]).then(({data:e})=>e),"v-05649ec6":()=>u(()=>import("./分析方案模板说明.html-93191e95.js"),[]).then(({data:e})=>e),"v-aa47e304":()=>u(()=>import("./基础属性配置.html-7158c85c.js"),[]).then(({data:e})=>e),"v-20ae30e2":()=>u(()=>import("./过滤配置.html-69241b23.js"),[]).then(({data:e})=>e),"v-fb758c14":()=>u(()=>import("./OAuth管理.html-f4f4e374.js"),[]).then(({data:e})=>e),"v-ceb7b898":()=>u(()=>import("./分析记录管理.html-94fd5a90.js"),[]).then(({data:e})=>e),"v-04f2bfb6":()=>u(()=>import("./团队管理.html-4a60f4f5.js"),[]).then(({data:e})=>e),"v-6b614576":()=>u(()=>import("./工具管理.html-3ac7c59a.js"),[]).then(({data:e})=>e),"v-15e62d37":()=>u(()=>import("./用户管理.html-fe658e34.js"),[]).then(({data:e})=>e),"v-3a124584":()=>u(()=>import("./节点管理.html-d35d61ad.js"),[]).then(({data:e})=>e),"v-15ee6c7d":()=>u(()=>import("./项目管理.html-54c86c5b.js"),[]).then(({data:e})=>e),"v-63a00f05":()=>u(()=>import("./团队管理.html-a21de07f.js"),[]).then(({data:e})=>e),"v-455fed71":()=>u(()=>import("./成员权限.html-4e77afc1.js"),[]).then(({data:e})=>e),"v-bfa89738":()=>u(()=>import("./节点管理.html-8b6ba95b.js"),[]).then(({data:e})=>e),"v-6f03892b":()=>u(()=>import("./其他配置.html-44a6f109.js"),[]).then(({data:e})=>e),"v-1c5e67c8":()=>u(()=>import("./常驻节点分析.html-192fbab3.js"),[]).then(({data:e})=>e),"v-b58b961c":()=>u(()=>import("./快速扫描模式.html-7dc85655.js"),[]).then(({data:e})=>e),"v-aae78fb0":()=>u(()=>import("./本地分析.html-b67e71be.js"),[]).then(({data:e})=>e),"v-6c548cb1":()=>u(()=>import("./配置说明.html-90986766.js"),[]).then(({data:e})=>e),"v-6a904c98":()=>u(()=>import("./工具列表.html-6d320578.js"),[]).then(({data:e})=>e),"v-15a53546":()=>u(()=>import("./工具管理说明.html-9d64fce3.js"),[]).then(({data:e})=>e),"v-28be823c":()=>u(()=>import("./自定义工具.html-7f234a0d.js"),[]).then(({data:e})=>e),"v-403820f8":()=>u(()=>import("./自定义规则.html-4ffb8d2c.js"),[]).then(({data:e})=>e),"v-11cec998":()=>u(()=>import("./快速启动一次代码分析.html-1fdc91f9.js"),[]).then(({data:e})=>e),"v-7fa74610":()=>u(()=>import("./Jenkins_Plugin.html-6d1bdd5f.js"),[]).then(({data:e})=>e),"v-55b96640":()=>u(()=>import("./ScriptAPI_guide.html-a6789fea.js"),[]).then(({data:e})=>e),"v-48a59655":()=>u(()=>import("./deploy_with_minio.html-cbb3a284.js"),[]).then(({data:e})=>e),"v-051518aa":()=>u(()=>import("./deploy_without_migrate.html-90300af0.js"),[]).then(({data:e})=>e),"v-c3df2014":()=>u(()=>import("./gitlab_oauth_guide.html-d11fffe7.js"),[]).then(({data:e})=>e),"v-32060cba":()=>u(()=>import("./server.html-3d988e17.js"),[]).then(({data:e})=>e),"v-2b72915d":()=>u(()=>import("./Error-Prone.html-8bdd0b5f.js"),[]).then(({data:e})=>e),"v-1cf92e76":()=>u(()=>import("./TCA-Armory-C1.html-5177716b.js"),[]).then(({data:e})=>e),"v-01906c04":()=>u(()=>import("./TCA-Armory-Q1.html-bb42cfff.js"),[]).then(({data:e})=>e),"v-6d0cdd3c":()=>u(()=>import("./TCA-Armory-R.html-a4907275.js"),[]).then(({data:e})=>e),"v-0db91de5":()=>u(()=>import("./eslint.html-fbc7baff.js"),[]).then(({data:e})=>e),"v-33a5d252":()=>u(()=>import("./golangcilint.html-2e27c271.js"),[]).then(({data:e})=>e),"v-02d030be":()=>u(()=>import("./code_spec_oc.html-c551e928.js"),[]).then(({data:e})=>e),"v-218b1d6f":()=>u(()=>import("./cpp_doc.html-bf6ce6bb.js"),[]).then(({data:e})=>e),"v-c54ad424":()=>u(()=>import("./dependency_vul.html-f875aa89.js"),[]).then(({data:e})=>e),"v-918a6bfe":()=>u(()=>import("./enhanced_safety_java.html-7731bb0b.js"),[]).then(({data:e})=>e),"v-0b3551c4":()=>u(()=>import("./front_end_framework_check.html-bc39db93.js"),[]).then(({data:e})=>e),"v-f8f08cc2":()=>u(()=>import("./test_case_verify_go.html-2211e0d9.js"),[]).then(({data:e})=>e),"v-61b23c38":()=>u(()=>import("./Error-Prone.html-81fc48a5.js"),[]).then(({data:e})=>e),"v-7c0ce2de":()=>u(()=>import("./TCA-Armory-C1.html-9ef6db9a.js"),[]).then(({data:e})=>e),"v-b2de67c2":()=>u(()=>import("./TCA-Armory-Q1.html-20e46388.js"),[]).then(({data:e})=>e),"v-027ae47e":()=>u(()=>import("./TCA-Armory-R.html-d83fb336.js"),[]).then(({data:e})=>e),"v-438ad62a":()=>u(()=>import("./eslint.html-0421823e.js"),[]).then(({data:e})=>e),"v-77e2c75c":()=>u(()=>import("./golangcilint.html-70bf0a39.js"),[]).then(({data:e})=>e),"v-1f200688":()=>u(()=>import("./code_spec_oc.html-b745b523.js"),[]).then(({data:e})=>e),"v-ef89f918":()=>u(()=>import("./cpp_doc.html-c7d5253e.js"),[]).then(({data:e})=>e),"v-7981d049":()=>u(()=>import("./dependency_vul.html-387d064d.js"),[]).then(({data:e})=>e),"v-dd34d7c8":()=>u(()=>import("./enhanced_safety_java.html-006895cc.js"),[]).then(({data:e})=>e),"v-6908b43a":()=>u(()=>import("./front_end_framework_check.html-755e8478.js"),[]).then(({data:e})=>e),"v-87c47fb8":()=>u(()=>import("./test_case_verify_go.html-704e2cfd.js"),[]).then(({data:e})=>e),"v-3706649a":()=>u(()=>import("./404.html-f9875e7b.js"),[]).then(({data:e})=>e)},wu=JSON.parse('{"base":"/CodeAnalysis/","lang":"en-US","title":"","description":"","head":[["link",{"rel":"icon","type":"image/png","href":"/images/favicon.png"}],["meta",{"name":"msapplication-TileColor","content":"#3eaf7c"}],["meta",{"name":"theme-color","content":"#3eaf7c"}]],"locales":{"/":{"lang":"zh-CN","title":"腾讯云代码分析","description":"用心关注每行代码迭代、助力传承卓越代码文化!"},"/en":{"lang":"en-US","title":"Tencent Cloud Code Analysis","description":"用心关注每行代码迭代、助力传承卓越代码文化!"}}}');var Su=([e,t,l])=>e==="meta"&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,l]),Vu=e=>{const t=new Set,l=[];return e.forEach(i=>{const n=Su(i);t.has(n)||(t.add(n),l.push(i))}),l},Ul=e=>/^(https?:)?\/\//.test(e),ju=e=>/^mailto:/.test(e),Mu=e=>/^tel:/.test(e),On=e=>Object.prototype.toString.call(e)==="[object Object]",us=e=>e[e.length-1]==="/"?e.slice(0,-1):e,ds=e=>e[0]==="/"?e.slice(1):e,Es=(e,t)=>{const l=Object.keys(e).sort((i,n)=>{const r=n.split("/").length-i.split("/").length;return r!==0?r:n.length-i.length});for(const i of l)if(t.startsWith(i))return i;return"/"};const hs={"v-8daa1a0e":_(()=>u(()=>import("./index.html-d13f5268.js"),[])),"v-2d0a870d":_(()=>u(()=>import("./index.html-3ffc2657.js"),[])),"v-2d0ad528":_(()=>u(()=>import("./index.html-50f0e95e.js"),[])),"v-2743edae":_(()=>u(()=>import("./install_mysql_on_centos.html-2c216767.js"),[])),"v-b650f4dc":_(()=>u(()=>import("./install_nginx_from_source.html-39cfa334.js"),[])),"v-92a2a070":_(()=>u(()=>import("./install_python37_on_centos.html-77d1e41a.js"),[])),"v-07307966":_(()=>u(()=>import("./install_python37_on_ubuntu.html-5c2a2a11.js"),[])),"v-446601d1":_(()=>u(()=>import("./install_redis_from_source.html-089c356a.js"),[])),"v-85814896":_(()=>u(()=>import("./install_redis_on_centos.html-927eeae4.js"),[])),"v-5f228e44":_(()=>u(()=>import("./任务分布式执行.html-6ed77c45.js"),[])),"v-f9c3256c":_(()=>u(()=>import("./使用自建工具git库.html-ba1393b3.js"),[])),"v-16f1abd8":_(()=>u(()=>import("./集成代码分析工具.html-7b03efe0.js"),["assets/集成代码分析工具.html-7b03efe0.js","assets/ProcessConfiguration2-c60284cc.js"])),"v-075401e2":_(()=>u(()=>import("./index.html-d386891c.js"),["assets/index.html-d386891c.js","assets/API的个人令牌-d33dd7b6.js"])),"v-34e7f038":_(()=>u(()=>import("./代码度量数据模块接口.html-f9443a60.js"),[])),"v-d1cb31be":_(()=>u(()=>import("./代码扫描数据模块接口.html-af83f351.js"),[])),"v-6981ad02":_(()=>u(()=>import("./任务管理模块接口.html-b2f03717.js"),[])),"v-2fb80293":_(()=>u(()=>import("./对象主要字段说明.html-77986132.js"),[])),"v-4b0e7010":_(()=>u(()=>import("./结果概览模块接口.html-4ee7fd62.js"),[])),"v-bb3cf496":_(()=>u(()=>import("./项目管理模块接口.html-3a996ff5.js"),[])),"v-ee298290":_(()=>u(()=>import("./changelog.html-3b9a2e33.js"),[])),"v-1b714c0e":_(()=>u(()=>import("./contribute.html-bb8c692b.js"),[])),"v-f6077552":_(()=>u(()=>import("./joingroup.html-d64da6dc.js"),[])),"v-78c226f8":_(()=>u(()=>import("./pr.html-d355a211.js"),["assets/pr.html-d355a211.js","assets/PR-48d0e900.js"])),"v-e6412400":_(()=>u(()=>import("./index.html-5c984d6d.js"),[])),"v-023e8091":_(()=>u(()=>import("./FAQ.html-7682a4cb.js"),[])),"v-3c0f9a24":_(()=>u(()=>import("./index.html-984e57d5.js"),[])),"v-64f30f77":_(()=>u(()=>import("./codeDeploy.html-bfd1275a.js"),[])),"v-0967ab59":_(()=>u(()=>import("./deployClient.html-9dc0de26.js"),["assets/deployClient.html-9dc0de26.js","assets/personalToken-2ae175b9.js"])),"v-0ceb929d":_(()=>u(()=>import("./deploySever.html-1f528b16.js"),["assets/deploySever.html-1f528b16.js","assets/planPage-27225805.js","assets/start_scan_02-3fe00a0e.js","assets/start_scan_04-65ab4d48.js"])),"v-2d129638":_(()=>u(()=>import("./dockerDeploy.html-4ecfde5f.js"),[])),"v-fb43c324":_(()=>u(()=>import("./dockercomposeDeploy.html-427f62d1.js"),[])),"v-6825e832":_(()=>u(()=>import("./enhanceDeploy.html-8c0e7dac.js"),[])),"v-bb3dad6e":_(()=>u(()=>import("./initRepo.html-dd029873.js"),["assets/initRepo.html-dd029873.js","assets/planPage-27225805.js","assets/start_scan_02-3fe00a0e.js"])),"v-2bb8df5b":_(()=>u(()=>import("./intro.html-218c4de3.js"),[])),"v-1b6d66dd":_(()=>u(()=>import("./runProject.html-3c0bf355.js"),["assets/runProject.html-3c0bf355.js","assets/start_scan_04-65ab4d48.js"])),"v-d29a371a":_(()=>u(()=>import("./install_mysql_on_centos.html-cc6980ef.js"),[])),"v-173841d2":_(()=>u(()=>import("./install_nginx_from_source.html-7bb4d6c5.js"),[])),"v-58ad86e3":_(()=>u(()=>import("./install_python37_on_centos.html-cd63257c.js"),[])),"v-c332cb30":_(()=>u(()=>import("./install_python37_on_ubuntu.html-15ea3d7a.js"),[])),"v-d81b4954":_(()=>u(()=>import("./install_redis_from_source.html-91fed3be.js"),[])),"v-2cae527a":_(()=>u(()=>import("./install_redis_on_centos.html-eb0d02c0.js"),[])),"v-4b1e72ba":_(()=>u(()=>import("./任务分布式执行.html-bc7f33c5.js"),[])),"v-281ecd65":_(()=>u(()=>import("./使用自建工具git库.html-8a45c991.js"),[])),"v-331b689a":_(()=>u(()=>import("./集成代码分析工具.html-47aad379.js"),["assets/集成代码分析工具.html-47aad379.js","assets/ProcessConfiguration2-c60284cc.js"])),"v-53f9ca7d":_(()=>u(()=>import("./index.html-892823d8.js"),["assets/index.html-892823d8.js","assets/API的个人令牌-d33dd7b6.js"])),"v-3f0143e9":_(()=>u(()=>import("./代码度量数据模块接口.html-d92729e0.js"),[])),"v-1ee0b9b4":_(()=>u(()=>import("./代码扫描数据模块接口.html-9e291d69.js"),[])),"v-736a6678":_(()=>u(()=>import("./任务管理模块接口.html-d04cb684.js"),[])),"v-2ac3a5d8":_(()=>u(()=>import("./对象主要字段说明.html-a10f4785.js"),[])),"v-54f72986":_(()=>u(()=>import("./结果概览模块接口.html-b8aa1708.js"),[])),"v-c525ae0c":_(()=>u(()=>import("./项目管理模块接口.html-eba8e5dc.js"),[])),"v-3179abd3":_(()=>u(()=>import("./changelog.html-c22ca463.js"),[])),"v-5b86903e":_(()=>u(()=>import("./contribute.html-e2151c44.js"),[])),"v-2d8ab272":_(()=>u(()=>import("./joingroup.html-fcf92f00.js"),[])),"v-1c31906e":_(()=>u(()=>import("./pr.html-238f6a7c.js"),["assets/pr.html-238f6a7c.js","assets/PR-48d0e900.js"])),"v-47357bdb":_(()=>u(()=>import("./index.html-929379d0.js"),[])),"v-1d94bd54":_(()=>u(()=>import("./FAQ.html-8873eb25.js"),[])),"v-47cae8b3":_(()=>u(()=>import("./index.html-eaba2094.js"),[])),"v-17ff7712":_(()=>u(()=>import("./codeDeploy.html-319b644b.js"),[])),"v-2af89834":_(()=>u(()=>import("./deployClient.html-a08e0f33.js"),["assets/deployClient.html-a08e0f33.js","assets/personalToken-2ae175b9.js"])),"v-8927c33c":_(()=>u(()=>import("./deploySever.html-2b7d9acd.js"),["assets/deploySever.html-2b7d9acd.js","assets/planPage-27225805.js","assets/start_scan_02-3fe00a0e.js","assets/start_scan_04-65ab4d48.js"])),"v-0b07a1bf":_(()=>u(()=>import("./dockerDeploy.html-cd423864.js"),[])),"v-1c65d59a":_(()=>u(()=>import("./dockercomposeDeploy.html-295cc18e.js"),[])),"v-78b296b7":_(()=>u(()=>import("./enhanceDeploy.html-165efbbb.js"),[])),"v-6108bba4":_(()=>u(()=>import("./initRepo.html-439e220f.js"),["assets/initRepo.html-439e220f.js","assets/planPage-27225805.js","assets/start_scan_02-3fe00a0e.js"])),"v-396ae2e0":_(()=>u(()=>import("./intro.html-df1c3002.js"),[])),"v-630c6310":_(()=>u(()=>import("./runProject.html-2ddb4214.js"),["assets/runProject.html-2ddb4214.js","assets/start_scan_04-65ab4d48.js"])),"v-e2e9d388":_(()=>u(()=>import("./deploySource.html-52110188.js"),[])),"v-641bec60":_(()=>u(()=>import("./web.html-1b03934f.js"),[])),"v-2aa9208a":_(()=>u(()=>import("./分析结果查看.html-d5884e54.js"),["assets/分析结果查看.html-d5884e54.js","assets/codelint_03-8fa68424.js"])),"v-459a75e4":_(()=>u(()=>import("./添加规则配置.html-86efce15.js"),["assets/添加规则配置.html-86efce15.js","assets/AddRule3-9d6ed3bf.js"])),"v-4b5d7d25":_(()=>u(()=>import("./代码度量配置.html-a0b512c6.js"),[])),"v-8554b5ae":_(()=>u(()=>import("./代码检查编译配置.html-6ab56434.js"),[])),"v-0b272f8a":_(()=>u(()=>import("./代码检查规则配置.html-00c1c969.js"),["assets/代码检查规则配置.html-00c1c969.js","assets/AddRule3-9d6ed3bf.js","assets/scheme_codelint_03-5bcd9286.js","assets/scheme_codelint_04-1cece3c4.js"])),"v-7f8f12be":_(()=>u(()=>import("./代码检查配置.html-daa38911.js"),["assets/代码检查配置.html-daa38911.js","assets/scheme_codelint_01-9eec47a6.js"])),"v-7b5fb5ab":_(()=>u(()=>import("./分析方案模板说明.html-d1dabf97.js"),["assets/分析方案模板说明.html-d1dabf97.js","assets/scheme_template_02-70fd366c.js"])),"v-592884a3":_(()=>u(()=>import("./基础属性配置.html-b1c09b73.js"),[])),"v-9d3d5372":_(()=>u(()=>import("./过滤配置.html-b496bc8d.js"),[])),"v-01483471":_(()=>u(()=>import("./OAuth管理.html-5142cdcf.js"),["assets/OAuth管理.html-5142cdcf.js","assets/manage_oauth_02-fc66f681.js"])),"v-46f099d9":_(()=>u(()=>import("./分析记录管理.html-613c8218.js"),["assets/分析记录管理.html-613c8218.js","assets/manage_job_01-8f68e1e2.js"])),"v-e38c74ec":_(()=>u(()=>import("./团队管理.html-77ccbb28.js"),["assets/团队管理.html-77ccbb28.js","assets/manage_org_02-ce951ef7.js"])),"v-07d72a4a":_(()=>u(()=>import("./工具管理.html-404b9f7d.js"),["assets/工具管理.html-404b9f7d.js","assets/manage_tool_01-405e8179.js"])),"v-b2cd5ac8":_(()=>u(()=>import("./用户管理.html-01a71e5a.js"),["assets/用户管理.html-01a71e5a.js","assets/manage_user_02-e4d7abc6.js"])),"v-6a752a2e":_(()=>u(()=>import("./节点管理.html-3a0c1401.js"),["assets/节点管理.html-3a0c1401.js","assets/manage_node_04-ba2c36cb.js"])),"v-b2bcdc3c":_(()=>u(()=>import("./项目管理.html-e07a0f63.js"),["assets/项目管理.html-e07a0f63.js","assets/manage_team_01-ead0dac9.js"])),"v-1759972c":_(()=>u(()=>import("./团队管理.html-adf41fb7.js"),["assets/团队管理.html-adf41fb7.js","assets/team_member-8942b2d5.js"])),"v-53d9da54":_(()=>u(()=>import("./成员权限.html-54a4da1a.js"),["assets/成员权限.html-54a4da1a.js","assets/team_member-8942b2d5.js"])),"v-30ded9c9":_(()=>u(()=>import("./节点管理.html-2af93833.js"),["assets/节点管理.html-2af93833.js","assets/org_tag_scheme-0392461b.js"])),"v-66bece26":_(()=>u(()=>import("./其他配置.html-91b8f003.js"),[])),"v-78d0e857":_(()=>u(()=>import("./常驻节点分析.html-b27148e9.js"),[])),"v-2c3a512d":_(()=>u(()=>import("./快速扫描模式.html-1e463c76.js"),[])),"v-bb7105ba":_(()=>u(()=>import("./本地分析.html-b5c4dff0.js"),["assets/本地分析.html-b5c4dff0.js","assets/start_scan_03-f1dea0e4.js"])),"v-640fd1ac":_(()=>u(()=>import("./配置说明.html-ddefec01.js"),[])),"v-5b6aff19":_(()=>u(()=>import("./工具列表.html-99ed1bf3.js"),[])),"v-781ca92a":_(()=>u(()=>import("./工具管理说明.html-6f52ba51.js"),[])),"v-72a0db1d":_(()=>u(()=>import("./自定义工具.html-bc29708f.js"),["assets/自定义工具.html-bc29708f.js","assets/customtool_06-8ec07c7b.js"])),"v-66e40bbf":_(()=>u(()=>import("./自定义规则.html-85879bde.js"),[])),"v-bbb8ba4e":_(()=>u(()=>import("./快速启动一次代码分析.html-212cdb47.js"),["assets/快速启动一次代码分析.html-212cdb47.js","assets/start_scan_01-c88b8a36.js","assets/start_scan_02-3fe00a0e.js","assets/start_scan_04-65ab4d48.js"])),"v-356f7475":_(()=>u(()=>import("./Jenkins_Plugin.html-c5bed20a.js"),["assets/Jenkins_Plugin.html-c5bed20a.js","assets/jenkins_shell-131e349c.js"])),"v-374a553a":_(()=>u(()=>import("./deploy_with_minio.html-49f7112e.js"),[])),"v-5c7ce0e5":_(()=>u(()=>import("./deploy_without_migrate.html-1e77db2a.js"),[])),"v-2b8ad044":_(()=>u(()=>import("./server.html-c5f18a1a.js"),[])),"v-b654617e":_(()=>u(()=>import("./deploySource.html-c424f754.js"),[])),"v-0245ec8a":_(()=>u(()=>import("./web.html-d1b22ea4.js"),[])),"v-67ff15d4":_(()=>u(()=>import("./个人令牌.html-aa4ca908.js"),[])),"v-3c5ef996":_(()=>u(()=>import("./分析结果查看.html-effefb84.js"),["assets/分析结果查看.html-effefb84.js","assets/codelint_03-8fa68424.js"])),"v-d1640082":_(()=>u(()=>import("./添加规则配置.html-7eb54a9d.js"),["assets/添加规则配置.html-7eb54a9d.js","assets/AddRule3-9d6ed3bf.js"])),"v-c5ddf200":_(()=>u(()=>import("./代码度量配置.html-03d18fab.js"),[])),"v-475a8e44":_(()=>u(()=>import("./代码检查编译配置.html-ecee328e.js"),[])),"v-d5a7ceb6":_(()=>u(()=>import("./代码检查规则配置.html-366b55db.js"),["assets/代码检查规则配置.html-366b55db.js","assets/AddRule3-9d6ed3bf.js","assets/scheme_codelint_03-5bcd9286.js","assets/scheme_codelint_04-1cece3c4.js"])),"v-11ec007c":_(()=>u(()=>import("./代码检查配置.html-cb330737.js"),["assets/代码检查配置.html-cb330737.js","assets/scheme_codelint_01-9eec47a6.js"])),"v-05649ec6":_(()=>u(()=>import("./分析方案模板说明.html-2b92cddd.js"),["assets/分析方案模板说明.html-2b92cddd.js","assets/scheme_template_02-70fd366c.js"])),"v-aa47e304":_(()=>u(()=>import("./基础属性配置.html-bc124671.js"),[])),"v-20ae30e2":_(()=>u(()=>import("./过滤配置.html-d0b32b09.js"),[])),"v-fb758c14":_(()=>u(()=>import("./OAuth管理.html-1bfab8bb.js"),["assets/OAuth管理.html-1bfab8bb.js","assets/manage_oauth_02-fc66f681.js"])),"v-ceb7b898":_(()=>u(()=>import("./分析记录管理.html-130acaf2.js"),["assets/分析记录管理.html-130acaf2.js","assets/manage_job_01-8f68e1e2.js"])),"v-04f2bfb6":_(()=>u(()=>import("./团队管理.html-5ebf6b40.js"),["assets/团队管理.html-5ebf6b40.js","assets/manage_org_02-ce951ef7.js"])),"v-6b614576":_(()=>u(()=>import("./工具管理.html-1eb7e99b.js"),["assets/工具管理.html-1eb7e99b.js","assets/manage_tool_01-405e8179.js"])),"v-15e62d37":_(()=>u(()=>import("./用户管理.html-faa0bff0.js"),["assets/用户管理.html-faa0bff0.js","assets/manage_user_02-e4d7abc6.js"])),"v-3a124584":_(()=>u(()=>import("./节点管理.html-b436d9b1.js"),["assets/节点管理.html-b436d9b1.js","assets/manage_node_04-ba2c36cb.js"])),"v-15ee6c7d":_(()=>u(()=>import("./项目管理.html-7f3dd5ba.js"),["assets/项目管理.html-7f3dd5ba.js","assets/manage_team_01-ead0dac9.js"])),"v-63a00f05":_(()=>u(()=>import("./团队管理.html-8144a48b.js"),["assets/团队管理.html-8144a48b.js","assets/team_member-8942b2d5.js"])),"v-455fed71":_(()=>u(()=>import("./成员权限.html-9077d3da.js"),["assets/成员权限.html-9077d3da.js","assets/team_member-8942b2d5.js"])),"v-bfa89738":_(()=>u(()=>import("./节点管理.html-3ac337bb.js"),["assets/节点管理.html-3ac337bb.js","assets/org_tag_scheme-0392461b.js"])),"v-6f03892b":_(()=>u(()=>import("./其他配置.html-21ce6df9.js"),[])),"v-1c5e67c8":_(()=>u(()=>import("./常驻节点分析.html-502c6050.js"),[])),"v-b58b961c":_(()=>u(()=>import("./快速扫描模式.html-9123e16a.js"),[])),"v-aae78fb0":_(()=>u(()=>import("./本地分析.html-28645990.js"),["assets/本地分析.html-28645990.js","assets/start_scan_03-f1dea0e4.js"])),"v-6c548cb1":_(()=>u(()=>import("./配置说明.html-43356197.js"),[])),"v-6a904c98":_(()=>u(()=>import("./工具列表.html-761dad60.js"),[])),"v-15a53546":_(()=>u(()=>import("./工具管理说明.html-eb2175ad.js"),[])),"v-28be823c":_(()=>u(()=>import("./自定义工具.html-5b755770.js"),["assets/自定义工具.html-5b755770.js","assets/customtool_06-8ec07c7b.js"])),"v-403820f8":_(()=>u(()=>import("./自定义规则.html-603972e0.js"),[])),"v-11cec998":_(()=>u(()=>import("./快速启动一次代码分析.html-1aa3a7e8.js"),["assets/快速启动一次代码分析.html-1aa3a7e8.js","assets/start_scan_01-c88b8a36.js","assets/start_scan_02-3fe00a0e.js","assets/start_scan_04-65ab4d48.js"])),"v-7fa74610":_(()=>u(()=>import("./Jenkins_Plugin.html-9a064624.js"),["assets/Jenkins_Plugin.html-9a064624.js","assets/jenkins_shell-131e349c.js"])),"v-55b96640":_(()=>u(()=>import("./ScriptAPI_guide.html-fd6383b9.js"),[])),"v-48a59655":_(()=>u(()=>import("./deploy_with_minio.html-8ed46649.js"),[])),"v-051518aa":_(()=>u(()=>import("./deploy_without_migrate.html-9c6f524c.js"),[])),"v-c3df2014":_(()=>u(()=>import("./gitlab_oauth_guide.html-04a9d45f.js"),[])),"v-32060cba":_(()=>u(()=>import("./server.html-7ca036de.js"),[])),"v-2b72915d":_(()=>u(()=>import("./Error-Prone.html-93c2d746.js"),[])),"v-1cf92e76":_(()=>u(()=>import("./TCA-Armory-C1.html-f73f9e95.js"),[])),"v-01906c04":_(()=>u(()=>import("./TCA-Armory-Q1.html-188dfbc4.js"),[])),"v-6d0cdd3c":_(()=>u(()=>import("./TCA-Armory-R.html-0470623e.js"),["assets/TCA-Armory-R.html-0470623e.js","assets/createcustomrule-3919c596.js","assets/scheme_codelint_03-5bcd9286.js"])),"v-0db91de5":_(()=>u(()=>import("./eslint.html-4b6f5c3f.js"),[])),"v-33a5d252":_(()=>u(()=>import("./golangcilint.html-5390ac76.js"),["assets/golangcilint.html-5390ac76.js","assets/golangcilintversion-56b74bb6.js"])),"v-02d030be":_(()=>u(()=>import("./code_spec_oc.html-9d084275.js"),[])),"v-218b1d6f":_(()=>u(()=>import("./cpp_doc.html-2bc2277b.js"),[])),"v-c54ad424":_(()=>u(()=>import("./dependency_vul.html-da9f0e2b.js"),[])),"v-918a6bfe":_(()=>u(()=>import("./enhanced_safety_java.html-7a9b7b0d.js"),[])),"v-0b3551c4":_(()=>u(()=>import("./front_end_framework_check.html-2b5efba2.js"),[])),"v-f8f08cc2":_(()=>u(()=>import("./test_case_verify_go.html-bb4607bd.js"),[])),"v-61b23c38":_(()=>u(()=>import("./Error-Prone.html-dfd35ccd.js"),[])),"v-7c0ce2de":_(()=>u(()=>import("./TCA-Armory-C1.html-0c581c74.js"),[])),"v-b2de67c2":_(()=>u(()=>import("./TCA-Armory-Q1.html-08aa80f4.js"),[])),"v-027ae47e":_(()=>u(()=>import("./TCA-Armory-R.html-024d2d34.js"),["assets/TCA-Armory-R.html-024d2d34.js","assets/createcustomrule-3919c596.js","assets/scheme_codelint_03-5bcd9286.js"])),"v-438ad62a":_(()=>u(()=>import("./eslint.html-6696da7c.js"),[])),"v-77e2c75c":_(()=>u(()=>import("./golangcilint.html-5b7c9aa6.js"),["assets/golangcilint.html-5b7c9aa6.js","assets/golangcilintversion-56b74bb6.js"])),"v-1f200688":_(()=>u(()=>import("./code_spec_oc.html-870d81eb.js"),[])),"v-ef89f918":_(()=>u(()=>import("./cpp_doc.html-e71f1648.js"),[])),"v-7981d049":_(()=>u(()=>import("./dependency_vul.html-6e099c3e.js"),[])),"v-dd34d7c8":_(()=>u(()=>import("./enhanced_safety_java.html-6d9266e1.js"),[])),"v-6908b43a":_(()=>u(()=>import("./front_end_framework_check.html-1cb6c259.js"),[])),"v-87c47fb8":_(()=>u(()=>import("./test_case_verify_go.html-15d53988.js"),[])),"v-3706649a":_(()=>u(()=>import("./404.html-0a2717d4.js"),[]))};var $u=Symbol(""),qu=Ae(Iu),vs=Ml({key:"",path:"",title:"",lang:"",frontmatter:{},headers:[]}),Ct=Ae(vs),Qt=()=>Ct,fs=Symbol(""),At=()=>{const e=Te(fs);if(!e)throw new Error("usePageFrontmatter() is called without provider.");return e},As=Symbol(""),Nu=()=>{const e=Te(As);if(!e)throw new Error("usePageHead() is called without provider.");return e},Hu=Symbol(""),gs=Symbol(""),Uu=()=>{const e=Te(gs);if(!e)throw new Error("usePageLang() is called without provider.");return e},ms=Symbol(""),Wu=()=>{const e=Te(ms);if(!e)throw new Error("usePageLayout() is called without provider.");return e},In=Symbol(""),Wl=()=>{const e=Te(In);if(!e)throw new Error("useRouteLocale() is called without provider.");return e},ll=Ae(wu),_s=()=>ll,ps=Symbol(""),wn=()=>{const e=Te(ps);if(!e)throw new Error("useSiteLocaleData() is called without provider.");return e},Ku=Symbol(""),Qu="Layout",Ju="NotFound",ht=Al({resolveLayouts:e=>e.reduce((t,l)=>({...t,...l.layouts}),{}),resolvePageData:async e=>{const t=qu.value[e];return await(t==null?void 0:t())??vs},resolvePageFrontmatter:e=>e.frontmatter,resolvePageHead:(e,t,l)=>{const i=ge(t.description)?t.description:l.description,n=[...X(t.head)?t.head:[],...l.head,["title",{},e],["meta",{name:"description",content:i}]];return Vu(n)},resolvePageHeadTitle:(e,t)=>[e.title,t.title].filter(l=>!!l).join(" | "),resolvePageLang:e=>e.lang||"en",resolvePageLayout:(e,t)=>{let l;if(e.path){const i=e.frontmatter.layout;ge(i)?l=i:l=Qu}else l=Ju;return t[l]},resolveRouteLocale:(e,t)=>Es(e,t),resolveSiteLocaleData:(e,t)=>({...e,...e.locales[t]})}),Sn=de({name:"ClientOnly",setup(e,t){const l=Ae(!1);return Ge(()=>{l.value=!0}),()=>{var i,n;return l.value?(n=(i=t.slots).default)==null?void 0:n.call(i):null}}}),Gu=de({name:"Content",props:{pageKey:{type:String,required:!1,default:""}},setup(e){const t=Qt(),l=$(()=>hs[e.pageKey||t.value.key]);return()=>l.value?ce(l.value):ce("div","404 Not Found")}}),wt=(e={})=>e,Vn=e=>Ul(e)?e:`/CodeAnalysis/${ds(e)}`;function Bs(e,t,l){var i,n,r;t===void 0&&(t=50),l===void 0&&(l={});var o=(i=l.isImmediate)!=null&&i,s=(n=l.callback)!=null&&n,a=l.maxWait,c=Date.now(),d=[];function E(){if(a!==void 0){var g=Date.now()-c;if(g+t>=a)return a-g}return t}var v=function(){var g=[].slice.call(arguments),k=this;return new Promise(function(y,C){var m=o&&r===void 0;if(r!==void 0&&clearTimeout(r),r=setTimeout(function(){if(r=void 0,c=Date.now(),!o){var z=e.apply(k,g);s&&s(z),d.forEach(function(P){return(0,P.resolve)(z)}),d=[]}},E()),m){var B=e.apply(k,g);return s&&s(B),y(B)}d.push({resolve:y,reject:C})})};return v.cancel=function(g){r!==void 0&&clearTimeout(r),d.forEach(function(k){return(0,k.reject)(g)}),d=[]},v}/*! + * vue-router v4.2.2 + * (c) 2023 Eduardo San Martin Morote + * @license MIT + */const tl=typeof window<"u";function Yu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const me=Object.assign;function Wi(e,t){const l={};for(const i in t){const n=t[i];l[i]=ot(n)?n.map(e):e(n)}return l}const Cl=()=>{},ot=Array.isArray,Xu=/\/$/,Zu=e=>e.replace(Xu,"");function Ki(e,t,l="/"){let i,n={},r="",o="";const s=t.indexOf("#");let a=t.indexOf("?");return s=0&&(a=-1),a>-1&&(i=t.slice(0,a),r=t.slice(a+1,s>-1?s:t.length),n=e(r)),s>-1&&(i=i||t.slice(0,s),o=t.slice(s,t.length)),i=id(i??t,l),{fullPath:i+(r&&"?")+r+o,path:i,query:n,hash:o}}function ed(e,t){const l=t.query?e(t.query):"";return t.path+(l&&"?")+l+(t.hash||"")}function xr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function td(e,t,l){const i=t.matched.length-1,n=l.matched.length-1;return i>-1&&i===n&&El(t.matched[i],l.matched[n])&&ks(t.params,l.params)&&e(t.query)===e(l.query)&&t.hash===l.hash}function El(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ks(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const l in e)if(!ld(e[l],t[l]))return!1;return!0}function ld(e,t){return ot(e)?Rr(e,t):ot(t)?Rr(t,e):e===t}function Rr(e,t){return ot(t)?e.length===t.length&&e.every((l,i)=>l===t[i]):e.length===1&&e[0]===t}function id(e,t){if(e.startsWith("/"))return e;if(!e)return t;const l=t.split("/"),i=e.split("/"),n=i[i.length-1];(n===".."||n===".")&&i.push("");let r=l.length-1,o,s;for(o=0;o1&&r--;else break;return l.slice(0,r).join("/")+"/"+i.slice(o-(o===i.length?1:0)).join("/")}var Il;(function(e){e.pop="pop",e.push="push"})(Il||(Il={}));var Tl;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Tl||(Tl={}));function nd(e){if(!e)if(tl){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Zu(e)}const rd=/^[^#]+#/;function od(e,t){return e.replace(rd,"#")+t}function sd(e,t){const l=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect();return{behavior:t.behavior,left:i.left-l.left-(t.left||0),top:i.top-l.top-(t.top||0)}}const Oi=()=>({left:window.pageXOffset,top:window.pageYOffset});function ad(e){let t;if("el"in e){const l=e.el,i=typeof l=="string"&&l.startsWith("#"),n=typeof l=="string"?i?document.getElementById(l.slice(1)):document.querySelector(l):l;if(!n)return;t=sd(n,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Or(e,t){return(history.state?history.state.position-t:-1)+e}const dn=new Map;function cd(e,t){dn.set(e,t)}function ud(e){const t=dn.get(e);return dn.delete(e),t}let dd=()=>location.protocol+"//"+location.host;function bs(e,t){const{pathname:l,search:i,hash:n}=t,r=e.indexOf("#");if(r>-1){let s=n.includes(e.slice(r))?e.slice(r).length:1,a=n.slice(s);return a[0]!=="/"&&(a="/"+a),xr(a,"")}return xr(l,e)+i+n}function Ed(e,t,l,i){let n=[],r=[],o=null;const s=({state:v})=>{const g=bs(e,location),k=l.value,y=t.value;let C=0;if(v){if(l.value=g,t.value=v,o&&o===k){o=null;return}C=y?v.position-y.position:0}else i(g);n.forEach(m=>{m(l.value,k,{delta:C,type:Il.pop,direction:C?C>0?Tl.forward:Tl.back:Tl.unknown})})};function a(){o=l.value}function c(v){n.push(v);const g=()=>{const k=n.indexOf(v);k>-1&&n.splice(k,1)};return r.push(g),g}function d(){const{history:v}=window;v.state&&v.replaceState(me({},v.state,{scroll:Oi()}),"")}function E(){for(const v of r)v();r=[],window.removeEventListener("popstate",s),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",s),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:a,listen:c,destroy:E}}function Ir(e,t,l,i=!1,n=!1){return{back:e,current:t,forward:l,replaced:i,position:window.history.length,scroll:n?Oi():null}}function hd(e){const{history:t,location:l}=window,i={value:bs(e,l)},n={value:t.state};n.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(a,c,d){const E=e.indexOf("#"),v=E>-1?(l.host&&document.querySelector("base")?e:e.slice(E))+a:dd()+e+a;try{t[d?"replaceState":"pushState"](c,"",v),n.value=c}catch(g){console.error(g),l[d?"replace":"assign"](v)}}function o(a,c){const d=me({},t.state,Ir(n.value.back,a,n.value.forward,!0),c,{position:n.value.position});r(a,d,!0),i.value=a}function s(a,c){const d=me({},n.value,t.state,{forward:a,scroll:Oi()});r(d.current,d,!0);const E=me({},Ir(i.value,a,null),{position:d.position+1},c);r(a,E,!1),i.value=a}return{location:i,state:n,push:s,replace:o}}function vd(e){e=nd(e);const t=hd(e),l=Ed(e,t.state,t.location,t.replace);function i(r,o=!0){o||l.pauseListeners(),history.go(r)}const n=me({location:"",base:e,go:i,createHref:od.bind(null,e)},t,l);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>t.state.value}),n}function fd(e){return typeof e=="string"||e&&typeof e=="object"}function ys(e){return typeof e=="string"||typeof e=="symbol"}const vt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Fs=Symbol("");var wr;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(wr||(wr={}));function hl(e,t){return me(new Error,{type:e,[Fs]:!0},t)}function Et(e,t){return e instanceof Error&&Fs in e&&(t==null||!!(e.type&t))}const Sr="[^/]+?",Ad={sensitive:!1,strict:!1,start:!0,end:!0},gd=/[.+*?^${}()[\]/\\]/g;function md(e,t){const l=me({},Ad,t),i=[];let n=l.start?"^":"";const r=[];for(const c of e){const d=c.length?[]:[90];l.strict&&!c.length&&(n+="/");for(let E=0;Et.length?t.length===1&&t[0]===40+40?1:-1:0}function pd(e,t){let l=0;const i=e.score,n=t.score;for(;l0&&t[t.length-1]<0}const Bd={type:0,value:""},kd=/[a-zA-Z0-9_]/;function bd(e){if(!e)return[[]];if(e==="/")return[[Bd]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${l})/"${c}": ${g}`)}let l=0,i=l;const n=[];let r;function o(){r&&n.push(r),r=[]}let s=0,a,c="",d="";function E(){c&&(l===0?r.push({type:0,value:c}):l===1||l===2||l===3?(r.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:d,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),c="")}function v(){c+=a}for(;s{o(B)}:Cl}function o(d){if(ys(d)){const E=i.get(d);E&&(i.delete(d),l.splice(l.indexOf(E),1),E.children.forEach(o),E.alias.forEach(o))}else{const E=l.indexOf(d);E>-1&&(l.splice(E,1),d.record.name&&i.delete(d.record.name),d.children.forEach(o),d.alias.forEach(o))}}function s(){return l}function a(d){let E=0;for(;E=0&&(d.record.path!==l[E].record.path||!Ds(d,l[E]));)E++;l.splice(E,0,d),d.record.name&&!Mr(d)&&i.set(d.record.name,d)}function c(d,E){let v,g={},k,y;if("name"in d&&d.name){if(v=i.get(d.name),!v)throw hl(1,{location:d});y=v.record.name,g=me(jr(E.params,v.keys.filter(B=>!B.optional).map(B=>B.name)),d.params&&jr(d.params,v.keys.map(B=>B.name))),k=v.stringify(g)}else if("path"in d)k=d.path,v=l.find(B=>B.re.test(k)),v&&(g=v.parse(k),y=v.record.name);else{if(v=E.name?i.get(E.name):l.find(B=>B.re.test(E.path)),!v)throw hl(1,{location:d,currentLocation:E});y=v.record.name,g=me({},E.params,d.params),k=v.stringify(g)}const C=[];let m=v;for(;m;)C.unshift(m.record),m=m.parent;return{name:y,path:k,params:g,matched:C,meta:Cd(C)}}return e.forEach(d=>r(d)),{addRoute:r,resolve:c,removeRoute:o,getRoutes:s,getRecordMatcher:n}}function jr(e,t){const l={};for(const i of t)i in e&&(l[i]=e[i]);return l}function Dd(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Ld(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function Ld(e){const t={},l=e.props||!1;if("component"in e)t.default=l;else for(const i in e.components)t[i]=typeof l=="boolean"?l:l[i];return t}function Mr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Cd(e){return e.reduce((t,l)=>me(t,l.meta),{})}function $r(e,t){const l={};for(const i in e)l[i]=i in t?t[i]:e[i];return l}function Ds(e,t){return t.children.some(l=>l===e||Ds(e,l))}const Ls=/#/g,Td=/&/g,Pd=/\//g,zd=/=/g,xd=/\?/g,Cs=/\+/g,Rd=/%5B/g,Od=/%5D/g,Ts=/%5E/g,Id=/%60/g,Ps=/%7B/g,wd=/%7C/g,zs=/%7D/g,Sd=/%20/g;function jn(e){return encodeURI(""+e).replace(wd,"|").replace(Rd,"[").replace(Od,"]")}function Vd(e){return jn(e).replace(Ps,"{").replace(zs,"}").replace(Ts,"^")}function En(e){return jn(e).replace(Cs,"%2B").replace(Sd,"+").replace(Ls,"%23").replace(Td,"%26").replace(Id,"`").replace(Ps,"{").replace(zs,"}").replace(Ts,"^")}function jd(e){return En(e).replace(zd,"%3D")}function Md(e){return jn(e).replace(Ls,"%23").replace(xd,"%3F")}function $d(e){return e==null?"":Md(e).replace(Pd,"%2F")}function _i(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function qd(e){const t={};if(e===""||e==="?")return t;const i=(e[0]==="?"?e.slice(1):e).split("&");for(let n=0;nr&&En(r)):[i&&En(i)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+l,r!=null&&(t+="="+r))})}return t}function Nd(e){const t={};for(const l in e){const i=e[l];i!==void 0&&(t[l]=ot(i)?i.map(n=>n==null?null:""+n):i==null?i:""+i)}return t}const Hd=Symbol(""),Nr=Symbol(""),Ii=Symbol(""),Mn=Symbol(""),hn=Symbol("");function pl(){let e=[];function t(i){return e.push(i),()=>{const n=e.indexOf(i);n>-1&&e.splice(n,1)}}function l(){e=[]}return{add:t,list:()=>e,reset:l}}function Tt(e,t,l,i,n){const r=i&&(i.enterCallbacks[n]=i.enterCallbacks[n]||[]);return()=>new Promise((o,s)=>{const a=E=>{E===!1?s(hl(4,{from:l,to:t})):E instanceof Error?s(E):fd(E)?s(hl(2,{from:t,to:E})):(r&&i.enterCallbacks[n]===r&&typeof E=="function"&&r.push(E),o())},c=e.call(i&&i.instances[n],t,l,a);let d=Promise.resolve(c);e.length<3&&(d=d.then(a)),d.catch(E=>s(E))})}function Qi(e,t,l,i){const n=[];for(const r of e)for(const o in r.components){let s=r.components[o];if(!(t!=="beforeRouteEnter"&&!r.instances[o]))if(Ud(s)){const c=(s.__vccOpts||s)[t];c&&n.push(Tt(c,l,i,r,o))}else{let a=s();n.push(()=>a.then(c=>{if(!c)return Promise.reject(new Error(`Couldn't resolve component "${o}" at "${r.path}"`));const d=Yu(c)?c.default:c;r.components[o]=d;const v=(d.__vccOpts||d)[t];return v&&Tt(v,l,i,r,o)()}))}}return n}function Ud(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Hr(e){const t=Te(Ii),l=Te(Mn),i=$(()=>t.resolve(te(e.to))),n=$(()=>{const{matched:a}=i.value,{length:c}=a,d=a[c-1],E=l.matched;if(!d||!E.length)return-1;const v=E.findIndex(El.bind(null,d));if(v>-1)return v;const g=Ur(a[c-2]);return c>1&&Ur(d)===g&&E[E.length-1].path!==g?E.findIndex(El.bind(null,a[c-2])):v}),r=$(()=>n.value>-1&&Jd(l.params,i.value.params)),o=$(()=>n.value>-1&&n.value===l.matched.length-1&&ks(l.params,i.value.params));function s(a={}){return Qd(a)?t[te(e.replace)?"replace":"push"](te(e.to)).catch(Cl):Promise.resolve()}return{route:i,href:$(()=>i.value.href),isActive:r,isExactActive:o,navigate:s}}const Wd=de({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Hr,setup(e,{slots:t}){const l=Al(Hr(e)),{options:i}=Te(Ii),n=$(()=>({[Wr(e.activeClass,i.linkActiveClass,"router-link-active")]:l.isActive,[Wr(e.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:l.isExactActive}));return()=>{const r=t.default&&t.default(l);return e.custom?r:ce("a",{"aria-current":l.isExactActive?e.ariaCurrentValue:null,href:l.href,onClick:l.navigate,class:n.value},r)}}}),Kd=Wd;function Qd(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Jd(e,t){for(const l in t){const i=t[l],n=e[l];if(typeof i=="string"){if(i!==n)return!1}else if(!ot(n)||n.length!==i.length||i.some((r,o)=>r!==n[o]))return!1}return!0}function Ur(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Wr=(e,t,l)=>e??t??l,Gd=de({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:l}){const i=Te(hn),n=$(()=>e.route||i.value),r=Te(Nr,0),o=$(()=>{let c=te(r);const{matched:d}=n.value;let E;for(;(E=d[c])&&!E.components;)c++;return c}),s=$(()=>n.value.matched[o.value]);Wt(Nr,$(()=>o.value+1)),Wt(Hd,s),Wt(hn,n);const a=Ae();return rt(()=>[a.value,s.value,e.name],([c,d,E],[v,g,k])=>{d&&(d.instances[E]=c,g&&g!==d&&c&&c===v&&(d.leaveGuards.size||(d.leaveGuards=g.leaveGuards),d.updateGuards.size||(d.updateGuards=g.updateGuards))),c&&d&&(!g||!El(d,g)||!v)&&(d.enterCallbacks[E]||[]).forEach(y=>y(c))},{flush:"post"}),()=>{const c=n.value,d=e.name,E=s.value,v=E&&E.components[d];if(!v)return Kr(l.default,{Component:v,route:c});const g=E.props[d],k=g?g===!0?c.params:typeof g=="function"?g(c):g:null,C=ce(v,me({},k,t,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(E.instances[d]=null)},ref:a}));return Kr(l.default,{Component:C,route:c})||C}}});function Kr(e,t){if(!e)return null;const l=e(t);return l.length===1?l[0]:l}const xs=Gd;function Yd(e){const t=Fd(e.routes,e),l=e.parseQuery||qd,i=e.stringifyQuery||qr,n=e.history,r=pl(),o=pl(),s=pl(),a=Ro(vt);let c=vt;tl&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Wi.bind(null,F=>""+F),E=Wi.bind(null,$d),v=Wi.bind(null,_i);function g(F,N){let S,Q;return ys(F)?(S=t.getRecordMatcher(F),Q=N):Q=F,t.addRoute(Q,S)}function k(F){const N=t.getRecordMatcher(F);N&&t.removeRoute(N)}function y(){return t.getRoutes().map(F=>F.record)}function C(F){return!!t.getRecordMatcher(F)}function m(F,N){if(N=me({},N||a.value),typeof F=="string"){const p=Ki(l,F,N.path),b=t.resolve({path:p.path},N),D=n.createHref(p.fullPath);return me(p,b,{params:v(b.params),hash:_i(p.hash),redirectedFrom:void 0,href:D})}let S;if("path"in F)S=me({},F,{path:Ki(l,F.path,N.path).path});else{const p=me({},F.params);for(const b in p)p[b]==null&&delete p[b];S=me({},F,{params:E(p)}),N.params=E(N.params)}const Q=t.resolve(S,N),ue=F.hash||"";Q.params=d(v(Q.params));const h=ed(i,me({},F,{hash:Vd(ue),path:Q.path})),f=n.createHref(h);return me({fullPath:h,hash:ue,query:i===qr?Nd(F.query):F.query||{}},Q,{redirectedFrom:void 0,href:f})}function B(F){return typeof F=="string"?Ki(l,F,a.value.path):me({},F)}function z(F,N){if(c!==F)return hl(8,{from:N,to:F})}function P(F){return w(F)}function W(F){return P(me(B(F),{replace:!0}))}function Z(F){const N=F.matched[F.matched.length-1];if(N&&N.redirect){const{redirect:S}=N;let Q=typeof S=="function"?S(F):S;return typeof Q=="string"&&(Q=Q.includes("?")||Q.includes("#")?Q=B(Q):{path:Q},Q.params={}),me({query:F.query,hash:F.hash,params:"path"in Q?{}:F.params},Q)}}function w(F,N){const S=c=m(F),Q=a.value,ue=F.state,h=F.force,f=F.replace===!0,p=Z(S);if(p)return w(me(B(p),{state:typeof p=="object"?me({},ue,p.state):ue,force:h,replace:f}),N||S);const b=S;b.redirectedFrom=N;let D;return!h&&td(i,Q,S)&&(D=hl(16,{to:b,from:Q}),Ne(Q,Q,!0,!1)),(D?Promise.resolve(D):j(b,Q)).catch(T=>Et(T)?Et(T,2)?T:Ie(T):oe(T,b,Q)).then(T=>{if(T){if(Et(T,2))return w(me({replace:f},B(T.to),{state:typeof T.to=="object"?me({},ue,T.to.state):ue,force:h}),N||b)}else T=L(b,Q,!0,f,ue);return J(b,Q,T),T})}function A(F,N){const S=z(F,N);return S?Promise.reject(S):Promise.resolve()}function H(F){const N=kt.values().next().value;return N&&typeof N.runWithContext=="function"?N.runWithContext(F):F()}function j(F,N){let S;const[Q,ue,h]=Xd(F,N);S=Qi(Q.reverse(),"beforeRouteLeave",F,N);for(const p of Q)p.leaveGuards.forEach(b=>{S.push(Tt(b,F,N))});const f=A.bind(null,F,N);return S.push(f),Oe(S).then(()=>{S=[];for(const p of r.list())S.push(Tt(p,F,N));return S.push(f),Oe(S)}).then(()=>{S=Qi(ue,"beforeRouteUpdate",F,N);for(const p of ue)p.updateGuards.forEach(b=>{S.push(Tt(b,F,N))});return S.push(f),Oe(S)}).then(()=>{S=[];for(const p of F.matched)if(p.beforeEnter&&!N.matched.includes(p))if(ot(p.beforeEnter))for(const b of p.beforeEnter)S.push(Tt(b,F,N));else S.push(Tt(p.beforeEnter,F,N));return S.push(f),Oe(S)}).then(()=>(F.matched.forEach(p=>p.enterCallbacks={}),S=Qi(h,"beforeRouteEnter",F,N),S.push(f),Oe(S))).then(()=>{S=[];for(const p of o.list())S.push(Tt(p,F,N));return S.push(f),Oe(S)}).catch(p=>Et(p,8)?p:Promise.reject(p))}function J(F,N,S){for(const Q of s.list())H(()=>Q(F,N,S))}function L(F,N,S,Q,ue){const h=z(F,N);if(h)return h;const f=N===vt,p=tl?history.state:{};S&&(Q||f?n.replace(F.fullPath,me({scroll:f&&p&&p.scroll},ue)):n.push(F.fullPath,ue)),a.value=F,Ne(F,N,S,f),Ie()}let O;function I(){O||(O=n.listen((F,N,S)=>{if(!st.listening)return;const Q=m(F),ue=Z(Q);if(ue){w(me(ue,{replace:!0}),Q).catch(Cl);return}c=Q;const h=a.value;tl&&cd(Or(h.fullPath,S.delta),Oi()),j(Q,h).catch(f=>Et(f,12)?f:Et(f,2)?(w(f.to,Q).then(p=>{Et(p,20)&&!S.delta&&S.type===Il.pop&&n.go(-1,!1)}).catch(Cl),Promise.reject()):(S.delta&&n.go(-S.delta,!1),oe(f,Q,h))).then(f=>{f=f||L(Q,h,!1),f&&(S.delta&&!Et(f,8)?n.go(-S.delta,!1):S.type===Il.pop&&Et(f,20)&&n.go(-1,!1)),J(Q,h,f)}).catch(Cl)}))}let se=pl(),U=pl(),ne;function oe(F,N,S){Ie(F);const Q=U.list();return Q.length?Q.forEach(ue=>ue(F,N,S)):console.error(F),Promise.reject(F)}function Ve(){return ne&&a.value!==vt?Promise.resolve():new Promise((F,N)=>{se.add([F,N])})}function Ie(F){return ne||(ne=!F,I(),se.list().forEach(([N,S])=>F?S(F):N()),se.reset()),F}function Ne(F,N,S,Q){const{scrollBehavior:ue}=e;if(!tl||!ue)return Promise.resolve();const h=!S&&ud(Or(F.fullPath,0))||(Q||!S)&&history.state&&history.state.scroll||null;return Li().then(()=>ue(F,N,h)).then(f=>f&&ad(f)).catch(f=>oe(f,F,N))}const je=F=>n.go(F);let Bt;const kt=new Set,st={currentRoute:a,listening:!0,addRoute:g,removeRoute:k,hasRoute:C,getRoutes:y,resolve:m,options:e,push:P,replace:W,go:je,back:()=>je(-1),forward:()=>je(1),beforeEach:r.add,beforeResolve:o.add,afterEach:s.add,onError:U.add,isReady:Ve,install(F){const N=this;F.component("RouterLink",Kd),F.component("RouterView",xs),F.config.globalProperties.$router=N,Object.defineProperty(F.config.globalProperties,"$route",{enumerable:!0,get:()=>te(a)}),tl&&!Bt&&a.value===vt&&(Bt=!0,P(n.location).catch(ue=>{}));const S={};for(const ue in vt)S[ue]=$(()=>a.value[ue]);F.provide(Ii,N),F.provide(Mn,Al(S)),F.provide(hn,a);const Q=F.unmount;kt.add(F),F.unmount=function(){kt.delete(F),kt.size<1&&(c=vt,O&&O(),O=null,a.value=vt,Bt=!1,ne=!1),Q()}}};function Oe(F){return F.reduce((N,S)=>N.then(()=>H(S)),Promise.resolve())}return st}function Xd(e,t){const l=[],i=[],n=[],r=Math.max(t.matched.length,e.matched.length);for(let o=0;oEl(c,s))?i.push(s):l.push(s));const a=e.matched[o];a&&(t.matched.find(c=>El(c,a))||n.push(a))}return[l,i,n]}function Gt(){return Te(Ii)}function Yt(){return Te(Mn)}const Zd=({headerLinkSelector:e,headerAnchorSelector:t,delay:l,offset:i=5})=>{const n=Gt(),o=Bs(()=>{var y,C;const s=Math.max(window.scrollY,document.documentElement.scrollTop,document.body.scrollTop);if(Math.abs(s-0)v.some(B=>B.hash===m.hash));for(let m=0;m=(((y=B.parentElement)==null?void 0:y.offsetTop)??0)-i,W=!z||s<(((C=z.parentElement)==null?void 0:C.offsetTop)??0)-i;if(!(P&&W))continue;const w=decodeURIComponent(n.currentRoute.value.hash),A=decodeURIComponent(B.hash);if(w===A)return;if(E){for(let H=m+1;H{window.addEventListener("scroll",o)}),Nl(()=>{window.removeEventListener("scroll",o)})},Qr=async(e,t)=>{const{scrollBehavior:l}=e.options;e.options.scrollBehavior=void 0,await e.replace({query:e.currentRoute.value.query,hash:t,force:!0}).finally(()=>e.options.scrollBehavior=l)},eE="a.sidebar-item",tE=".header-anchor",lE=300,iE=5,nE=wt({setup(){Zd({headerLinkSelector:eE,headerAnchorSelector:tE,delay:lE,offset:iE})}}),Jr=()=>window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,rE=()=>window.scrollTo({top:0,behavior:"smooth"});const oE=de({name:"BackToTop",setup(){const e=Ae(0),t=$(()=>e.value>300),l=Bs(()=>{e.value=Jr()},100);Ge(()=>{e.value=Jr(),window.addEventListener("scroll",()=>l())});const i=ce("div",{class:"back-to-top",onClick:rE});return()=>ce(Hl,{name:"back-to-top"},()=>t.value?i:null)}}),sE=wt({rootComponents:[oE]});const aE=ce("svg",{class:"external-link-icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},[ce("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}),ce("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"})]),cE=de({name:"ExternalLinkIcon",props:{locales:{type:Object,required:!1,default:()=>({})}},setup(e){const t=Wl(),l=$(()=>e.locales[t.value]??{openInNewWindow:"open in new window"});return()=>ce("span",[aE,ce("span",{class:"external-link-icon-sr-only"},l.value.openInNewWindow)])}}),uE={"/en":{openInNewWindow:"open in new window"},"/":{openInNewWindow:"在新窗口打开"}},dE=wt({enhance({app:e}){e.component("ExternalLinkIcon",ce(cE,{locales:uE}))}});/*! medium-zoom 1.0.8 | MIT License | https://github.com/francoischalifour/medium-zoom */var Mt=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},i=window.Promise||function(L){function O(){}L(O,O)},n=function(L){var O=L.target;if(O===H){k();return}z.indexOf(O)!==-1&&y({target:O})},r=function(){if(!(W||!A.original)){var L=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(Z-L)>w.scrollOffset&&setTimeout(k,150)}},o=function(L){var O=L.key||L.keyCode;(O==="Escape"||O==="Esc"||O===27)&&k()},s=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},O=L;if(L.background&&(H.style.background=L.background),L.container&&L.container instanceof Object&&(O.container=Mt({},w.container,L.container)),L.template){var I=si(L.template)?L.template:document.querySelector(L.template);O.template=I}return w=Mt({},w,O),z.forEach(function(se){se.dispatchEvent(el("medium-zoom:update",{detail:{zoom:j}}))}),j},a=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e(Mt({},w,L))},c=function(){for(var L=arguments.length,O=Array(L),I=0;I0?O.reduce(function(U,ne){return[].concat(U,Yr(ne))},[]):z;return se.forEach(function(U){U.classList.remove("medium-zoom-image"),U.dispatchEvent(el("medium-zoom:detach",{detail:{zoom:j}}))}),z=z.filter(function(U){return se.indexOf(U)===-1}),j},E=function(L,O){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return z.forEach(function(se){se.addEventListener("medium-zoom:"+L,O,I)}),P.push({type:"medium-zoom:"+L,listener:O,options:I}),j},v=function(L,O){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return z.forEach(function(se){se.removeEventListener("medium-zoom:"+L,O,I)}),P=P.filter(function(se){return!(se.type==="medium-zoom:"+L&&se.listener.toString()===O.toString())}),j},g=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},O=L.target,I=function(){var U={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},ne=void 0,oe=void 0;if(w.container)if(w.container instanceof Object)U=Mt({},U,w.container),ne=U.width-U.left-U.right-w.margin*2,oe=U.height-U.top-U.bottom-w.margin*2;else{var Ve=si(w.container)?w.container:document.querySelector(w.container),Ie=Ve.getBoundingClientRect(),Ne=Ie.width,je=Ie.height,Bt=Ie.left,kt=Ie.top;U=Mt({},U,{width:Ne,height:je,left:Bt,top:kt})}ne=ne||U.width-w.margin*2,oe=oe||U.height-w.margin*2;var st=A.zoomedHd||A.original,Oe=Gr(st)?ne:st.naturalWidth||ne,F=Gr(st)?oe:st.naturalHeight||oe,N=st.getBoundingClientRect(),S=N.top,Q=N.left,ue=N.width,h=N.height,f=Math.min(Math.max(ue,Oe),ne)/ue,p=Math.min(Math.max(h,F),oe)/h,b=Math.min(f,p),D=(-Q+(ne-ue)/2+w.margin+U.left)/b,T=(-S+(oe-h)/2+w.margin+U.top)/b,M="scale("+b+") translate3d("+D+"px, "+T+"px, 0)";A.zoomed.style.transform=M,A.zoomedHd&&(A.zoomedHd.style.transform=M)};return new i(function(se){if(O&&z.indexOf(O)===-1){se(j);return}var U=function Ne(){W=!1,A.zoomed.removeEventListener("transitionend",Ne),A.original.dispatchEvent(el("medium-zoom:opened",{detail:{zoom:j}})),se(j)};if(A.zoomed){se(j);return}if(O)A.original=O;else if(z.length>0){var ne=z;A.original=ne[0]}else{se(j);return}if(A.original.dispatchEvent(el("medium-zoom:open",{detail:{zoom:j}})),Z=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,W=!0,A.zoomed=vE(A.original),document.body.appendChild(H),w.template){var oe=si(w.template)?w.template:document.querySelector(w.template);A.template=document.createElement("div"),A.template.appendChild(oe.content.cloneNode(!0)),document.body.appendChild(A.template)}if(A.original.parentElement&&A.original.parentElement.tagName==="PICTURE"&&A.original.currentSrc&&(A.zoomed.src=A.original.currentSrc),document.body.appendChild(A.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),A.original.classList.add("medium-zoom-image--hidden"),A.zoomed.classList.add("medium-zoom-image--opened"),A.zoomed.addEventListener("click",k),A.zoomed.addEventListener("transitionend",U),A.original.getAttribute("data-zoom-src")){A.zoomedHd=A.zoomed.cloneNode(),A.zoomedHd.removeAttribute("srcset"),A.zoomedHd.removeAttribute("sizes"),A.zoomedHd.removeAttribute("loading"),A.zoomedHd.src=A.zoomed.getAttribute("data-zoom-src"),A.zoomedHd.onerror=function(){clearInterval(Ve),console.warn("Unable to reach the zoom image target "+A.zoomedHd.src),A.zoomedHd=null,I()};var Ve=setInterval(function(){A.zoomedHd.complete&&(clearInterval(Ve),A.zoomedHd.classList.add("medium-zoom-image--opened"),A.zoomedHd.addEventListener("click",k),document.body.appendChild(A.zoomedHd),I())},10)}else if(A.original.hasAttribute("srcset")){A.zoomedHd=A.zoomed.cloneNode(),A.zoomedHd.removeAttribute("sizes"),A.zoomedHd.removeAttribute("loading");var Ie=A.zoomedHd.addEventListener("load",function(){A.zoomedHd.removeEventListener("load",Ie),A.zoomedHd.classList.add("medium-zoom-image--opened"),A.zoomedHd.addEventListener("click",k),document.body.appendChild(A.zoomedHd),I()})}else I()})},k=function(){return new i(function(L){if(W||!A.original){L(j);return}var O=function I(){A.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(A.zoomed),A.zoomedHd&&document.body.removeChild(A.zoomedHd),document.body.removeChild(H),A.zoomed.classList.remove("medium-zoom-image--opened"),A.template&&document.body.removeChild(A.template),W=!1,A.zoomed.removeEventListener("transitionend",I),A.original.dispatchEvent(el("medium-zoom:closed",{detail:{zoom:j}})),A.original=null,A.zoomed=null,A.zoomedHd=null,A.template=null,L(j)};W=!0,document.body.classList.remove("medium-zoom--opened"),A.zoomed.style.transform="",A.zoomedHd&&(A.zoomedHd.style.transform=""),A.template&&(A.template.style.transition="opacity 150ms",A.template.style.opacity=0),A.original.dispatchEvent(el("medium-zoom:close",{detail:{zoom:j}})),A.zoomed.addEventListener("transitionend",O)})},y=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},O=L.target;return A.original?k():g({target:O})},C=function(){return w},m=function(){return z},B=function(){return A.original},z=[],P=[],W=!1,Z=0,w=l,A={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(t)==="[object Object]"?w=t:(t||typeof t=="string")&&c(t),w=Mt({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},w);var H=hE(w.background);document.addEventListener("click",n),document.addEventListener("keyup",o),document.addEventListener("scroll",r),window.addEventListener("resize",k);var j={open:g,close:k,toggle:y,update:s,clone:a,attach:c,detach:d,on:E,off:v,getOptions:C,getImages:m,getZoomedImage:B};return j};function AE(e,t){t===void 0&&(t={});var l=t.insertAt;if(!(!e||typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",l==="top"&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var gE=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";AE(gE);const mE=fE,_E=Symbol("mediumZoom");const pE=".theme-default-content > img, .theme-default-content :not(a) > img",BE={},kE=300,bE=wt({enhance({app:e,router:t}){const l=mE(BE);l.refresh=(i=pE)=>{l.detach(),l.attach(i)},e.provide(_E,l),t.afterEach(()=>{setTimeout(()=>l.refresh(),kE)})}});/** + * NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT + */const Ee={settings:{minimum:.08,easing:"ease",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,barSelector:'[role="bar"]',parent:"body",template:'
    '},status:null,set:e=>{const t=Ee.isStarted();e=Ji(e,Ee.settings.minimum,1),Ee.status=e===1?null:e;const l=Ee.render(!t),i=l.querySelector(Ee.settings.barSelector),n=Ee.settings.speed,r=Ee.settings.easing;return l.offsetWidth,yE(o=>{li(i,{transform:"translate3d("+Xr(e)+"%,0,0)",transition:"all "+n+"ms "+r}),e===1?(li(l,{transition:"none",opacity:"1"}),l.offsetWidth,setTimeout(function(){li(l,{transition:"all "+n+"ms linear",opacity:"0"}),setTimeout(function(){Ee.remove(),o()},n)},n)):setTimeout(()=>o(),n)}),Ee},isStarted:()=>typeof Ee.status=="number",start:()=>{Ee.status||Ee.set(0);const e=()=>{setTimeout(()=>{Ee.status&&(Ee.trickle(),e())},Ee.settings.trickleSpeed)};return Ee.settings.trickle&&e(),Ee},done:e=>!e&&!Ee.status?Ee:Ee.inc(.3+.5*Math.random()).set(1),inc:e=>{let t=Ee.status;return t?(typeof e!="number"&&(e=(1-t)*Ji(Math.random()*t,.1,.95)),t=Ji(t+e,0,.994),Ee.set(t)):Ee.start()},trickle:()=>Ee.inc(Math.random()*Ee.settings.trickleRate),render:e=>{if(Ee.isRendered())return document.getElementById("nprogress");Zr(document.documentElement,"nprogress-busy");const t=document.createElement("div");t.id="nprogress",t.innerHTML=Ee.settings.template;const l=t.querySelector(Ee.settings.barSelector),i=e?"-100":Xr(Ee.status||0),n=document.querySelector(Ee.settings.parent);return li(l,{transition:"all 0 linear",transform:"translate3d("+i+"%,0,0)"}),n!==document.body&&Zr(n,"nprogress-custom-parent"),n==null||n.appendChild(t),t},remove:()=>{eo(document.documentElement,"nprogress-busy"),eo(document.querySelector(Ee.settings.parent),"nprogress-custom-parent");const e=document.getElementById("nprogress");e&&FE(e)},isRendered:()=>!!document.getElementById("nprogress")},Ji=(e,t,l)=>el?l:e,Xr=e=>(-1+e)*100,yE=function(){const e=[];function t(){const l=e.shift();l&&l(t)}return function(l){e.push(l),e.length===1&&t()}}(),li=function(){const e=["Webkit","O","Moz","ms"],t={};function l(o){return o.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(s,a){return a.toUpperCase()})}function i(o){const s=document.body.style;if(o in s)return o;let a=e.length;const c=o.charAt(0).toUpperCase()+o.slice(1);let d;for(;a--;)if(d=e[a]+c,d in s)return d;return o}function n(o){return o=l(o),t[o]??(t[o]=i(o))}function r(o,s,a){s=n(s),o.style[s]=a}return function(o,s){for(const a in s){const c=s[a];c!==void 0&&Object.prototype.hasOwnProperty.call(s,a)&&r(o,a,c)}}}(),Rs=(e,t)=>(typeof e=="string"?e:$n(e)).indexOf(" "+t+" ")>=0,Zr=(e,t)=>{const l=$n(e),i=l+t;Rs(l,t)||(e.className=i.substring(1))},eo=(e,t)=>{const l=$n(e);if(!Rs(e,t))return;const i=l.replace(" "+t+" "," ");e.className=i.substring(1,i.length-1)},$n=e=>(" "+(e.className||"")+" ").replace(/\s+/gi," "),FE=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)};const DE=()=>{Ge(()=>{const e=Gt(),t=new Set;t.add(e.currentRoute.value.path),e.beforeEach(l=>{t.has(l.path)||Ee.start()}),e.afterEach(l=>{t.add(l.path),Ee.done()})})},LE=wt({setup(){DE()}}),CE=JSON.parse(`{"logo":"/images/favicon.png","repo":"https://github.com/Tencent/CodeAnalysis","docsDir":"doc","locales":{"/en":{"navbar":[{"text":"快速部署","link":"/en/quickStarted/"},{"text":"帮助文档","link":"/en/guide/"},{"text":"API","link":"/en/api/"},{"text":"了解更多","children":[{"text":"深入","children":["/en/advanced/任务分布式执行.md","/en/advanced/集成代码分析工具.md","/en/advanced/使用自建工具git库.md"]},{"text":"依赖安装参考","children":["/en/advanced/install_python37_on_centos.md","/en/advanced/install_python37_on_ubuntu.md","/en/advanced/install_mysql_on_centos.md","/en/advanced/install_redis_from_source.md","/en/advanced/install_redis_on_centos.md"]}]},{"text":"社区","children":["/en/community/contribute.md","/en/community/changelog.md","/en/community/joingroup.md",{"text":"体验官方版本","link":"https://tca.tencent.com/"}]}],"selectLanguageName":"English","selectLanguageText":"Languages","selectLanguageAriaLabel":"Languages","sidebar":{"/en/guide/":[{"text":"介绍","children":["/en/guide/README.md","/en/guide/快速入门/快速启动一次代码分析.md"]},{"text":"团队管理","children":["/en/guide/团队管理/团队管理.md","/en/guide/团队管理/成员权限.md","/en/guide/团队管理/节点管理.md"]},{"text":"代码检查","children":["/en/guide/代码检查/分析结果查看.md","/en/guide/代码检查/添加规则配置.md",{"text":"典型工具使用手册","children":["/en/guide/代码检查/工具/eslint.md","/en/guide/代码检查/工具/golangcilint.md","/en/guide/代码检查/工具/TCA-Armory-R.md","/en/guide/代码检查/工具/TCA-Armory-C1.md","/en/guide/代码检查/工具/TCA-Armory-Q1.md","/en/guide/代码检查/工具/Error-Prone.md"]},{"text":"典型规则包使用手册","children":["/en/guide/代码检查/规则包/cpp_doc.md","/en/guide/代码检查/规则包/enhanced_safety_java.md","/en/guide/代码检查/规则包/test_case_verify_go.md","/en/guide/代码检查/规则包/code_spec_oc.md","/en/guide/代码检查/规则包/front_end_framework_check.md","/en/guide/代码检查/规则包/dependency_vul.md"]}]},{"text":"分析方案","children":["/en/guide/分析方案/基础属性配置.md","/en/guide/分析方案/代码检查配置.md","/en/guide/分析方案/代码检查规则配置.md","/en/guide/分析方案/代码检查编译配置.md","/en/guide/分析方案/代码度量配置.md","/en/guide/分析方案/过滤配置.md","/en/guide/分析方案/分析方案模板说明.md"]},{"text":"工具管理","children":["/en/guide/工具管理/工具管理说明.md","/en/guide/工具管理/工具列表.md","/en/guide/工具管理/自定义规则.md","/en/guide/工具管理/自定义工具.md"]},{"text":"后台管理","children":["/en/guide/后台管理/用户管理.md","/en/guide/后台管理/团队管理.md","/en/guide/后台管理/项目管理.md","/en/guide/后台管理/分析记录管理.md","/en/guide/后台管理/节点管理.md","/en/guide/后台管理/工具管理.md","/en/guide/后台管理/OAuth管理.md"]},{"text":"客户端","children":["/en/guide/客户端/本地分析.md","/en/guide/客户端/常驻节点分析.md","/en/guide/客户端/快速扫描模式.md","/en/guide/客户端/其他配置.md"]},{"text":"服务端","children":["/en/guide/服务端/server.md","/en/guide/服务端/deploy_with_minio.md"]},{"text":"Web端","children":["/en/guide/web/web.md","/en/guide/web/deploySource.md"]},{"text":"插件","children":["/en/guide/插件/Jenkins_Plugin.md"]}],"/en/advanced/":[{"text":"深入","children":["/en/advanced/任务分布式执行.md","/en/advanced/集成代码分析工具.md","/en/advanced/使用自建工具git库.md"]},{"text":"依赖安装参考","children":["/en/advanced/install_python37_on_centos.md","/en/advanced/install_python37_on_ubuntu.md","/en/advanced/install_mysql_on_centos.md","/en/advanced/install_redis_from_source.md","/en/advanced/install_redis_on_centos.md"]}],"/en/community/":[{"text":"社区资源","children":["/en/community/contribute.md","/en/community/pr.md","/en/community/changelog.md","/en/community/joingroup.md"]}],"/en/api/":[{"text":"API","children":["/en/api/README.md","/en/api/对象主要字段说明.md","/en/api/项目管理模块接口.md","/en/api/任务管理模块接口.md","/en/api/结果概览模块接口.md","/en/api/代码扫描数据模块接口.md","/en/api/代码度量数据模块接口.md"]}],"/en/quickStarted/":[{"text":"快速入门","link":"/en/quickStarted/deploySever.md","children":["/en/quickStarted/README.md","/en/quickStarted/dockerDeploy.md","/en/quickStarted/dockercomposeDeploy.md","/en/quickStarted/codeDeploy.md"]},{"text":"其他","children":["/en/quickStarted/enhanceDeploy.md","/en/quickStarted/FAQ.md"]}]},"sidebarDepth":1,"editLinkText":"Edit this page on GitHub"},"/":{"navbar":[{"text":"快速部署","link":"/zh/quickStarted/"},{"text":"帮助文档","link":"/zh/guide/"},{"text":"API","link":"/zh/api/"},{"text":"了解更多","children":[{"text":"深入","children":["/zh/advanced/任务分布式执行.md","/zh/advanced/集成代码分析工具.md","/zh/advanced/使用自建工具git库.md"]},{"text":"依赖安装参考","children":["/zh/advanced/install_python37_on_centos.md","/zh/advanced/install_python37_on_ubuntu.md","/zh/advanced/install_mysql_on_centos.md","/zh/advanced/install_redis_from_source.md","/zh/advanced/install_redis_on_centos.md"]}]},{"text":"社区","children":["/zh/community/contribute.md","/zh/community/changelog.md","/zh/community/joingroup.md",{"text":"体验官方版本","link":"https://tca.tencent.com/"}]}],"selectLanguageName":"简体中文","selectLanguageText":"选择语言","selectLanguageAriaLabel":"选择语言","sidebar":{"/zh/guide/":[{"text":"介绍","children":["/zh/guide/README.md","/zh/guide/快速入门/快速启动一次代码分析.md"]},{"text":"团队管理","children":["/zh/guide/团队管理/团队管理.md","/zh/guide/团队管理/成员权限.md","/zh/guide/团队管理/节点管理.md"]},{"text":"代码检查","children":["/zh/guide/代码检查/分析结果查看.md","/zh/guide/代码检查/添加规则配置.md",{"text":"典型工具使用手册","children":["/zh/guide/代码检查/工具/eslint.md","/zh/guide/代码检查/工具/golangcilint.md","/zh/guide/代码检查/工具/TCA-Armory-R.md","/zh/guide/代码检查/工具/TCA-Armory-C1.md","/zh/guide/代码检查/工具/TCA-Armory-Q1.md","/zh/guide/代码检查/工具/Error-Prone.md"]},{"text":"典型规则包使用手册","children":["/zh/guide/代码检查/规则包/cpp_doc.md","/zh/guide/代码检查/规则包/enhanced_safety_java.md","/zh/guide/代码检查/规则包/test_case_verify_go.md","/zh/guide/代码检查/规则包/code_spec_oc.md","/zh/guide/代码检查/规则包/front_end_framework_check.md","/zh/guide/代码检查/规则包/dependency_vul.md"]}]},{"text":"分析方案","children":["/zh/guide/分析方案/基础属性配置.md","/zh/guide/分析方案/代码检查配置.md","/zh/guide/分析方案/代码检查规则配置.md","/zh/guide/分析方案/代码检查编译配置.md","/zh/guide/分析方案/代码度量配置.md","/zh/guide/分析方案/过滤配置.md","/zh/guide/分析方案/分析方案模板说明.md"]},{"text":"工具管理","children":["/zh/guide/工具管理/工具管理说明.md","/zh/guide/工具管理/工具列表.md","/zh/guide/工具管理/自定义规则.md","/zh/guide/工具管理/自定义工具.md"]},{"text":"个人中心","children":["/zh/guide/个人中心/个人令牌.md"]},{"text":"后台管理","children":["/zh/guide/后台管理/用户管理.md","/zh/guide/后台管理/团队管理.md","/zh/guide/后台管理/项目管理.md","/zh/guide/后台管理/分析记录管理.md","/zh/guide/后台管理/节点管理.md","/zh/guide/后台管理/工具管理.md","/zh/guide/后台管理/OAuth管理.md"]},{"text":"客户端","children":["/zh/guide/客户端/本地分析.md","/zh/guide/客户端/常驻节点分析.md","/zh/guide/客户端/快速扫描模式.md","/zh/guide/客户端/其他配置.md"]},{"text":"服务端","children":["/zh/guide/服务端/server.md","/zh/guide/服务端/deploy_with_minio.md"]},{"text":"Web端","children":["/zh/guide/web/web.md","/zh/guide/web/deploySource.md"]},{"text":"插件","children":["/zh/guide/插件/Jenkins_Plugin.md"]}],"/zh/advanced/":[{"text":"深入","children":["/zh/advanced/任务分布式执行.md","/zh/advanced/集成代码分析工具.md","/zh/advanced/使用自建工具git库.md"]},{"text":"依赖安装参考","children":["/zh/advanced/install_python37_on_centos.md","/zh/advanced/install_python37_on_ubuntu.md","/zh/advanced/install_mysql_on_centos.md","/zh/advanced/install_redis_from_source.md","/zh/advanced/install_redis_on_centos.md"]}],"/zh/community/":[{"text":"社区资源","children":["/zh/community/contribute.md","/zh/community/pr.md","/zh/community/changelog.md","/zh/community/joingroup.md"]}],"/zh/api/":[{"text":"API","children":["/zh/api/README.md","/zh/api/对象主要字段说明.md","/zh/api/项目管理模块接口.md","/zh/api/任务管理模块接口.md","/zh/api/结果概览模块接口.md","/zh/api/代码扫描数据模块接口.md","/zh/api/代码度量数据模块接口.md"]}],"/zh/quickStarted/":[{"text":"快速入门","children":["/zh/quickStarted/README.md","/zh/quickStarted/dockerDeploy.md","/zh/quickStarted/dockercomposeDeploy.md","/zh/quickStarted/codeDeploy.md"]},{"text":"其他","children":["/zh/quickStarted/enhanceDeploy.md","/zh/quickStarted/FAQ.md"]}]},"sidebarDepth":1,"editLinkText":"在 GitHub 上编辑此页","lastUpdatedText":"上次更新","contributorsText":"贡献者","tip":"提示","warning":"注意","danger":"警告","notFound":["这里什么都没有","我们怎么到这来了?","这是一个 404 页面","看起来我们进入了错误的链接"],"backToHome":"返回首页","openInNewWindow":"在新窗口打开","toggleDarkMode":"切换夜间模式","toggleSidebar":"切换侧边栏"}},"colorMode":"auto","colorModeSwitch":true,"navbar":[],"selectLanguageText":"Languages","selectLanguageAriaLabel":"Select language","sidebar":"auto","sidebarDepth":2,"editLink":true,"editLinkText":"Edit this page","lastUpdated":true,"lastUpdatedText":"Last Updated","contributors":true,"contributorsText":"Contributors","notFound":["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],"backToHome":"Take me home","openInNewWindow":"open in new window","toggleColorMode":"toggle color mode","toggleSidebar":"toggle sidebar"}`),TE=Ae(CE),Os=()=>TE,Is=Symbol(""),PE=()=>{const e=Te(Is);if(!e)throw new Error("useThemeLocaleData() is called without provider.");return e},zE=(e,t)=>{const{locales:l,...i}=e;return{...i,...l==null?void 0:l[t]}},xE=wt({enhance({app:e}){const t=Os(),l=e._context.provides[In],i=$(()=>zE(t.value,l.value));e.provide(Is,i),Object.defineProperties(e.config.globalProperties,{$theme:{get(){return t.value}},$themeLocale:{get(){return i.value}}})}}),RE=de({__name:"Badge",props:{type:{type:String,required:!1,default:"tip"},text:{type:String,required:!1,default:""},vertical:{type:String,required:!1,default:void 0}},setup(e){return(t,l)=>(q(),ee("span",{class:Ue(["badge",e.type]),style:jl({verticalAlign:e.vertical})},[Be(t.$slots,"default",{},()=>[It(xe(e.text),1)])],6))}}),Fe=(e,t)=>{const l=e.__vccOpts||e;for(const[i,n]of t)l[i]=n;return l},OE=Fe(RE,[["__file","Badge.vue"]]),IE=de({name:"CodeGroup",slots:Object,setup(e,{slots:t}){const l=Ae(-1),i=Ae([]),n=(s=l.value)=>{s{s>0?l.value=s-1:l.value=i.value.length-1,i.value[l.value].focus()},o=(s,a)=>{s.key===" "||s.key==="Enter"?(s.preventDefault(),l.value=a):s.key==="ArrowRight"?(s.preventDefault(),n(a)):s.key==="ArrowLeft"&&(s.preventDefault(),r(a))};return()=>{var a;const s=(((a=t.default)==null?void 0:a.call(t))||[]).filter(c=>c.type.name==="CodeGroupItem").map(c=>(c.props===null&&(c.props={}),c));return s.length===0?null:(l.value<0||l.value>s.length-1?(l.value=s.findIndex(c=>c.props.active===""||c.props.active===!0),l.value===-1&&(l.value=0)):s.forEach((c,d)=>{c.props.active=d===l.value}),ce("div",{class:"code-group"},[ce("div",{class:"code-group__nav"},ce("ul",{class:"code-group__ul"},s.map((c,d)=>{const E=d===l.value;return ce("li",{class:"code-group__li"},ce("button",{ref:v=>{v&&(i.value[d]=v)},class:{"code-group__nav-tab":!0,"code-group__nav-tab-active":E},ariaPressed:E,ariaExpanded:E,onClick:()=>l.value=d,onKeydown:v=>o(v,d)},c.props.title))}))),s]))}}}),wE=["aria-selected"],SE=de({name:"CodeGroupItem"}),VE=de({...SE,props:{title:{type:String,required:!0},active:{type:Boolean,required:!1,default:!1}},setup(e){return(t,l)=>(q(),ee("div",{class:Ue(["code-group-item",{"code-group-item__active":e.active}]),"aria-selected":e.active},[Be(t.$slots,"default")],10,wE))}}),jE=Fe(VE,[["__file","CodeGroupItem.vue"]]);function ws(e){return po()?(fa(e),!0):!1}function wl(e){return typeof e=="function"?e():te(e)}const ME=typeof window<"u",Ss=()=>{};function $E(e,t){function l(...i){return new Promise((n,r)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(n).catch(r)})}return l}const Vs=e=>e();function qE(e=Vs){const t=Ae(!0);function l(){t.value=!1}function i(){t.value=!0}const n=(...r)=>{t.value&&e(...r)};return{isActive:Ml(t),pause:l,resume:i,eventFilter:n}}function NE(...e){if(e.length!==1)return Ga(...e);const t=e[0];return typeof t=="function"?Ml(Ka(()=>({get:t,set:Ss}))):Ae(t)}function HE(e=!1,t={}){const{truthyValue:l=!0,falsyValue:i=!1}=t,n=Re(e),r=Ae(e);function o(s){if(arguments.length)return r.value=s,r.value;{const a=wl(l);return r.value=r.value===a?wl(i):a,r.value}}return n?o:[r,o]}var to=Object.getOwnPropertySymbols,UE=Object.prototype.hasOwnProperty,WE=Object.prototype.propertyIsEnumerable,KE=(e,t)=>{var l={};for(var i in e)UE.call(e,i)&&t.indexOf(i)<0&&(l[i]=e[i]);if(e!=null&&to)for(var i of to(e))t.indexOf(i)<0&&WE.call(e,i)&&(l[i]=e[i]);return l};function QE(e,t,l={}){const i=l,{eventFilter:n=Vs}=i,r=KE(i,["eventFilter"]);return rt(e,$E(n,t),r)}var JE=Object.defineProperty,GE=Object.defineProperties,YE=Object.getOwnPropertyDescriptors,pi=Object.getOwnPropertySymbols,js=Object.prototype.hasOwnProperty,Ms=Object.prototype.propertyIsEnumerable,lo=(e,t,l)=>t in e?JE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,XE=(e,t)=>{for(var l in t||(t={}))js.call(t,l)&&lo(e,l,t[l]);if(pi)for(var l of pi(t))Ms.call(t,l)&&lo(e,l,t[l]);return e},ZE=(e,t)=>GE(e,YE(t)),eh=(e,t)=>{var l={};for(var i in e)js.call(e,i)&&t.indexOf(i)<0&&(l[i]=e[i]);if(e!=null&&pi)for(var i of pi(e))t.indexOf(i)<0&&Ms.call(e,i)&&(l[i]=e[i]);return l};function th(e,t,l={}){const i=l,{eventFilter:n}=i,r=eh(i,["eventFilter"]),{eventFilter:o,pause:s,resume:a,isActive:c}=qE(n);return{stop:QE(e,t,ZE(XE({},r),{eventFilter:o})),pause:s,resume:a,isActive:c}}function lh(e){var t;const l=wl(e);return(t=l==null?void 0:l.$el)!=null?t:l}const Bi=ME?window:void 0;function io(...e){let t,l,i,n;if(typeof e[0]=="string"||Array.isArray(e[0])?([l,i,n]=e,t=Bi):[t,l,i,n]=e,!t)return Ss;Array.isArray(l)||(l=[l]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(d=>d()),r.length=0},s=(d,E,v,g)=>(d.addEventListener(E,v,g),()=>d.removeEventListener(E,v,g)),a=rt(()=>[lh(t),wl(n)],([d,E])=>{o(),d&&r.push(...l.flatMap(v=>i.map(g=>s(d,v,g,E))))},{immediate:!0,flush:"post"}),c=()=>{a(),o()};return ws(c),c}function ih(){const e=Ae(!1);return os()&&Ge(()=>{e.value=!0}),e}function nh(e){const t=ih();return $(()=>(t.value,!!e()))}function rh(e,t={}){const{window:l=Bi}=t,i=nh(()=>l&&"matchMedia"in l&&typeof l.matchMedia=="function");let n;const r=Ae(!1),o=()=>{n&&("removeEventListener"in n?n.removeEventListener("change",s):n.removeListener(s))},s=()=>{i.value&&(o(),n=l.matchMedia(NE(e).value),r.value=!!(n!=null&&n.matches),n&&("addEventListener"in n?n.addEventListener("change",s):n.addListener(s)))};return uc(s),ws(()=>o()),r}const ii=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ni="__vueuse_ssr_handlers__",oh=sh();function sh(){return ni in ii||(ii[ni]=ii[ni]||{}),ii[ni]}function ah(e,t){return oh[e]||t}function ch(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}var uh=Object.defineProperty,no=Object.getOwnPropertySymbols,dh=Object.prototype.hasOwnProperty,Eh=Object.prototype.propertyIsEnumerable,ro=(e,t,l)=>t in e?uh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,oo=(e,t)=>{for(var l in t||(t={}))dh.call(t,l)&&ro(e,l,t[l]);if(no)for(var l of no(t))Eh.call(t,l)&&ro(e,l,t[l]);return e};const hh={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},so="vueuse-storage";function vh(e,t,l,i={}){var n;const{flush:r="pre",deep:o=!0,listenToStorageChanges:s=!0,writeDefaults:a=!0,mergeDefaults:c=!1,shallow:d,window:E=Bi,eventFilter:v,onError:g=A=>{console.error(A)}}=i,k=(d?Ro:Ae)(t);if(!l)try{l=ah("getDefaultStorage",()=>{var A;return(A=Bi)==null?void 0:A.localStorage})()}catch(A){g(A)}if(!l)return k;const y=wl(t),C=ch(y),m=(n=i.serializer)!=null?n:hh[C],{pause:B,resume:z}=th(k,()=>P(k.value),{flush:r,deep:o,eventFilter:v});return E&&s&&(io(E,"storage",w),io(E,so,Z)),w(),k;function P(A){try{if(A==null)l.removeItem(e);else{const H=m.write(A),j=l.getItem(e);j!==H&&(l.setItem(e,H),E&&E.dispatchEvent(new CustomEvent(so,{detail:{key:e,oldValue:j,newValue:H,storageArea:l}})))}}catch(H){g(H)}}function W(A){const H=A?A.newValue:l.getItem(e);if(H==null)return a&&y!==null&&l.setItem(e,m.write(y)),y;if(!A&&c){const j=m.read(H);return typeof c=="function"?c(j,y):C==="object"&&!Array.isArray(j)?oo(oo({},y),j):j}else return typeof H!="string"?H:m.read(H)}function Z(A){w(A.detail)}function w(A){if(!(A&&A.storageArea!==l)){if(A&&A.key==null){k.value=y;return}if(!(A&&A.key!==e)){B();try{k.value=W(A)}catch(H){g(H)}finally{A?Li(z):z()}}}}}function fh(e){return rh("(prefers-color-scheme: dark)",e)}const Ah=()=>Os(),qe=()=>PE(),$s=Symbol(""),qn=()=>{const e=Te($s);if(!e)throw new Error("useDarkMode() is called without provider.");return e},gh=()=>{const e=qe(),t=fh(),l=vh("vuepress-color-scheme",e.value.colorMode),i=$({get(){return e.value.colorModeSwitch?l.value==="auto"?t.value:l.value==="dark":e.value.colorMode==="dark"},set(n){n===t.value?l.value="auto":l.value=n?"dark":"light"}});Wt($s,i),mh(i)},mh=e=>{const t=(l=e.value)=>{const i=window==null?void 0:window.document.querySelector("html");i==null||i.classList.toggle("dark",l)};Ge(()=>{rt(e,t,{immediate:!0})}),zi(()=>t())},qs=(...e)=>{const l=Gt().resolve(...e),i=l.matched[l.matched.length-1];if(!(i!=null&&i.redirect))return l;const{redirect:n}=i,r=re(n)?n(l):n,o=ge(r)?{path:r}:r;return qs({hash:l.hash,query:l.query,params:l.params,...o})},Nn=e=>{const t=qs(encodeURI(e));return{text:t.meta.title||e,link:t.name==="404"?e:t.fullPath}};let Gi=null,Bl=null;const _h={wait:()=>Gi,pending:()=>{Gi=new Promise(e=>Bl=e)},resolve:()=>{Bl==null||Bl(),Gi=null,Bl=null}},Ns=()=>_h,Hs=Symbol("sidebarItems"),Hn=()=>{const e=Te(Hs);if(!e)throw new Error("useSidebarItems() is called without provider.");return e},ph=()=>{const e=qe(),t=At(),l=$(()=>Bh(t.value,e.value));Wt(Hs,l)},Bh=(e,t)=>{const l=e.sidebar??t.sidebar??"auto",i=e.sidebarDepth??t.sidebarDepth??2;return e.home||l===!1?[]:l==="auto"?bh(i):X(l)?Us(l,i):On(l)?yh(l,i):[]},kh=(e,t)=>({text:e.title,link:e.link,children:Un(e.children,t)}),Un=(e,t)=>t>0?e.map(l=>kh(l,t-1)):[],bh=e=>{const t=Qt();return[{text:t.value.title,children:Un(t.value.headers,e)}]},Us=(e,t)=>{const l=Yt(),i=Qt(),n=r=>{var s;let o;if(ge(r)?o=Nn(r):o=r,o.children)return{...o,children:o.children.map(a=>n(a))};if(o.link===l.path){const a=((s=i.value.headers[0])==null?void 0:s.level)===1?i.value.headers[0].children:i.value.headers;return{...o,children:Un(a,t)}}return o};return e.map(r=>n(r))},yh=(e,t)=>{const l=Yt(),i=Es(e,l.path),n=e[i]??[];return Us(n,t)},Fh="719px",Dh={mobile:Fh};var Sl;(function(e){e.MOBILE="mobile"})(Sl||(Sl={}));var ho;const Lh={[Sl.MOBILE]:Number.parseInt((ho=Dh.mobile)==null?void 0:ho.replace("px",""),10)},Ws=(e,t)=>{const l=Lh[e];Number.isInteger(l)&&Ge(()=>{t(l),window.addEventListener("resize",()=>t(l),!1),window.addEventListener("orientationchange",()=>t(l),!1)})},Ch={},Th={class:"theme-default-content"};function Ph(e,t){const l=_t("Content");return q(),ee("div",Th,[le(l)])}const zh=Fe(Ch,[["render",Ph],["__file","HomeContent.vue"]]),xh={key:0,class:"features"},Rh=de({__name:"HomeFeatures",setup(e){const t=At(),l=$(()=>X(t.value.features)?t.value.features:[]);return(i,n)=>l.value.length?(q(),ee("div",xh,[(q(!0),ee(ke,null,Rt(l.value,r=>(q(),ee("div",{key:r.title,class:"feature"},[ve("h2",null,xe(r.title),1),ve("p",null,xe(r.details),1)]))),128))])):De("v-if",!0)}}),Oh=Fe(Rh,[["__file","HomeFeatures.vue"]]),Ih=["innerHTML"],wh=["textContent"],Sh=de({__name:"HomeFooter",setup(e){const t=At(),l=$(()=>t.value.footer),i=$(()=>t.value.footerHtml);return(n,r)=>l.value?(q(),ee(ke,{key:0},[De(" eslint-disable-next-line vue/no-v-html "),i.value?(q(),ee("div",{key:0,class:"footer",innerHTML:l.value},null,8,Ih)):(q(),ee("div",{key:1,class:"footer",textContent:xe(l.value)},null,8,wh))],64)):De("v-if",!0)}}),Vh=Fe(Sh,[["__file","HomeFooter.vue"]]),jh=["href","rel","target","aria-label"],Mh=de({inheritAttrs:!1}),$h=de({...Mh,__name:"AutoLink",props:{item:{type:Object,required:!0}},setup(e){const t=e,l=Yt(),i=_s(),{item:n}=Di(t),r=$(()=>Ul(n.value.link)),o=$(()=>ju(n.value.link)||Mu(n.value.link)),s=$(()=>{if(!o.value){if(n.value.target)return n.value.target;if(r.value)return"_blank"}}),a=$(()=>s.value==="_blank"),c=$(()=>!r.value&&!o.value&&!a.value),d=$(()=>{if(!o.value){if(n.value.rel)return n.value.rel;if(a.value)return"noopener noreferrer"}}),E=$(()=>n.value.ariaLabel||n.value.text),v=$(()=>{const y=Object.keys(i.value.locales);return y.length?!y.some(C=>C===n.value.link):n.value.link!=="/"}),g=$(()=>v.value?l.path.startsWith(n.value.link):!1),k=$(()=>c.value?n.value.activeMatch?new RegExp(n.value.activeMatch).test(l.path):g.value:!1);return(y,C)=>{const m=_t("RouterLink"),B=_t("AutoLinkExternalIcon");return c.value?(q(),Ce(m,cn({key:0,class:{"router-link-active":k.value},to:te(n).link,"aria-label":E.value},y.$attrs),{default:we(()=>[Be(y.$slots,"before"),It(" "+xe(te(n).text)+" ",1),Be(y.$slots,"after")]),_:3},16,["class","to","aria-label"])):(q(),ee("a",cn({key:1,class:"external-link",href:te(n).link,rel:d.value,target:s.value,"aria-label":E.value},y.$attrs),[Be(y.$slots,"before"),It(" "+xe(te(n).text)+" ",1),a.value?(q(),Ce(B,{key:0})):De("v-if",!0),Be(y.$slots,"after")],16,jh))}}}),gt=Fe($h,[["__file","AutoLink.vue"]]),qh={class:"hero"},Nh={key:0,id:"main-title"},Hh={key:1,class:"description"},Uh={key:2,class:"actions"},Wh=de({__name:"HomeHero",setup(e){const t=At(),l=wn(),i=qn(),n=$(()=>i.value&&t.value.heroImageDark!==void 0?t.value.heroImageDark:t.value.heroImage),r=$(()=>t.value.heroAlt||s.value||"hero"),o=$(()=>t.value.heroHeight||280),s=$(()=>t.value.heroText===null?null:t.value.heroText||l.value.title||"Hello"),a=$(()=>t.value.tagline===null?null:t.value.tagline||l.value.description||"Welcome to your VuePress site"),c=$(()=>X(t.value.actions)?t.value.actions.map(({text:E,link:v,type:g="primary"})=>({text:E,link:v,type:g})):[]),d=()=>{if(!n.value)return null;const E=ce("img",{src:Vn(n.value),alt:r.value,height:o.value});return t.value.heroImageDark===void 0?E:ce(Sn,()=>E)};return(E,v)=>(q(),ee("header",qh,[le(d),s.value?(q(),ee("h1",Nh,xe(s.value),1)):De("v-if",!0),a.value?(q(),ee("p",Hh,xe(a.value),1)):De("v-if",!0),c.value.length?(q(),ee("p",Uh,[(q(!0),ee(ke,null,Rt(c.value,g=>(q(),Ce(gt,{key:g.text,class:Ue(["action-button",[g.type]]),item:g},null,8,["class","item"]))),128))])):De("v-if",!0)]))}}),Kh=Fe(Wh,[["__file","HomeHero.vue"]]),Qh={class:"home"},Jh=de({__name:"Home",setup(e){return(t,l)=>(q(),ee("main",Qh,[le(Kh),le(Oh),le(zh),le(Vh)]))}}),Gh=Fe(Jh,[["__file","Home.vue"]]),Yh=de({__name:"NavbarBrand",setup(e){const t=Wl(),l=wn(),i=qe(),n=qn(),r=$(()=>i.value.home||t.value),o=$(()=>l.value.title),s=$(()=>n.value&&i.value.logoDark!==void 0?i.value.logoDark:i.value.logo),a=()=>{if(!s.value)return null;const c=ce("img",{class:"logo",src:Vn(s.value),alt:o.value});return i.value.logoDark===void 0?c:ce(Sn,()=>c)};return(c,d)=>{const E=_t("RouterLink");return q(),Ce(E,{to:r.value},{default:we(()=>[le(a),o.value?(q(),ee("span",{key:0,class:Ue(["site-name",{"can-hide":s.value}])},xe(o.value),3)):De("v-if",!0)]),_:1},8,["to"])}}}),Xh=Fe(Yh,[["__file","NavbarBrand.vue"]]),Zh=de({__name:"DropdownTransition",setup(e){const t=i=>{i.style.height=i.scrollHeight+"px"},l=i=>{i.style.height=""};return(i,n)=>(q(),Ce(Hl,{name:"dropdown",onEnter:t,onAfterEnter:l,onBeforeLeave:t},{default:we(()=>[Be(i.$slots,"default")]),_:3}))}}),Ks=Fe(Zh,[["__file","DropdownTransition.vue"]]),ev=["aria-label"],tv={class:"title"},lv=ve("span",{class:"arrow down"},null,-1),iv=["aria-label"],nv={class:"title"},rv={class:"navbar-dropdown"},ov={class:"navbar-dropdown-subtitle"},sv={key:1},av={class:"navbar-dropdown-subitem-wrapper"},cv=de({__name:"NavbarDropdown",props:{item:{type:Object,required:!0}},setup(e){const t=e,{item:l}=Di(t),i=$(()=>l.value.ariaLabel||l.value.text),n=Ae(!1),r=Yt();rt(()=>r.path,()=>{n.value=!1});const o=a=>{a.detail===0?n.value=!n.value:n.value=!1},s=(a,c)=>c[c.length-1]===a;return(a,c)=>(q(),ee("div",{class:Ue(["navbar-dropdown-wrapper",{open:n.value}])},[ve("button",{class:"navbar-dropdown-title",type:"button","aria-label":i.value,onClick:o},[ve("span",tv,xe(te(l).text),1),lv],8,ev),ve("button",{class:"navbar-dropdown-title-mobile",type:"button","aria-label":i.value,onClick:c[0]||(c[0]=d=>n.value=!n.value)},[ve("span",nv,xe(te(l).text),1),ve("span",{class:Ue(["arrow",n.value?"down":"right"])},null,2)],8,iv),le(Ks,null,{default:we(()=>[hi(ve("ul",rv,[(q(!0),ee(ke,null,Rt(te(l).children,d=>(q(),ee("li",{key:d.text,class:"navbar-dropdown-item"},[d.children?(q(),ee(ke,{key:0},[ve("h4",ov,[d.link?(q(),Ce(gt,{key:0,item:d,onFocusout:E=>s(d,te(l).children)&&d.children.length===0&&(n.value=!1)},null,8,["item","onFocusout"])):(q(),ee("span",sv,xe(d.text),1))]),ve("ul",av,[(q(!0),ee(ke,null,Rt(d.children,E=>(q(),ee("li",{key:E.link,class:"navbar-dropdown-subitem"},[le(gt,{item:E,onFocusout:v=>s(E,d.children)&&s(d,te(l).children)&&(n.value=!1)},null,8,["item","onFocusout"])]))),128))])],64)):(q(),Ce(gt,{key:1,item:d,onFocusout:E=>s(d,te(l).children)&&(n.value=!1)},null,8,["item","onFocusout"]))]))),128))],512),[[mi,n.value]])]),_:1})],2))}}),uv=Fe(cv,[["__file","NavbarDropdown.vue"]]),ao=e=>decodeURI(e).replace(/#.*$/,"").replace(/(index)?\.(md|html)$/,""),dv=(e,t)=>{if(t.hash===e)return!0;const l=ao(t.path),i=ao(e);return l===i},Qs=(e,t)=>e.link&&dv(e.link,t)?!0:e.children?e.children.some(l=>Qs(l,t)):!1,Js=e=>!Ul(e)||/github\.com/.test(e)?"GitHub":/bitbucket\.org/.test(e)?"Bitbucket":/gitlab\.com/.test(e)?"GitLab":/gitee\.com/.test(e)?"Gitee":null,Ev={GitHub:":repo/edit/:branch/:path",GitLab:":repo/-/edit/:branch/:path",Gitee:":repo/edit/:branch/:path",Bitbucket:":repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default"},hv=({docsRepo:e,editLinkPattern:t})=>{if(t)return t;const l=Js(e);return l!==null?Ev[l]:null},vv=({docsRepo:e,docsBranch:t,docsDir:l,filePathRelative:i,editLinkPattern:n})=>{if(!i)return null;const r=hv({docsRepo:e,editLinkPattern:n});return r?r.replace(/:repo/,Ul(e)?e:`https://github.com/${e}`).replace(/:branch/,t).replace(/:path/,ds(`${us(l)}/${i}`)):null},fv={key:0,class:"navbar-items"},Av=de({__name:"NavbarItems",setup(e){const t=()=>{const d=Gt(),E=Wl(),v=_s(),g=wn(),k=Ah(),y=qe();return $(()=>{const C=Object.keys(v.value.locales);if(C.length<2)return[];const m=d.currentRoute.value.path,B=d.currentRoute.value.fullPath;return[{text:`${y.value.selectLanguageText}`,ariaLabel:`${y.value.selectLanguageAriaLabel??y.value.selectLanguageText}`,children:C.map(P=>{var j,J;const W=((j=v.value.locales)==null?void 0:j[P])??{},Z=((J=k.value.locales)==null?void 0:J[P])??{},w=`${W.lang}`,A=Z.selectLanguageName??w;let H;if(w===g.value.lang)H=B;else{const L=m.replace(E.value,P);d.getRoutes().some(O=>O.path===L)?H=B.replace(m,L):H=Z.home??P}return{text:A,link:H}})}]})},l=()=>{const d=qe(),E=$(()=>d.value.repo),v=$(()=>E.value?Js(E.value):null),g=$(()=>E.value&&!Ul(E.value)?`https://github.com/${E.value}`:E.value),k=$(()=>g.value?d.value.repoLabel?d.value.repoLabel:v.value===null?"Source":v.value:null);return $(()=>!g.value||!k.value?[]:[{text:k.value,link:g.value}])},i=d=>ge(d)?Nn(d):d.children?{...d,children:d.children.map(i)}:d,n=()=>{const d=qe();return $(()=>(d.value.navbar||[]).map(i))},r=Ae(!1),o=n(),s=t(),a=l(),c=$(()=>[...o.value,...s.value,...a.value]);return Ws(Sl.MOBILE,d=>{window.innerWidthc.value.length?(q(),ee("nav",fv,[(q(!0),ee(ke,null,Rt(c.value,v=>(q(),ee("div",{key:v.text,class:"navbar-item"},[v.children?(q(),Ce(uv,{key:0,item:v,class:Ue(r.value?"mobile":"")},null,8,["item","class"])):(q(),Ce(gt,{key:1,item:v},null,8,["item"]))]))),128))])):De("v-if",!0)}}),Gs=Fe(Av,[["__file","NavbarItems.vue"]]),gv=["title"],mv={class:"icon",focusable:"false",viewBox:"0 0 32 32"},_v=Qc('',9),pv=[_v],Bv={class:"icon",focusable:"false",viewBox:"0 0 32 32"},kv=ve("path",{d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z",fill:"currentColor"},null,-1),bv=[kv],yv=de({__name:"ToggleColorModeButton",setup(e){const t=qe(),l=qn(),i=()=>{l.value=!l.value};return(n,r)=>(q(),ee("button",{class:"toggle-color-mode-button",title:te(t).toggleColorMode,onClick:i},[hi((q(),ee("svg",mv,pv,512)),[[mi,!te(l)]]),hi((q(),ee("svg",Bv,bv,512)),[[mi,te(l)]])],8,gv))}}),Fv=Fe(yv,[["__file","ToggleColorModeButton.vue"]]),Dv=["title"],Lv=ve("div",{class:"icon","aria-hidden":"true"},[ve("span"),ve("span"),ve("span")],-1),Cv=[Lv],Tv=de({__name:"ToggleSidebarButton",emits:["toggle"],setup(e){const t=qe();return(l,i)=>(q(),ee("div",{class:"toggle-sidebar-button",title:te(t).toggleSidebar,"aria-expanded":"false",role:"button",tabindex:"0",onClick:i[0]||(i[0]=n=>l.$emit("toggle"))},Cv,8,Dv))}}),Pv=Fe(Tv,[["__file","ToggleSidebarButton.vue"]]),zv=de({__name:"Navbar",emits:["toggle-sidebar"],setup(e){const t=qe(),l=Ae(null),i=Ae(null),n=Ae(0),r=$(()=>n.value?{maxWidth:n.value+"px"}:{});Ws(Sl.MOBILE,s=>{var c;const a=o(l.value,"paddingLeft")+o(l.value,"paddingRight");window.innerWidth{const c=_t("NavbarSearch");return q(),ee("header",{ref_key:"navbar",ref:l,class:"navbar"},[le(Pv,{onToggle:a[0]||(a[0]=d=>s.$emit("toggle-sidebar"))}),ve("span",{ref_key:"navbarBrand",ref:i},[le(Xh)],512),ve("div",{class:"navbar-items-wrapper",style:jl(r.value)},[Be(s.$slots,"before"),le(Gs,{class:"can-hide"}),Be(s.$slots,"after"),te(t).colorModeSwitch?(q(),Ce(Fv,{key:0})):De("v-if",!0),le(c)],4)],512)}}}),xv=Fe(zv,[["__file","Navbar.vue"]]),Rv={class:"page-meta"},Ov={key:0,class:"meta-item edit-link"},Iv={key:1,class:"meta-item last-updated"},wv={class:"meta-item-label"},Sv={class:"meta-item-info"},Vv={key:2,class:"meta-item contributors"},jv={class:"meta-item-label"},Mv={class:"meta-item-info"},$v=["title"],qv=de({__name:"PageMeta",setup(e){const t=()=>{const a=qe(),c=Qt(),d=At();return $(()=>{if(!(d.value.editLink??a.value.editLink??!0))return null;const{repo:v,docsRepo:g=v,docsBranch:k="main",docsDir:y="",editLinkText:C}=a.value;if(!g)return null;const m=vv({docsRepo:g,docsBranch:k,docsDir:y,filePathRelative:c.value.filePathRelative,editLinkPattern:d.value.editLinkPattern??a.value.editLinkPattern});return m?{text:C??"Edit this page",link:m}:null})},l=()=>{const a=qe(),c=Qt(),d=At();return $(()=>{var g,k;return!(d.value.lastUpdated??a.value.lastUpdated??!0)||!((g=c.value.git)!=null&&g.updatedTime)?null:new Date((k=c.value.git)==null?void 0:k.updatedTime).toLocaleString()})},i=()=>{const a=qe(),c=Qt(),d=At();return $(()=>{var v;return d.value.contributors??a.value.contributors??!0?((v=c.value.git)==null?void 0:v.contributors)??null:null})},n=qe(),r=t(),o=l(),s=i();return(a,c)=>{const d=_t("ClientOnly");return q(),ee("footer",Rv,[te(r)?(q(),ee("div",Ov,[le(gt,{class:"meta-item-label",item:te(r)},null,8,["item"])])):De("v-if",!0),te(o)?(q(),ee("div",Iv,[ve("span",wv,xe(te(n).lastUpdatedText)+": ",1),le(d,null,{default:we(()=>[ve("span",Sv,xe(te(o)),1)]),_:1})])):De("v-if",!0),te(s)&&te(s).length?(q(),ee("div",Vv,[ve("span",jv,xe(te(n).contributorsText)+": ",1),ve("span",Mv,[(q(!0),ee(ke,null,Rt(te(s),(E,v)=>(q(),ee(ke,{key:v},[ve("span",{class:"contributor",title:`email: ${E.email}`},xe(E.name),9,$v),v!==te(s).length-1?(q(),ee(ke,{key:0},[It(", ")],64)):De("v-if",!0)],64))),128))])])):De("v-if",!0)])}}}),Nv=Fe(qv,[["__file","PageMeta.vue"]]),Hv={key:0,class:"page-nav"},Uv={class:"inner"},Wv={key:0,class:"prev"},Kv={key:1,class:"next"},Qv=de({__name:"PageNav",setup(e){const t=a=>a===!1?null:ge(a)?Nn(a):On(a)?a:!1,l=(a,c,d)=>{const E=a.findIndex(v=>v.link===c);if(E!==-1){const v=a[E+d];return v!=null&&v.link?v:null}for(const v of a)if(v.children){const g=l(v.children,c,d);if(g)return g}return null},i=At(),n=Hn(),r=Yt(),o=$(()=>{const a=t(i.value.prev);return a!==!1?a:l(n.value,r.path,-1)}),s=$(()=>{const a=t(i.value.next);return a!==!1?a:l(n.value,r.path,1)});return(a,c)=>o.value||s.value?(q(),ee("nav",Hv,[ve("p",Uv,[o.value?(q(),ee("span",Wv,[le(gt,{item:o.value},null,8,["item"])])):De("v-if",!0),s.value?(q(),ee("span",Kv,[le(gt,{item:s.value},null,8,["item"])])):De("v-if",!0)])])):De("v-if",!0)}}),Jv=Fe(Qv,[["__file","PageNav.vue"]]),Gv={class:"page"},Yv={class:"theme-default-content"},Xv=de({__name:"Page",setup(e){return(t,l)=>{const i=_t("Content");return q(),ee("main",Gv,[Be(t.$slots,"top"),ve("div",Yv,[Be(t.$slots,"content-top"),le(i),Be(t.$slots,"content-bottom")]),le(Nv),le(Jv),Be(t.$slots,"bottom")])}}}),Zv=Fe(Xv,[["__file","Page.vue"]]),ef=["onKeydown"],tf={class:"sidebar-item-children"},lf=de({__name:"SidebarItem",props:{item:{type:Object,required:!0},depth:{type:Number,required:!1,default:0}},setup(e){const t=e,{item:l,depth:i}=Di(t),n=Yt(),r=Gt(),o=$(()=>Qs(l.value,n)),s=$(()=>({"sidebar-item":!0,"sidebar-heading":i.value===0,active:o.value,collapsible:l.value.collapsible})),a=$(()=>l.value.collapsible?o.value:!0),[c,d]=HE(a.value),E=g=>{l.value.collapsible&&(g.preventDefault(),d())},v=r.afterEach(g=>{Li(()=>{c.value=a.value})});return Nl(()=>{v()}),(g,k)=>{var C;const y=_t("SidebarItem",!0);return q(),ee("li",null,[te(l).link?(q(),Ce(gt,{key:0,class:Ue(s.value),item:te(l)},null,8,["class","item"])):(q(),ee("p",{key:1,tabindex:"0",class:Ue(s.value),onClick:E,onKeydown:Pu(E,["enter"])},[It(xe(te(l).text)+" ",1),te(l).collapsible?(q(),ee("span",{key:0,class:Ue(["arrow",te(c)?"down":"right"])},null,2)):De("v-if",!0)],42,ef)),(C=te(l).children)!=null&&C.length?(q(),Ce(Ks,{key:2},{default:we(()=>[hi(ve("ul",tf,[(q(!0),ee(ke,null,Rt(te(l).children,m=>(q(),Ce(y,{key:`${te(i)}${m.text}${m.link}`,item:m,depth:te(i)+1},null,8,["item","depth"]))),128))],512),[[mi,te(c)]])]),_:1})):De("v-if",!0)])}}}),nf=Fe(lf,[["__file","SidebarItem.vue"]]),rf={key:0,class:"sidebar-items"},of=de({__name:"SidebarItems",setup(e){const t=Yt(),l=Hn();return Ge(()=>{rt(()=>t.hash,i=>{const n=document.querySelector(".sidebar");if(!n)return;const r=document.querySelector(`.sidebar a.sidebar-item[href="${t.path}${i}"]`);if(!r)return;const{top:o,height:s}=n.getBoundingClientRect(),{top:a,height:c}=r.getBoundingClientRect();ao+s&&r.scrollIntoView(!1)})}),(i,n)=>te(l).length?(q(),ee("ul",rf,[(q(!0),ee(ke,null,Rt(te(l),r=>(q(),Ce(nf,{key:`${r.text}${r.link}`,item:r},null,8,["item"]))),128))])):De("v-if",!0)}}),sf=Fe(of,[["__file","SidebarItems.vue"]]),af={class:"sidebar"},cf=de({__name:"Sidebar",setup(e){return(t,l)=>(q(),ee("aside",af,[le(Gs),Be(t.$slots,"top"),le(sf),Be(t.$slots,"bottom")]))}}),uf=Fe(cf,[["__file","Sidebar.vue"]]),df=de({__name:"Layout",setup(e){const t=Qt(),l=At(),i=qe(),n=$(()=>l.value.navbar!==!1&&i.value.navbar!==!1),r=Hn(),o=Ae(!1),s=C=>{o.value=typeof C=="boolean"?C:!o.value},a={x:0,y:0},c=C=>{a.x=C.changedTouches[0].clientX,a.y=C.changedTouches[0].clientY},d=C=>{const m=C.changedTouches[0].clientX-a.x,B=C.changedTouches[0].clientY-a.y;Math.abs(m)>Math.abs(B)&&Math.abs(m)>40&&(m>0&&a.x<=80?s(!0):s(!1))},E=$(()=>[{"no-navbar":!n.value,"no-sidebar":!r.value.length,"sidebar-open":o.value},l.value.pageClass]);let v;Ge(()=>{v=Gt().afterEach(()=>{s(!1)})}),zi(()=>{v()});const g=Ns(),k=g.resolve,y=g.pending;return(C,m)=>(q(),ee("div",{class:Ue(["theme-container",E.value]),onTouchstart:c,onTouchend:d},[Be(C.$slots,"navbar",{},()=>[n.value?(q(),Ce(xv,{key:0,onToggleSidebar:s},{before:we(()=>[Be(C.$slots,"navbar-before")]),after:we(()=>[Be(C.$slots,"navbar-after")]),_:3})):De("v-if",!0)]),ve("div",{class:"sidebar-mask",onClick:m[0]||(m[0]=B=>s(!1))}),Be(C.$slots,"sidebar",{},()=>[le(uf,null,{top:we(()=>[Be(C.$slots,"sidebar-top")]),bottom:we(()=>[Be(C.$slots,"sidebar-bottom")]),_:3})]),Be(C.$slots,"page",{},()=>[te(l).home?(q(),Ce(Gh,{key:0})):(q(),Ce(Hl,{key:1,name:"fade-slide-y",mode:"out-in",onBeforeEnter:te(k),onBeforeLeave:te(y)},{default:we(()=>[(q(),Ce(Zv,{key:te(t).path},{top:we(()=>[Be(C.$slots,"page-top")]),"content-top":we(()=>[Be(C.$slots,"page-content-top")]),"content-bottom":we(()=>[Be(C.$slots,"page-content-bottom")]),bottom:we(()=>[Be(C.$slots,"page-bottom")]),_:3}))]),_:3},8,["onBeforeEnter","onBeforeLeave"]))])],34))}}),Ef=Fe(df,[["__file","Layout.vue"]]),hf={class:"theme-container"},vf={class:"page"},ff={class:"theme-default-content"},Af=ve("h1",null,"404",-1),gf=de({__name:"NotFound",setup(e){const t=Wl(),l=qe(),i=l.value.notFound??["Not Found"],n=()=>i[Math.floor(Math.random()*i.length)],r=l.value.home??t.value,o=l.value.backToHome??"Back to home";return(s,a)=>{const c=_t("RouterLink");return q(),ee("div",hf,[ve("main",vf,[ve("div",ff,[Af,ve("blockquote",null,xe(n()),1),le(c,{to:te(r)},{default:we(()=>[It(xe(te(o)),1)]),_:1},8,["to"])])])])}}}),mf=Fe(gf,[["__file","NotFound.vue"]]);const _f=wt({enhance({app:e,router:t}){e.component("Badge",OE),e.component("CodeGroup",IE),e.component("CodeGroupItem",jE),e.component("AutoLinkExternalIcon",()=>{const i=e.component("ExternalLinkIcon");return i?ce(i):null}),e.component("NavbarSearch",()=>{const i=e.component("Docsearch")||e.component("SearchBox");return i?ce(i):null});const l=t.options.scrollBehavior;t.options.scrollBehavior=async(...i)=>(await Ns().wait(),l(...i))},setup(){gh(),ph()},layouts:{Layout:Ef,NotFound:mf}}),pf=e=>e instanceof Element?document.activeElement===e&&(["TEXTAREA","SELECT","INPUT"].includes(e.tagName)||e.hasAttribute("contenteditable")):!1,Bf=(e,t)=>t.some(l=>{if(ge(l))return l===e.key;const{key:i,ctrl:n=!1,shift:r=!1,alt:o=!1}=l;return i===e.key&&n===e.ctrlKey&&r===e.shiftKey&&o===e.altKey}),kf=/[^\x00-\x7F]/,bf=e=>e.split(/\s+/g).map(t=>t.trim()).filter(t=>!!t),co=e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),uo=(e,t)=>{const l=t.join(" "),i=bf(e);if(kf.test(e))return i.some(o=>l.toLowerCase().indexOf(o)>-1);const n=e.endsWith(" ");return new RegExp(i.map((o,s)=>i.length===s+1&&!n?`(?=.*\\b${co(o)})`:`(?=.*\\b${co(o)}\\b)`).join("")+".+","gi").test(l)},yf=({input:e,hotKeys:t})=>{if(t.value.length===0)return;const l=i=>{e.value&&Bf(i,t.value)&&!pf(i.target)&&(i.preventDefault(),e.value.focus())};Ge(()=>{document.addEventListener("keydown",l)}),Nl(()=>{document.removeEventListener("keydown",l)})},Ff=[{title:"腾讯云代码分析文档",headers:[{level:3,title:"腾讯工蜂代码库镜像库",slug:"腾讯工蜂代码库镜像库",link:"#腾讯工蜂代码库镜像库",children:[]},{level:3,title:"金牌🏅️服务微信群",slug:"金牌🏅️服务微信群",link:"#金牌🏅️服务微信群",children:[]},{level:3,title:"团队成员",slug:"团队成员",link:"#团队成员",children:[]}],path:"/",pathLocale:"/",extraFields:[]},{title:"Tencent Cloud Code Analysis Doc",headers:[{level:3,title:"Repo Mirror",slug:"repo-mirror",link:"#repo-mirror",children:[]},{level:3,title:"WeChat Group",slug:"wechat-group",link:"#wechat-group",children:[]}],path:"/en/",pathLocale:"/en",extraFields:[]},{title:"",headers:[],path:"/zh/",pathLocale:"/",extraFields:[]},{title:"在 CentOS 安装 MySQL",headers:[{level:2,title:"注意",slug:"注意",link:"#注意",children:[]},{level:2,title:"环境",slug:"环境",link:"#环境",children:[]},{level:2,title:"安装 mysql yum源",slug:"安装-mysql-yum源",link:"#安装-mysql-yum源",children:[]},{level:2,title:"安装MySQL",slug:"安装mysql",link:"#安装mysql",children:[]},{level:2,title:"配置MySQL服务",slug:"配置mysql服务",link:"#配置mysql服务",children:[]},{level:2,title:"启动MySQL服务",slug:"启动mysql服务",link:"#启动mysql服务",children:[{level:3,title:"修改root用户密码",slug:"修改root用户密码",link:"#修改root用户密码",children:[]}]},{level:2,title:"参考文档",slug:"参考文档",link:"#参考文档",children:[]}],path:"/en/advanced/install_mysql_on_centos.html",pathLocale:"/en",extraFields:[]},{title:"源码安装 Nginx",headers:[{level:2,title:"运行环境",slug:"运行环境",link:"#运行环境",children:[]},{level:2,title:"环境准备",slug:"环境准备",link:"#环境准备",children:[]},{level:2,title:"下载源码",slug:"下载源码",link:"#下载源码",children:[]},{level:2,title:"解压安装",slug:"解压安装",link:"#解压安装",children:[]},{level:2,title:"添加nginx配置文件",slug:"添加nginx配置文件",link:"#添加nginx配置文件",children:[]},{level:2,title:"配置开机自动启动",slug:"配置开机自动启动",link:"#配置开机自动启动",children:[]},{level:2,title:"参考文档",slug:"参考文档",link:"#参考文档",children:[]}],path:"/en/advanced/install_nginx_from_source.html",pathLocale:"/en",extraFields:[]},{title:"在 CentOS 安装 Python3.7",headers:[{level:2,title:"下载Python源码包",slug:"下载python源码包",link:"#下载python源码包",children:[]},{level:2,title:"安装前准备",slug:"安装前准备",link:"#安装前准备",children:[]},{level:2,title:"解压安装",slug:"解压安装",link:"#解压安装",children:[]},{level:2,title:"检查",slug:"检查",link:"#检查",children:[]},{level:2,title:"pypi下载源配置",slug:"pypi下载源配置",link:"#pypi下载源配置",children:[]},{level:2,title:"一键安装脚本",slug:"一键安装脚本",link:"#一键安装脚本",children:[]}],path:"/en/advanced/install_python37_on_centos.html",pathLocale:"/en",extraFields:[]},{title:"在 Ubuntu 安装 Python3.7",headers:[{level:2,title:"下载Python源码包",slug:"下载python源码包",link:"#下载python源码包",children:[]},{level:2,title:"安装前准备",slug:"安装前准备",link:"#安装前准备",children:[]},{level:2,title:"解压安装",slug:"解压安装",link:"#解压安装",children:[]},{level:2,title:"检查",slug:"检查",link:"#检查",children:[]},{level:2,title:"pypi下载源配置",slug:"pypi下载源配置",link:"#pypi下载源配置",children:[]}],path:"/en/advanced/install_python37_on_ubuntu.html",pathLocale:"/en",extraFields:[]},{title:"源码安装 Redis",headers:[{level:2,title:"运行环境",slug:"运行环境",link:"#运行环境",children:[]},{level:2,title:"环境准备",slug:"环境准备",link:"#环境准备",children:[]},{level:2,title:"下载源码",slug:"下载源码",link:"#下载源码",children:[]},{level:2,title:"编译安装",slug:"编译安装",link:"#编译安装",children:[]},{level:2,title:"调整配置",slug:"调整配置",link:"#调整配置",children:[]},{level:2,title:"启动服务",slug:"启动服务",link:"#启动服务",children:[]},{level:2,title:"配置开机自动启动",slug:"配置开机自动启动",link:"#配置开机自动启动",children:[]},{level:2,title:"参考文档",slug:"参考文档",link:"#参考文档",children:[]}],path:"/en/advanced/install_redis_from_source.html",pathLocale:"/en",extraFields:[]},{title:"在 CentOS 安装 Redis",headers:[{level:2,title:"注意",slug:"注意",link:"#注意",children:[]},{level:2,title:"环境",slug:"环境",link:"#环境",children:[]},{level:2,title:"yum 安装 redis",slug:"yum-安装-redis",link:"#yum-安装-redis",children:[]},{level:2,title:"修改redis密码",slug:"修改redis密码",link:"#修改redis密码",children:[]},{level:2,title:"启动redis",slug:"启动redis",link:"#启动redis",children:[]},{level:2,title:"访问redis",slug:"访问redis",link:"#访问redis",children:[]}],path:"/en/advanced/install_redis_on_centos.html",pathLocale:"/en",extraFields:[]},{title:"任务分布式执行",headers:[{level:2,title:"适用场景",slug:"适用场景",link:"#适用场景",children:[]},{level:2,title:"常驻节点配置",slug:"常驻节点配置",link:"#常驻节点配置",children:[]}],path:"/en/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.html",pathLocale:"/en",extraFields:[]},{title:"使用自建工具git库",headers:[{level:2,title:"为什么要自建工具库",slug:"为什么要自建工具库",link:"#为什么要自建工具库",children:[]},{level:2,title:"如何使用其他工具库",slug:"如何使用其他工具库",link:"#如何使用其他工具库",children:[]},{level:2,title:"其他工具库建议",slug:"其他工具库建议",link:"#其他工具库建议",children:[]}],path:"/en/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93.html",pathLocale:"/en",extraFields:[]},{title:"源码集成代码分析工具",headers:[{level:2,title:"初识TCA任务执行机制",slug:"初识tca任务执行机制",link:"#初识tca任务执行机制",children:[]},{level:2,title:"添加分析工具(以 tca_ql_php 为例)",slug:"添加分析工具-以-tca-ql-php-为例",link:"#添加分析工具-以-tca-ql-php-为例",children:[{level:3,title:"如何让Server知道存在相应工具",slug:"如何让server知道存在相应工具",link:"#如何让server知道存在相应工具",children:[]}]},{level:2,title:"让server知道哪些客户端可以执行tca_ql_php工具",slug:"让server知道哪些客户端可以执行tca-ql-php工具",link:"#让server知道哪些客户端可以执行tca-ql-php工具",children:[]},{level:2,title:"client下载/找到工具所在目录及需要的环境",slug:"client下载-找到工具所在目录及需要的环境",link:"#client下载-找到工具所在目录及需要的环境",children:[]},{level:2,title:"让client知道tca_ql_php对应的启动脚本是什么",slug:"让client知道tca-ql-php对应的启动脚本是什么",link:"#让client知道tca-ql-php对应的启动脚本是什么",children:[{level:3,title:"脚本编写规范",slug:"脚本编写规范",link:"#脚本编写规范",children:[]}]},{level:2,title:"params 表格",slug:"params-表格",link:"#params-表格",children:[]}],path:"/en/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7.html",pathLocale:"/en",extraFields:[]},{title:"接口调用说明",headers:[{level:2,title:"接口地址",slug:"接口地址",link:"#接口地址",children:[]},{level:2,title:"接口鉴权方式",slug:"接口鉴权方式",link:"#接口鉴权方式",children:[]},{level:2,title:"获取 org_sid 和 project_team 信息",slug:"获取-org-sid-和-project-team-信息",link:"#获取-org-sid-和-project-team-信息",children:[]},{level:2,title:"Example",slug:"example",link:"#example",children:[]},{level:2,title:"分页方式",slug:"分页方式",link:"#分页方式",children:[]}],path:"/en/api/",pathLocale:"/en",extraFields:[]},{title:"代码度量数据管理",headers:[{level:2,title:"查看指定项目的圈复杂度文件列表",slug:"查看指定项目的圈复杂度文件列表",link:"#查看指定项目的圈复杂度文件列表",children:[]},{level:2,title:"查看指定项目的圈复杂度文件问题列表",slug:"查看指定项目的圈复杂度文件问题列表",link:"#查看指定项目的圈复杂度文件问题列表",children:[]},{level:2,title:"查看指定项目的圈复杂度问题列表",slug:"查看指定项目的圈复杂度问题列表",link:"#查看指定项目的圈复杂度问题列表",children:[]},{level:2,title:"查看指定项目指定扫描的圈复杂度文件列表",slug:"查看指定项目指定扫描的圈复杂度文件列表",link:"#查看指定项目指定扫描的圈复杂度文件列表",children:[]},{level:2,title:"查看指定项目指定扫描的圈复杂度文件问题列表",slug:"查看指定项目指定扫描的圈复杂度文件问题列表",link:"#查看指定项目指定扫描的圈复杂度文件问题列表",children:[]},{level:2,title:"查看指定项目指定扫描的圈复杂度问题列表",slug:"查看指定项目指定扫描的圈复杂度问题列表",link:"#查看指定项目指定扫描的圈复杂度问题列表",children:[]},{level:2,title:"查看指定项目的重复文件列表",slug:"查看指定项目的重复文件列表",link:"#查看指定项目的重复文件列表",children:[]},{level:2,title:"查看指定项目的指定重复文件",slug:"查看指定项目的指定重复文件",link:"#查看指定项目的指定重复文件",children:[]},{level:2,title:"查看指定项目的指定文件的重复块列表",slug:"查看指定项目的指定文件的重复块列表",link:"#查看指定项目的指定文件的重复块列表",children:[]},{level:2,title:"查看指定项目的文件行数列表",slug:"查看指定项目的文件行数列表",link:"#查看指定项目的文件行数列表",children:[]},{level:2,title:"查看指定项目的语言列表",slug:"查看指定项目的语言列表",link:"#查看指定项目的语言列表",children:[]}],path:"/en/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/en",extraFields:[]},{title:"代码扫描数据管理",headers:[{level:2,title:"查看扫描问题列表",slug:"查看扫描问题列表",link:"#查看扫描问题列表",children:[]},{level:2,title:"查看问题详情",slug:"查看问题详情",link:"#查看问题详情",children:[]}],path:"/en/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/en",extraFields:[]},{title:"任务管理模块",headers:[{level:2,title:"执行指定代码库指定分析项目扫描任务",slug:"执行指定代码库指定分析项目扫描任务",link:"#执行指定代码库指定分析项目扫描任务",children:[]},{level:2,title:"查看指定项目的任务列表",slug:"查看指定项目的任务列表",link:"#查看指定项目的任务列表",children:[]},{level:2,title:"查看指定项目的指定任务详情",slug:"查看指定项目的指定任务详情",link:"#查看指定项目的指定任务详情",children:[]}],path:"/en/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/en",extraFields:[]},{title:"对象主要字段说明",headers:[{level:2,title:"团队(org):",slug:"团队-org",link:"#团队-org",children:[]},{level:2,title:"项目(team):",slug:"项目-team",link:"#项目-team",children:[]},{level:2,title:"代码库(repository):",slug:"代码库-repository",link:"#代码库-repository",children:[]},{level:2,title:"扫描方案(scanscheme):",slug:"扫描方案-scanscheme",link:"#扫描方案-scanscheme",children:[]}],path:"/en/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.html",pathLocale:"/en",extraFields:[]},{title:"代码扫描管理",headers:[{level:2,title:"查看项目扫描最新结果概览",slug:"查看项目扫描最新结果概览",link:"#查看项目扫描最新结果概览",children:[]},{level:2,title:"查看项目代码最新扫描结果概览",slug:"查看项目代码最新扫描结果概览",link:"#查看项目代码最新扫描结果概览",children:[]},{level:2,title:"查看项目代码扫描结果概览",slug:"查看项目代码扫描结果概览",link:"#查看项目代码扫描结果概览",children:[]},{level:2,title:"查看项目代码度量圈复杂度结果概览",slug:"查看项目代码度量圈复杂度结果概览",link:"#查看项目代码度量圈复杂度结果概览",children:[]},{level:2,title:"查看项目代码度量重复代码结果概览",slug:"查看项目代码度量重复代码结果概览",link:"#查看项目代码度量重复代码结果概览",children:[]},{level:2,title:"查看项目代码度量代码统计结果概览",slug:"查看项目代码度量代码统计结果概览",link:"#查看项目代码度量代码统计结果概览",children:[]}],path:"/en/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/en",extraFields:[]},{title:"项目管理模块",headers:[{level:2,title:"查看指定代码库的指定分析项目列表",slug:"查看指定代码库的指定分析项目列表",link:"#查看指定代码库的指定分析项目列表",children:[]},{level:2,title:"查看指定代码库详情",slug:"查看指定代码库详情",link:"#查看指定代码库详情",children:[]},{level:2,title:"查看指定代码库的不同分支的列表接口",slug:"查看指定代码库的不同分支的列表接口",link:"#查看指定代码库的不同分支的列表接口",children:[]},{level:2,title:"查看指定代码库的分析项目列表",slug:"查看指定代码库的分析项目列表",link:"#查看指定代码库的分析项目列表",children:[]},{level:2,title:"创建指定代码库的指定分析项目",slug:"创建指定代码库的指定分析项目",link:"#创建指定代码库的指定分析项目",children:[]},{level:2,title:"查看指定代码库的指定分析项目",slug:"查看指定代码库的指定分析项目",link:"#查看指定代码库的指定分析项目",children:[]},{level:2,title:"查看指定代码库的扫描方案列表",slug:"查看指定代码库的扫描方案列表",link:"#查看指定代码库的扫描方案列表",children:[]},{level:2,title:"使用指定扫描方案模板创建指定代码库的扫描方案",slug:"使用指定扫描方案模板创建指定代码库的扫描方案",link:"#使用指定扫描方案模板创建指定代码库的扫描方案",children:[]},{level:2,title:"查看指定代码库的指定扫描方案",slug:"查看指定代码库的指定扫描方案",link:"#查看指定代码库的指定扫描方案",children:[]},{level:2,title:"更新指定代码库的指定方案",slug:"更新指定代码库的指定方案",link:"#更新指定代码库的指定方案",children:[]},{level:2,title:"查看指定代码库的扫描方案的代码扫描配置",slug:"查看指定代码库的扫描方案的代码扫描配置",link:"#查看指定代码库的扫描方案的代码扫描配置",children:[]},{level:2,title:"更新指定代码库的指定方案的代码扫描配置",slug:"更新指定代码库的指定方案的代码扫描配置",link:"#更新指定代码库的指定方案的代码扫描配置",children:[]},{level:2,title:"查看指定代码库的扫描方案的代码度量配置",slug:"查看指定代码库的扫描方案的代码度量配置",link:"#查看指定代码库的扫描方案的代码度量配置",children:[]},{level:2,title:"更新指定代码库的指定方案的代码度量配置",slug:"更新指定代码库的指定方案的代码度量配置",link:"#更新指定代码库的指定方案的代码度量配置",children:[]},{level:2,title:"查看指定代码库的扫描方案的过滤路径列表",slug:"查看指定代码库的扫描方案的过滤路径列表",link:"#查看指定代码库的扫描方案的过滤路径列表",children:[]},{level:2,title:"创建指定代码库的指定方案的过滤路径列表",slug:"创建指定代码库的指定方案的过滤路径列表",link:"#创建指定代码库的指定方案的过滤路径列表",children:[]},{level:2,title:"查看指定代码库的扫描方案的指定过滤路径",slug:"查看指定代码库的扫描方案的指定过滤路径",link:"#查看指定代码库的扫描方案的指定过滤路径",children:[]},{level:2,title:"更新指定代码库的指定方案的指定过滤路径",slug:"更新指定代码库的指定方案的指定过滤路径",link:"#更新指定代码库的指定方案的指定过滤路径",children:[]},{level:2,title:"删除指定代码库的指定方案的指定过滤路径",slug:"删除指定代码库的指定方案的指定过滤路径",link:"#删除指定代码库的指定方案的指定过滤路径",children:[]}],path:"/en/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/en",extraFields:[]},{title:"更新日志",headers:[{level:2,title:"V1.4.1 (2022-7-28)",slug:"v1-4-1-2022-7-28",link:"#v1-4-1-2022-7-28",children:[{level:3,title:"Features",slug:"features",link:"#features",children:[]},{level:3,title:"Docs",slug:"docs",link:"#docs",children:[]}]},{level:2,title:"V1.4.0 (2022-7-18)",slug:"v1-4-0-2022-7-18",link:"#v1-4-0-2022-7-18",children:[{level:3,title:"Features",slug:"features-1",link:"#features-1",children:[]},{level:3,title:"Docs",slug:"docs-1",link:"#docs-1",children:[]}]},{level:2,title:"V1.3.3 (2022-6-29)",slug:"v1-3-3-2022-6-29",link:"#v1-3-3-2022-6-29",children:[{level:3,title:"Features",slug:"features-2",link:"#features-2",children:[]},{level:3,title:"Bugfixes",slug:"bugfixes",link:"#bugfixes",children:[]},{level:3,title:"Docs",slug:"docs-2",link:"#docs-2",children:[]}]},{level:2,title:"V1.3.2 (2022-6-16)",slug:"v1-3-2-2022-6-16",link:"#v1-3-2-2022-6-16",children:[{level:3,title:"Features",slug:"features-3",link:"#features-3",children:[]},{level:3,title:"Docs",slug:"docs-3",link:"#docs-3",children:[]}]},{level:2,title:"V1.3.1 (2022-6-14)",slug:"v1-3-1-2022-6-14",link:"#v1-3-1-2022-6-14",children:[{level:3,title:"Features",slug:"features-4",link:"#features-4",children:[]}]},{level:2,title:"V1.3.0 (2022-6-7)",slug:"v1-3-0-2022-6-7",link:"#v1-3-0-2022-6-7",children:[{level:3,title:"Features",slug:"features-5",link:"#features-5",children:[]},{level:3,title:"Bugfixes",slug:"bugfixes-1",link:"#bugfixes-1",children:[]},{level:3,title:"Docs",slug:"docs-4",link:"#docs-4",children:[]}]},{level:2,title:"V1.2.1 (2022-5-24)",slug:"v1-2-1-2022-5-24",link:"#v1-2-1-2022-5-24",children:[{level:3,title:"Features",slug:"features-6",link:"#features-6",children:[]},{level:3,title:"Docs",slug:"docs-5",link:"#docs-5",children:[]}]},{level:2,title:"V1.2.0 (2022-4-27)",slug:"v1-2-0-2022-4-27",link:"#v1-2-0-2022-4-27",children:[{level:3,title:"Features",slug:"features-7",link:"#features-7",children:[]},{level:3,title:"Docs",slug:"docs-6",link:"#docs-6",children:[]}]},{level:2,title:"V1.1.3 (2022-4-18)",slug:"v1-1-3-2022-4-18",link:"#v1-1-3-2022-4-18",children:[{level:3,title:"Features",slug:"features-8",link:"#features-8",children:[]},{level:3,title:"Docs",slug:"docs-7",link:"#docs-7",children:[]}]},{level:2,title:"V1.1.2 (2022-4-2)",slug:"v1-1-2-2022-4-2",link:"#v1-1-2-2022-4-2",children:[{level:3,title:"Features",slug:"features-9",link:"#features-9",children:[]},{level:3,title:"Docs",slug:"docs-8",link:"#docs-8",children:[]}]},{level:2,title:"V1.1.1 (2022-3-31)",slug:"v1-1-1-2022-3-31",link:"#v1-1-1-2022-3-31",children:[{level:3,title:"Features",slug:"features-10",link:"#features-10",children:[]},{level:3,title:"Docs",slug:"docs-9",link:"#docs-9",children:[]}]},{level:2,title:"V1.1.0 (2022-3-29)",slug:"v1-1-0-2022-3-29",link:"#v1-1-0-2022-3-29",children:[{level:3,title:"Features",slug:"features-11",link:"#features-11",children:[]},{level:3,title:"Bugfixes",slug:"bugfixes-2",link:"#bugfixes-2",children:[]},{level:3,title:"Docs",slug:"docs-10",link:"#docs-10",children:[]}]},{level:2,title:"V1.0.1 (2022-03-01)",slug:"v1-0-1-2022-03-01",link:"#v1-0-1-2022-03-01",children:[{level:3,title:"Features",slug:"features-12",link:"#features-12",children:[]},{level:3,title:"Bugfixes",slug:"bugfixes-3",link:"#bugfixes-3",children:[]},{level:3,title:"Docs",slug:"docs-11",link:"#docs-11",children:[]}]},{level:2,title:"V1.0.0",slug:"v1-0-0",link:"#v1-0-0",children:[]}],path:"/en/community/changelog.html",pathLocale:"/en",extraFields:[]},{title:"贡献指南",headers:[{level:2,title:"报告问题",slug:"报告问题",link:"#报告问题",children:[{level:3,title:"搜索已知issue",slug:"搜索已知issue",link:"#搜索已知issue",children:[]},{level:3,title:"报告新issue",slug:"报告新issue",link:"#报告新issue",children:[]}]},{level:2,title:"Pull Request",slug:"pull-request",link:"#pull-request",children:[{level:3,title:"分支管理",slug:"分支管理",link:"#分支管理",children:[]},{level:3,title:"提交Pull Request",slug:"提交pull-request",link:"#提交pull-request",children:[]}]},{level:2,title:"许可",slug:"许可",link:"#许可",children:[]}],path:"/en/community/contribute.html",pathLocale:"/en",extraFields:[]},{title:"加入社区",headers:[],path:"/en/community/joingroup.html",pathLocale:"/en",extraFields:[]},{title:"PR操作流程",headers:[{level:2,title:"一、Fork目标代码库",slug:"一、fork目标代码库",link:"#一、fork目标代码库",children:[]},{level:2,title:"二、克隆Fork的代码库并创建分支",slug:"二、克隆fork的代码库并创建分支",link:"#二、克隆fork的代码库并创建分支",children:[]},{level:2,title:"三、在目标项目中提交PR",slug:"三、在目标项目中提交pr",link:"#三、在目标项目中提交pr",children:[{level:3,title:"1.进入到目标项目中,点击Pull requests Tab,再点击New pull request就会进入到创建PR的页面",slug:"_1-进入到目标项目中-点击pull-requests-tab-再点击new-pull-request就会进入到创建pr的页面",link:"#_1-进入到目标项目中-点击pull-requests-tab-再点击new-pull-request就会进入到创建pr的页面",children:[]},{level:3,title:"2.进入PR页面后",slug:"_2-进入pr页面后",link:"#_2-进入pr页面后",children:[]}]},{level:2,title:"更多信息请参阅GitHub PullRequest官方文档",slug:"更多信息请参阅github-pullrequest官方文档",link:"#更多信息请参阅github-pullrequest官方文档",children:[]},{level:2,title:"TCA团队诚邀您的加入",slug:"tca团队诚邀您的加入",link:"#tca团队诚邀您的加入",children:[]}],path:"/en/community/pr.html",pathLocale:"/en",extraFields:[]},{title:"腾讯云代码分析",headers:[{level:2,title:"主要功能",slug:"主要功能",link:"#主要功能",children:[{level:3,title:"代码检查",slug:"代码检查",link:"#代码检查",children:[]},{level:3,title:"代码度量",slug:"代码度量",link:"#代码度量",children:[]},{level:3,title:"代码圈复杂度",slug:"代码圈复杂度",link:"#代码圈复杂度",children:[]},{level:3,title:"代码重复率",slug:"代码重复率",link:"#代码重复率",children:[]},{level:3,title:"代码统计",slug:"代码统计",link:"#代码统计",children:[]}]}],path:"/en/guide/",pathLocale:"/en",extraFields:[]},{title:"FAQ",headers:[{level:2,title:"Server常见问题与处理方法",slug:"server常见问题与处理方法",link:"#server常见问题与处理方法",children:[{level:3,title:"1. 环境部署",slug:"_1-环境部署",link:"#_1-环境部署",children:[]},{level:3,title:"2. 服务启动与初始化",slug:"_2-服务启动与初始化",link:"#_2-服务启动与初始化",children:[]},{level:3,title:"3. 平台使用",slug:"_3-平台使用",link:"#_3-平台使用",children:[]}]},{level:2,title:"CodeAnalysis仓库文件问题",slug:"codeanalysis仓库文件问题",link:"#codeanalysis仓库文件问题",children:[{level:3,title:"1. clone到本地时相关md文件内资源图片无法显示",slug:"_1-clone到本地时相关md文件内资源图片无法显示",link:"#_1-clone到本地时相关md文件内资源图片无法显示",children:[]}]}],path:"/en/quickStarted/FAQ.html",pathLocale:"/en",extraFields:[]},{title:"Tencent Cloud Code Analysis",headers:[],path:"/en/quickStarted/",pathLocale:"/en",extraFields:[]},{title:"源代码快速部署",headers:[],path:"/en/quickStarted/codeDeploy.html",pathLocale:"/en",extraFields:[]},{title:"部署与配置客户端",headers:[{level:2,title:"通过源代码",slug:"通过源代码",link:"#通过源代码",children:[{level:3,title:"依赖环境",slug:"依赖环境",link:"#依赖环境",children:[]},{level:3,title:"使用步骤",slug:"使用步骤",link:"#使用步骤",children:[]}]},{level:2,title:"通过Docker-Compose",slug:"通过docker-compose",link:"#通过docker-compose",children:[{level:3,title:"使用步骤",slug:"使用步骤-1",link:"#使用步骤-1",children:[]}]},{level:2,title:"通过可执行文件",slug:"通过可执行文件",link:"#通过可执行文件",children:[{level:3,title:"依赖环境",slug:"依赖环境-1",link:"#依赖环境-1",children:[]},{level:3,title:"使用步骤",slug:"使用步骤-2",link:"#使用步骤-2",children:[]}]}],path:"/en/quickStarted/deployClient.html",pathLocale:"/en",extraFields:[]},{title:"部署 TCA",headers:[{level:2,title:"Docker快速部署",slug:"docker快速部署",link:"#docker快速部署",children:[{level:3,title:"依赖环境",slug:"依赖环境",link:"#依赖环境",children:[]},{level:3,title:"部署对象",slug:"部署对象",link:"#部署对象",children:[]},{level:3,title:"操作说明",slug:"操作说明",link:"#操作说明",children:[]}]},{level:2,title:"进入平台页面",slug:"进入平台页面",link:"#进入平台页面",children:[]},{level:2,title:"创建团队及项目",slug:"创建团队及项目",link:"#创建团队及项目",children:[]},{level:2,title:"登记代码库",slug:"登记代码库",link:"#登记代码库",children:[]},{level:2,title:"创建分析项目",slug:"创建分析项目",link:"#创建分析项目",children:[{level:3,title:"分析方案说明",slug:"分析方案说明",link:"#分析方案说明",children:[]}]},{level:2,title:"执行代码分析",slug:"执行代码分析",link:"#执行代码分析",children:[]},{level:2,title:"查看分析历史",slug:"查看分析历史",link:"#查看分析历史",children:[]},{level:2,title:"查看分析概览",slug:"查看分析概览",link:"#查看分析概览",children:[]}],path:"/en/quickStarted/deploySever.html",pathLocale:"/en",extraFields:[]},{title:"Docker rapid deployment(Recommended for a out of the box try)",headers:[],path:"/en/quickStarted/dockerDeploy.html",pathLocale:"/en",extraFields:[]},{title:"Docker-Compose快速部署",headers:[],path:"/en/quickStarted/dockercomposeDeploy.html",pathLocale:"/en",extraFields:[]},{title:"Enhanced Analysis Module Deployment",headers:[{level:2,title:"Concepts",slug:"concepts",link:"#concepts",children:[]},{level:2,title:"Module Features",slug:"module-features",link:"#module-features",children:[]},{level:2,title:"TCA official website version enhanced capability application",slug:"tca-official-website-version-enhanced-capability-application",link:"#tca-official-website-version-enhanced-capability-application",children:[]},{level:2,title:"TCA Private Deployment Enhanced Capability Application",slug:"tca-private-deployment-enhanced-capability-application",link:"#tca-private-deployment-enhanced-capability-application",children:[{level:3,title:"Preparation",slug:"preparation",link:"#preparation",children:[]},{level:3,title:"Steps",slug:"steps",link:"#steps",children:[]},{level:3,title:"CLS Operation and Maintenance",slug:"cls-operation-and-maintenance",link:"#cls-operation-and-maintenance",children:[]}]}],path:"/en/quickStarted/enhanceDeploy.html",pathLocale:"/en",extraFields:[]},{title:"创建代码分析项目",headers:[{level:2,title:"进入平台页面",slug:"进入平台页面",link:"#进入平台页面",children:[]},{level:2,title:"创建团队及项目",slug:"创建团队及项目",link:"#创建团队及项目",children:[]},{level:2,title:"登记代码库",slug:"登记代码库",link:"#登记代码库",children:[]},{level:2,title:"创建分析项目",slug:"创建分析项目",link:"#创建分析项目",children:[{level:3,title:"分析方案说明",slug:"分析方案说明",link:"#分析方案说明",children:[]}]}],path:"/en/quickStarted/initRepo.html",pathLocale:"/en",extraFields:[]},{title:"平台概述",headers:[{level:3,title:"使用TCA Action快速体验",slug:"使用tca-action快速体验",link:"#使用tca-action快速体验",children:[]},{level:3,title:"部署TCA",slug:"部署tca",link:"#部署tca",children:[]},{level:3,title:"创建首个代码分析项目",slug:"创建首个代码分析项目",link:"#创建首个代码分析项目",children:[]},{level:3,title:"快速扩展客户端",slug:"快速扩展客户端",link:"#快速扩展客户端",children:[]},{level:3,title:"了解更多",slug:"了解更多",link:"#了解更多",children:[]}],path:"/en/quickStarted/intro.html",pathLocale:"/en",extraFields:[]},{title:"启动代码分析",headers:[{level:2,title:"执行代码分析",slug:"执行代码分析",link:"#执行代码分析",children:[]},{level:2,title:"查看分析历史",slug:"查看分析历史",link:"#查看分析历史",children:[]},{level:2,title:"查看分析概览",slug:"查看分析概览",link:"#查看分析概览",children:[]}],path:"/en/quickStarted/runProject.html",pathLocale:"/en",extraFields:[]},{title:"在 CentOS 安装 MySQL",headers:[{level:2,title:"注意",slug:"注意",link:"#注意",children:[]},{level:2,title:"环境",slug:"环境",link:"#环境",children:[]},{level:2,title:"安装 mysql yum源",slug:"安装-mysql-yum源",link:"#安装-mysql-yum源",children:[]},{level:2,title:"安装MySQL",slug:"安装mysql",link:"#安装mysql",children:[]},{level:2,title:"配置MySQL服务",slug:"配置mysql服务",link:"#配置mysql服务",children:[]},{level:2,title:"启动MySQL服务",slug:"启动mysql服务",link:"#启动mysql服务",children:[{level:3,title:"修改root用户密码",slug:"修改root用户密码",link:"#修改root用户密码",children:[]}]},{level:2,title:"参考文档",slug:"参考文档",link:"#参考文档",children:[]}],path:"/zh/advanced/install_mysql_on_centos.html",pathLocale:"/",extraFields:[]},{title:"源码安装 Nginx",headers:[{level:2,title:"运行环境",slug:"运行环境",link:"#运行环境",children:[]},{level:2,title:"环境准备",slug:"环境准备",link:"#环境准备",children:[]},{level:2,title:"下载源码",slug:"下载源码",link:"#下载源码",children:[]},{level:2,title:"解压安装",slug:"解压安装",link:"#解压安装",children:[]},{level:2,title:"添加nginx配置文件",slug:"添加nginx配置文件",link:"#添加nginx配置文件",children:[]},{level:2,title:"配置开机自动启动",slug:"配置开机自动启动",link:"#配置开机自动启动",children:[]},{level:2,title:"参考文档",slug:"参考文档",link:"#参考文档",children:[]}],path:"/zh/advanced/install_nginx_from_source.html",pathLocale:"/",extraFields:[]},{title:"在 CentOS 安装 Python3.7",headers:[{level:2,title:"下载Python源码包",slug:"下载python源码包",link:"#下载python源码包",children:[]},{level:2,title:"安装前准备",slug:"安装前准备",link:"#安装前准备",children:[]},{level:2,title:"解压安装",slug:"解压安装",link:"#解压安装",children:[]},{level:2,title:"检查",slug:"检查",link:"#检查",children:[]},{level:2,title:"pypi下载源配置",slug:"pypi下载源配置",link:"#pypi下载源配置",children:[]},{level:2,title:"一键安装脚本",slug:"一键安装脚本",link:"#一键安装脚本",children:[]}],path:"/zh/advanced/install_python37_on_centos.html",pathLocale:"/",extraFields:[]},{title:"在 Ubuntu 安装 Python3.7",headers:[{level:2,title:"下载Python源码包",slug:"下载python源码包",link:"#下载python源码包",children:[]},{level:2,title:"安装前准备",slug:"安装前准备",link:"#安装前准备",children:[]},{level:2,title:"解压安装",slug:"解压安装",link:"#解压安装",children:[]},{level:2,title:"检查",slug:"检查",link:"#检查",children:[]},{level:2,title:"pypi下载源配置",slug:"pypi下载源配置",link:"#pypi下载源配置",children:[]}],path:"/zh/advanced/install_python37_on_ubuntu.html",pathLocale:"/",extraFields:[]},{title:"源码安装 Redis",headers:[{level:2,title:"运行环境",slug:"运行环境",link:"#运行环境",children:[]},{level:2,title:"环境准备",slug:"环境准备",link:"#环境准备",children:[]},{level:2,title:"下载源码",slug:"下载源码",link:"#下载源码",children:[]},{level:2,title:"编译安装",slug:"编译安装",link:"#编译安装",children:[]},{level:2,title:"调整配置",slug:"调整配置",link:"#调整配置",children:[]},{level:2,title:"启动服务",slug:"启动服务",link:"#启动服务",children:[]},{level:2,title:"配置开机自动启动",slug:"配置开机自动启动",link:"#配置开机自动启动",children:[]},{level:2,title:"参考文档",slug:"参考文档",link:"#参考文档",children:[]}],path:"/zh/advanced/install_redis_from_source.html",pathLocale:"/",extraFields:[]},{title:"在 CentOS 安装 Redis",headers:[{level:2,title:"注意",slug:"注意",link:"#注意",children:[]},{level:2,title:"环境",slug:"环境",link:"#环境",children:[]},{level:2,title:"yum 安装 redis",slug:"yum-安装-redis",link:"#yum-安装-redis",children:[]},{level:2,title:"修改redis密码",slug:"修改redis密码",link:"#修改redis密码",children:[]},{level:2,title:"启动redis",slug:"启动redis",link:"#启动redis",children:[]},{level:2,title:"访问redis",slug:"访问redis",link:"#访问redis",children:[]}],path:"/zh/advanced/install_redis_on_centos.html",pathLocale:"/",extraFields:[]},{title:"任务分布式执行",headers:[{level:2,title:"适用场景",slug:"适用场景",link:"#适用场景",children:[]},{level:2,title:"常驻节点配置",slug:"常驻节点配置",link:"#常驻节点配置",children:[]}],path:"/zh/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.html",pathLocale:"/",extraFields:[]},{title:"使用自建工具git库",headers:[{level:2,title:"为什么要自建工具库",slug:"为什么要自建工具库",link:"#为什么要自建工具库",children:[]},{level:2,title:"如何使用其他工具库",slug:"如何使用其他工具库",link:"#如何使用其他工具库",children:[]},{level:2,title:"其他工具库建议",slug:"其他工具库建议",link:"#其他工具库建议",children:[]}],path:"/zh/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93.html",pathLocale:"/",extraFields:[]},{title:"源码集成代码分析工具",headers:[{level:2,title:"初识TCA任务执行机制",slug:"初识tca任务执行机制",link:"#初识tca任务执行机制",children:[]},{level:2,title:"添加分析工具(以 tca_ql_php 为例)",slug:"添加分析工具-以-tca-ql-php-为例",link:"#添加分析工具-以-tca-ql-php-为例",children:[{level:3,title:"如何让Server知道存在相应工具",slug:"如何让server知道存在相应工具",link:"#如何让server知道存在相应工具",children:[]}]},{level:2,title:"让server知道哪些客户端可以执行tca_ql_php工具",slug:"让server知道哪些客户端可以执行tca-ql-php工具",link:"#让server知道哪些客户端可以执行tca-ql-php工具",children:[]},{level:2,title:"client下载/找到工具所在目录及需要的环境",slug:"client下载-找到工具所在目录及需要的环境",link:"#client下载-找到工具所在目录及需要的环境",children:[]},{level:2,title:"让client知道tca_ql_php对应的启动脚本是什么",slug:"让client知道tca-ql-php对应的启动脚本是什么",link:"#让client知道tca-ql-php对应的启动脚本是什么",children:[{level:3,title:"脚本编写规范",slug:"脚本编写规范",link:"#脚本编写规范",children:[]}]},{level:2,title:"params 表格",slug:"params-表格",link:"#params-表格",children:[]}],path:"/zh/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7.html",pathLocale:"/",extraFields:[]},{title:"接口调用说明",headers:[{level:2,title:"接口地址",slug:"接口地址",link:"#接口地址",children:[]},{level:2,title:"接口鉴权方式",slug:"接口鉴权方式",link:"#接口鉴权方式",children:[]},{level:2,title:"获取 org_sid 和 project_team 信息",slug:"获取-org-sid-和-project-team-信息",link:"#获取-org-sid-和-project-team-信息",children:[]},{level:2,title:"Example",slug:"example",link:"#example",children:[]},{level:2,title:"分页方式",slug:"分页方式",link:"#分页方式",children:[]},{level:2,title:"响应格式",slug:"响应格式",link:"#响应格式",children:[]}],path:"/zh/api/",pathLocale:"/",extraFields:[]},{title:"代码度量数据管理",headers:[{level:2,title:"查看指定项目的圈复杂度文件列表",slug:"查看指定项目的圈复杂度文件列表",link:"#查看指定项目的圈复杂度文件列表",children:[]},{level:2,title:"查看指定项目的圈复杂度文件问题列表",slug:"查看指定项目的圈复杂度文件问题列表",link:"#查看指定项目的圈复杂度文件问题列表",children:[]},{level:2,title:"查看指定项目的圈复杂度问题列表",slug:"查看指定项目的圈复杂度问题列表",link:"#查看指定项目的圈复杂度问题列表",children:[]},{level:2,title:"查看指定项目指定扫描的圈复杂度文件列表",slug:"查看指定项目指定扫描的圈复杂度文件列表",link:"#查看指定项目指定扫描的圈复杂度文件列表",children:[]},{level:2,title:"查看指定项目指定扫描的圈复杂度文件问题列表",slug:"查看指定项目指定扫描的圈复杂度文件问题列表",link:"#查看指定项目指定扫描的圈复杂度文件问题列表",children:[]},{level:2,title:"查看指定项目指定扫描的圈复杂度问题列表",slug:"查看指定项目指定扫描的圈复杂度问题列表",link:"#查看指定项目指定扫描的圈复杂度问题列表",children:[]},{level:2,title:"查看指定项目的重复文件列表",slug:"查看指定项目的重复文件列表",link:"#查看指定项目的重复文件列表",children:[]},{level:2,title:"查看指定项目的指定重复文件",slug:"查看指定项目的指定重复文件",link:"#查看指定项目的指定重复文件",children:[]},{level:2,title:"查看指定项目的指定文件的重复块列表",slug:"查看指定项目的指定文件的重复块列表",link:"#查看指定项目的指定文件的重复块列表",children:[]},{level:2,title:"查看指定项目的文件行数列表",slug:"查看指定项目的文件行数列表",link:"#查看指定项目的文件行数列表",children:[]},{level:2,title:"查看指定项目的语言列表",slug:"查看指定项目的语言列表",link:"#查看指定项目的语言列表",children:[]}],path:"/zh/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/",extraFields:[]},{title:"代码扫描数据管理",headers:[{level:2,title:"查看扫描问题列表",slug:"查看扫描问题列表",link:"#查看扫描问题列表",children:[]},{level:2,title:"查看问题详情",slug:"查看问题详情",link:"#查看问题详情",children:[]},{level:2,title:"查看每次扫描的问题列表",slug:"查看每次扫描的问题列表",link:"#查看每次扫描的问题列表",children:[]},{level:2,title:"查看指定CR扫描的问题列表",slug:"查看指定cr扫描的问题列表",link:"#查看指定cr扫描的问题列表",children:[]}],path:"/zh/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/",extraFields:[]},{title:"任务管理模块",headers:[{level:2,title:"执行指定代码库指定分析项目扫描任务",slug:"执行指定代码库指定分析项目扫描任务",link:"#执行指定代码库指定分析项目扫描任务",children:[]},{level:2,title:"查看指定项目的任务列表",slug:"查看指定项目的任务列表",link:"#查看指定项目的任务列表",children:[]},{level:2,title:"查看指定项目的指定任务详情",slug:"查看指定项目的指定任务详情",link:"#查看指定项目的指定任务详情",children:[]}],path:"/zh/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/",extraFields:[]},{title:"对象主要字段说明",headers:[{level:2,title:"团队(org):",slug:"团队-org",link:"#团队-org",children:[]},{level:2,title:"项目(team):",slug:"项目-team",link:"#项目-team",children:[]},{level:2,title:"代码库(repository):",slug:"代码库-repository",link:"#代码库-repository",children:[]},{level:2,title:"扫描方案(scanscheme):",slug:"扫描方案-scanscheme",link:"#扫描方案-scanscheme",children:[]}],path:"/zh/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.html",pathLocale:"/",extraFields:[]},{title:"代码扫描管理",headers:[{level:2,title:"查看项目扫描最新结果概览",slug:"查看项目扫描最新结果概览",link:"#查看项目扫描最新结果概览",children:[]},{level:2,title:"查看项目代码最新扫描结果概览",slug:"查看项目代码最新扫描结果概览",link:"#查看项目代码最新扫描结果概览",children:[]},{level:2,title:"查看项目代码扫描结果概览",slug:"查看项目代码扫描结果概览",link:"#查看项目代码扫描结果概览",children:[]},{level:2,title:"查看项目代码度量圈复杂度结果概览",slug:"查看项目代码度量圈复杂度结果概览",link:"#查看项目代码度量圈复杂度结果概览",children:[]},{level:2,title:"查看项目代码度量重复代码结果概览",slug:"查看项目代码度量重复代码结果概览",link:"#查看项目代码度量重复代码结果概览",children:[]},{level:2,title:"查看项目代码度量代码统计结果概览",slug:"查看项目代码度量代码统计结果概览",link:"#查看项目代码度量代码统计结果概览",children:[]}],path:"/zh/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/",extraFields:[]},{title:"项目管理模块",headers:[{level:2,title:"查看指定代码库的指定分析项目列表",slug:"查看指定代码库的指定分析项目列表",link:"#查看指定代码库的指定分析项目列表",children:[]},{level:2,title:"查看已创建的授权信息",slug:"查看已创建的授权信息",link:"#查看已创建的授权信息",children:[]},{level:2,title:"登记代码库",slug:"登记代码库",link:"#登记代码库",children:[]},{level:2,title:"查看指定代码库详情",slug:"查看指定代码库详情",link:"#查看指定代码库详情",children:[]},{level:2,title:"查看指定代码库的不同分支的列表接口",slug:"查看指定代码库的不同分支的列表接口",link:"#查看指定代码库的不同分支的列表接口",children:[]},{level:2,title:"查看指定代码库的分析项目列表",slug:"查看指定代码库的分析项目列表",link:"#查看指定代码库的分析项目列表",children:[]},{level:2,title:"创建指定代码库的指定分析项目",slug:"创建指定代码库的指定分析项目",link:"#创建指定代码库的指定分析项目",children:[]},{level:2,title:"查看指定代码库的指定分析项目",slug:"查看指定代码库的指定分析项目",link:"#查看指定代码库的指定分析项目",children:[]},{level:2,title:"查看指定代码库的扫描方案列表",slug:"查看指定代码库的扫描方案列表",link:"#查看指定代码库的扫描方案列表",children:[]},{level:2,title:"查看指定代码库的指定扫描方案",slug:"查看指定代码库的指定扫描方案",link:"#查看指定代码库的指定扫描方案",children:[]},{level:2,title:"更新指定代码库的指定方案",slug:"更新指定代码库的指定方案",link:"#更新指定代码库的指定方案",children:[]},{level:2,title:"查看指定代码库的扫描方案的代码扫描配置",slug:"查看指定代码库的扫描方案的代码扫描配置",link:"#查看指定代码库的扫描方案的代码扫描配置",children:[]},{level:2,title:"更新指定代码库的指定方案的代码扫描配置",slug:"更新指定代码库的指定方案的代码扫描配置",link:"#更新指定代码库的指定方案的代码扫描配置",children:[]},{level:2,title:"查看指定代码库的扫描方案的代码度量配置",slug:"查看指定代码库的扫描方案的代码度量配置",link:"#查看指定代码库的扫描方案的代码度量配置",children:[]},{level:2,title:"更新指定代码库的指定方案的代码度量配置",slug:"更新指定代码库的指定方案的代码度量配置",link:"#更新指定代码库的指定方案的代码度量配置",children:[]},{level:2,title:"查看指定代码库的扫描方案的过滤路径列表",slug:"查看指定代码库的扫描方案的过滤路径列表",link:"#查看指定代码库的扫描方案的过滤路径列表",children:[]},{level:2,title:"创建指定代码库的指定方案的过滤路径列表",slug:"创建指定代码库的指定方案的过滤路径列表",link:"#创建指定代码库的指定方案的过滤路径列表",children:[]},{level:2,title:"查看指定代码库的扫描方案的指定过滤路径",slug:"查看指定代码库的扫描方案的指定过滤路径",link:"#查看指定代码库的扫描方案的指定过滤路径",children:[]},{level:2,title:"更新指定代码库的指定方案的指定过滤路径",slug:"更新指定代码库的指定方案的指定过滤路径",link:"#更新指定代码库的指定方案的指定过滤路径",children:[]},{level:2,title:"删除指定代码库的指定方案的指定过滤路径",slug:"删除指定代码库的指定方案的指定过滤路径",link:"#删除指定代码库的指定方案的指定过滤路径",children:[]}],path:"/zh/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",pathLocale:"/",extraFields:[]},{title:"更新日志",headers:[{level:2,title:"V1.4.1 (2022-7-28)",slug:"v1-4-1-2022-7-28",link:"#v1-4-1-2022-7-28",children:[{level:3,title:"Features",slug:"features",link:"#features",children:[]},{level:3,title:"Docs",slug:"docs",link:"#docs",children:[]}]},{level:2,title:"V1.4.0 (2022-7-18)",slug:"v1-4-0-2022-7-18",link:"#v1-4-0-2022-7-18",children:[{level:3,title:"Features",slug:"features-1",link:"#features-1",children:[]},{level:3,title:"Docs",slug:"docs-1",link:"#docs-1",children:[]}]},{level:2,title:"V1.3.3 (2022-6-29)",slug:"v1-3-3-2022-6-29",link:"#v1-3-3-2022-6-29",children:[{level:3,title:"Features",slug:"features-2",link:"#features-2",children:[]},{level:3,title:"Bugfixes",slug:"bugfixes",link:"#bugfixes",children:[]},{level:3,title:"Docs",slug:"docs-2",link:"#docs-2",children:[]}]},{level:2,title:"V1.3.2 (2022-6-16)",slug:"v1-3-2-2022-6-16",link:"#v1-3-2-2022-6-16",children:[{level:3,title:"Features",slug:"features-3",link:"#features-3",children:[]},{level:3,title:"Docs",slug:"docs-3",link:"#docs-3",children:[]}]},{level:2,title:"V1.3.1 (2022-6-14)",slug:"v1-3-1-2022-6-14",link:"#v1-3-1-2022-6-14",children:[{level:3,title:"Features",slug:"features-4",link:"#features-4",children:[]}]},{level:2,title:"V1.3.0 (2022-6-7)",slug:"v1-3-0-2022-6-7",link:"#v1-3-0-2022-6-7",children:[{level:3,title:"Features",slug:"features-5",link:"#features-5",children:[]},{level:3,title:"Bugfixes",slug:"bugfixes-1",link:"#bugfixes-1",children:[]},{level:3,title:"Docs",slug:"docs-4",link:"#docs-4",children:[]}]},{level:2,title:"V1.2.1 (2022-5-24)",slug:"v1-2-1-2022-5-24",link:"#v1-2-1-2022-5-24",children:[{level:3,title:"Features",slug:"features-6",link:"#features-6",children:[]},{level:3,title:"Docs",slug:"docs-5",link:"#docs-5",children:[]}]},{level:2,title:"V1.2.0 (2022-4-27)",slug:"v1-2-0-2022-4-27",link:"#v1-2-0-2022-4-27",children:[{level:3,title:"Features",slug:"features-7",link:"#features-7",children:[]},{level:3,title:"Docs",slug:"docs-6",link:"#docs-6",children:[]}]},{level:2,title:"V1.1.3 (2022-4-18)",slug:"v1-1-3-2022-4-18",link:"#v1-1-3-2022-4-18",children:[{level:3,title:"Features",slug:"features-8",link:"#features-8",children:[]},{level:3,title:"Docs",slug:"docs-7",link:"#docs-7",children:[]}]},{level:2,title:"V1.1.2 (2022-4-2)",slug:"v1-1-2-2022-4-2",link:"#v1-1-2-2022-4-2",children:[{level:3,title:"Features",slug:"features-9",link:"#features-9",children:[]},{level:3,title:"Docs",slug:"docs-8",link:"#docs-8",children:[]}]},{level:2,title:"V1.1.1 (2022-3-31)",slug:"v1-1-1-2022-3-31",link:"#v1-1-1-2022-3-31",children:[{level:3,title:"Features",slug:"features-10",link:"#features-10",children:[]},{level:3,title:"Docs",slug:"docs-9",link:"#docs-9",children:[]}]},{level:2,title:"V1.1.0 (2022-3-29)",slug:"v1-1-0-2022-3-29",link:"#v1-1-0-2022-3-29",children:[{level:3,title:"Features",slug:"features-11",link:"#features-11",children:[]},{level:3,title:"Bugfixes",slug:"bugfixes-2",link:"#bugfixes-2",children:[]},{level:3,title:"Docs",slug:"docs-10",link:"#docs-10",children:[]}]},{level:2,title:"V1.0.1 (2022-03-01)",slug:"v1-0-1-2022-03-01",link:"#v1-0-1-2022-03-01",children:[{level:3,title:"Features",slug:"features-12",link:"#features-12",children:[]},{level:3,title:"Bugfixes",slug:"bugfixes-3",link:"#bugfixes-3",children:[]},{level:3,title:"Docs",slug:"docs-11",link:"#docs-11",children:[]}]},{level:2,title:"V1.0.0",slug:"v1-0-0",link:"#v1-0-0",children:[]}],path:"/zh/community/changelog.html",pathLocale:"/",extraFields:[]},{title:"贡献指南",headers:[{level:2,title:"报告问题",slug:"报告问题",link:"#报告问题",children:[{level:3,title:"搜索已知issue",slug:"搜索已知issue",link:"#搜索已知issue",children:[]},{level:3,title:"报告新issue",slug:"报告新issue",link:"#报告新issue",children:[]}]},{level:2,title:"Pull Request",slug:"pull-request",link:"#pull-request",children:[{level:3,title:"分支管理",slug:"分支管理",link:"#分支管理",children:[]},{level:3,title:"提交Pull Request",slug:"提交pull-request",link:"#提交pull-request",children:[]}]},{level:2,title:"许可",slug:"许可",link:"#许可",children:[]}],path:"/zh/community/contribute.html",pathLocale:"/",extraFields:[]},{title:"加入社区",headers:[],path:"/zh/community/joingroup.html",pathLocale:"/",extraFields:[]},{title:"PR操作流程",headers:[{level:2,title:"一、Fork目标代码库",slug:"一、fork目标代码库",link:"#一、fork目标代码库",children:[]},{level:2,title:"二、克隆Fork的代码库并创建分支",slug:"二、克隆fork的代码库并创建分支",link:"#二、克隆fork的代码库并创建分支",children:[]},{level:2,title:"三、在目标项目中提交PR",slug:"三、在目标项目中提交pr",link:"#三、在目标项目中提交pr",children:[{level:3,title:"1.进入到目标项目中,点击Pull requests Tab,再点击New pull request就会进入到创建PR的页面",slug:"_1-进入到目标项目中-点击pull-requests-tab-再点击new-pull-request就会进入到创建pr的页面",link:"#_1-进入到目标项目中-点击pull-requests-tab-再点击new-pull-request就会进入到创建pr的页面",children:[]},{level:3,title:"2.进入PR页面后",slug:"_2-进入pr页面后",link:"#_2-进入pr页面后",children:[]}]},{level:2,title:"更多信息请参阅GitHub PullRequest官方文档",slug:"更多信息请参阅github-pullrequest官方文档",link:"#更多信息请参阅github-pullrequest官方文档",children:[]},{level:2,title:"TCA团队诚邀您的加入",slug:"tca团队诚邀您的加入",link:"#tca团队诚邀您的加入",children:[]}],path:"/zh/community/pr.html",pathLocale:"/",extraFields:[]},{title:"腾讯云代码分析",headers:[{level:2,title:"主要功能",slug:"主要功能",link:"#主要功能",children:[{level:3,title:"代码检查",slug:"代码检查",link:"#代码检查",children:[]},{level:3,title:"代码度量",slug:"代码度量",link:"#代码度量",children:[]},{level:3,title:"代码圈复杂度",slug:"代码圈复杂度",link:"#代码圈复杂度",children:[]},{level:3,title:"代码重复率",slug:"代码重复率",link:"#代码重复率",children:[]},{level:3,title:"代码统计",slug:"代码统计",link:"#代码统计",children:[]}]}],path:"/zh/guide/",pathLocale:"/",extraFields:[]},{title:"FAQ",headers:[{level:2,title:"Server常见问题与处理方法",slug:"server常见问题与处理方法",link:"#server常见问题与处理方法",children:[{level:3,title:"1. 环境部署",slug:"_1-环境部署",link:"#_1-环境部署",children:[]},{level:3,title:"2. 服务启动与初始化",slug:"_2-服务启动与初始化",link:"#_2-服务启动与初始化",children:[]},{level:3,title:"3. 平台使用",slug:"_3-平台使用",link:"#_3-平台使用",children:[]}]},{level:2,title:"CodeAnalysis仓库文件问题",slug:"codeanalysis仓库文件问题",link:"#codeanalysis仓库文件问题",children:[{level:3,title:"1. clone到本地时相关md文件内资源图片无法显示",slug:"_1-clone到本地时相关md文件内资源图片无法显示",link:"#_1-clone到本地时相关md文件内资源图片无法显示",children:[]}]}],path:"/zh/quickStarted/FAQ.html",pathLocale:"/",extraFields:[]},{title:"腾讯云代码分析介绍",headers:[],path:"/zh/quickStarted/",pathLocale:"/",extraFields:[]},{title:"源代码快速部署",headers:[],path:"/zh/quickStarted/codeDeploy.html",pathLocale:"/",extraFields:[]},{title:"部署与配置客户端",headers:[{level:2,title:"通过源代码",slug:"通过源代码",link:"#通过源代码",children:[{level:3,title:"依赖环境",slug:"依赖环境",link:"#依赖环境",children:[]},{level:3,title:"使用步骤",slug:"使用步骤",link:"#使用步骤",children:[]}]},{level:2,title:"通过Docker-Compose",slug:"通过docker-compose",link:"#通过docker-compose",children:[{level:3,title:"使用步骤",slug:"使用步骤-1",link:"#使用步骤-1",children:[]}]},{level:2,title:"通过可执行文件",slug:"通过可执行文件",link:"#通过可执行文件",children:[{level:3,title:"依赖环境",slug:"依赖环境-1",link:"#依赖环境-1",children:[]},{level:3,title:"使用步骤",slug:"使用步骤-2",link:"#使用步骤-2",children:[]}]}],path:"/zh/quickStarted/deployClient.html",pathLocale:"/",extraFields:[]},{title:"部署 TCA",headers:[{level:2,title:"Docker快速部署",slug:"docker快速部署",link:"#docker快速部署",children:[{level:3,title:"依赖环境",slug:"依赖环境",link:"#依赖环境",children:[]},{level:3,title:"部署对象",slug:"部署对象",link:"#部署对象",children:[]},{level:3,title:"操作说明",slug:"操作说明",link:"#操作说明",children:[]}]},{level:2,title:"进入平台页面",slug:"进入平台页面",link:"#进入平台页面",children:[]},{level:2,title:"创建团队及项目",slug:"创建团队及项目",link:"#创建团队及项目",children:[]},{level:2,title:"登记代码库",slug:"登记代码库",link:"#登记代码库",children:[]},{level:2,title:"创建分析项目",slug:"创建分析项目",link:"#创建分析项目",children:[{level:3,title:"分析方案说明",slug:"分析方案说明",link:"#分析方案说明",children:[]}]},{level:2,title:"执行代码分析",slug:"执行代码分析",link:"#执行代码分析",children:[]},{level:2,title:"查看分析历史",slug:"查看分析历史",link:"#查看分析历史",children:[]},{level:2,title:"查看分析概览",slug:"查看分析概览",link:"#查看分析概览",children:[]}],path:"/zh/quickStarted/deploySever.html",pathLocale:"/",extraFields:[]},{title:"Docker快速部署(平台体验首推)",headers:[],path:"/zh/quickStarted/dockerDeploy.html",pathLocale:"/",extraFields:[]},{title:"Docker-Compose快速部署",headers:[],path:"/zh/quickStarted/dockercomposeDeploy.html",pathLocale:"/",extraFields:[]},{title:"增强分析模块部署",headers:[{level:2,title:"概念",slug:"概念",link:"#概念",children:[]},{level:2,title:"模块功能",slug:"模块功能",link:"#模块功能",children:[]},{level:2,title:"TCA 官网版增强能力申请",slug:"tca-官网版增强能力申请",link:"#tca-官网版增强能力申请",children:[]},{level:2,title:"TCA 私有化部署增强能力申请",slug:"tca-私有化部署增强能力申请",link:"#tca-私有化部署增强能力申请",children:[{level:3,title:"准备",slug:"准备",link:"#准备",children:[]},{level:3,title:"步骤",slug:"步骤",link:"#步骤",children:[]},{level:3,title:"CLS 运维",slug:"cls-运维",link:"#cls-运维",children:[]}]}],path:"/zh/quickStarted/enhanceDeploy.html",pathLocale:"/",extraFields:[]},{title:"创建代码分析项目",headers:[{level:2,title:"进入平台页面",slug:"进入平台页面",link:"#进入平台页面",children:[]},{level:2,title:"创建团队及项目",slug:"创建团队及项目",link:"#创建团队及项目",children:[]},{level:2,title:"登记代码库",slug:"登记代码库",link:"#登记代码库",children:[]},{level:2,title:"创建分析项目",slug:"创建分析项目",link:"#创建分析项目",children:[{level:3,title:"分析方案说明",slug:"分析方案说明",link:"#分析方案说明",children:[]}]}],path:"/zh/quickStarted/initRepo.html",pathLocale:"/",extraFields:[]},{title:"平台概述",headers:[{level:3,title:"使用TCA Action快速体验",slug:"使用tca-action快速体验",link:"#使用tca-action快速体验",children:[]},{level:3,title:"部署TCA",slug:"部署tca",link:"#部署tca",children:[]},{level:3,title:"创建首个代码分析项目",slug:"创建首个代码分析项目",link:"#创建首个代码分析项目",children:[]},{level:3,title:"快速扩展客户端",slug:"快速扩展客户端",link:"#快速扩展客户端",children:[]},{level:3,title:"了解更多",slug:"了解更多",link:"#了解更多",children:[]}],path:"/zh/quickStarted/intro.html",pathLocale:"/",extraFields:[]},{title:"启动代码分析",headers:[{level:2,title:"执行代码分析",slug:"执行代码分析",link:"#执行代码分析",children:[]},{level:2,title:"查看分析历史",slug:"查看分析历史",link:"#查看分析历史",children:[]},{level:2,title:"查看分析概览",slug:"查看分析概览",link:"#查看分析概览",children:[]}],path:"/zh/quickStarted/runProject.html",pathLocale:"/",extraFields:[]},{title:"VM 部署文档",headers:[{level:2,title:"前置条件",slug:"前置条件",link:"#前置条件",children:[]},{level:2,title:"部署步骤",slug:"部署步骤",link:"#部署步骤",children:[]}],path:"/en/guide/web/deploySource.html",pathLocale:"/en",extraFields:[]},{title:"TCA Web",headers:[{level:2,title:"工程结构",slug:"工程结构",link:"#工程结构",children:[{level:3,title:"packages 目录说明",slug:"packages-目录说明",link:"#packages-目录说明",children:[]}]},{level:2,title:"基于构建后资源部署(tca-deploy-source)",slug:"基于构建后资源部署-tca-deploy-source",link:"#基于构建后资源部署-tca-deploy-source",children:[]},{level:2,title:"基于开发模式启动",slug:"基于开发模式启动",link:"#基于开发模式启动",children:[]},{level:2,title:"本地开发后构建部署",slug:"本地开发后构建部署",link:"#本地开发后构建部署",children:[]}],path:"/en/guide/web/web.html",pathLocale:"/en",extraFields:[]},{title:"代码检查结果查看",headers:[{level:2,title:"问题列表",slug:"问题列表",link:"#问题列表",children:[]},{level:2,title:"问题详情",slug:"问题详情",link:"#问题详情",children:[]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html",pathLocale:"/en",extraFields:[]},{title:"添加规则配置",headers:[],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html",pathLocale:"/en",extraFields:[]},{title:"代码度量配置",headers:[{level:2,title:"圈复杂度",slug:"圈复杂度",link:"#圈复杂度",children:[]},{level:2,title:"重复代码",slug:"重复代码",link:"#重复代码",children:[]},{level:2,title:"代码统计",slug:"代码统计",link:"#代码统计",children:[]}],path:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE.html",pathLocale:"/en",extraFields:[]},{title:"代码检查-编译配置",headers:[{level:2,title:"编译所需环境说明(重要)",slug:"编译所需环境说明-重要",link:"#编译所需环境说明-重要",children:[]},{level:2,title:"编译配置字段说明",slug:"编译配置字段说明",link:"#编译配置字段说明",children:[]},{level:2,title:"编译配置示例",slug:"编译配置示例",link:"#编译配置示例",children:[{level:3,title:"JAVA 项目",slug:"java-项目",link:"#java-项目",children:[]},{level:3,title:"Object-C 项目",slug:"object-c-项目",link:"#object-c-项目",children:[]},{level:3,title:"C/C++ 项目",slug:"c-c-项目",link:"#c-c-项目",children:[]},{level:3,title:"C# 项目",slug:"c-项目",link:"#c-项目",children:[]}]}],path:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE.html",pathLocale:"/en",extraFields:[]},{title:"代码检查-规则配置",headers:[{level:2,title:"在规则配置中,如何添加规则?",slug:"在规则配置中-如何添加规则",link:"#在规则配置中-如何添加规则",children:[]},{level:2,title:"在规则配置中,如果将官方规则包中的规则进行调整?",slug:"在规则配置中-如果将官方规则包中的规则进行调整",link:"#在规则配置中-如果将官方规则包中的规则进行调整",children:[]}],path:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html",pathLocale:"/en",extraFields:[]},{title:"代码检查配置",headers:[{level:2,title:"规则配置",slug:"规则配置",link:"#规则配置",children:[]},{level:2,title:"编译配置",slug:"编译配置",link:"#编译配置",children:[]}],path:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE.html",pathLocale:"/en",extraFields:[]},{title:"分析方案模版",headers:[{level:2,title:"使用说明",slug:"使用说明",link:"#使用说明",children:[]}],path:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E.html",pathLocale:"/en",extraFields:[]},{title:"基础属性配置",headers:[],path:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html",pathLocale:"/en",extraFields:[]},{title:"过滤配置",headers:[{level:2,title:"路径过滤",slug:"路径过滤",link:"#路径过滤",children:[]},{level:2,title:"问题过滤",slug:"问题过滤",link:"#问题过滤",children:[]}],path:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE.html",pathLocale:"/en",extraFields:[]},{title:"OAuth管理",headers:[],path:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"分析记录管理",headers:[],path:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"团队管理",headers:[],path:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"工具管理",headers:[],path:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"用户管理",headers:[],path:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"节点管理",headers:[],path:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"项目管理",headers:[],path:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"团队说明",headers:[{level:2,title:"层级关系",slug:"层级关系",link:"#层级关系",children:[]},{level:2,title:"权限控制",slug:"权限控制",link:"#权限控制",children:[]},{level:2,title:"邀请团队成员",slug:"邀请团队成员",link:"#邀请团队成员",children:[]}],path:"/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"成员权限",headers:[{level:2,title:"团队成员",slug:"团队成员",link:"#团队成员",children:[]},{level:2,title:"项目成员",slug:"项目成员",link:"#项目成员",children:[]}],path:"/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.html",pathLocale:"/en",extraFields:[]},{title:"团队节点与标签",headers:[{level:2,title:"适用场景",slug:"适用场景",link:"#适用场景",children:[]},{level:2,title:"团队节点注册",slug:"团队节点注册",link:"#团队节点注册",children:[]},{level:2,title:"团队节点管理",slug:"团队节点管理",link:"#团队节点管理",children:[]},{level:2,title:"使用团队标签",slug:"使用团队标签",link:"#使用团队标签",children:[]}],path:"/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html",pathLocale:"/en",extraFields:[]},{title:"其他配置与用法",headers:[{level:3,title:"1. 配置使用本地工具",slug:"_1-配置使用本地工具",link:"#_1-配置使用本地工具",children:[]},{level:3,title:"2. 使用自建git server存放工具",slug:"_2-使用自建git-server存放工具",link:"#_2-使用自建git-server存放工具",children:[]},{level:3,title:"3. git lfs带宽和存储配额不够问题",slug:"_3-git-lfs带宽和存储配额不够问题",link:"#_3-git-lfs带宽和存储配额不够问题",children:[]}],path:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.html",pathLocale:"/en",extraFields:[]},{title:"常驻节点分析",headers:[{level:2,title:"使用场景",slug:"使用场景",link:"#使用场景",children:[]},{level:2,title:"前置步骤",slug:"前置步骤",link:"#前置步骤",children:[]},{level:2,title:"节点配置",slug:"节点配置",link:"#节点配置",children:[{level:3,title:"配置 config.ini 文件",slug:"配置-config-ini-文件",link:"#配置-config-ini-文件",children:[]},{level:3,title:"启动常驻节点",slug:"启动常驻节点",link:"#启动常驻节点",children:[]},{level:3,title:"管理节点",slug:"管理节点",link:"#管理节点",children:[]}]}],path:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html",pathLocale:"/en",extraFields:[]},{title:"快速扫描模式",headers:[{level:2,title:"使用场景",slug:"使用场景",link:"#使用场景",children:[]},{level:2,title:"使用步骤",slug:"使用步骤",link:"#使用步骤",children:[{level:3,title:"1. 在页面上创建分析方案模板",slug:"_1-在页面上创建分析方案模板",link:"#_1-在页面上创建分析方案模板",children:[]},{level:3,title:"2. 初始化扫描需要的工具",slug:"_2-初始化扫描需要的工具",link:"#_2-初始化扫描需要的工具",children:[]},{level:3,title:"3. 执行快速扫描",slug:"_3-执行快速扫描",link:"#_3-执行快速扫描",children:[]}]}],path:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F.html",pathLocale:"/en",extraFields:[]},{title:"客户端本地分析",headers:[{level:2,title:"使用场景",slug:"使用场景",link:"#使用场景",children:[]},{level:2,title:"前置步骤",slug:"前置步骤",link:"#前置步骤",children:[]},{level:2,title:"分析配置",slug:"分析配置",link:"#分析配置",children:[{level:3,title:"配置客户端 config.ini 文件",slug:"配置客户端-config-ini-文件",link:"#配置客户端-config-ini-文件",children:[]},{level:3,title:"配置客户端 codedog.ini 文件",slug:"配置客户端-codedog-ini-文件",link:"#配置客户端-codedog-ini-文件",children:[]}]},{level:2,title:"启动代码分析",slug:"启动代码分析",link:"#启动代码分析",children:[{level:3,title:"客户端源码下启动分析",slug:"客户端源码下启动分析",link:"#客户端源码下启动分析",children:[]},{level:3,title:"客户端二进制启动分析",slug:"客户端二进制启动分析",link:"#客户端二进制启动分析",children:[]},{level:3,title:"docker下启动分析",slug:"docker下启动分析",link:"#docker下启动分析",children:[]}]}],path:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html",pathLocale:"/en",extraFields:[]},{title:"TCA Client",headers:[{level:2,title:"一、基础配置",slug:"一、基础配置",link:"#一、基础配置",children:[{level:3,title:"1. 机器配置推荐",slug:"_1-机器配置推荐",link:"#_1-机器配置推荐",children:[]},{level:3,title:"2. 配置client/config.ini文件",slug:"_2-配置client-config-ini文件",link:"#_2-配置client-config-ini文件",children:[]},{level:3,title:"3. 配置client/codedog.ini文件(分布式节点模式无需配置)",slug:"_3-配置client-codedog-ini文件-分布式节点模式无需配置",link:"#_3-配置client-codedog-ini文件-分布式节点模式无需配置",children:[]}]},{level:2,title:"二、使用docker环境快速体验",slug:"二、使用docker环境快速体验",link:"#二、使用docker环境快速体验",children:[{level:3,title:"1. 下载和安装Docker",slug:"_1-下载和安装docker",link:"#_1-下载和安装docker",children:[]},{level:3,title:"2. 构建docker镜像",slug:"_2-构建docker镜像",link:"#_2-构建docker镜像",children:[]},{level:3,title:"3. 执行docker容器,扫描代码,可选以下两种方式",slug:"_3-执行docker容器-扫描代码-可选以下两种方式",link:"#_3-执行docker容器-扫描代码-可选以下两种方式",children:[]}]},{level:2,title:"三、使用本地机器环境运行",slug:"三、使用本地机器环境运行",link:"#三、使用本地机器环境运行",children:[{level:3,title:"1. 安装Python环境和第三方库",slug:"_1-安装python环境和第三方库",link:"#_1-安装python环境和第三方库",children:[]},{level:3,title:"2. 安装第三方工具",slug:"_2-安装第三方工具",link:"#_2-安装第三方工具",children:[]},{level:3,title:"3. 启动代码分析",slug:"_3-启动代码分析",link:"#_3-启动代码分析",children:[]}]},{level:2,title:"四、使用分布式节点模式执行客户端",slug:"四、使用分布式节点模式执行客户端",link:"#四、使用分布式节点模式执行客户端",children:[{level:3,title:"1. 安装Python环境和第三方库",slug:"_1-安装python环境和第三方库-1",link:"#_1-安装python环境和第三方库-1",children:[]},{level:3,title:"2. 安装第三方工具",slug:"_2-安装第三方工具-1",link:"#_2-安装第三方工具-1",children:[]},{level:3,title:"3. 启动代码分析节点",slug:"_3-启动代码分析节点",link:"#_3-启动代码分析节点",children:[]},{level:3,title:"4. 配置节点",slug:"_4-配置节点",link:"#_4-配置节点",children:[]}]},{level:2,title:"五、其他配置与用法",slug:"五、其他配置与用法",link:"#五、其他配置与用法",children:[{level:3,title:"1. 配置使用本地工具",slug:"_1-配置使用本地工具",link:"#_1-配置使用本地工具",children:[]},{level:3,title:"2. 使用自建git server存放工具",slug:"_2-使用自建git-server存放工具",link:"#_2-使用自建git-server存放工具",children:[]},{level:3,title:"3. git lfs带宽和存储配额不够问题",slug:"_3-git-lfs带宽和存储配额不够问题",link:"#_3-git-lfs带宽和存储配额不够问题",children:[]}]}],path:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.html",pathLocale:"/en",extraFields:[]},{title:"工具列表",headers:[],path:"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8.html",pathLocale:"/en",extraFields:[]},{title:"工具管理说明",headers:[{level:2,title:"自定义工具",slug:"自定义工具",link:"#自定义工具",children:[{level:3,title:"工具白名单",slug:"工具白名单",link:"#工具白名单",children:[]}]},{level:2,title:"使用场景说明",slug:"使用场景说明",link:"#使用场景说明",children:[{level:3,title:"场景 1",slug:"场景-1",link:"#场景-1",children:[]},{level:3,title:"场景 2",slug:"场景-2",link:"#场景-2",children:[]}]}],path:"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E.html",pathLocale:"/en",extraFields:[]},{title:"自定义工具",headers:[{level:2,title:"自定义工具步骤说明",slug:"自定义工具步骤说明",link:"#自定义工具步骤说明",children:[{level:3,title:"第一步,编写代码,实现分析工具逻辑",slug:"第一步-编写代码-实现分析工具逻辑",link:"#第一步-编写代码-实现分析工具逻辑",children:[]},{level:3,title:"第二步,提交工具到 git 代码库",slug:"第二步-提交工具到-git-代码库",link:"#第二步-提交工具到-git-代码库",children:[]},{level:3,title:"第三步,在工具管理页面中创建工具",slug:"第三步-在工具管理页面中创建工具",link:"#第三步-在工具管理页面中创建工具",children:[]},{level:3,title:"第四步,为工具添加规则",slug:"第四步-为工具添加规则",link:"#第四步-为工具添加规则",children:[]},{level:3,title:"第五步,将工具配置到执行节点",slug:"第五步-将工具配置到执行节点",link:"#第五步-将工具配置到执行节点",children:[]},{level:3,title:"第六步,完成上述操作,在项目中使用工具规则",slug:"第六步-完成上述操作-在项目中使用工具规则",link:"#第六步-完成上述操作-在项目中使用工具规则",children:[]}]},{level:2,title:"自定义工具权限说明",slug:"自定义工具权限说明",link:"#自定义工具权限说明",children:[]}],path:"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7.html",pathLocale:"/en",extraFields:[]},{title:"自定义规则",headers:[{level:2,title:"自定义规则权限说明",slug:"自定义规则权限说明",link:"#自定义规则权限说明",children:[]},{level:2,title:"平台提供的正则工具 TCA-Armory-R 说明",slug:"平台提供的正则工具-tca-armory-r-说明",link:"#平台提供的正则工具-tca-armory-r-说明",children:[]},{level:2,title:"平台提供的正则工具 RegexScan 说明",slug:"平台提供的正则工具-regexscan-说明",link:"#平台提供的正则工具-regexscan-说明",children:[{level:3,title:"自定义规则步骤",slug:"自定义规则步骤",link:"#自定义规则步骤",children:[]}]}],path:"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.html",pathLocale:"/en",extraFields:[]},{title:"Quick start a code analysis",headers:[{level:2,title:"Create teams and projects",slug:"create-teams-and-projects",link:"#create-teams-and-projects",children:[]},{level:2,title:"Register your repository",slug:"register-your-repository",link:"#register-your-repository",children:[]},{level:2,title:"Start code analysis",slug:"start-code-analysis",link:"#start-code-analysis",children:[{level:3,title:"Initialization",slug:"initialization",link:"#initialization",children:[]},{level:3,title:"Run a code analysis",slug:"run-a-code-analysis",link:"#run-a-code-analysis",children:[]}]},{level:2,title:"Analysis history",slug:"analysis-history",link:"#analysis-history",children:[]},{level:2,title:"Analysis overview",slug:"analysis-overview",link:"#analysis-overview",children:[]}],path:"/en/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html",pathLocale:"/en",extraFields:[]},{title:"Jenkins插件使用说明",headers:[{level:2,title:"使用前准备",slug:"使用前准备",link:"#使用前准备",children:[{level:3,title:"获取Jenkins插件",slug:"获取jenkins插件",link:"#获取jenkins插件",children:[]},{level:3,title:"在Jenkins安装插件",slug:"在jenkins安装插件",link:"#在jenkins安装插件",children:[]},{level:3,title:"完善启动客户端的环境",slug:"完善启动客户端的环境",link:"#完善启动客户端的环境",children:[]}]},{level:2,title:"使用插件",slug:"使用插件",link:"#使用插件",children:[{level:3,title:"在 TCA 创建团队和项目",slug:"在-tca-创建团队和项目",link:"#在-tca-创建团队和项目",children:[]},{level:3,title:"配置Jenkins环境变量",slug:"配置jenkins环境变量",link:"#配置jenkins环境变量",children:[]},{level:3,title:"配置 TCA 插件",slug:"配置-tca-插件",link:"#配置-tca-插件",children:[]},{level:3,title:"启动构建并查看结果",slug:"启动构建并查看结果",link:"#启动构建并查看结果",children:[]}]},{level:2,title:"设置质量门禁",slug:"设置质量门禁",link:"#设置质量门禁",children:[{level:3,title:"可视化界面使用质量门禁",slug:"可视化界面使用质量门禁",link:"#可视化界面使用质量门禁",children:[]},{level:3,title:"pipeline脚本使用质量门禁",slug:"pipeline脚本使用质量门禁",link:"#pipeline脚本使用质量门禁",children:[]}]}],path:"/en/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin.html",pathLocale:"/en",extraFields:[]},{title:"基于MinIO部署文件服务器",headers:[{level:2,title:"本地部署",slug:"本地部署",link:"#本地部署",children:[{level:3,title:"前置步骤",slug:"前置步骤",link:"#前置步骤",children:[]},{level:3,title:"配置步骤",slug:"配置步骤",link:"#配置步骤",children:[]},{level:3,title:"结尾",slug:"结尾",link:"#结尾",children:[]}]}],path:"/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio.html",pathLocale:"/en",extraFields:[]},{title:"",headers:[],path:"/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate.html",pathLocale:"/en",extraFields:[]},{title:"TCA Server",headers:[{level:2,title:"工程结构",slug:"工程结构",link:"#工程结构",children:[]},{level:2,title:"配置说明",slug:"配置说明",link:"#配置说明",children:[{level:3,title:"Main服务",slug:"main服务",link:"#main服务",children:[]},{level:3,title:"Analysis服务",slug:"analysis服务",link:"#analysis服务",children:[]},{level:3,title:"Login服务",slug:"login服务",link:"#login服务",children:[]},{level:3,title:"File服务",slug:"file服务",link:"#file服务",children:[]},{level:3,title:"ScmProxy",slug:"scmproxy",link:"#scmproxy",children:[]}]}],path:"/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server.html",pathLocale:"/en",extraFields:[]},{title:"VM 部署文档",headers:[{level:2,title:"前置条件",slug:"前置条件",link:"#前置条件",children:[]},{level:2,title:"部署步骤",slug:"部署步骤",link:"#部署步骤",children:[]}],path:"/zh/guide/web/deploySource.html",pathLocale:"/",extraFields:[]},{title:"TCA Web",headers:[{level:2,title:"工程结构",slug:"工程结构",link:"#工程结构",children:[{level:3,title:"packages 目录说明",slug:"packages-目录说明",link:"#packages-目录说明",children:[]}]},{level:2,title:"基于构建后资源部署(tca-deploy-source)",slug:"基于构建后资源部署-tca-deploy-source",link:"#基于构建后资源部署-tca-deploy-source",children:[]},{level:2,title:"基于开发模式启动",slug:"基于开发模式启动",link:"#基于开发模式启动",children:[]},{level:2,title:"本地开发后构建部署",slug:"本地开发后构建部署",link:"#本地开发后构建部署",children:[]}],path:"/zh/guide/web/web.html",pathLocale:"/",extraFields:[]},{title:"个人令牌说明",headers:[],path:"/zh/guide/%E4%B8%AA%E4%BA%BA%E4%B8%AD%E5%BF%83/%E4%B8%AA%E4%BA%BA%E4%BB%A4%E7%89%8C.html",pathLocale:"/",extraFields:[]},{title:"代码检查结果查看",headers:[{level:2,title:"问题列表",slug:"问题列表",link:"#问题列表",children:[]},{level:2,title:"问题详情",slug:"问题详情",link:"#问题详情",children:[]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html",pathLocale:"/",extraFields:[]},{title:"添加规则配置",headers:[],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html",pathLocale:"/",extraFields:[]},{title:"代码度量配置",headers:[{level:2,title:"圈复杂度",slug:"圈复杂度",link:"#圈复杂度",children:[]},{level:2,title:"重复代码",slug:"重复代码",link:"#重复代码",children:[]},{level:2,title:"代码统计",slug:"代码统计",link:"#代码统计",children:[]}],path:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE.html",pathLocale:"/",extraFields:[]},{title:"代码检查-编译配置",headers:[{level:2,title:"编译所需环境说明(重要)",slug:"编译所需环境说明-重要",link:"#编译所需环境说明-重要",children:[]},{level:2,title:"编译配置字段说明",slug:"编译配置字段说明",link:"#编译配置字段说明",children:[]},{level:2,title:"编译配置示例",slug:"编译配置示例",link:"#编译配置示例",children:[{level:3,title:"JAVA 项目",slug:"java-项目",link:"#java-项目",children:[]},{level:3,title:"Object-C 项目",slug:"object-c-项目",link:"#object-c-项目",children:[]},{level:3,title:"C/C++ 项目",slug:"c-c-项目",link:"#c-c-项目",children:[]},{level:3,title:"C# 项目",slug:"c-项目",link:"#c-项目",children:[]}]}],path:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE.html",pathLocale:"/",extraFields:[]},{title:"代码检查-规则配置",headers:[{level:2,title:"在规则配置中,如何添加规则?",slug:"在规则配置中-如何添加规则",link:"#在规则配置中-如何添加规则",children:[]},{level:2,title:"在规则配置中,如果将官方规则包中的规则进行调整?",slug:"在规则配置中-如果将官方规则包中的规则进行调整",link:"#在规则配置中-如果将官方规则包中的规则进行调整",children:[]}],path:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html",pathLocale:"/",extraFields:[]},{title:"代码检查配置",headers:[{level:2,title:"规则配置",slug:"规则配置",link:"#规则配置",children:[]},{level:2,title:"编译配置",slug:"编译配置",link:"#编译配置",children:[]}],path:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE.html",pathLocale:"/",extraFields:[]},{title:"分析方案模版",headers:[{level:2,title:"使用说明",slug:"使用说明",link:"#使用说明",children:[]}],path:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E.html",pathLocale:"/",extraFields:[]},{title:"基础属性配置",headers:[],path:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html",pathLocale:"/",extraFields:[]},{title:"过滤配置",headers:[{level:2,title:"路径过滤",slug:"路径过滤",link:"#路径过滤",children:[]},{level:2,title:"问题过滤",slug:"问题过滤",link:"#问题过滤",children:[]}],path:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE.html",pathLocale:"/",extraFields:[]},{title:"OAuth管理",headers:[],path:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"分析记录管理",headers:[],path:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"团队管理",headers:[],path:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"工具管理",headers:[],path:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"用户管理",headers:[],path:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"节点管理",headers:[],path:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"项目管理",headers:[],path:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"团队说明",headers:[{level:2,title:"层级关系",slug:"层级关系",link:"#层级关系",children:[]},{level:2,title:"权限控制",slug:"权限控制",link:"#权限控制",children:[]},{level:2,title:"邀请团队成员",slug:"邀请团队成员",link:"#邀请团队成员",children:[]}],path:"/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"成员权限",headers:[{level:2,title:"团队成员",slug:"团队成员",link:"#团队成员",children:[]},{level:2,title:"项目成员",slug:"项目成员",link:"#项目成员",children:[]}],path:"/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.html",pathLocale:"/",extraFields:[]},{title:"团队节点与标签",headers:[{level:2,title:"适用场景",slug:"适用场景",link:"#适用场景",children:[]},{level:2,title:"团队节点注册",slug:"团队节点注册",link:"#团队节点注册",children:[]},{level:2,title:"团队节点管理",slug:"团队节点管理",link:"#团队节点管理",children:[]},{level:2,title:"使用团队标签",slug:"使用团队标签",link:"#使用团队标签",children:[]}],path:"/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html",pathLocale:"/",extraFields:[]},{title:"其他配置与用法",headers:[{level:3,title:"1. 配置使用本地工具",slug:"_1-配置使用本地工具",link:"#_1-配置使用本地工具",children:[]},{level:3,title:"2. 使用自建git server存放工具",slug:"_2-使用自建git-server存放工具",link:"#_2-使用自建git-server存放工具",children:[]},{level:3,title:"3. git lfs带宽和存储配额不够问题",slug:"_3-git-lfs带宽和存储配额不够问题",link:"#_3-git-lfs带宽和存储配额不够问题",children:[]}],path:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.html",pathLocale:"/",extraFields:[]},{title:"常驻节点分析",headers:[{level:2,title:"使用场景",slug:"使用场景",link:"#使用场景",children:[]},{level:2,title:"前置步骤",slug:"前置步骤",link:"#前置步骤",children:[]},{level:2,title:"节点配置",slug:"节点配置",link:"#节点配置",children:[{level:3,title:"配置 config.ini 文件",slug:"配置-config-ini-文件",link:"#配置-config-ini-文件",children:[]},{level:3,title:"启动常驻节点",slug:"启动常驻节点",link:"#启动常驻节点",children:[]},{level:3,title:"管理节点",slug:"管理节点",link:"#管理节点",children:[]}]}],path:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html",pathLocale:"/",extraFields:[]},{title:"快速扫描模式",headers:[{level:2,title:"使用场景",slug:"使用场景",link:"#使用场景",children:[]},{level:2,title:"使用步骤",slug:"使用步骤",link:"#使用步骤",children:[{level:3,title:"使用内置默认方案快速扫描",slug:"使用内置默认方案快速扫描",link:"#使用内置默认方案快速扫描",children:[]},{level:3,title:"2. 执行快速扫描",slug:"_2-执行快速扫描",link:"#_2-执行快速扫描",children:[]},{level:3,title:"使用自定义的分析方案快速扫描",slug:"使用自定义的分析方案快速扫描",link:"#使用自定义的分析方案快速扫描",children:[]},{level:3,title:"3. 执行快速扫描",slug:"_3-执行快速扫描",link:"#_3-执行快速扫描",children:[]}]}],path:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F.html",pathLocale:"/",extraFields:[]},{title:"客户端本地分析",headers:[{level:2,title:"使用场景",slug:"使用场景",link:"#使用场景",children:[]},{level:2,title:"前置步骤",slug:"前置步骤",link:"#前置步骤",children:[]},{level:2,title:"分析配置",slug:"分析配置",link:"#分析配置",children:[{level:3,title:"配置客户端 config.ini 文件",slug:"配置客户端-config-ini-文件",link:"#配置客户端-config-ini-文件",children:[]},{level:3,title:"配置客户端 codedog.ini 文件",slug:"配置客户端-codedog-ini-文件",link:"#配置客户端-codedog-ini-文件",children:[]}]},{level:2,title:"启动代码分析",slug:"启动代码分析",link:"#启动代码分析",children:[{level:3,title:"客户端源码下启动分析",slug:"客户端源码下启动分析",link:"#客户端源码下启动分析",children:[]},{level:3,title:"客户端二进制启动分析",slug:"客户端二进制启动分析",link:"#客户端二进制启动分析",children:[]},{level:3,title:"docker下启动分析",slug:"docker下启动分析",link:"#docker下启动分析",children:[]}]}],path:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html",pathLocale:"/",extraFields:[]},{title:"TCA Client",headers:[{level:2,title:"一、基础配置",slug:"一、基础配置",link:"#一、基础配置",children:[{level:3,title:"1. 机器配置推荐",slug:"_1-机器配置推荐",link:"#_1-机器配置推荐",children:[]},{level:3,title:"2. 配置client/config.ini文件",slug:"_2-配置client-config-ini文件",link:"#_2-配置client-config-ini文件",children:[]},{level:3,title:"3. 配置client/codedog.ini文件(分布式节点模式无需配置)",slug:"_3-配置client-codedog-ini文件-分布式节点模式无需配置",link:"#_3-配置client-codedog-ini文件-分布式节点模式无需配置",children:[]}]},{level:2,title:"二、使用docker环境快速体验",slug:"二、使用docker环境快速体验",link:"#二、使用docker环境快速体验",children:[{level:3,title:"1. 下载和安装Docker",slug:"_1-下载和安装docker",link:"#_1-下载和安装docker",children:[]},{level:3,title:"2. 构建docker镜像",slug:"_2-构建docker镜像",link:"#_2-构建docker镜像",children:[]},{level:3,title:"3. 执行docker容器,扫描代码,可选以下两种方式",slug:"_3-执行docker容器-扫描代码-可选以下两种方式",link:"#_3-执行docker容器-扫描代码-可选以下两种方式",children:[]}]},{level:2,title:"三、使用本地机器环境运行",slug:"三、使用本地机器环境运行",link:"#三、使用本地机器环境运行",children:[{level:3,title:"1. 安装Python环境和第三方库",slug:"_1-安装python环境和第三方库",link:"#_1-安装python环境和第三方库",children:[]},{level:3,title:"2. 安装第三方工具",slug:"_2-安装第三方工具",link:"#_2-安装第三方工具",children:[]},{level:3,title:"3. 启动代码分析",slug:"_3-启动代码分析",link:"#_3-启动代码分析",children:[]}]},{level:2,title:"四、使用分布式节点模式执行客户端",slug:"四、使用分布式节点模式执行客户端",link:"#四、使用分布式节点模式执行客户端",children:[{level:3,title:"1. 安装Python环境和第三方库",slug:"_1-安装python环境和第三方库-1",link:"#_1-安装python环境和第三方库-1",children:[]},{level:3,title:"2. 安装第三方工具",slug:"_2-安装第三方工具-1",link:"#_2-安装第三方工具-1",children:[]},{level:3,title:"3. 启动代码分析节点",slug:"_3-启动代码分析节点",link:"#_3-启动代码分析节点",children:[]},{level:3,title:"4. 配置节点",slug:"_4-配置节点",link:"#_4-配置节点",children:[]}]},{level:2,title:"五、其他配置与用法",slug:"五、其他配置与用法",link:"#五、其他配置与用法",children:[{level:3,title:"1. 配置使用本地工具",slug:"_1-配置使用本地工具",link:"#_1-配置使用本地工具",children:[]},{level:3,title:"2. 使用自建git server存放工具",slug:"_2-使用自建git-server存放工具",link:"#_2-使用自建git-server存放工具",children:[]},{level:3,title:"3. git lfs带宽和存储配额不够问题",slug:"_3-git-lfs带宽和存储配额不够问题",link:"#_3-git-lfs带宽和存储配额不够问题",children:[]}]}],path:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.html",pathLocale:"/",extraFields:[]},{title:"工具列表",headers:[],path:"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8.html",pathLocale:"/",extraFields:[]},{title:"工具管理说明",headers:[{level:2,title:"自定义工具",slug:"自定义工具",link:"#自定义工具",children:[{level:3,title:"工具白名单",slug:"工具白名单",link:"#工具白名单",children:[]}]},{level:2,title:"使用场景说明",slug:"使用场景说明",link:"#使用场景说明",children:[{level:3,title:"场景 1",slug:"场景-1",link:"#场景-1",children:[]},{level:3,title:"场景 2",slug:"场景-2",link:"#场景-2",children:[]}]}],path:"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E.html",pathLocale:"/",extraFields:[]},{title:"自定义工具",headers:[{level:2,title:"自定义工具步骤说明",slug:"自定义工具步骤说明",link:"#自定义工具步骤说明",children:[{level:3,title:"第一步,编写代码,实现分析工具逻辑",slug:"第一步-编写代码-实现分析工具逻辑",link:"#第一步-编写代码-实现分析工具逻辑",children:[]},{level:3,title:"第二步,提交工具到 git 代码库",slug:"第二步-提交工具到-git-代码库",link:"#第二步-提交工具到-git-代码库",children:[]},{level:3,title:"第三步,在工具管理页面中创建工具",slug:"第三步-在工具管理页面中创建工具",link:"#第三步-在工具管理页面中创建工具",children:[]},{level:3,title:"第四步,为工具添加规则",slug:"第四步-为工具添加规则",link:"#第四步-为工具添加规则",children:[]},{level:3,title:"第五步,将工具配置到执行节点",slug:"第五步-将工具配置到执行节点",link:"#第五步-将工具配置到执行节点",children:[]},{level:3,title:"第六步,完成上述操作,在项目中使用工具规则",slug:"第六步-完成上述操作-在项目中使用工具规则",link:"#第六步-完成上述操作-在项目中使用工具规则",children:[]}]},{level:2,title:"自定义工具权限说明",slug:"自定义工具权限说明",link:"#自定义工具权限说明",children:[]}],path:"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7.html",pathLocale:"/",extraFields:[]},{title:"自定义规则",headers:[{level:2,title:"自定义规则权限说明",slug:"自定义规则权限说明",link:"#自定义规则权限说明",children:[]},{level:2,title:"平台提供的正则工具 TCA-Armory-R 说明",slug:"平台提供的正则工具-tca-armory-r-说明",link:"#平台提供的正则工具-tca-armory-r-说明",children:[]},{level:2,title:"平台提供的正则工具 RegexScan 说明",slug:"平台提供的正则工具-regexscan-说明",link:"#平台提供的正则工具-regexscan-说明",children:[{level:3,title:"自定义规则步骤",slug:"自定义规则步骤",link:"#自定义规则步骤",children:[]}]}],path:"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.html",pathLocale:"/",extraFields:[]},{title:"快速启动一次代码分析",headers:[{level:2,title:"创建团队及项目",slug:"创建团队及项目",link:"#创建团队及项目",children:[]},{level:2,title:"登记代码库",slug:"登记代码库",link:"#登记代码库",children:[]},{level:2,title:"启动代码分析",slug:"启动代码分析",link:"#启动代码分析",children:[{level:3,title:"执行初始化创建",slug:"执行初始化创建",link:"#执行初始化创建",children:[]},{level:3,title:"执行代码分析",slug:"执行代码分析",link:"#执行代码分析",children:[]}]},{level:2,title:"查看分析历史",slug:"查看分析历史",link:"#查看分析历史",children:[]},{level:2,title:"查看分析概览",slug:"查看分析概览",link:"#查看分析概览",children:[]}],path:"/zh/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html",pathLocale:"/",extraFields:[]},{title:"Jenkins插件使用说明",headers:[{level:2,title:"使用前准备",slug:"使用前准备",link:"#使用前准备",children:[{level:3,title:"获取Jenkins插件",slug:"获取jenkins插件",link:"#获取jenkins插件",children:[]},{level:3,title:"在Jenkins安装插件",slug:"在jenkins安装插件",link:"#在jenkins安装插件",children:[]},{level:3,title:"完善启动客户端的环境",slug:"完善启动客户端的环境",link:"#完善启动客户端的环境",children:[]}]},{level:2,title:"使用插件",slug:"使用插件",link:"#使用插件",children:[{level:3,title:"在 TCA 创建团队和项目",slug:"在-tca-创建团队和项目",link:"#在-tca-创建团队和项目",children:[]},{level:3,title:"配置Jenkins环境变量",slug:"配置jenkins环境变量",link:"#配置jenkins环境变量",children:[]},{level:3,title:"配置 TCA 插件",slug:"配置-tca-插件",link:"#配置-tca-插件",children:[]},{level:3,title:"启动构建并查看结果",slug:"启动构建并查看结果",link:"#启动构建并查看结果",children:[]}]},{level:2,title:"设置质量门禁",slug:"设置质量门禁",link:"#设置质量门禁",children:[{level:3,title:"可视化界面使用质量门禁",slug:"可视化界面使用质量门禁",link:"#可视化界面使用质量门禁",children:[]},{level:3,title:"pipeline脚本使用质量门禁",slug:"pipeline脚本使用质量门禁",link:"#pipeline脚本使用质量门禁",children:[]}]}],path:"/zh/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin.html",pathLocale:"/",extraFields:[]},{title:"API调用脚本使用指引",headers:[{level:2,title:"操作步骤",slug:"操作步骤",link:"#操作步骤",children:[]},{level:2,title:"方法总览",slug:"方法总览",link:"#方法总览",children:[]},{level:2,title:"API详细信息",slug:"api详细信息",link:"#api详细信息",children:[{level:3,title:"一、创建代码库",slug:"一、创建代码库",link:"#一、创建代码库",children:[]},{level:3,title:"二、设置指定代码库的指定方案的代码度量配置",slug:"二、设置指定代码库的指定方案的代码度量配置",link:"#二、设置指定代码库的指定方案的代码度量配置",children:[]},{level:3,title:"三、创建分析项目",slug:"三、创建分析项目",link:"#三、创建分析项目",children:[]},{level:3,title:"四、启动任务",slug:"四、启动任务",link:"#四、启动任务",children:[]},{level:3,title:"五、轮询任务结果",slug:"五、轮询任务结果",link:"#五、轮询任务结果",children:[]},{level:3,title:"六、获取分析概览",slug:"六、获取分析概览",link:"#六、获取分析概览",children:[]},{level:3,title:"七、查看扫描问题列表",slug:"七、查看扫描问题列表",link:"#七、查看扫描问题列表",children:[]},{level:3,title:"八、查看问题详情",slug:"八、查看问题详情",link:"#八、查看问题详情",children:[]},{level:3,title:"九、查看指定项目的圈复杂度问题列表",slug:"九、查看指定项目的圈复杂度问题列表",link:"#九、查看指定项目的圈复杂度问题列表",children:[]},{level:3,title:"十、查看指定项目的重复文件列表",slug:"十、查看指定项目的重复文件列表",link:"#十、查看指定项目的重复文件列表",children:[]}]}],path:"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/ScriptAPI_guide.html",pathLocale:"/",extraFields:[]},{title:"基于MinIO部署文件服务器",headers:[{level:2,title:"本地部署",slug:"本地部署",link:"#本地部署",children:[{level:3,title:"前置步骤",slug:"前置步骤",link:"#前置步骤",children:[]},{level:3,title:"配置步骤",slug:"配置步骤",link:"#配置步骤",children:[]},{level:3,title:"结尾",slug:"结尾",link:"#结尾",children:[]}]}],path:"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio.html",pathLocale:"/",extraFields:[]},{title:"",headers:[],path:"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate.html",pathLocale:"/",extraFields:[]},{title:"私有化gitlab Oauth认证",headers:[{level:2,title:"一、操作步骤",slug:"一、操作步骤",link:"#一、操作步骤",children:[{level:3,title:"1、 本地gitlab 生成 application",slug:"_1、-本地gitlab-生成-application",link:"#_1、-本地gitlab-生成-application",children:[]},{level:3,title:"2、在项目配置文件中添加相关配置信息",slug:"_2、在项目配置文件中添加相关配置信息",link:"#_2、在项目配置文件中添加相关配置信息",children:[]},{level:3,title:"3、代码分析平台添加Oauth配置",slug:"_3、代码分析平台添加oauth配置",link:"#_3、代码分析平台添加oauth配置",children:[]}]},{level:2,title:"二、详细操作过程说明",slug:"二、详细操作过程说明",link:"#二、详细操作过程说明",children:[{level:3,title:"1、 本地gitlab 生成 application",slug:"_1、-本地gitlab-生成-application-1",link:"#_1、-本地gitlab-生成-application-1",children:[]},{level:3,title:"2、在项目配置文件中添加相关配置信息",slug:"_2、在项目配置文件中添加相关配置信息-1",link:"#_2、在项目配置文件中添加相关配置信息-1",children:[]},{level:3,title:"3、代码分析平台添加Oauth配置",slug:"_3、代码分析平台添加oauth配置-1",link:"#_3、代码分析平台添加oauth配置-1",children:[]}]},{level:2,title:"三、常见问题",slug:"三、常见问题",link:"#三、常见问题",children:[{level:3,title:"1、使用Oauth登录的方式,认证时跳转页面失败",slug:"_1、使用oauth登录的方式-认证时跳转页面失败",link:"#_1、使用oauth登录的方式-认证时跳转页面失败",children:[]},{level:3,title:"2、无法找到本地部署的服务对应的前端页面",slug:"_2、无法找到本地部署的服务对应的前端页面",link:"#_2、无法找到本地部署的服务对应的前端页面",children:[]},{level:3,title:"3、认证没有跳转到正确的页面,或直接跳回到代码分析平台登陆界面。",slug:"_3、认证没有跳转到正确的页面-或直接跳回到代码分析平台登陆界面。",link:"#_3、认证没有跳转到正确的页面-或直接跳回到代码分析平台登陆界面。",children:[]},{level:3,title:"4、OAuth授权失败",slug:"_4、oauth授权失败",link:"#_4、oauth授权失败",children:[]}]}],path:"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/gitlab_oauth_guide.html",pathLocale:"/",extraFields:[]},{title:"TCA Server",headers:[{level:2,title:"工程结构",slug:"工程结构",link:"#工程结构",children:[]},{level:2,title:"配置说明",slug:"配置说明",link:"#配置说明",children:[{level:3,title:"Main服务",slug:"main服务",link:"#main服务",children:[]},{level:3,title:"Analysis服务",slug:"analysis服务",link:"#analysis服务",children:[]},{level:3,title:"Login服务",slug:"login服务",link:"#login服务",children:[]},{level:3,title:"File服务",slug:"file服务",link:"#file服务",children:[]},{level:3,title:"ScmProxy",slug:"scmproxy",link:"#scmproxy",children:[]}]}],path:"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server.html",pathLocale:"/",extraFields:[]},{title:"Error Prone 使用手册",headers:[{level:2,title:"Error Prone 介绍",slug:"error-prone-介绍",link:"#error-prone-介绍",children:[]},{level:2,title:"TCA使用指引",slug:"tca使用指引",link:"#tca使用指引",children:[]},{level:2,title:"Error Prone 配置",slug:"error-prone-配置",link:"#error-prone-配置",children:[{level:3,title:"通过Bazel构建",slug:"通过bazel构建",link:"#通过bazel构建",children:[]},{level:3,title:"Maven 配置 Error Prone",slug:"maven-配置-error-prone",link:"#maven-配置-error-prone",children:[]},{level:3,title:"其他配置和注意事项",slug:"其他配置和注意事项",link:"#其他配置和注意事项",children:[]}]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone.html",pathLocale:"/en",extraFields:[]},{title:"TCA-Armory-C1 使用手册",headers:[{level:2,title:"功能",slug:"功能",link:"#功能",children:[]},{level:2,title:"准备",slug:"准备",link:"#准备",children:[]},{level:2,title:"规则介绍",slug:"规则介绍",link:"#规则介绍",children:[{level:3,title:"CmdInject",slug:"cmdinject",link:"#cmdinject",children:[]},{level:3,title:"PathTraversal",slug:"pathtraversal",link:"#pathtraversal",children:[]},{level:3,title:"SQLInject",slug:"sqlinject",link:"#sqlinject",children:[]},{level:3,title:"SSRF",slug:"ssrf",link:"#ssrf",children:[]},{level:3,title:"XSS",slug:"xss",link:"#xss",children:[]},{level:3,title:"ObjectiveC/Copyright",slug:"objectivec-copyright",link:"#objectivec-copyright",children:[]},{level:3,title:"ObjectiveC/Indent",slug:"objectivec-indent",link:"#objectivec-indent",children:[]},{level:3,title:"ObjectiveC/MaxLinesPerFunction",slug:"objectivec-maxlinesperfunction",link:"#objectivec-maxlinesperfunction",children:[]},{level:3,title:"ObjectiveC/MissingDocInterface",slug:"objectivec-missingdocinterface",link:"#objectivec-missingdocinterface",children:[]},{level:3,title:"ObjectiveC/MissingDocProperty",slug:"objectivec-missingdocproperty",link:"#objectivec-missingdocproperty",children:[]},{level:3,title:"ObjectiveC/MissingDocProtocol",slug:"objectivec-missingdocprotocol",link:"#objectivec-missingdocprotocol",children:[]},{level:3,title:"ObjectiveC/ParameterCount",slug:"objectivec-parametercount",link:"#objectivec-parametercount",children:[]},{level:3,title:"ObjectiveC/ClassNaming",slug:"objectivec-classnaming",link:"#objectivec-classnaming",children:[]},{level:3,title:"ObjectiveC/FunctionNaming",slug:"objectivec-functionnaming",link:"#objectivec-functionnaming",children:[]},{level:3,title:"ObjectiveC/GlobalVariableNaming",slug:"objectivec-globalvariablenaming",link:"#objectivec-globalvariablenaming",children:[]},{level:3,title:"ObjectiveC/LocalVariableNaming",slug:"objectivec-localvariablenaming",link:"#objectivec-localvariablenaming",children:[]},{level:3,title:"ObjectiveC/MacroNaming",slug:"objectivec-macronaming",link:"#objectivec-macronaming",children:[]},{level:3,title:"ObjectiveC/MethodNaming",slug:"objectivec-methodnaming",link:"#objectivec-methodnaming",children:[]},{level:3,title:"ObjectiveC/ParameterNaming",slug:"objectivec-parameternaming",link:"#objectivec-parameternaming",children:[]},{level:3,title:"ObjectiveC/MaxLineLength",slug:"objectivec-maxlinelength",link:"#objectivec-maxlinelength",children:[]}]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html",pathLocale:"/en",extraFields:[]},{title:"TCA-Armory-Q1工具介绍",headers:[{level:2,title:"线程锁检查",slug:"线程锁检查",link:"#线程锁检查",children:[]},{level:2,title:"资源泄漏检查",slug:"资源泄漏检查",link:"#资源泄漏检查",children:[]},{level:2,title:"无效值检查",slug:"无效值检查",link:"#无效值检查",children:[]},{level:2,title:"数组溢出检查",slug:"数组溢出检查",link:"#数组溢出检查",children:[]},{level:2,title:"指针检查",slug:"指针检查",link:"#指针检查",children:[]},{level:2,title:"函数重写",slug:"函数重写",link:"#函数重写",children:[]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html",pathLocale:"/en",extraFields:[]},{title:"TCA-Armory-R 使用手册",headers:[{level:2,title:"适用场景",slug:"适用场景",link:"#适用场景",children:[]},{level:2,title:"对比RegexScan、RegexFileScan",slug:"对比regexscan、regexfilescan",link:"#对比regexscan、regexfilescan",children:[]},{level:2,title:"快速接入",slug:"快速接入",link:"#快速接入",children:[]},{level:2,title:"自定义规则",slug:"自定义规则",link:"#自定义规则",children:[{level:3,title:"1. 开放支持自定义规则权限",slug:"_1-开放支持自定义规则权限",link:"#_1-开放支持自定义规则权限",children:[]},{level:3,title:"2. 添加规则",slug:"_2-添加规则",link:"#_2-添加规则",children:[]},{level:3,title:"3. 填写规则信息",slug:"_3-填写规则信息",link:"#_3-填写规则信息",children:[]},{level:3,title:"规则示例:",slug:"规则示例",link:"#规则示例",children:[]},{level:3,title:"字段解释",slug:"字段解释",link:"#字段解释",children:[]},{level:3,title:"4. 将自定义规则添加到项目分析方案中",slug:"_4-将自定义规则添加到项目分析方案中",link:"#_4-将自定义规则添加到项目分析方案中",children:[]}]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html",pathLocale:"/en",extraFields:[]},{title:"Eslint 使用手册",headers:[{level:2,title:"适用场景",slug:"适用场景",link:"#适用场景",children:[]},{level:2,title:"快速接入",slug:"快速接入",link:"#快速接入",children:[]},{level:2,title:"高级配置",slug:"高级配置",link:"#高级配置",children:[{level:3,title:"基础概念",slug:"基础概念",link:"#基础概念",children:[]},{level:3,title:"设置 Globals",slug:"设置-globals",link:"#设置-globals",children:[]},{level:3,title:"指定参数配置文件",slug:"指定参数配置文件",link:"#指定参数配置文件",children:[]},{level:3,title:"指定 Eslint 配置文件",slug:"指定-eslint-配置文件",link:"#指定-eslint-配置文件",children:[]},{level:3,title:"设置配置类型",slug:"设置配置类型",link:"#设置配置类型",children:[]},{level:3,title:"配置优先顺序",slug:"配置优先顺序",link:"#配置优先顺序",children:[]},{level:3,title:"分析路径配置",slug:"分析路径配置",link:"#分析路径配置",children:[]}]},{level:2,title:"Q&A",slug:"q-a",link:"#q-a",children:[]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint.html",pathLocale:"/en",extraFields:[]},{title:"Golangcilint 使用手册",headers:[{level:2,title:"对比 GoMetaLinter",slug:"对比-gometalinter",link:"#对比-gometalinter",children:[]},{level:2,title:"快速接入",slug:"快速接入",link:"#快速接入",children:[]},{level:2,title:"高级配置",slug:"高级配置",link:"#高级配置",children:[{level:3,title:"Include",slug:"include",link:"#include",children:[]}]},{level:2,title:"Q&A",slug:"q-a",link:"#q-a",children:[]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint.html",pathLocale:"/en",extraFields:[]},{title:"【Objective-C】代码规范规则包",headers:[{level:2,title:"规则列表",slug:"规则列表",link:"#规则列表",children:[]},{level:2,title:"启用规则包",slug:"启用规则包",link:"#启用规则包",children:[]},{level:2,title:"格式化工具",slug:"格式化工具",link:"#格式化工具",children:[]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc.html",pathLocale:"/en",extraFields:[]},{title:"【C/C++】代码质量缺陷规则包",headers:[{level:2,title:"规则列表",slug:"规则列表",link:"#规则列表",children:[]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc.html",pathLocale:"/en",extraFields:[]},{title:"依赖漏洞扫描规则包",headers:[{level:2,title:"概述",slug:"概述",link:"#概述",children:[]},{level:2,title:"示例",slug:"示例",link:"#示例",children:[]},{level:2,title:"快速体验",slug:"快速体验",link:"#快速体验",children:[{level:3,title:"启用规则包",slug:"启用规则包",link:"#启用规则包",children:[]},{level:3,title:"更多",slug:"更多",link:"#更多",children:[]}]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul.html",pathLocale:"/en",extraFields:[]},{title:"【Java】强化安全规则包",headers:[{level:2,title:"规则列表",slug:"规则列表",link:"#规则列表",children:[]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java.html",pathLocale:"/en",extraFields:[]},{title:"前端框架检查规则包",headers:[{level:2,title:"背景",slug:"背景",link:"#背景",children:[]},{level:2,title:"需求",slug:"需求",link:"#需求",children:[{level:3,title:"示例",slug:"示例",link:"#示例",children:[]}]},{level:2,title:"快速体验",slug:"快速体验",link:"#快速体验",children:[{level:3,title:"启用规则包",slug:"启用规则包",link:"#启用规则包",children:[]},{level:3,title:"支持框架",slug:"支持框架",link:"#支持框架",children:[]},{level:3,title:"更多",slug:"更多",link:"#更多",children:[]}]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check.html",pathLocale:"/en",extraFields:[]},{title:"【Go】单元测试有效性验证",headers:[{level:2,title:"背景",slug:"背景",link:"#背景",children:[]},{level:2,title:"需求",slug:"需求",link:"#需求",children:[{level:3,title:"示例",slug:"示例",link:"#示例",children:[]}]},{level:2,title:"快速体验",slug:"快速体验",link:"#快速体验",children:[{level:3,title:"启用规则包",slug:"启用规则包",link:"#启用规则包",children:[]},{level:3,title:"支持框架",slug:"支持框架",link:"#支持框架",children:[]},{level:3,title:"扩展",slug:"扩展",link:"#扩展",children:[]}]}],path:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go.html",pathLocale:"/en",extraFields:[]},{title:"Error Prone 使用手册",headers:[{level:2,title:"Error Prone 介绍",slug:"error-prone-介绍",link:"#error-prone-介绍",children:[]},{level:2,title:"TCA使用指引",slug:"tca使用指引",link:"#tca使用指引",children:[]},{level:2,title:"Error Prone 配置",slug:"error-prone-配置",link:"#error-prone-配置",children:[{level:3,title:"通过Bazel构建",slug:"通过bazel构建",link:"#通过bazel构建",children:[]},{level:3,title:"Maven 配置 Error Prone",slug:"maven-配置-error-prone",link:"#maven-配置-error-prone",children:[]},{level:3,title:"其他配置和注意事项",slug:"其他配置和注意事项",link:"#其他配置和注意事项",children:[]}]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone.html",pathLocale:"/",extraFields:[]},{title:"TCA-Armory-C1 使用手册",headers:[{level:2,title:"功能",slug:"功能",link:"#功能",children:[]},{level:2,title:"准备",slug:"准备",link:"#准备",children:[]},{level:2,title:"规则介绍",slug:"规则介绍",link:"#规则介绍",children:[{level:3,title:"CmdInject",slug:"cmdinject",link:"#cmdinject",children:[]},{level:3,title:"PathTraversal",slug:"pathtraversal",link:"#pathtraversal",children:[]},{level:3,title:"SQLInject",slug:"sqlinject",link:"#sqlinject",children:[]},{level:3,title:"SSRF",slug:"ssrf",link:"#ssrf",children:[]},{level:3,title:"XSS",slug:"xss",link:"#xss",children:[]},{level:3,title:"ObjectiveC/Copyright",slug:"objectivec-copyright",link:"#objectivec-copyright",children:[]},{level:3,title:"ObjectiveC/Indent",slug:"objectivec-indent",link:"#objectivec-indent",children:[]},{level:3,title:"ObjectiveC/MaxLinesPerFunction",slug:"objectivec-maxlinesperfunction",link:"#objectivec-maxlinesperfunction",children:[]},{level:3,title:"ObjectiveC/MissingDocInterface",slug:"objectivec-missingdocinterface",link:"#objectivec-missingdocinterface",children:[]},{level:3,title:"ObjectiveC/MissingDocProperty",slug:"objectivec-missingdocproperty",link:"#objectivec-missingdocproperty",children:[]},{level:3,title:"ObjectiveC/MissingDocProtocol",slug:"objectivec-missingdocprotocol",link:"#objectivec-missingdocprotocol",children:[]},{level:3,title:"ObjectiveC/ParameterCount",slug:"objectivec-parametercount",link:"#objectivec-parametercount",children:[]},{level:3,title:"ObjectiveC/ClassNaming",slug:"objectivec-classnaming",link:"#objectivec-classnaming",children:[]},{level:3,title:"ObjectiveC/FunctionNaming",slug:"objectivec-functionnaming",link:"#objectivec-functionnaming",children:[]},{level:3,title:"ObjectiveC/GlobalVariableNaming",slug:"objectivec-globalvariablenaming",link:"#objectivec-globalvariablenaming",children:[]},{level:3,title:"ObjectiveC/LocalVariableNaming",slug:"objectivec-localvariablenaming",link:"#objectivec-localvariablenaming",children:[]},{level:3,title:"ObjectiveC/MacroNaming",slug:"objectivec-macronaming",link:"#objectivec-macronaming",children:[]},{level:3,title:"ObjectiveC/MethodNaming",slug:"objectivec-methodnaming",link:"#objectivec-methodnaming",children:[]},{level:3,title:"ObjectiveC/ParameterNaming",slug:"objectivec-parameternaming",link:"#objectivec-parameternaming",children:[]},{level:3,title:"ObjectiveC/MaxLineLength",slug:"objectivec-maxlinelength",link:"#objectivec-maxlinelength",children:[]}]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html",pathLocale:"/",extraFields:[]},{title:"TCA-Armory-Q1工具介绍",headers:[{level:2,title:"线程锁检查",slug:"线程锁检查",link:"#线程锁检查",children:[]},{level:2,title:"资源泄漏检查",slug:"资源泄漏检查",link:"#资源泄漏检查",children:[]},{level:2,title:"无效值检查",slug:"无效值检查",link:"#无效值检查",children:[]},{level:2,title:"数组溢出检查",slug:"数组溢出检查",link:"#数组溢出检查",children:[]},{level:2,title:"指针检查",slug:"指针检查",link:"#指针检查",children:[]},{level:2,title:"函数重写",slug:"函数重写",link:"#函数重写",children:[]},{level:2,title:"死代码检查",slug:"死代码检查",link:"#死代码检查",children:[]},{level:2,title:"变量初始化检查",slug:"变量初始化检查",link:"#变量初始化检查",children:[]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html",pathLocale:"/",extraFields:[]},{title:"TCA-Armory-R 使用手册",headers:[{level:2,title:"适用场景",slug:"适用场景",link:"#适用场景",children:[]},{level:2,title:"对比RegexScan、RegexFileScan",slug:"对比regexscan、regexfilescan",link:"#对比regexscan、regexfilescan",children:[]},{level:2,title:"快速接入",slug:"快速接入",link:"#快速接入",children:[]},{level:2,title:"自定义规则",slug:"自定义规则",link:"#自定义规则",children:[{level:3,title:"1. 开放支持自定义规则权限",slug:"_1-开放支持自定义规则权限",link:"#_1-开放支持自定义规则权限",children:[]},{level:3,title:"2. 添加规则",slug:"_2-添加规则",link:"#_2-添加规则",children:[]},{level:3,title:"3. 填写规则信息",slug:"_3-填写规则信息",link:"#_3-填写规则信息",children:[]},{level:3,title:"规则示例:",slug:"规则示例",link:"#规则示例",children:[]},{level:3,title:"字段解释",slug:"字段解释",link:"#字段解释",children:[]},{level:3,title:"4. 将自定义规则添加到项目分析方案中",slug:"_4-将自定义规则添加到项目分析方案中",link:"#_4-将自定义规则添加到项目分析方案中",children:[]}]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html",pathLocale:"/",extraFields:[]},{title:"Eslint 使用手册",headers:[{level:2,title:"适用场景",slug:"适用场景",link:"#适用场景",children:[]},{level:2,title:"快速接入",slug:"快速接入",link:"#快速接入",children:[]},{level:2,title:"高级配置",slug:"高级配置",link:"#高级配置",children:[{level:3,title:"基础概念",slug:"基础概念",link:"#基础概念",children:[]},{level:3,title:"设置 Globals",slug:"设置-globals",link:"#设置-globals",children:[]},{level:3,title:"指定参数配置文件",slug:"指定参数配置文件",link:"#指定参数配置文件",children:[]},{level:3,title:"指定 Eslint 配置文件",slug:"指定-eslint-配置文件",link:"#指定-eslint-配置文件",children:[]},{level:3,title:"设置配置类型",slug:"设置配置类型",link:"#设置配置类型",children:[]},{level:3,title:"配置优先顺序",slug:"配置优先顺序",link:"#配置优先顺序",children:[]},{level:3,title:"分析路径配置",slug:"分析路径配置",link:"#分析路径配置",children:[]}]},{level:2,title:"Q&A",slug:"q-a",link:"#q-a",children:[]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint.html",pathLocale:"/",extraFields:[]},{title:"Golangcilint 使用手册",headers:[{level:2,title:"对比 GoMetaLinter",slug:"对比-gometalinter",link:"#对比-gometalinter",children:[]},{level:2,title:"快速接入",slug:"快速接入",link:"#快速接入",children:[]},{level:2,title:"高级配置",slug:"高级配置",link:"#高级配置",children:[{level:3,title:"Include",slug:"include",link:"#include",children:[]}]},{level:2,title:"Q&A",slug:"q-a",link:"#q-a",children:[]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint.html",pathLocale:"/",extraFields:[]},{title:"【Objective-C】代码规范规则包",headers:[{level:2,title:"规则列表",slug:"规则列表",link:"#规则列表",children:[]},{level:2,title:"启用规则包",slug:"启用规则包",link:"#启用规则包",children:[]},{level:2,title:"格式化工具",slug:"格式化工具",link:"#格式化工具",children:[]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc.html",pathLocale:"/",extraFields:[]},{title:"【C/C++】代码质量缺陷规则包",headers:[{level:2,title:"规则列表",slug:"规则列表",link:"#规则列表",children:[]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc.html",pathLocale:"/",extraFields:[]},{title:"依赖漏洞扫描规则包",headers:[{level:2,title:"概述",slug:"概述",link:"#概述",children:[]},{level:2,title:"示例",slug:"示例",link:"#示例",children:[]},{level:2,title:"快速体验",slug:"快速体验",link:"#快速体验",children:[{level:3,title:"启用规则包",slug:"启用规则包",link:"#启用规则包",children:[]},{level:3,title:"更多",slug:"更多",link:"#更多",children:[]}]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul.html",pathLocale:"/",extraFields:[]},{title:"【Java】强化安全规则包",headers:[{level:2,title:"规则列表",slug:"规则列表",link:"#规则列表",children:[]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java.html",pathLocale:"/",extraFields:[]},{title:"前端框架检查规则包",headers:[{level:2,title:"背景",slug:"背景",link:"#背景",children:[]},{level:2,title:"需求",slug:"需求",link:"#需求",children:[{level:3,title:"示例",slug:"示例",link:"#示例",children:[]}]},{level:2,title:"快速体验",slug:"快速体验",link:"#快速体验",children:[{level:3,title:"启用规则包",slug:"启用规则包",link:"#启用规则包",children:[]},{level:3,title:"支持框架",slug:"支持框架",link:"#支持框架",children:[]},{level:3,title:"更多",slug:"更多",link:"#更多",children:[]}]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check.html",pathLocale:"/",extraFields:[]},{title:"【Go】单元测试有效性验证",headers:[{level:2,title:"背景",slug:"背景",link:"#背景",children:[]},{level:2,title:"需求",slug:"需求",link:"#需求",children:[{level:3,title:"示例",slug:"示例",link:"#示例",children:[]}]},{level:2,title:"快速体验",slug:"快速体验",link:"#快速体验",children:[{level:3,title:"启用规则包",slug:"启用规则包",link:"#启用规则包",children:[]},{level:3,title:"支持框架",slug:"支持框架",link:"#支持框架",children:[]},{level:3,title:"扩展",slug:"扩展",link:"#扩展",children:[]}]}],path:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go.html",pathLocale:"/",extraFields:[]},{title:"",headers:[],path:"/404.html",pathLocale:"/",extraFields:[]}],Df=Ae(Ff),Lf=()=>Df,Cf=({searchIndex:e,routeLocale:t,query:l,maxSuggestions:i})=>{const n=$(()=>e.value.filter(r=>r.pathLocale===t.value));return $(()=>{const r=l.value.trim().toLowerCase();if(!r)return[];const o=[],s=(a,c)=>{uo(r,[c.title])&&o.push({link:`${a.path}#${c.slug}`,title:a.title,header:c.title});for(const d of c.children){if(o.length>=i.value)return;s(a,d)}};for(const a of n.value){if(o.length>=i.value)break;if(uo(r,[a.title,...a.extraFields])){o.push({link:a.path,title:a.title});continue}for(const c of a.headers){if(o.length>=i.value)break;s(a,c)}}return o})},Tf=e=>{const t=Ae(0);return{focusIndex:t,focusNext:()=>{t.value{t.value>0?t.value-=1:t.value=e.value.length-1}}},Pf=de({name:"SearchBox",props:{locales:{type:Object,required:!1,default:()=>({})},hotKeys:{type:Array,required:!1,default:()=>[]},maxSuggestions:{type:Number,required:!1,default:5}},setup(e){const{locales:t,hotKeys:l,maxSuggestions:i}=Di(e),n=Gt(),r=Wl(),o=Lf(),s=Ae(null),a=Ae(!1),c=Ae(""),d=$(()=>t.value[r.value]??{}),E=Cf({searchIndex:o,routeLocale:r,query:c,maxSuggestions:i}),{focusIndex:v,focusNext:g,focusPrev:k}=Tf(E);yf({input:s,hotKeys:l});const y=$(()=>a.value&&!!E.value.length),C=()=>{y.value&&k()},m=()=>{y.value&&g()},B=z=>{if(!y.value)return;const P=E.value[z];P&&n.push(P.link).then(()=>{c.value="",v.value=0})};return()=>ce("form",{class:"search-box",role:"search"},[ce("input",{ref:s,type:"search",placeholder:d.value.placeholder,autocomplete:"off",spellcheck:!1,value:c.value,onFocus:()=>a.value=!0,onBlur:()=>a.value=!1,onInput:z=>c.value=z.target.value,onKeydown:z=>{switch(z.key){case"ArrowUp":{C();break}case"ArrowDown":{m();break}case"Enter":{z.preventDefault(),B(v.value);break}}}}),y.value&&ce("ul",{class:"suggestions",onMouseleave:()=>v.value=-1},E.value.map(({link:z,title:P,header:W},Z)=>ce("li",{class:["suggestion",{focus:v.value===Z}],onMouseenter:()=>v.value=Z,onMousedown:()=>B(Z)},ce("a",{href:z,onClick:w=>w.preventDefault()},[ce("span",{class:"page-title"},P),W&&ce("span",{class:"page-header"},`> ${W}`)]))))])}});const zf={},xf=["s","/"],Rf=5,Of=wt({enhance({app:e}){e.component("SearchBox",t=>ce(Pf,{locales:zf,hotKeys:xf,maxSuggestions:Rf,...t}))}}),ri=[nE,sE,dE,bE,LE,xE,_f,Of],If=[["v-8daa1a0e","/",{title:"腾讯云代码分析文档"},["/index.html","/README.md"]],["v-2d0a870d","/en/",{title:"Tencent Cloud Code Analysis Doc"},["/en/index.html","/en/README.md"]],["v-2d0ad528","/zh/",{title:""},["/zh/index.html","/zh/README.md"]],["v-2743edae","/en/advanced/install_mysql_on_centos.html",{title:"在 CentOS 安装 MySQL"},["/en/advanced/install_mysql_on_centos","/en/advanced/install_mysql_on_centos.md"]],["v-b650f4dc","/en/advanced/install_nginx_from_source.html",{title:"源码安装 Nginx"},["/en/advanced/install_nginx_from_source","/en/advanced/install_nginx_from_source.md"]],["v-92a2a070","/en/advanced/install_python37_on_centos.html",{title:"在 CentOS 安装 Python3.7"},["/en/advanced/install_python37_on_centos","/en/advanced/install_python37_on_centos.md"]],["v-07307966","/en/advanced/install_python37_on_ubuntu.html",{title:"在 Ubuntu 安装 Python3.7"},["/en/advanced/install_python37_on_ubuntu","/en/advanced/install_python37_on_ubuntu.md"]],["v-446601d1","/en/advanced/install_redis_from_source.html",{title:"源码安装 Redis"},["/en/advanced/install_redis_from_source","/en/advanced/install_redis_from_source.md"]],["v-85814896","/en/advanced/install_redis_on_centos.html",{title:"在 CentOS 安装 Redis"},["/en/advanced/install_redis_on_centos","/en/advanced/install_redis_on_centos.md"]],["v-5f228e44","/en/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.html",{title:"任务分布式执行"},["/en/advanced/任务分布式执行.html","/en/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C","/en/advanced/任务分布式执行.md","/en/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.md"]],["v-f9c3256c","/en/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93.html",{title:"使用自建工具git库"},["/en/advanced/使用自建工具git库.html","/en/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93","/en/advanced/使用自建工具git库.md","/en/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93.md"]],["v-16f1abd8","/en/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7.html",{title:"源码集成代码分析工具"},["/en/advanced/集成代码分析工具.html","/en/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7","/en/advanced/集成代码分析工具.md","/en/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7.md"]],["v-075401e2","/en/api/",{title:"接口调用说明"},["/en/api/index.html","/en/api/README.md"]],["v-34e7f038","/en/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"代码度量数据管理"},["/en/api/代码度量数据模块接口.html","/en/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/en/api/代码度量数据模块接口.md","/en/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-d1cb31be","/en/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"代码扫描数据管理"},["/en/api/代码扫描数据模块接口.html","/en/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/en/api/代码扫描数据模块接口.md","/en/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-6981ad02","/en/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"任务管理模块"},["/en/api/任务管理模块接口.html","/en/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/en/api/任务管理模块接口.md","/en/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-2fb80293","/en/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.html",{title:"对象主要字段说明"},["/en/api/对象主要字段说明.html","/en/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E","/en/api/对象主要字段说明.md","/en/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.md"]],["v-4b0e7010","/en/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"代码扫描管理"},["/en/api/结果概览模块接口.html","/en/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/en/api/结果概览模块接口.md","/en/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-bb3cf496","/en/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"项目管理模块"},["/en/api/项目管理模块接口.html","/en/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/en/api/项目管理模块接口.md","/en/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-ee298290","/en/community/changelog.html",{title:"更新日志"},["/en/community/changelog","/en/community/changelog.md"]],["v-1b714c0e","/en/community/contribute.html",{title:"贡献指南"},["/en/community/contribute","/en/community/contribute.md"]],["v-f6077552","/en/community/joingroup.html",{title:"加入社区"},["/en/community/joingroup","/en/community/joingroup.md"]],["v-78c226f8","/en/community/pr.html",{title:"PR操作流程"},["/en/community/pr","/en/community/pr.md"]],["v-e6412400","/en/guide/",{title:"腾讯云代码分析"},["/en/guide/index.html","/en/guide/README.md"]],["v-023e8091","/en/quickStarted/FAQ.html",{title:"FAQ"},["/en/quickStarted/FAQ","/en/quickStarted/FAQ.md"]],["v-3c0f9a24","/en/quickStarted/",{title:"Tencent Cloud Code Analysis"},["/en/quickStarted/index.html","/en/quickStarted/README.md"]],["v-64f30f77","/en/quickStarted/codeDeploy.html",{title:"源代码快速部署"},["/en/quickStarted/codeDeploy","/en/quickStarted/codeDeploy.md"]],["v-0967ab59","/en/quickStarted/deployClient.html",{title:"部署与配置客户端"},["/en/quickStarted/deployClient","/en/quickStarted/deployClient.md"]],["v-0ceb929d","/en/quickStarted/deploySever.html",{title:"部署 TCA"},["/en/quickStarted/deploySever","/en/quickStarted/deploySever.md"]],["v-2d129638","/en/quickStarted/dockerDeploy.html",{title:"Docker rapid deployment(Recommended for a out of the box try)"},["/en/quickStarted/dockerDeploy","/en/quickStarted/dockerDeploy.md"]],["v-fb43c324","/en/quickStarted/dockercomposeDeploy.html",{title:"Docker-Compose快速部署"},["/en/quickStarted/dockercomposeDeploy","/en/quickStarted/dockercomposeDeploy.md"]],["v-6825e832","/en/quickStarted/enhanceDeploy.html",{title:"Enhanced Analysis Module Deployment"},["/en/quickStarted/enhanceDeploy","/en/quickStarted/enhanceDeploy.md"]],["v-bb3dad6e","/en/quickStarted/initRepo.html",{title:"创建代码分析项目"},["/en/quickStarted/initRepo","/en/quickStarted/initRepo.md"]],["v-2bb8df5b","/en/quickStarted/intro.html",{title:"平台概述"},["/en/quickStarted/intro","/en/quickStarted/intro.md"]],["v-1b6d66dd","/en/quickStarted/runProject.html",{title:"启动代码分析"},["/en/quickStarted/runProject","/en/quickStarted/runProject.md"]],["v-d29a371a","/zh/advanced/install_mysql_on_centos.html",{title:"在 CentOS 安装 MySQL"},["/zh/advanced/install_mysql_on_centos","/zh/advanced/install_mysql_on_centos.md"]],["v-173841d2","/zh/advanced/install_nginx_from_source.html",{title:"源码安装 Nginx"},["/zh/advanced/install_nginx_from_source","/zh/advanced/install_nginx_from_source.md"]],["v-58ad86e3","/zh/advanced/install_python37_on_centos.html",{title:"在 CentOS 安装 Python3.7"},["/zh/advanced/install_python37_on_centos","/zh/advanced/install_python37_on_centos.md"]],["v-c332cb30","/zh/advanced/install_python37_on_ubuntu.html",{title:"在 Ubuntu 安装 Python3.7"},["/zh/advanced/install_python37_on_ubuntu","/zh/advanced/install_python37_on_ubuntu.md"]],["v-d81b4954","/zh/advanced/install_redis_from_source.html",{title:"源码安装 Redis"},["/zh/advanced/install_redis_from_source","/zh/advanced/install_redis_from_source.md"]],["v-2cae527a","/zh/advanced/install_redis_on_centos.html",{title:"在 CentOS 安装 Redis"},["/zh/advanced/install_redis_on_centos","/zh/advanced/install_redis_on_centos.md"]],["v-4b1e72ba","/zh/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.html",{title:"任务分布式执行"},["/zh/advanced/任务分布式执行.html","/zh/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C","/zh/advanced/任务分布式执行.md","/zh/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.md"]],["v-281ecd65","/zh/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93.html",{title:"使用自建工具git库"},["/zh/advanced/使用自建工具git库.html","/zh/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93","/zh/advanced/使用自建工具git库.md","/zh/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93.md"]],["v-331b689a","/zh/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7.html",{title:"源码集成代码分析工具"},["/zh/advanced/集成代码分析工具.html","/zh/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7","/zh/advanced/集成代码分析工具.md","/zh/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7.md"]],["v-53f9ca7d","/zh/api/",{title:"接口调用说明"},["/zh/api/index.html","/zh/api/README.md"]],["v-3f0143e9","/zh/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"代码度量数据管理"},["/zh/api/代码度量数据模块接口.html","/zh/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/zh/api/代码度量数据模块接口.md","/zh/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-1ee0b9b4","/zh/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"代码扫描数据管理"},["/zh/api/代码扫描数据模块接口.html","/zh/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/zh/api/代码扫描数据模块接口.md","/zh/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-736a6678","/zh/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"任务管理模块"},["/zh/api/任务管理模块接口.html","/zh/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/zh/api/任务管理模块接口.md","/zh/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-2ac3a5d8","/zh/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.html",{title:"对象主要字段说明"},["/zh/api/对象主要字段说明.html","/zh/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E","/zh/api/对象主要字段说明.md","/zh/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.md"]],["v-54f72986","/zh/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"代码扫描管理"},["/zh/api/结果概览模块接口.html","/zh/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/zh/api/结果概览模块接口.md","/zh/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-c525ae0c","/zh/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html",{title:"项目管理模块"},["/zh/api/项目管理模块接口.html","/zh/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3","/zh/api/项目管理模块接口.md","/zh/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.md"]],["v-3179abd3","/zh/community/changelog.html",{title:"更新日志"},["/zh/community/changelog","/zh/community/changelog.md"]],["v-5b86903e","/zh/community/contribute.html",{title:"贡献指南"},["/zh/community/contribute","/zh/community/contribute.md"]],["v-2d8ab272","/zh/community/joingroup.html",{title:"加入社区"},["/zh/community/joingroup","/zh/community/joingroup.md"]],["v-1c31906e","/zh/community/pr.html",{title:"PR操作流程"},["/zh/community/pr","/zh/community/pr.md"]],["v-47357bdb","/zh/guide/",{title:"腾讯云代码分析"},["/zh/guide/index.html","/zh/guide/README.md"]],["v-1d94bd54","/zh/quickStarted/FAQ.html",{title:"FAQ"},["/zh/quickStarted/FAQ","/zh/quickStarted/FAQ.md"]],["v-47cae8b3","/zh/quickStarted/",{title:"腾讯云代码分析介绍"},["/zh/quickStarted/index.html","/zh/quickStarted/README.md"]],["v-17ff7712","/zh/quickStarted/codeDeploy.html",{title:"源代码快速部署"},["/zh/quickStarted/codeDeploy","/zh/quickStarted/codeDeploy.md"]],["v-2af89834","/zh/quickStarted/deployClient.html",{title:"部署与配置客户端"},["/zh/quickStarted/deployClient","/zh/quickStarted/deployClient.md"]],["v-8927c33c","/zh/quickStarted/deploySever.html",{title:"部署 TCA"},["/zh/quickStarted/deploySever","/zh/quickStarted/deploySever.md"]],["v-0b07a1bf","/zh/quickStarted/dockerDeploy.html",{title:"Docker快速部署(平台体验首推)"},["/zh/quickStarted/dockerDeploy","/zh/quickStarted/dockerDeploy.md"]],["v-1c65d59a","/zh/quickStarted/dockercomposeDeploy.html",{title:"Docker-Compose快速部署"},["/zh/quickStarted/dockercomposeDeploy","/zh/quickStarted/dockercomposeDeploy.md"]],["v-78b296b7","/zh/quickStarted/enhanceDeploy.html",{title:"增强分析模块部署"},["/zh/quickStarted/enhanceDeploy","/zh/quickStarted/enhanceDeploy.md"]],["v-6108bba4","/zh/quickStarted/initRepo.html",{title:"创建代码分析项目"},["/zh/quickStarted/initRepo","/zh/quickStarted/initRepo.md"]],["v-396ae2e0","/zh/quickStarted/intro.html",{title:"平台概述"},["/zh/quickStarted/intro","/zh/quickStarted/intro.md"]],["v-630c6310","/zh/quickStarted/runProject.html",{title:"启动代码分析"},["/zh/quickStarted/runProject","/zh/quickStarted/runProject.md"]],["v-e2e9d388","/en/guide/web/deploySource.html",{title:"VM 部署文档"},["/en/guide/web/deploySource","/en/guide/web/deploySource.md"]],["v-641bec60","/en/guide/web/web.html",{title:"TCA Web"},["/en/guide/web/web","/en/guide/web/web.md"]],["v-2aa9208a","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html",{title:"代码检查结果查看"},["/en/guide/代码检查/分析结果查看.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B","/en/guide/代码检查/分析结果查看.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.md"]],["v-459a75e4","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html",{title:"添加规则配置"},["/en/guide/代码检查/添加规则配置.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE","/en/guide/代码检查/添加规则配置.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.md"]],["v-4b5d7d25","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE.html",{title:"代码度量配置"},["/en/guide/分析方案/代码度量配置.html","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE","/en/guide/分析方案/代码度量配置.md","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE.md"]],["v-8554b5ae","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE.html",{title:"代码检查-编译配置"},["/en/guide/分析方案/代码检查编译配置.html","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE","/en/guide/分析方案/代码检查编译配置.md","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE.md"]],["v-0b272f8a","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html",{title:"代码检查-规则配置"},["/en/guide/分析方案/代码检查规则配置.html","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE","/en/guide/分析方案/代码检查规则配置.md","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.md"]],["v-7f8f12be","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE.html",{title:"代码检查配置"},["/en/guide/分析方案/代码检查配置.html","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE","/en/guide/分析方案/代码检查配置.md","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE.md"]],["v-7b5fb5ab","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E.html",{title:"分析方案模版"},["/en/guide/分析方案/分析方案模板说明.html","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E","/en/guide/分析方案/分析方案模板说明.md","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E.md"]],["v-592884a3","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html",{title:"基础属性配置"},["/en/guide/分析方案/基础属性配置.html","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE","/en/guide/分析方案/基础属性配置.md","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.md"]],["v-9d3d5372","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE.html",{title:"过滤配置"},["/en/guide/分析方案/过滤配置.html","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE","/en/guide/分析方案/过滤配置.md","/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE.md"]],["v-01483471","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86.html",{title:"OAuth管理"},["/en/guide/后台管理/OAuth管理.html","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86","/en/guide/后台管理/OAuth管理.md","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86.md"]],["v-46f099d9","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86.html",{title:"分析记录管理"},["/en/guide/后台管理/分析记录管理.html","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86","/en/guide/后台管理/分析记录管理.md","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86.md"]],["v-e38c74ec","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html",{title:"团队管理"},["/en/guide/后台管理/团队管理.html","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86","/en/guide/后台管理/团队管理.md","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.md"]],["v-07d72a4a","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86.html",{title:"工具管理"},["/en/guide/后台管理/工具管理.html","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86","/en/guide/后台管理/工具管理.md","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86.md"]],["v-b2cd5ac8","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.html",{title:"用户管理"},["/en/guide/后台管理/用户管理.html","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86","/en/guide/后台管理/用户管理.md","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.md"]],["v-6a752a2e","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html",{title:"节点管理"},["/en/guide/后台管理/节点管理.html","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86","/en/guide/后台管理/节点管理.md","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.md"]],["v-b2bcdc3c","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86.html",{title:"项目管理"},["/en/guide/后台管理/项目管理.html","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86","/en/guide/后台管理/项目管理.md","/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86.md"]],["v-1759972c","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html",{title:"团队说明"},["/en/guide/团队管理/团队管理.html","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86","/en/guide/团队管理/团队管理.md","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.md"]],["v-53d9da54","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.html",{title:"成员权限"},["/en/guide/团队管理/成员权限.html","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90","/en/guide/团队管理/成员权限.md","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.md"]],["v-30ded9c9","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html",{title:"团队节点与标签"},["/en/guide/团队管理/节点管理.html","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86","/en/guide/团队管理/节点管理.md","/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.md"]],["v-66bece26","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.html",{title:"其他配置与用法"},["/en/guide/客户端/其他配置.html","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE","/en/guide/客户端/其他配置.md","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.md"]],["v-78d0e857","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html",{title:"常驻节点分析"},["/en/guide/客户端/常驻节点分析.html","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90","/en/guide/客户端/常驻节点分析.md","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.md"]],["v-2c3a512d","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F.html",{title:"快速扫描模式"},["/en/guide/客户端/快速扫描模式.html","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F","/en/guide/客户端/快速扫描模式.md","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F.md"]],["v-bb7105ba","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html",{title:"客户端本地分析"},["/en/guide/客户端/本地分析.html","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90","/en/guide/客户端/本地分析.md","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.md"]],["v-640fd1ac","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.html",{title:"TCA Client"},["/en/guide/客户端/配置说明.html","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E","/en/guide/客户端/配置说明.md","/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.md"]],["v-5b6aff19","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8.html",{title:"工具列表"},["/en/guide/工具管理/工具列表.html","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8","/en/guide/工具管理/工具列表.md","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8.md"]],["v-781ca92a","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E.html",{title:"工具管理说明"},["/en/guide/工具管理/工具管理说明.html","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E","/en/guide/工具管理/工具管理说明.md","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E.md"]],["v-72a0db1d","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7.html",{title:"自定义工具"},["/en/guide/工具管理/自定义工具.html","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7","/en/guide/工具管理/自定义工具.md","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7.md"]],["v-66e40bbf","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.html",{title:"自定义规则"},["/en/guide/工具管理/自定义规则.html","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99","/en/guide/工具管理/自定义规则.md","/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.md"]],["v-bbb8ba4e","/en/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html",{title:"Quick start a code analysis"},["/en/guide/快速入门/快速启动一次代码分析.html","/en/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90","/en/guide/快速入门/快速启动一次代码分析.md","/en/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.md"]],["v-356f7475","/en/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin.html",{title:"Jenkins插件使用说明"},["/en/guide/插件/Jenkins_Plugin.html","/en/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin","/en/guide/插件/Jenkins_Plugin.md","/en/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin.md"]],["v-374a553a","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio.html",{title:"基于MinIO部署文件服务器"},["/en/guide/服务端/deploy_with_minio.html","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio","/en/guide/服务端/deploy_with_minio.md","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio.md"]],["v-5c7ce0e5","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate.html",{title:""},["/en/guide/服务端/deploy_without_migrate.html","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate","/en/guide/服务端/deploy_without_migrate.md","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate.md"]],["v-2b8ad044","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server.html",{title:"TCA Server"},["/en/guide/服务端/server.html","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server","/en/guide/服务端/server.md","/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server.md"]],["v-b654617e","/zh/guide/web/deploySource.html",{title:"VM 部署文档"},["/zh/guide/web/deploySource","/zh/guide/web/deploySource.md"]],["v-0245ec8a","/zh/guide/web/web.html",{title:"TCA Web"},["/zh/guide/web/web","/zh/guide/web/web.md"]],["v-67ff15d4","/zh/guide/%E4%B8%AA%E4%BA%BA%E4%B8%AD%E5%BF%83/%E4%B8%AA%E4%BA%BA%E4%BB%A4%E7%89%8C.html",{title:"个人令牌说明"},["/zh/guide/个人中心/个人令牌.html","/zh/guide/%E4%B8%AA%E4%BA%BA%E4%B8%AD%E5%BF%83/%E4%B8%AA%E4%BA%BA%E4%BB%A4%E7%89%8C","/zh/guide/个人中心/个人令牌.md","/zh/guide/%E4%B8%AA%E4%BA%BA%E4%B8%AD%E5%BF%83/%E4%B8%AA%E4%BA%BA%E4%BB%A4%E7%89%8C.md"]],["v-3c5ef996","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html",{title:"代码检查结果查看"},["/zh/guide/代码检查/分析结果查看.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B","/zh/guide/代码检查/分析结果查看.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.md"]],["v-d1640082","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html",{title:"添加规则配置"},["/zh/guide/代码检查/添加规则配置.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE","/zh/guide/代码检查/添加规则配置.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.md"]],["v-c5ddf200","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE.html",{title:"代码度量配置"},["/zh/guide/分析方案/代码度量配置.html","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE","/zh/guide/分析方案/代码度量配置.md","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE.md"]],["v-475a8e44","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE.html",{title:"代码检查-编译配置"},["/zh/guide/分析方案/代码检查编译配置.html","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE","/zh/guide/分析方案/代码检查编译配置.md","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE.md"]],["v-d5a7ceb6","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html",{title:"代码检查-规则配置"},["/zh/guide/分析方案/代码检查规则配置.html","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE","/zh/guide/分析方案/代码检查规则配置.md","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.md"]],["v-11ec007c","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE.html",{title:"代码检查配置"},["/zh/guide/分析方案/代码检查配置.html","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE","/zh/guide/分析方案/代码检查配置.md","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE.md"]],["v-05649ec6","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E.html",{title:"分析方案模版"},["/zh/guide/分析方案/分析方案模板说明.html","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E","/zh/guide/分析方案/分析方案模板说明.md","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E.md"]],["v-aa47e304","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html",{title:"基础属性配置"},["/zh/guide/分析方案/基础属性配置.html","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE","/zh/guide/分析方案/基础属性配置.md","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.md"]],["v-20ae30e2","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE.html",{title:"过滤配置"},["/zh/guide/分析方案/过滤配置.html","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE","/zh/guide/分析方案/过滤配置.md","/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE.md"]],["v-fb758c14","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86.html",{title:"OAuth管理"},["/zh/guide/后台管理/OAuth管理.html","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86","/zh/guide/后台管理/OAuth管理.md","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/OAuth%E7%AE%A1%E7%90%86.md"]],["v-ceb7b898","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86.html",{title:"分析记录管理"},["/zh/guide/后台管理/分析记录管理.html","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86","/zh/guide/后台管理/分析记录管理.md","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86.md"]],["v-04f2bfb6","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html",{title:"团队管理"},["/zh/guide/后台管理/团队管理.html","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86","/zh/guide/后台管理/团队管理.md","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.md"]],["v-6b614576","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86.html",{title:"工具管理"},["/zh/guide/后台管理/工具管理.html","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86","/zh/guide/后台管理/工具管理.md","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86.md"]],["v-15e62d37","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.html",{title:"用户管理"},["/zh/guide/后台管理/用户管理.html","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86","/zh/guide/后台管理/用户管理.md","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.md"]],["v-3a124584","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html",{title:"节点管理"},["/zh/guide/后台管理/节点管理.html","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86","/zh/guide/后台管理/节点管理.md","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.md"]],["v-15ee6c7d","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86.html",{title:"项目管理"},["/zh/guide/后台管理/项目管理.html","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86","/zh/guide/后台管理/项目管理.md","/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86.md"]],["v-63a00f05","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html",{title:"团队说明"},["/zh/guide/团队管理/团队管理.html","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86","/zh/guide/团队管理/团队管理.md","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.md"]],["v-455fed71","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.html",{title:"成员权限"},["/zh/guide/团队管理/成员权限.html","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90","/zh/guide/团队管理/成员权限.md","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.md"]],["v-bfa89738","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html",{title:"团队节点与标签"},["/zh/guide/团队管理/节点管理.html","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86","/zh/guide/团队管理/节点管理.md","/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.md"]],["v-6f03892b","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.html",{title:"其他配置与用法"},["/zh/guide/客户端/其他配置.html","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE","/zh/guide/客户端/其他配置.md","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.md"]],["v-1c5e67c8","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html",{title:"常驻节点分析"},["/zh/guide/客户端/常驻节点分析.html","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90","/zh/guide/客户端/常驻节点分析.md","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.md"]],["v-b58b961c","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F.html",{title:"快速扫描模式"},["/zh/guide/客户端/快速扫描模式.html","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F","/zh/guide/客户端/快速扫描模式.md","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F.md"]],["v-aae78fb0","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html",{title:"客户端本地分析"},["/zh/guide/客户端/本地分析.html","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90","/zh/guide/客户端/本地分析.md","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.md"]],["v-6c548cb1","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.html",{title:"TCA Client"},["/zh/guide/客户端/配置说明.html","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E","/zh/guide/客户端/配置说明.md","/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.md"]],["v-6a904c98","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8.html",{title:"工具列表"},["/zh/guide/工具管理/工具列表.html","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8","/zh/guide/工具管理/工具列表.md","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8.md"]],["v-15a53546","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E.html",{title:"工具管理说明"},["/zh/guide/工具管理/工具管理说明.html","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E","/zh/guide/工具管理/工具管理说明.md","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E.md"]],["v-28be823c","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7.html",{title:"自定义工具"},["/zh/guide/工具管理/自定义工具.html","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7","/zh/guide/工具管理/自定义工具.md","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7.md"]],["v-403820f8","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.html",{title:"自定义规则"},["/zh/guide/工具管理/自定义规则.html","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99","/zh/guide/工具管理/自定义规则.md","/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.md"]],["v-11cec998","/zh/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html",{title:"快速启动一次代码分析"},["/zh/guide/快速入门/快速启动一次代码分析.html","/zh/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90","/zh/guide/快速入门/快速启动一次代码分析.md","/zh/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.md"]],["v-7fa74610","/zh/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin.html",{title:"Jenkins插件使用说明"},["/zh/guide/插件/Jenkins_Plugin.html","/zh/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin","/zh/guide/插件/Jenkins_Plugin.md","/zh/guide/%E6%8F%92%E4%BB%B6/Jenkins_Plugin.md"]],["v-55b96640","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/ScriptAPI_guide.html",{title:"API调用脚本使用指引"},["/zh/guide/服务端/ScriptAPI_guide.html","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/ScriptAPI_guide","/zh/guide/服务端/ScriptAPI_guide.md","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/ScriptAPI_guide.md"]],["v-48a59655","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio.html",{title:"基于MinIO部署文件服务器"},["/zh/guide/服务端/deploy_with_minio.html","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio","/zh/guide/服务端/deploy_with_minio.md","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio.md"]],["v-051518aa","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate.html",{title:""},["/zh/guide/服务端/deploy_without_migrate.html","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate","/zh/guide/服务端/deploy_without_migrate.md","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate.md"]],["v-c3df2014","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/gitlab_oauth_guide.html",{title:"私有化gitlab Oauth认证"},["/zh/guide/服务端/gitlab_oauth_guide.html","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/gitlab_oauth_guide","/zh/guide/服务端/gitlab_oauth_guide.md","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/gitlab_oauth_guide.md"]],["v-32060cba","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server.html",{title:"TCA Server"},["/zh/guide/服务端/server.html","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server","/zh/guide/服务端/server.md","/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server.md"]],["v-2b72915d","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone.html",{title:"Error Prone 使用手册"},["/en/guide/代码检查/工具/Error-Prone.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone","/en/guide/代码检查/工具/Error-Prone.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone.md"]],["v-1cf92e76","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html",{title:"TCA-Armory-C1 使用手册"},["/en/guide/代码检查/工具/TCA-Armory-C1.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1","/en/guide/代码检查/工具/TCA-Armory-C1.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.md"]],["v-01906c04","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html",{title:"TCA-Armory-Q1工具介绍"},["/en/guide/代码检查/工具/TCA-Armory-Q1.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1","/en/guide/代码检查/工具/TCA-Armory-Q1.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.md"]],["v-6d0cdd3c","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html",{title:"TCA-Armory-R 使用手册"},["/en/guide/代码检查/工具/TCA-Armory-R.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R","/en/guide/代码检查/工具/TCA-Armory-R.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.md"]],["v-0db91de5","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint.html",{title:"Eslint 使用手册"},["/en/guide/代码检查/工具/eslint.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint","/en/guide/代码检查/工具/eslint.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint.md"]],["v-33a5d252","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint.html",{title:"Golangcilint 使用手册"},["/en/guide/代码检查/工具/golangcilint.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint","/en/guide/代码检查/工具/golangcilint.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint.md"]],["v-02d030be","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc.html",{title:"【Objective-C】代码规范规则包"},["/en/guide/代码检查/规则包/code_spec_oc.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc","/en/guide/代码检查/规则包/code_spec_oc.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc.md"]],["v-218b1d6f","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc.html",{title:"【C/C++】代码质量缺陷规则包"},["/en/guide/代码检查/规则包/cpp_doc.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc","/en/guide/代码检查/规则包/cpp_doc.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc.md"]],["v-c54ad424","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul.html",{title:"依赖漏洞扫描规则包"},["/en/guide/代码检查/规则包/dependency_vul.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul","/en/guide/代码检查/规则包/dependency_vul.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul.md"]],["v-918a6bfe","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java.html",{title:"【Java】强化安全规则包"},["/en/guide/代码检查/规则包/enhanced_safety_java.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java","/en/guide/代码检查/规则包/enhanced_safety_java.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java.md"]],["v-0b3551c4","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check.html",{title:"前端框架检查规则包"},["/en/guide/代码检查/规则包/front_end_framework_check.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check","/en/guide/代码检查/规则包/front_end_framework_check.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check.md"]],["v-f8f08cc2","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go.html",{title:"【Go】单元测试有效性验证"},["/en/guide/代码检查/规则包/test_case_verify_go.html","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go","/en/guide/代码检查/规则包/test_case_verify_go.md","/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go.md"]],["v-61b23c38","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone.html",{title:"Error Prone 使用手册"},["/zh/guide/代码检查/工具/Error-Prone.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone","/zh/guide/代码检查/工具/Error-Prone.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/Error-Prone.md"]],["v-7c0ce2de","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html",{title:"TCA-Armory-C1 使用手册"},["/zh/guide/代码检查/工具/TCA-Armory-C1.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1","/zh/guide/代码检查/工具/TCA-Armory-C1.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.md"]],["v-b2de67c2","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html",{title:"TCA-Armory-Q1工具介绍"},["/zh/guide/代码检查/工具/TCA-Armory-Q1.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1","/zh/guide/代码检查/工具/TCA-Armory-Q1.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.md"]],["v-027ae47e","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html",{title:"TCA-Armory-R 使用手册"},["/zh/guide/代码检查/工具/TCA-Armory-R.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R","/zh/guide/代码检查/工具/TCA-Armory-R.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.md"]],["v-438ad62a","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint.html",{title:"Eslint 使用手册"},["/zh/guide/代码检查/工具/eslint.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint","/zh/guide/代码检查/工具/eslint.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint.md"]],["v-77e2c75c","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint.html",{title:"Golangcilint 使用手册"},["/zh/guide/代码检查/工具/golangcilint.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint","/zh/guide/代码检查/工具/golangcilint.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint.md"]],["v-1f200688","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc.html",{title:"【Objective-C】代码规范规则包"},["/zh/guide/代码检查/规则包/code_spec_oc.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc","/zh/guide/代码检查/规则包/code_spec_oc.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc.md"]],["v-ef89f918","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc.html",{title:"【C/C++】代码质量缺陷规则包"},["/zh/guide/代码检查/规则包/cpp_doc.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc","/zh/guide/代码检查/规则包/cpp_doc.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc.md"]],["v-7981d049","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul.html",{title:"依赖漏洞扫描规则包"},["/zh/guide/代码检查/规则包/dependency_vul.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul","/zh/guide/代码检查/规则包/dependency_vul.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul.md"]],["v-dd34d7c8","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java.html",{title:"【Java】强化安全规则包"},["/zh/guide/代码检查/规则包/enhanced_safety_java.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java","/zh/guide/代码检查/规则包/enhanced_safety_java.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java.md"]],["v-6908b43a","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check.html",{title:"前端框架检查规则包"},["/zh/guide/代码检查/规则包/front_end_framework_check.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check","/zh/guide/代码检查/规则包/front_end_framework_check.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check.md"]],["v-87c47fb8","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go.html",{title:"【Go】单元测试有效性验证"},["/zh/guide/代码检查/规则包/test_case_verify_go.html","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go","/zh/guide/代码检查/规则包/test_case_verify_go.md","/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go.md"]],["v-3706649a","/404.html",{title:""},["/404"]]];var Eo=de({name:"Vuepress",setup(){const e=Wu();return()=>ce(e.value)}}),wf=()=>If.reduce((e,[t,l,i,n])=>(e.push({name:t,path:l,component:Eo,meta:i},...n.map(r=>({path:r,redirect:l}))),e),[{name:"404",path:"/:catchAll(.*)",component:Eo}]),Sf=vd,Vf=()=>{const e=Yd({history:Sf(us("/CodeAnalysis/")),routes:wf(),scrollBehavior:(t,l,i)=>i||(t.hash?{el:t.hash}:{top:0})});return e.beforeResolve(async(t,l)=>{var i;(t.path!==l.path||l===vt)&&([Ct.value]=await Promise.all([ht.resolvePageData(t.name),(i=hs[t.name])==null?void 0:i.__asyncLoader()]))}),e},jf=e=>{e.component("ClientOnly",Sn),e.component("Content",Gu)},Mf=(e,t,l)=>{const i=Ae(t.currentRoute.value.path);rt(()=>t.currentRoute.value.path,v=>i.value=v);const n=$(()=>ht.resolveLayouts(l)),r=$(()=>ht.resolveRouteLocale(ll.value.locales,i.value)),o=$(()=>ht.resolveSiteLocaleData(ll.value,r.value)),s=$(()=>ht.resolvePageFrontmatter(Ct.value)),a=$(()=>ht.resolvePageHeadTitle(Ct.value,o.value)),c=$(()=>ht.resolvePageHead(a.value,s.value,o.value)),d=$(()=>ht.resolvePageLang(Ct.value)),E=$(()=>ht.resolvePageLayout(Ct.value,n.value));return e.provide($u,n),e.provide(fs,s),e.provide(Hu,a),e.provide(As,c),e.provide(gs,d),e.provide(ms,E),e.provide(In,r),e.provide(ps,o),Object.defineProperties(e.config.globalProperties,{$frontmatter:{get:()=>s.value},$head:{get:()=>c.value},$headTitle:{get:()=>a.value},$lang:{get:()=>d.value},$page:{get:()=>Ct.value},$routeLocale:{get:()=>r.value},$site:{get:()=>ll.value},$siteLocale:{get:()=>o.value},$withBase:{get:()=>Vn}}),{layouts:n,pageData:Ct,pageFrontmatter:s,pageHead:c,pageHeadTitle:a,pageLang:d,pageLayout:E,routeLocale:r,siteData:ll,siteLocaleData:o}},$f=()=>{const e=Nu(),t=Uu(),l=Ae([]),i=()=>{e.value.forEach(r=>{const o=qf(r);o&&l.value.push(o)})},n=()=>{document.documentElement.lang=t.value,l.value.forEach(r=>{r.parentNode===document.head&&document.head.removeChild(r)}),l.value.splice(0,l.value.length),e.value.forEach(r=>{const o=Nf(r);o!==null&&(document.head.appendChild(o),l.value.push(o))})};Wt(Ku,n),Ge(()=>{i(),n(),rt(()=>e.value,()=>n())})},qf=([e,t,l=""])=>{const i=Object.entries(t).map(([s,a])=>ge(a)?`[${s}=${JSON.stringify(a)}]`:a===!0?`[${s}]`:"").join(""),n=`head > ${e}${i}`;return Array.from(document.querySelectorAll(n)).find(s=>s.innerText===l)||null},Nf=([e,t,l])=>{if(!ge(e))return null;const i=document.createElement(e);return On(t)&&Object.entries(t).forEach(([n,r])=>{ge(r)?i.setAttribute(n,r):r===!0&&i.setAttribute(n,"")}),ge(l)&&i.appendChild(document.createTextNode(l)),i},Hf=Ru,Uf=async()=>{var l;const e=Hf({name:"VuepressApp",setup(){var i;$f();for(const n of ri)(i=n.setup)==null||i.call(n);return()=>[ce(xs),...ri.flatMap(({rootComponents:n=[]})=>n.map(r=>ce(r)))]}}),t=Vf();jf(e),Mf(e,t,ri);for(const i of ri)await((l=i.enhance)==null?void 0:l.call(i,{app:e,router:t,siteData:ll}));return e.use(t),{app:e,router:t}};Uf().then(({app:e,router:t})=>{t.isReady().then(()=>{e.mount("#app")})});export{Fe as _,ve as a,It as b,ee as c,Uf as createVueApp,le as d,Qc as e,De as f,q as o,_t as r,we as w}; diff --git a/assets/back-to-top-8efcbe56.svg b/assets/back-to-top-8efcbe56.svg new file mode 100644 index 000000000..83236781a --- /dev/null +++ b/assets/back-to-top-8efcbe56.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/changelog.html-3b9a2e33.js b/assets/changelog.html-3b9a2e33.js new file mode 100644 index 000000000..618238893 --- /dev/null +++ b/assets/changelog.html-3b9a2e33.js @@ -0,0 +1 @@ +import{_ as e,o as i,c as a,e as l}from"./app-2a91d8ab.js";const r={},h=l('

    更新日志

    V1.4.1 (2022-7-28)

    Features

    • 【服务端】统一部署脚本,封装local、docker、docker-compose部署方式启动server&web&client
    • 【服务端】支持源码安装Redis与Nginx
    • 【服务端】macOS启动docker desktop
    • 【服务端】完善github action脚本
    • 【工具】更新工具列表

    Docs

    • 上传新版本白皮书
    • 调整快速入门指引文档

    V1.4.0 (2022-7-18)

    Features

    • 【客户端】jenkins插件增加分析方案模版ID和分析方案名称参数
    • 【服务端】增加扫描方案模板API
    • 【服务器】优化文件服务器鉴权交互
    • 【客户端】QuickScan支持指定分析方案模板进行扫描;支持从环境变量读取文件服务器url和token
    • 【Web端】升级moment依赖

    Docs

    • 更新插件使用说明书和启动参数说明

    V1.3.3 (2022-6-29)

    Features

    • 【服务端】支持团队、项目组禁用,支持代码库、分析项目删除
    • 【服务端】扫描方案支持分支过滤
    • 【Web端】支持禁用团队、项目,代码库登记支持ssh_url
    • 【Web端】支持分支过滤配置,修复代码统计文件选中效果,支持工具、依赖凭证移除
    • 【工具】增加tca_ql工具
    • 【客户端】节点模式不再由客户端加载编译工具的环境变量,避免覆盖机器原有环境变量
    • 【客户端】QuickScan模式,异常时输出task.log方便排查问题
    • 【客户端】.code.yml支持.yaml后缀

    Bugfixes

    • 【客户端】tool_scheme和ini配置共用时,可能出现工具重复,需要对工具库去重后再拉取

    Docs

    • 更新TCA Action相关文档
    • 更新Jenkins插件文档;增加环境依赖说明
    • 更新自定义工具文档,使用工具依赖
    • 更新CLS readme

    V1.3.2 (2022-6-16)

    Features

    • 【客户端】QuickScan根据语言执行不同的任务

    Docs

    • docker-compose部署文档中数据库注意事项

    V1.3.1 (2022-6-14)

    Features

    • 【客户端】新增merge quest分支增量扫描
    • 【客户端】新增Quickscan模式
    • 【客户端】localscan支持工具并发
    • 【工具】新增二进制文件依赖分析工具
    • 【服务端】server调整服务监控探测脚本:celery状态判断
    • 【服务端】增加子任务接口,完善部署脚本
    • 【服务端】更新CLS版本v20220613.1
    • 【服务端】基于 CentOS7.9.2009(已测)的运行环境一键安装脚本,并已安装及配置命令 gunicorn 和 celery
    • 【Web端】调整OAuth显示

    V1.3.0 (2022-6-7)

    Features

    • 【工具】新增独立工具Loong
    • 【工具】新增Java、JS基础安全规则包
    • 【工具】增加Go和Python技术安全规则包
    • 【服务端】新增oauth授权及工具依赖管理
    • 【服务端】docker-compose部署支持挂载本地日志目录
    • 【客户端】支持工具依赖管理
    • 【Web端】支持工具依赖管理设置和Git OAuth设置
    • 【Web端】团队列表支持滚动加载

    Bugfixes

    • 【服务端】补充scmproxy缺失依赖
    • 【服务端】修复issue入库忽略处理操作

    Docs

    • 更新工具目录readme
    • 更新client README.md

    V1.2.1 (2022-5-24)

    Features

    • 【工具】新增Collie/Compass(测试版)工具
    • 【工具】添加tscancode系列工具
    • 【工具】工具区分编译型和非编译型
    • 【客户端】更新cmdscm二进制文件,调整获取ssh端口号方式
    • 【客户端】增加腾讯工蜂作为工具拉取源,支持选用
    • 【服务端】调整工程配置和文档,支持https克隆
    • 【Web端】前端页面优化

    Docs

    • 添加集成工具说明文档
    • readme增加微信公众号和腾讯开源摘星计划的说明及链接
    • 修改帮助文档的脚本名称;修改工蜂镜像仓库链接位置
    • 调整自定义规则文档
    • 调整doc,优化部署、使用文档

    V1.2.0 (2022-4-27)

    Features

    • 【Web端】增加工具管理
    • 【工具】增加logback检查的安全规则
    • 【服务端】增加TCA server&web 一键部署脚本
    • 【服务端】删除main部分异步任务;调整server nginx启动位置
    • 【服务端】增加server健康监测

    Docs

    • 完善部署和Q&A文档
    • 上传工具列表

    V1.1.3 (2022-4-18)

    Features

    • 【工具】上传开源合规检查规则
    • 【工具】新增PHP安全相关规则
    • 【服务端】上线license鉴权
    • 【客户端】支持对工具license校验

    Docs

    • 更新文档内的工具默认路径
    • 增加任务分布式执行能力操作文档
    • 增加PR操作流程

    V1.1.2 (2022-4-2)

    Features

    • 【服务端】优化部署构建脚本

    Docs

    • 简化前端部署脚本&文档
    • 优化指引文档

    V1.1.1 (2022-3-31)

    Features

    • 【工具】增加0daychecker工具
    • 【工具】增加Log4j、LogBack漏洞检查规则包

    Docs

    • 完善部署文档说明,推荐使用Docker-Compose 2.3.3版本

    V1.1.0 (2022-3-29)

    Features

    • 【客户端】client支持arm64架构执行环境
    • 【客户端】client新增分布式节点模式
    • 【客户端】修改参数isTotal(是否开启全量扫描)判断方式及参数startCommand(启动客户端命令)拼接方式
    • 【服务端】支持任务分布式下发
    • 【服务端】完善基于minio的文件存储配置
    • 【Web端】调整文件资源引用地址
    • 【Web端】web模块部署脚本问题修复及优化
    • 【Web端】增加管理后台、增加在线分析
    • 【Web端】调整前端部署脚本,支持传递nginx配置地址、前端资源部署地址

    Bugfixes

    • Jenkins插件命令拼装逻辑修正

    Docs

    • 调整pypi下载失败提示
    • 调整前端部署文档及脚本
    • 更新License

    V1.0.1 (2022-03-01)

    Features

    • feat: 【服务端】调整代码库登记ssh url链接格式适配
    • feat: 【工具】上线支持PHP安全工具-Rips
    • feat: 【工具】调整androidlint部分规则描述
    • feat: 【客户端】上线Jenkins插件
    • feat: 【客户端】增加工具拉取可选配置项
    • feat: 【客户端】支持在命令行参数中输入团队编号和项目名称
    • feat: 【客户端】限制PYTHON_VERSION环境变量可选值
    • feat: 【客户端】增加在docker中快速使用client的方式

    Bugfixes

    • fix: 【服务端】补充缺失的依赖
    • fix: 【Web端】修复下载codedog.ini失败提示

    Docs

    • doc: 上线部署文档Q&A
    • doc: 优化部署文档、帮助文档说明
    • doc: 增加产品白皮书
    • doc: 补充redis和nginx源码安装参考文档

    V1.0.0

    初始发布

    ',74),d=[h];function s(c,n){return i(),a("div",null,d)}const u=e(r,[["render",s],["__file","changelog.html.vue"]]);export{u as default}; diff --git a/assets/changelog.html-55c50323.js b/assets/changelog.html-55c50323.js new file mode 100644 index 000000000..81cec38ee --- /dev/null +++ b/assets/changelog.html-55c50323.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3179abd3","path":"/zh/community/changelog.html","title":"更新日志","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"V1.4.1 (2022-7-28)","slug":"v1-4-1-2022-7-28","link":"#v1-4-1-2022-7-28","children":[{"level":3,"title":"Features","slug":"features","link":"#features","children":[]},{"level":3,"title":"Docs","slug":"docs","link":"#docs","children":[]}]},{"level":2,"title":"V1.4.0 (2022-7-18)","slug":"v1-4-0-2022-7-18","link":"#v1-4-0-2022-7-18","children":[{"level":3,"title":"Features","slug":"features-1","link":"#features-1","children":[]},{"level":3,"title":"Docs","slug":"docs-1","link":"#docs-1","children":[]}]},{"level":2,"title":"V1.3.3 (2022-6-29)","slug":"v1-3-3-2022-6-29","link":"#v1-3-3-2022-6-29","children":[{"level":3,"title":"Features","slug":"features-2","link":"#features-2","children":[]},{"level":3,"title":"Bugfixes","slug":"bugfixes","link":"#bugfixes","children":[]},{"level":3,"title":"Docs","slug":"docs-2","link":"#docs-2","children":[]}]},{"level":2,"title":"V1.3.2 (2022-6-16)","slug":"v1-3-2-2022-6-16","link":"#v1-3-2-2022-6-16","children":[{"level":3,"title":"Features","slug":"features-3","link":"#features-3","children":[]},{"level":3,"title":"Docs","slug":"docs-3","link":"#docs-3","children":[]}]},{"level":2,"title":"V1.3.1 (2022-6-14)","slug":"v1-3-1-2022-6-14","link":"#v1-3-1-2022-6-14","children":[{"level":3,"title":"Features","slug":"features-4","link":"#features-4","children":[]}]},{"level":2,"title":"V1.3.0 (2022-6-7)","slug":"v1-3-0-2022-6-7","link":"#v1-3-0-2022-6-7","children":[{"level":3,"title":"Features","slug":"features-5","link":"#features-5","children":[]},{"level":3,"title":"Bugfixes","slug":"bugfixes-1","link":"#bugfixes-1","children":[]},{"level":3,"title":"Docs","slug":"docs-4","link":"#docs-4","children":[]}]},{"level":2,"title":"V1.2.1 (2022-5-24)","slug":"v1-2-1-2022-5-24","link":"#v1-2-1-2022-5-24","children":[{"level":3,"title":"Features","slug":"features-6","link":"#features-6","children":[]},{"level":3,"title":"Docs","slug":"docs-5","link":"#docs-5","children":[]}]},{"level":2,"title":"V1.2.0 (2022-4-27)","slug":"v1-2-0-2022-4-27","link":"#v1-2-0-2022-4-27","children":[{"level":3,"title":"Features","slug":"features-7","link":"#features-7","children":[]},{"level":3,"title":"Docs","slug":"docs-6","link":"#docs-6","children":[]}]},{"level":2,"title":"V1.1.3 (2022-4-18)","slug":"v1-1-3-2022-4-18","link":"#v1-1-3-2022-4-18","children":[{"level":3,"title":"Features","slug":"features-8","link":"#features-8","children":[]},{"level":3,"title":"Docs","slug":"docs-7","link":"#docs-7","children":[]}]},{"level":2,"title":"V1.1.2 (2022-4-2)","slug":"v1-1-2-2022-4-2","link":"#v1-1-2-2022-4-2","children":[{"level":3,"title":"Features","slug":"features-9","link":"#features-9","children":[]},{"level":3,"title":"Docs","slug":"docs-8","link":"#docs-8","children":[]}]},{"level":2,"title":"V1.1.1 (2022-3-31)","slug":"v1-1-1-2022-3-31","link":"#v1-1-1-2022-3-31","children":[{"level":3,"title":"Features","slug":"features-10","link":"#features-10","children":[]},{"level":3,"title":"Docs","slug":"docs-9","link":"#docs-9","children":[]}]},{"level":2,"title":"V1.1.0 (2022-3-29)","slug":"v1-1-0-2022-3-29","link":"#v1-1-0-2022-3-29","children":[{"level":3,"title":"Features","slug":"features-11","link":"#features-11","children":[]},{"level":3,"title":"Bugfixes","slug":"bugfixes-2","link":"#bugfixes-2","children":[]},{"level":3,"title":"Docs","slug":"docs-10","link":"#docs-10","children":[]}]},{"level":2,"title":"V1.0.1 (2022-03-01)","slug":"v1-0-1-2022-03-01","link":"#v1-0-1-2022-03-01","children":[{"level":3,"title":"Features","slug":"features-12","link":"#features-12","children":[]},{"level":3,"title":"Bugfixes","slug":"bugfixes-3","link":"#bugfixes-3","children":[]},{"level":3,"title":"Docs","slug":"docs-11","link":"#docs-11","children":[]}]},{"level":2,"title":"V1.0.0","slug":"v1-0-0","link":"#v1-0-0","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/community/changelog.md"}');export{e as data}; diff --git a/assets/changelog.html-c22ca463.js b/assets/changelog.html-c22ca463.js new file mode 100644 index 000000000..618238893 --- /dev/null +++ b/assets/changelog.html-c22ca463.js @@ -0,0 +1 @@ +import{_ as e,o as i,c as a,e as l}from"./app-2a91d8ab.js";const r={},h=l('

    更新日志

    V1.4.1 (2022-7-28)

    Features

    • 【服务端】统一部署脚本,封装local、docker、docker-compose部署方式启动server&web&client
    • 【服务端】支持源码安装Redis与Nginx
    • 【服务端】macOS启动docker desktop
    • 【服务端】完善github action脚本
    • 【工具】更新工具列表

    Docs

    • 上传新版本白皮书
    • 调整快速入门指引文档

    V1.4.0 (2022-7-18)

    Features

    • 【客户端】jenkins插件增加分析方案模版ID和分析方案名称参数
    • 【服务端】增加扫描方案模板API
    • 【服务器】优化文件服务器鉴权交互
    • 【客户端】QuickScan支持指定分析方案模板进行扫描;支持从环境变量读取文件服务器url和token
    • 【Web端】升级moment依赖

    Docs

    • 更新插件使用说明书和启动参数说明

    V1.3.3 (2022-6-29)

    Features

    • 【服务端】支持团队、项目组禁用,支持代码库、分析项目删除
    • 【服务端】扫描方案支持分支过滤
    • 【Web端】支持禁用团队、项目,代码库登记支持ssh_url
    • 【Web端】支持分支过滤配置,修复代码统计文件选中效果,支持工具、依赖凭证移除
    • 【工具】增加tca_ql工具
    • 【客户端】节点模式不再由客户端加载编译工具的环境变量,避免覆盖机器原有环境变量
    • 【客户端】QuickScan模式,异常时输出task.log方便排查问题
    • 【客户端】.code.yml支持.yaml后缀

    Bugfixes

    • 【客户端】tool_scheme和ini配置共用时,可能出现工具重复,需要对工具库去重后再拉取

    Docs

    • 更新TCA Action相关文档
    • 更新Jenkins插件文档;增加环境依赖说明
    • 更新自定义工具文档,使用工具依赖
    • 更新CLS readme

    V1.3.2 (2022-6-16)

    Features

    • 【客户端】QuickScan根据语言执行不同的任务

    Docs

    • docker-compose部署文档中数据库注意事项

    V1.3.1 (2022-6-14)

    Features

    • 【客户端】新增merge quest分支增量扫描
    • 【客户端】新增Quickscan模式
    • 【客户端】localscan支持工具并发
    • 【工具】新增二进制文件依赖分析工具
    • 【服务端】server调整服务监控探测脚本:celery状态判断
    • 【服务端】增加子任务接口,完善部署脚本
    • 【服务端】更新CLS版本v20220613.1
    • 【服务端】基于 CentOS7.9.2009(已测)的运行环境一键安装脚本,并已安装及配置命令 gunicorn 和 celery
    • 【Web端】调整OAuth显示

    V1.3.0 (2022-6-7)

    Features

    • 【工具】新增独立工具Loong
    • 【工具】新增Java、JS基础安全规则包
    • 【工具】增加Go和Python技术安全规则包
    • 【服务端】新增oauth授权及工具依赖管理
    • 【服务端】docker-compose部署支持挂载本地日志目录
    • 【客户端】支持工具依赖管理
    • 【Web端】支持工具依赖管理设置和Git OAuth设置
    • 【Web端】团队列表支持滚动加载

    Bugfixes

    • 【服务端】补充scmproxy缺失依赖
    • 【服务端】修复issue入库忽略处理操作

    Docs

    • 更新工具目录readme
    • 更新client README.md

    V1.2.1 (2022-5-24)

    Features

    • 【工具】新增Collie/Compass(测试版)工具
    • 【工具】添加tscancode系列工具
    • 【工具】工具区分编译型和非编译型
    • 【客户端】更新cmdscm二进制文件,调整获取ssh端口号方式
    • 【客户端】增加腾讯工蜂作为工具拉取源,支持选用
    • 【服务端】调整工程配置和文档,支持https克隆
    • 【Web端】前端页面优化

    Docs

    • 添加集成工具说明文档
    • readme增加微信公众号和腾讯开源摘星计划的说明及链接
    • 修改帮助文档的脚本名称;修改工蜂镜像仓库链接位置
    • 调整自定义规则文档
    • 调整doc,优化部署、使用文档

    V1.2.0 (2022-4-27)

    Features

    • 【Web端】增加工具管理
    • 【工具】增加logback检查的安全规则
    • 【服务端】增加TCA server&web 一键部署脚本
    • 【服务端】删除main部分异步任务;调整server nginx启动位置
    • 【服务端】增加server健康监测

    Docs

    • 完善部署和Q&A文档
    • 上传工具列表

    V1.1.3 (2022-4-18)

    Features

    • 【工具】上传开源合规检查规则
    • 【工具】新增PHP安全相关规则
    • 【服务端】上线license鉴权
    • 【客户端】支持对工具license校验

    Docs

    • 更新文档内的工具默认路径
    • 增加任务分布式执行能力操作文档
    • 增加PR操作流程

    V1.1.2 (2022-4-2)

    Features

    • 【服务端】优化部署构建脚本

    Docs

    • 简化前端部署脚本&文档
    • 优化指引文档

    V1.1.1 (2022-3-31)

    Features

    • 【工具】增加0daychecker工具
    • 【工具】增加Log4j、LogBack漏洞检查规则包

    Docs

    • 完善部署文档说明,推荐使用Docker-Compose 2.3.3版本

    V1.1.0 (2022-3-29)

    Features

    • 【客户端】client支持arm64架构执行环境
    • 【客户端】client新增分布式节点模式
    • 【客户端】修改参数isTotal(是否开启全量扫描)判断方式及参数startCommand(启动客户端命令)拼接方式
    • 【服务端】支持任务分布式下发
    • 【服务端】完善基于minio的文件存储配置
    • 【Web端】调整文件资源引用地址
    • 【Web端】web模块部署脚本问题修复及优化
    • 【Web端】增加管理后台、增加在线分析
    • 【Web端】调整前端部署脚本,支持传递nginx配置地址、前端资源部署地址

    Bugfixes

    • Jenkins插件命令拼装逻辑修正

    Docs

    • 调整pypi下载失败提示
    • 调整前端部署文档及脚本
    • 更新License

    V1.0.1 (2022-03-01)

    Features

    • feat: 【服务端】调整代码库登记ssh url链接格式适配
    • feat: 【工具】上线支持PHP安全工具-Rips
    • feat: 【工具】调整androidlint部分规则描述
    • feat: 【客户端】上线Jenkins插件
    • feat: 【客户端】增加工具拉取可选配置项
    • feat: 【客户端】支持在命令行参数中输入团队编号和项目名称
    • feat: 【客户端】限制PYTHON_VERSION环境变量可选值
    • feat: 【客户端】增加在docker中快速使用client的方式

    Bugfixes

    • fix: 【服务端】补充缺失的依赖
    • fix: 【Web端】修复下载codedog.ini失败提示

    Docs

    • doc: 上线部署文档Q&A
    • doc: 优化部署文档、帮助文档说明
    • doc: 增加产品白皮书
    • doc: 补充redis和nginx源码安装参考文档

    V1.0.0

    初始发布

    ',74),d=[h];function s(c,n){return i(),a("div",null,d)}const u=e(r,[["render",s],["__file","changelog.html.vue"]]);export{u as default}; diff --git a/assets/changelog.html-c4b08e96.js b/assets/changelog.html-c4b08e96.js new file mode 100644 index 000000000..e22c446ca --- /dev/null +++ b/assets/changelog.html-c4b08e96.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-ee298290","path":"/en/community/changelog.html","title":"更新日志","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"V1.4.1 (2022-7-28)","slug":"v1-4-1-2022-7-28","link":"#v1-4-1-2022-7-28","children":[{"level":3,"title":"Features","slug":"features","link":"#features","children":[]},{"level":3,"title":"Docs","slug":"docs","link":"#docs","children":[]}]},{"level":2,"title":"V1.4.0 (2022-7-18)","slug":"v1-4-0-2022-7-18","link":"#v1-4-0-2022-7-18","children":[{"level":3,"title":"Features","slug":"features-1","link":"#features-1","children":[]},{"level":3,"title":"Docs","slug":"docs-1","link":"#docs-1","children":[]}]},{"level":2,"title":"V1.3.3 (2022-6-29)","slug":"v1-3-3-2022-6-29","link":"#v1-3-3-2022-6-29","children":[{"level":3,"title":"Features","slug":"features-2","link":"#features-2","children":[]},{"level":3,"title":"Bugfixes","slug":"bugfixes","link":"#bugfixes","children":[]},{"level":3,"title":"Docs","slug":"docs-2","link":"#docs-2","children":[]}]},{"level":2,"title":"V1.3.2 (2022-6-16)","slug":"v1-3-2-2022-6-16","link":"#v1-3-2-2022-6-16","children":[{"level":3,"title":"Features","slug":"features-3","link":"#features-3","children":[]},{"level":3,"title":"Docs","slug":"docs-3","link":"#docs-3","children":[]}]},{"level":2,"title":"V1.3.1 (2022-6-14)","slug":"v1-3-1-2022-6-14","link":"#v1-3-1-2022-6-14","children":[{"level":3,"title":"Features","slug":"features-4","link":"#features-4","children":[]}]},{"level":2,"title":"V1.3.0 (2022-6-7)","slug":"v1-3-0-2022-6-7","link":"#v1-3-0-2022-6-7","children":[{"level":3,"title":"Features","slug":"features-5","link":"#features-5","children":[]},{"level":3,"title":"Bugfixes","slug":"bugfixes-1","link":"#bugfixes-1","children":[]},{"level":3,"title":"Docs","slug":"docs-4","link":"#docs-4","children":[]}]},{"level":2,"title":"V1.2.1 (2022-5-24)","slug":"v1-2-1-2022-5-24","link":"#v1-2-1-2022-5-24","children":[{"level":3,"title":"Features","slug":"features-6","link":"#features-6","children":[]},{"level":3,"title":"Docs","slug":"docs-5","link":"#docs-5","children":[]}]},{"level":2,"title":"V1.2.0 (2022-4-27)","slug":"v1-2-0-2022-4-27","link":"#v1-2-0-2022-4-27","children":[{"level":3,"title":"Features","slug":"features-7","link":"#features-7","children":[]},{"level":3,"title":"Docs","slug":"docs-6","link":"#docs-6","children":[]}]},{"level":2,"title":"V1.1.3 (2022-4-18)","slug":"v1-1-3-2022-4-18","link":"#v1-1-3-2022-4-18","children":[{"level":3,"title":"Features","slug":"features-8","link":"#features-8","children":[]},{"level":3,"title":"Docs","slug":"docs-7","link":"#docs-7","children":[]}]},{"level":2,"title":"V1.1.2 (2022-4-2)","slug":"v1-1-2-2022-4-2","link":"#v1-1-2-2022-4-2","children":[{"level":3,"title":"Features","slug":"features-9","link":"#features-9","children":[]},{"level":3,"title":"Docs","slug":"docs-8","link":"#docs-8","children":[]}]},{"level":2,"title":"V1.1.1 (2022-3-31)","slug":"v1-1-1-2022-3-31","link":"#v1-1-1-2022-3-31","children":[{"level":3,"title":"Features","slug":"features-10","link":"#features-10","children":[]},{"level":3,"title":"Docs","slug":"docs-9","link":"#docs-9","children":[]}]},{"level":2,"title":"V1.1.0 (2022-3-29)","slug":"v1-1-0-2022-3-29","link":"#v1-1-0-2022-3-29","children":[{"level":3,"title":"Features","slug":"features-11","link":"#features-11","children":[]},{"level":3,"title":"Bugfixes","slug":"bugfixes-2","link":"#bugfixes-2","children":[]},{"level":3,"title":"Docs","slug":"docs-10","link":"#docs-10","children":[]}]},{"level":2,"title":"V1.0.1 (2022-03-01)","slug":"v1-0-1-2022-03-01","link":"#v1-0-1-2022-03-01","children":[{"level":3,"title":"Features","slug":"features-12","link":"#features-12","children":[]},{"level":3,"title":"Bugfixes","slug":"bugfixes-3","link":"#bugfixes-3","children":[]},{"level":3,"title":"Docs","slug":"docs-11","link":"#docs-11","children":[]}]},{"level":2,"title":"V1.0.0","slug":"v1-0-0","link":"#v1-0-0","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/community/changelog.md"}');export{e as data}; diff --git a/assets/codeDeploy.html-0291e9cf.js b/assets/codeDeploy.html-0291e9cf.js new file mode 100644 index 000000000..53d61c013 --- /dev/null +++ b/assets/codeDeploy.html-0291e9cf.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-64f30f77","path":"/en/quickStarted/codeDeploy.html","title":"源代码快速部署","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/codeDeploy.md"}');export{e as data}; diff --git a/assets/codeDeploy.html-319b644b.js b/assets/codeDeploy.html-319b644b.js new file mode 100644 index 000000000..1a74b461d --- /dev/null +++ b/assets/codeDeploy.html-319b644b.js @@ -0,0 +1,7 @@ +import{_ as d,r as c,o as n,c as t,a as l,b as e,d as a,w as o,e as s}from"./app-2a91d8ab.js";const r={},h=l("h1",{id:"源代码快速部署",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#源代码快速部署","aria-hidden":"true"},"#"),e(" 源代码快速部署")],-1),p=l("br",null,null,-1),u=s(`

    依赖环境

    • 系统环境

      • Linux
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备

      提示

      TCA 一键部署脚本已封装好 Python、Mariadb、Redis 与 Nginx 安装步骤,无需自行安装本地部署体验可按 操作说明 内容直接进行部署操作。

      注意:生产环境建议使用专业的 MySQL、Redis 等服务

      • Python 3.7

      • MySQL 服务(MySQL5.7.8 以上版本或 Mariadb 10.5 以上版本)

      • Redis 服务(4.0版本以上)

      • Nginx 服务

    • 权限准备

      • 环境权限:安装 Server 依赖软件(python、nginx、yum 等软件包)需要使用 ROOT 权限
        • 启动 Server 服务时可以使用非 ROOT 用户运行
      • 数据库权限:Server 服务执行数据库初始化需要依赖 CREATE、ALTER、INDEX、DELETE、LOCK TABLES、SELECT、INSERT、REFERENCES、UPDATE 权限
    • 端口使用:需要开放80端口的访问权限(80为TCA平台默认访问端口),或调整 Web 服务默认的访问端口地址

    操作说明

    首次启动操作
    1. 进入 CodeAnalysis 工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径

    2. 安装基础软件与部署 TCA(可根据脚本选项确定是否要安装 Python、MySQL、Redis、Nginx 相关基础软件),执行

    $ bash ./quick_install.sh local deploy
    +

    执行该命令会做以下四个步骤:

    • Install:检测本地 Python3.7、Mariadb/MySQL、Redis 与 Nginx,如果不存在会提示安装
    • Init:部署 TCA Server、Web与Client,并进行初始化
    • Start:启动 TCA Server、Web与Client
    • Check:检测 TCA 的运行状态

    注意:在运行过程中,脚本会检测本地是否安装了相关基础软件(Python3.7、MySQL/Mariadb、Redis、Nignx),如果未安装会输出以下类似提示语:

    Do you want to install [Redis] by this script?
    +Please enter:[Y/N]
    +

    如果确定通过脚本安装可以输入Y

    1. 执行完成,无其他报错,即可登录:
    `,12),b={class:"custom-container tip"},_=l("p",{class:"custom-container-title"},"提示",-1),g=l("code",null,"http://部署机器IP/",-1),m=l("br",null,null,-1),v=l("p",null,"默认平台登录账号/密码:CodeDog/admin",-1),E=l("p",null,"如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录",-1),y=s(`
    更新操作

    1. 更新代码

    2. 执行以下命令

    bash ./quick_install.sh local install tca  #更新相关配置
    +bash ./quick_install.sh local start  #启动服务(会自动关闭之前的服务)
    +bash ./quick_install.sh local check  #检查服务是否启动失败
    +

    注意:
    local install命令行参数说明:
    - base:安装 Python、Mariadb/MySQL、Redis 与 Nginx
    - tca:初始化或更新 TCA Server、Web、Client 相关配置和数据
    - server:初始化或更新 TCA Server 相关配置和数据
    - web:初始化或更新 TCA Web 相关配置和数据
    - client:初始化或更新 TCA Client 相关配置和数据
    - 不填参数,默认会执行basetca相关操作

    启动和停止服务
    • 启动所有服务:bash ./quick_install.sh local start

    • 启动Main相关服务:bash ./quick_install.sh local start main

      • local start支持启动指定服务,如上述的启动Main服务,还支持mysql/redis/analysis/file/login/scmproxy/nginx/client/all
    • 停止所有服务:bash ./quick_install.sh local stop

    • 停止Main相关服务:bash ./quick_install.sh local stop main

      • local stop支持停止指定服务,如上述的停止Main服务,还支持analysis/file/login/scmproxy/nginx/client/all

    注意:

    1. 启动时会自动关闭之前已经运行的服务

    2. mysqlredis默认会使用systemctl进行启动,如果systemctl无法使用,则会直接使用nohup方式运行相关服务

    检查服务运行状态

    检查服务运行状态:bash ./quick_install.sh local check

    • 目前支持检查 server 与 web,暂不支持 client
    获取服务输出日志

    打印 TCA Server 各个服务的日志路径: bash ./quick_install.sh local log

    `,14);function A(C,x){const i=c("RouterLink");return n(),t("div",null,[h,l("p",null,[e("TCA提供部署脚本,支持一键式快速部署Server、Web、Client。"),p,e(" 脚本共提供三种部署方式:"),a(i,{to:"/zh/quickStarted/dockerDeploy.html"},{default:o(()=>[e("Docker部署(平台体验首推)")]),_:1}),e("、"),a(i,{to:"/zh/quickStarted/dockercomposeDeploy.html"},{default:o(()=>[e("Docker-Compose部署")]),_:1}),e("、源码部署, 可根据您的具体使用场景任意选择其一进行部署。")]),u,l("div",b,[_,l("p",null,[e("至此,您已完成 TCA 平台部署,请在浏览器输入"),g,e(",点击立即体验,完成登录后即可开启您的腾讯云代码分析。"),m,e(" 平台内操作指引请查看:"),a(i,{to:"/zh/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html"},{default:o(()=>[e("快速启动一次代码分析")]),_:1})]),v,E]),y])}const k=d(r,[["render",A],["__file","codeDeploy.html.vue"]]);export{k as default}; diff --git a/assets/codeDeploy.html-bfd1275a.js b/assets/codeDeploy.html-bfd1275a.js new file mode 100644 index 000000000..d53d0aa17 --- /dev/null +++ b/assets/codeDeploy.html-bfd1275a.js @@ -0,0 +1,7 @@ +import{_ as d,r as c,o as n,c as t,a as l,b as e,d as a,w as o,e as s}from"./app-2a91d8ab.js";const r={},h=l("h1",{id:"源代码快速部署",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#源代码快速部署","aria-hidden":"true"},"#"),e(" 源代码快速部署")],-1),p=l("br",null,null,-1),u=s(`

    依赖环境

    • 系统环境

      • Linux
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备

      TIP

      TCA 一键部署脚本已封装好 Python、Mariadb、Redis 与 Nginx 安装步骤,无需自行安装本地部署体验可按 操作说明 内容直接进行部署操作。

      注意:生产环境建议使用专业的 MySQL、Redis 等服务

      • Python 3.7

      • MySQL 服务(MySQL5.7.8 以上版本或 Mariadb 10.5 以上版本)

      • Redis 服务(4.0版本以上)

      • Nginx 服务

    • 权限准备

      • 环境权限:安装 Server 依赖软件(python、nginx、yum 等软件包)需要使用 ROOT 权限
        • 启动 Server 服务时可以使用非 ROOT 用户运行
      • 数据库权限:Server 服务执行数据库初始化需要依赖 CREATE、ALTER、INDEX、DELETE、LOCK TABLES、SELECT、INSERT、REFERENCES、UPDATE 权限
    • 端口使用:需要开放80端口的访问权限(80为TCA平台默认访问端口),或调整 Web 服务默认的访问端口地址

    操作说明

    首次启动操作
    1. 进入 CodeAnalysis 工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径

    2. 安装基础软件与部署 TCA(可根据脚本选项确定是否要安装 Python、MySQL、Redis、Nginx 相关基础软件),执行

    $ bash ./quick_install.sh local deploy
    +

    执行该命令会做以下四个步骤:

    • Install:检测本地 Python3.7、Mariadb/MySQL、Redis 与 Nginx,如果不存在会提示安装
    • Init:部署 TCA Server、Web与Client,并进行初始化
    • Start:启动 TCA Server、Web与Client
    • Check:检测 TCA 的运行状态

    注意:在运行过程中,脚本会检测本地是否安装了相关基础软件(Python3.7、MySQL/Mariadb、Redis、Nignx),如果未安装会输出以下类似提示语:

    Do you want to install [Redis] by this script?
    +Please enter:[Y/N]
    +

    如果确定通过脚本安装可以输入Y

    1. 执行完成,无其他报错,即可登录:
    `,12),b={class:"custom-container tip"},_=l("p",{class:"custom-container-title"},"TIP",-1),g=l("code",null,"http://部署机器IP/",-1),m=l("br",null,null,-1),v=l("p",null,"默认平台登录账号/密码:CodeDog/admin",-1),E=l("p",null,"如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录",-1),y=s(`
    更新操作

    1. 更新代码

    2. 执行以下命令

    bash ./quick_install.sh local install tca  #更新相关配置
    +bash ./quick_install.sh local start  #启动服务(会自动关闭之前的服务)
    +bash ./quick_install.sh local check  #检查服务是否启动失败
    +

    注意:
    local install命令行参数说明:
    - base:安装 Python、Mariadb/MySQL、Redis 与 Nginx
    - tca:初始化或更新 TCA Server、Web、Client 相关配置和数据
    - server:初始化或更新 TCA Server 相关配置和数据
    - web:初始化或更新 TCA Web 相关配置和数据
    - client:初始化或更新 TCA Client 相关配置和数据
    - 不填参数,默认会执行basetca相关操作

    启动和停止服务
    • 启动所有服务:bash ./quick_install.sh local start

    • 启动Main相关服务:bash ./quick_install.sh local start main

      • local start支持启动指定服务,如上述的启动Main服务,还支持mysql/redis/analysis/file/login/scmproxy/nginx/client/all
    • 停止所有服务:bash ./quick_install.sh local stop

    • 停止Main相关服务:bash ./quick_install.sh local stop main

      • local stop支持停止指定服务,如上述的停止Main服务,还支持analysis/file/login/scmproxy/nginx/client/all

    注意:

    1. 启动时会自动关闭之前已经运行的服务

    2. mysqlredis默认会使用systemctl进行启动,如果systemctl无法使用,则会直接使用nohup方式运行相关服务

    检查服务运行状态

    检查服务运行状态:bash ./quick_install.sh local check

    • 目前支持检查 server 与 web,暂不支持 client
    获取服务输出日志

    打印 TCA Server 各个服务的日志路径: bash ./quick_install.sh local log

    `,14);function A(C,x){const i=c("RouterLink");return n(),t("div",null,[h,l("p",null,[e("TCA提供部署脚本,支持一键式快速部署Server、Web、Client。"),p,e(" 脚本共提供三种部署方式:"),a(i,{to:"/en/quickStarted/dockerDeploy.html"},{default:o(()=>[e("Docker部署(平台体验首推)")]),_:1}),e("、"),a(i,{to:"/en/quickStarted/dockercomposeDeploy.html"},{default:o(()=>[e("Docker-Compose部署")]),_:1}),e("、源码部署, 可根据您的具体使用场景任意选择其一进行部署。")]),u,l("div",b,[_,l("p",null,[e("至此,您已完成 TCA 平台部署,请在浏览器输入"),g,e(",点击立即体验,完成登录后即可开启您的腾讯云代码分析。"),m,e(" 平台内操作指引请查看:"),a(i,{to:"/en/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html"},{default:o(()=>[e("快速启动一次代码分析")]),_:1})]),v,E]),y])}const S=d(r,[["render",A],["__file","codeDeploy.html.vue"]]);export{S as default}; diff --git a/assets/codeDeploy.html-fb37d8a4.js b/assets/codeDeploy.html-fb37d8a4.js new file mode 100644 index 000000000..407a03377 --- /dev/null +++ b/assets/codeDeploy.html-fb37d8a4.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-17ff7712","path":"/zh/quickStarted/codeDeploy.html","title":"源代码快速部署","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/codeDeploy.md"}');export{t as data}; diff --git a/assets/code_spec_oc.html-870d81eb.js b/assets/code_spec_oc.html-870d81eb.js new file mode 100644 index 000000000..0ec6f83e8 --- /dev/null +++ b/assets/code_spec_oc.html-870d81eb.js @@ -0,0 +1,2 @@ +import{_ as i,r as o,o as a,c as l,a as e,b as t,d as r,e as s}from"./app-2a91d8ab.js";const c={},h=e("h1",{id:"【objective-c】代码规范规则包",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#【objective-c】代码规范规则包","aria-hidden":"true"},"#"),t(" 【Objective-C】代码规范规则包")],-1),A=e("p",null,"该规则包针对 Objective-C/C++ 语言进行代码规范相关检查。",-1),d=e("h2",{id:"规则列表",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#规则列表","aria-hidden":"true"},"#"),t(" 规则列表")],-1),E={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/Copyright",target:"_blank",rel:"noopener noreferrer"},C={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/Indent",target:"_blank",rel:"noopener noreferrer"},b={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MaxLinesPerFunction",target:"_blank",rel:"noopener noreferrer"},g={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MissingDocInterface",target:"_blank",rel:"noopener noreferrer"},_={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MissingDocProperty",target:"_blank",rel:"noopener noreferrer"},u={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MissingDocProtocol",target:"_blank",rel:"noopener noreferrer"},m={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/ParameterCount",target:"_blank",rel:"noopener noreferrer"},B={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/ClassNaming",target:"_blank",rel:"noopener noreferrer"},p={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/FunctionNaming",target:"_blank",rel:"noopener noreferrer"},f={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/GlobalVariableNaming",target:"_blank",rel:"noopener noreferrer"},v={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/LocalVariableNaming",target:"_blank",rel:"noopener noreferrer"},j={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MacroNaming",target:"_blank",rel:"noopener noreferrer"},y={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MethodNaming",target:"_blank",rel:"noopener noreferrer"},O={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/ParameterNaming",target:"_blank",rel:"noopener noreferrer"},F={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MaxLineLength",target:"_blank",rel:"noopener noreferrer"},k=s(`

    启用规则包

    分析方案 -> 代码检查 ->【Objective-C】代码规范规则包 -> 启用/查看规则。

    格式化工具

    为了帮助你正确地格式化代码,我们建议你使用clang-format进行代码自动格式化。工具可直接通过 Homebrew 进行安装:

    brew install clang-format
    +

    安装完成后将 .clang-format 配置文件置于工程根目录,执行 clang-format -i FILE.m 即可完成自动格式化。目前格式化工具配置仅支持11.0版本。

    `,6);function N(T,x){const n=o("ExternalLinkIcon");return a(),l("div",null,[h,A,d,e("ul",null,[e("li",null,[e("a",E,[t("ObjectiveC/Copyright"),r(n)])]),e("li",null,[e("a",C,[t("ObjectiveC/Indent"),r(n)])]),e("li",null,[e("a",b,[t("ObjectiveC/MaxLinesPerFunction"),r(n)])]),e("li",null,[e("a",g,[t("ObjectiveC/MissingDocInterface"),r(n)])]),e("li",null,[e("a",_,[t("ObjectiveC/MissingDocProperty"),r(n)])]),e("li",null,[e("a",u,[t("ObjectiveC/MissingDocProtocol"),r(n)])]),e("li",null,[e("a",m,[t("ObjectiveC/ParameterCount"),r(n)])]),e("li",null,[e("a",B,[t("ObjectiveC/ClassNaming"),r(n)])]),e("li",null,[e("a",p,[t("ObjectiveC/FunctionNaming"),r(n)])]),e("li",null,[e("a",f,[t("ObjectiveC/GlobalVariableNaming"),r(n)])]),e("li",null,[e("a",v,[t("ObjectiveC/LocalVariableNaming"),r(n)])]),e("li",null,[e("a",j,[t("ObjectiveC/MacroNaming"),r(n)])]),e("li",null,[e("a",y,[t("ObjectiveC/MethodNaming"),r(n)])]),e("li",null,[e("a",O,[t("ObjectiveC/ParameterNaming"),r(n)])]),e("li",null,[e("a",F,[t("ObjectiveC/MaxLineLength"),r(n)])])]),k])}const M=i(c,[["render",N],["__file","code_spec_oc.html.vue"]]);export{M as default}; diff --git a/assets/code_spec_oc.html-9d084275.js b/assets/code_spec_oc.html-9d084275.js new file mode 100644 index 000000000..4219451ec --- /dev/null +++ b/assets/code_spec_oc.html-9d084275.js @@ -0,0 +1,2 @@ +import{_ as i,r as o,o as a,c as l,a as e,b as t,d as r,e as s}from"./app-2a91d8ab.js";const c={},A=e("h1",{id:"【objective-c】代码规范规则包",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#【objective-c】代码规范规则包","aria-hidden":"true"},"#"),t(" 【Objective-C】代码规范规则包")],-1),h=e("p",null,"该规则包针对 Objective-C/C++ 语言进行代码规范相关检查。",-1),d=e("h2",{id:"规则列表",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#规则列表","aria-hidden":"true"},"#"),t(" 规则列表")],-1),E={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/Copyright",target:"_blank",rel:"noopener noreferrer"},C={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/Indent",target:"_blank",rel:"noopener noreferrer"},b={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MaxLinesPerFunction",target:"_blank",rel:"noopener noreferrer"},g={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MissingDocInterface",target:"_blank",rel:"noopener noreferrer"},_={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MissingDocProperty",target:"_blank",rel:"noopener noreferrer"},u={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MissingDocProtocol",target:"_blank",rel:"noopener noreferrer"},m={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/ParameterCount",target:"_blank",rel:"noopener noreferrer"},B={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/ClassNaming",target:"_blank",rel:"noopener noreferrer"},p={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/FunctionNaming",target:"_blank",rel:"noopener noreferrer"},f={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/GlobalVariableNaming",target:"_blank",rel:"noopener noreferrer"},v={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/LocalVariableNaming",target:"_blank",rel:"noopener noreferrer"},j={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MacroNaming",target:"_blank",rel:"noopener noreferrer"},y={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MethodNaming",target:"_blank",rel:"noopener noreferrer"},O={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/ParameterNaming",target:"_blank",rel:"noopener noreferrer"},F={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#ObjectiveC/MaxLineLength",target:"_blank",rel:"noopener noreferrer"},k=s(`

    启用规则包

    分析方案 -> 代码检查 ->【Objective-C】代码规范规则包 -> 启用/查看规则。

    格式化工具

    为了帮助你正确地格式化代码,我们建议你使用clang-format进行代码自动格式化。工具可直接通过 Homebrew 进行安装:

    brew install clang-format
    +

    安装完成后将 .clang-format 配置文件置于工程根目录,执行 clang-format -i FILE.m 即可完成自动格式化。目前格式化工具配置仅支持11.0版本。

    `,6);function N(T,x){const n=o("ExternalLinkIcon");return a(),l("div",null,[A,h,d,e("ul",null,[e("li",null,[e("a",E,[t("ObjectiveC/Copyright"),r(n)])]),e("li",null,[e("a",C,[t("ObjectiveC/Indent"),r(n)])]),e("li",null,[e("a",b,[t("ObjectiveC/MaxLinesPerFunction"),r(n)])]),e("li",null,[e("a",g,[t("ObjectiveC/MissingDocInterface"),r(n)])]),e("li",null,[e("a",_,[t("ObjectiveC/MissingDocProperty"),r(n)])]),e("li",null,[e("a",u,[t("ObjectiveC/MissingDocProtocol"),r(n)])]),e("li",null,[e("a",m,[t("ObjectiveC/ParameterCount"),r(n)])]),e("li",null,[e("a",B,[t("ObjectiveC/ClassNaming"),r(n)])]),e("li",null,[e("a",p,[t("ObjectiveC/FunctionNaming"),r(n)])]),e("li",null,[e("a",f,[t("ObjectiveC/GlobalVariableNaming"),r(n)])]),e("li",null,[e("a",v,[t("ObjectiveC/LocalVariableNaming"),r(n)])]),e("li",null,[e("a",j,[t("ObjectiveC/MacroNaming"),r(n)])]),e("li",null,[e("a",y,[t("ObjectiveC/MethodNaming"),r(n)])]),e("li",null,[e("a",O,[t("ObjectiveC/ParameterNaming"),r(n)])]),e("li",null,[e("a",F,[t("ObjectiveC/MaxLineLength"),r(n)])])]),k])}const L=i(c,[["render",N],["__file","code_spec_oc.html.vue"]]);export{L as default}; diff --git a/assets/code_spec_oc.html-b745b523.js b/assets/code_spec_oc.html-b745b523.js new file mode 100644 index 000000000..edda42440 --- /dev/null +++ b/assets/code_spec_oc.html-b745b523.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-1f200688","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc.html","title":"【Objective-C】代码规范规则包","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"规则列表","slug":"规则列表","link":"#规则列表","children":[]},{"level":2,"title":"启用规则包","slug":"启用规则包","link":"#启用规则包","children":[]},{"level":2,"title":"格式化工具","slug":"格式化工具","link":"#格式化工具","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/规则包/code_spec_oc.md"}');export{e as data}; diff --git a/assets/code_spec_oc.html-c551e928.js b/assets/code_spec_oc.html-c551e928.js new file mode 100644 index 000000000..5958fdb21 --- /dev/null +++ b/assets/code_spec_oc.html-c551e928.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-02d030be","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/code_spec_oc.html","title":"【Objective-C】代码规范规则包","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"规则列表","slug":"规则列表","link":"#规则列表","children":[]},{"level":2,"title":"启用规则包","slug":"启用规则包","link":"#启用规则包","children":[]},{"level":2,"title":"格式化工具","slug":"格式化工具","link":"#格式化工具","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/规则包/code_spec_oc.md"}');export{e as data}; diff --git a/assets/codelint_01-16d22a72.png b/assets/codelint_01-16d22a72.png new file mode 100644 index 000000000..ce5098c2c Binary files /dev/null and b/assets/codelint_01-16d22a72.png differ diff --git a/assets/codelint_02-f10f8b1f.png b/assets/codelint_02-f10f8b1f.png new file mode 100644 index 000000000..406a93799 Binary files /dev/null and b/assets/codelint_02-f10f8b1f.png differ diff --git a/assets/codelint_03-2a32e4e0.png b/assets/codelint_03-2a32e4e0.png new file mode 100644 index 000000000..d013b2511 Binary files /dev/null and b/assets/codelint_03-2a32e4e0.png differ diff --git a/assets/codelint_03-8fa68424.js b/assets/codelint_03-8fa68424.js new file mode 100644 index 000000000..3f4ba18a4 --- /dev/null +++ b/assets/codelint_03-8fa68424.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/codelint_01-16d22a72.png",o="/CodeAnalysis/assets/codelint_02-f10f8b1f.png",t="/CodeAnalysis/assets/codelint_03-2a32e4e0.png";export{s as _,o as a,t as b}; diff --git a/assets/codelint_04-0c416697.png b/assets/codelint_04-0c416697.png new file mode 100644 index 000000000..b315bc7bf Binary files /dev/null and b/assets/codelint_04-0c416697.png differ diff --git a/assets/contribute.html-50405d2a.js b/assets/contribute.html-50405d2a.js new file mode 100644 index 000000000..44bc04e9a --- /dev/null +++ b/assets/contribute.html-50405d2a.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5b86903e","path":"/zh/community/contribute.html","title":"贡献指南","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"报告问题","slug":"报告问题","link":"#报告问题","children":[{"level":3,"title":"搜索已知issue","slug":"搜索已知issue","link":"#搜索已知issue","children":[]},{"level":3,"title":"报告新issue","slug":"报告新issue","link":"#报告新issue","children":[]}]},{"level":2,"title":"Pull Request","slug":"pull-request","link":"#pull-request","children":[{"level":3,"title":"分支管理","slug":"分支管理","link":"#分支管理","children":[]},{"level":3,"title":"提交Pull Request","slug":"提交pull-request","link":"#提交pull-request","children":[]}]},{"level":2,"title":"许可","slug":"许可","link":"#许可","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/community/contribute.md"}');export{e as data}; diff --git a/assets/contribute.html-58671db5.js b/assets/contribute.html-58671db5.js new file mode 100644 index 000000000..a955f967f --- /dev/null +++ b/assets/contribute.html-58671db5.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-1b714c0e","path":"/en/community/contribute.html","title":"贡献指南","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"报告问题","slug":"报告问题","link":"#报告问题","children":[{"level":3,"title":"搜索已知issue","slug":"搜索已知issue","link":"#搜索已知issue","children":[]},{"level":3,"title":"报告新issue","slug":"报告新issue","link":"#报告新issue","children":[]}]},{"level":2,"title":"Pull Request","slug":"pull-request","link":"#pull-request","children":[{"level":3,"title":"分支管理","slug":"分支管理","link":"#分支管理","children":[]},{"level":3,"title":"提交Pull Request","slug":"提交pull-request","link":"#提交pull-request","children":[]}]},{"level":2,"title":"许可","slug":"许可","link":"#许可","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/community/contribute.md"}');export{e as data}; diff --git a/assets/contribute.html-bb8c692b.js b/assets/contribute.html-bb8c692b.js new file mode 100644 index 000000000..5ac3e4ddf --- /dev/null +++ b/assets/contribute.html-bb8c692b.js @@ -0,0 +1 @@ +import{_ as l,r as n,o as r,c as d,a as e,b as o,d as t,w as c,e as a}from"./app-2a91d8ab.js";const h={},u=e("h1",{id:"贡献指南",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#贡献指南","aria-hidden":"true"},"#"),o(" 贡献指南")],-1),_=e("p",null,"欢迎报告Issue或提交Pull Request。建议在贡献代码前先阅读以下贡献指南。",-1),p=e("h2",{id:"报告问题",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#报告问题","aria-hidden":"true"},"#"),o(" 报告问题")],-1),m={href:"https://github.com/Tencent/CodeAnalysis/issues",target:"_blank",rel:"noopener noreferrer"},b=a('

    搜索已知issue

    在您提交新的issue前,请搜索现有issue以查看是否已有人提交任何类似问题或功能请求,确认不存在重复的issue。

    报告新issue

    当您提交新的issue时,请尽量提供更多的信息,例如与问题相关的详细描述、屏幕截图、视频、logcat和导致崩溃的代码块。

    Pull Request

    ',5),f=a('

    分支管理

    TCA有两个主要分支:

    • main 分支:
      1. 它是最新的(预)发布分支。我们以 main 作为标签, 带有版本号 v1.0.1, v1.0.2 ...
      2. 请不要在 main 分支提交任何PR.
    • dev 分支:
      1. 这是我们稳定发展的分支。经过全面测试后, dev 分支将合并到 main 分支的下一个版本。
      2. 请您将修复漏洞或开发新功能的PR提交到 dev 分支。

    提交Pull Request

    代码团队将监控所有拉取请求,我们对其进行一些代码检查和测试。在所有测试通过后,我们将接受此PR。但它不会立即合并到 main 分支,这有一些延迟。

    在提交拉取请求之前,请确保完成以下工作:

    ',6),x={href:"https://github.com/Tencent/CodeAnalysis/blob/main/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer"},C=e("code",null,"main",-1),R=e("li",null,"如果您更改了API,请更新代码或文档。",-1),g=e("li",null,"将版权声明添加到您添加的任何新文件的顶部。",-1),T=e("li",null,"检查您的代码样式。",-1),k=e("li",null,"测试您的代码,确保其可以正常运行。",-1),q=e("li",null,[o("现在,您可以向 "),e("code",null,"dev"),o(" 分支提交Pull Request。")],-1),I=e("h2",{id:"许可",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#许可","aria-hidden":"true"},"#"),o(" 许可")],-1),P={href:"https://github.com/Tencent/CodeAnalysis/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer"};function v(A,N){const s=n("ExternalLinkIcon"),i=n("RouterLink");return r(),d("div",null,[u,_,p,e("p",null,[o("我们使用"),e("a",m,[o("Github Issues"),t(s)]),o("来跟踪漏洞和功能请求。")]),b,e("p",null,[o("我们非常欢迎您提出Pull Request来帮助TCA变得更好,操作流程详见"),t(i,{to:"/en/community/pr.html"},{default:c(()=>[o("PullRequests操作流程")]),_:1}),o("。")]),f,e("ol",null,[e("li",null,[o("Fork "),e("a",x,[o("TCA仓库"),t(s)]),o(",并从 "),C,o(" 创建分支。")]),R,g,T,k,q]),I,e("p",null,[e("a",P,[o("MIT LICENSE"),t(s)]),o(" 是 TCA 的开源许可证。任何人贡献的代码都受此许可证保护。在贡献代码之前,请确保您可以接受许可。")])])}const L=l(h,[["render",v],["__file","contribute.html.vue"]]);export{L as default}; diff --git a/assets/contribute.html-e2151c44.js b/assets/contribute.html-e2151c44.js new file mode 100644 index 000000000..9d264e458 --- /dev/null +++ b/assets/contribute.html-e2151c44.js @@ -0,0 +1 @@ +import{_ as l,r as n,o as r,c as d,a as e,b as o,d as t,w as c,e as a}from"./app-2a91d8ab.js";const h={},u=e("h1",{id:"贡献指南",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#贡献指南","aria-hidden":"true"},"#"),o(" 贡献指南")],-1),_=e("p",null,"欢迎报告Issue或提交Pull Request。建议在贡献代码前先阅读以下贡献指南。",-1),p=e("h2",{id:"报告问题",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#报告问题","aria-hidden":"true"},"#"),o(" 报告问题")],-1),m={href:"https://github.com/Tencent/CodeAnalysis/issues",target:"_blank",rel:"noopener noreferrer"},b=a('

    搜索已知issue

    在您提交新的issue前,请搜索现有issue以查看是否已有人提交任何类似问题或功能请求,确认不存在重复的issue。

    报告新issue

    当您提交新的issue时,请尽量提供更多的信息,例如与问题相关的详细描述、屏幕截图、视频、logcat和导致崩溃的代码块。

    Pull Request

    ',5),f=a('

    分支管理

    TCA有两个主要分支:

    • main 分支:
      1. 它是最新的(预)发布分支。我们以 main 作为标签, 带有版本号 v1.0.1, v1.0.2 ...
      2. 请不要在 main 分支提交任何PR.
    • dev 分支:
      1. 这是我们稳定发展的分支。经过全面测试后, dev 分支将合并到 main 分支的下一个版本。
      2. 请您将修复漏洞或开发新功能的PR提交到 dev 分支。

    提交Pull Request

    代码团队将监控所有拉取请求,我们对其进行一些代码检查和测试。在所有测试通过后,我们将接受此PR。但它不会立即合并到 main 分支,这有一些延迟。

    在提交拉取请求之前,请确保完成以下工作:

    ',6),x={href:"https://github.com/Tencent/CodeAnalysis/blob/main/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer"},C=e("code",null,"main",-1),R=e("li",null,"如果您更改了API,请更新代码或文档。",-1),g=e("li",null,"将版权声明添加到您添加的任何新文件的顶部。",-1),T=e("li",null,"检查您的代码样式。",-1),k=e("li",null,"测试您的代码,确保其可以正常运行。",-1),q=e("li",null,[o("现在,您可以向 "),e("code",null,"dev"),o(" 分支提交Pull Request。")],-1),I=e("h2",{id:"许可",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#许可","aria-hidden":"true"},"#"),o(" 许可")],-1),P={href:"https://github.com/Tencent/CodeAnalysis/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer"};function v(A,N){const s=n("ExternalLinkIcon"),i=n("RouterLink");return r(),d("div",null,[u,_,p,e("p",null,[o("我们使用"),e("a",m,[o("Github Issues"),t(s)]),o("来跟踪漏洞和功能请求。")]),b,e("p",null,[o("我们非常欢迎您提出Pull Request来帮助TCA变得更好,操作流程详见"),t(i,{to:"/zh/community/pr.html"},{default:c(()=>[o("PullRequests操作流程")]),_:1}),o("。")]),f,e("ol",null,[e("li",null,[o("Fork "),e("a",x,[o("TCA仓库"),t(s)]),o(",并从 "),C,o(" 创建分支。")]),R,g,T,k,q]),I,e("p",null,[e("a",P,[o("MIT LICENSE"),t(s)]),o(" 是 TCA 的开源许可证。任何人贡献的代码都受此许可证保护。在贡献代码之前,请确保您可以接受许可。")])])}const L=l(h,[["render",v],["__file","contribute.html.vue"]]);export{L as default}; diff --git a/assets/cpp_doc.html-2bc2277b.js b/assets/cpp_doc.html-2bc2277b.js new file mode 100644 index 000000000..da5a78745 --- /dev/null +++ b/assets/cpp_doc.html-2bc2277b.js @@ -0,0 +1 @@ +import{_ as o,r as l,o as a,c as s,a as e,b as n,d as t}from"./app-2a91d8ab.js";const i={},c=e("h1",{id:"【c-c-】代码质量缺陷规则包",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#【c-c-】代码质量缺陷规则包","aria-hidden":"true"},"#"),n(" 【C/C++】代码质量缺陷规则包")],-1),_={href:"https://tencent.github.io/CodeAnalysis/zh/quickStarted/enhanceDeploy.html",target:"_blank",rel:"noopener noreferrer"},A=e("h2",{id:"规则列表",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#规则列表","aria-hidden":"true"},"#"),n(" 规则列表")],-1),h={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#array_overflow",target:"_blank",rel:"noopener noreferrer"},d={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#buff_overflow",target:"_blank",rel:"noopener noreferrer"},u={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#dead_lock",target:"_blank",rel:"noopener noreferrer"},E={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#func_ret_null",target:"_blank",rel:"noopener noreferrer"},f={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#missing_lock",target:"_blank",rel:"noopener noreferrer"},B={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#resource_leak",target:"_blank",rel:"noopener noreferrer"},p={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#unused_value",target:"_blank",rel:"noopener noreferrer"};function g(m,b){const r=l("ExternalLinkIcon");return a(),s("div",null,[c,e("p",null,[n("采用自研工具检查Cpp代码缺陷,需要使用license;属于 TCA 增强分析模块的能力之一,请参考"),e("a",_,[n("增强分析模块部署"),t(r)]),n("文档进行部署。")]),A,e("ul",null,[e("li",null,[e("a",h,[n("array_overflow"),t(r)])]),e("li",null,[e("a",d,[n("buff_overflow"),t(r)])]),e("li",null,[e("a",u,[n("dead_lock"),t(r)])]),e("li",null,[e("a",E,[n("func_ret_null"),t(r)])]),e("li",null,[e("a",f,[n("missing_lock"),t(r)])]),e("li",null,[e("a",B,[n("resource_leak"),t(r)])]),e("li",null,[e("a",p,[n("unused_value"),t(r)])])])])}const k=o(i,[["render",g],["__file","cpp_doc.html.vue"]]);export{k as default}; diff --git a/assets/cpp_doc.html-bf6ce6bb.js b/assets/cpp_doc.html-bf6ce6bb.js new file mode 100644 index 000000000..31d926e5f --- /dev/null +++ b/assets/cpp_doc.html-bf6ce6bb.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-218b1d6f","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc.html","title":"【C/C++】代码质量缺陷规则包","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"规则列表","slug":"规则列表","link":"#规则列表","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/规则包/cpp_doc.md"}');export{e as data}; diff --git a/assets/cpp_doc.html-c7d5253e.js b/assets/cpp_doc.html-c7d5253e.js new file mode 100644 index 000000000..866cb275a --- /dev/null +++ b/assets/cpp_doc.html-c7d5253e.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-ef89f918","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/cpp_doc.html","title":"【C/C++】代码质量缺陷规则包","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"规则列表","slug":"规则列表","link":"#规则列表","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/规则包/cpp_doc.md"}');export{e as data}; diff --git a/assets/cpp_doc.html-e71f1648.js b/assets/cpp_doc.html-e71f1648.js new file mode 100644 index 000000000..cb8dce0b6 --- /dev/null +++ b/assets/cpp_doc.html-e71f1648.js @@ -0,0 +1 @@ +import{_ as o,r as l,o as a,c as i,a as e,b as r,d as t}from"./app-2a91d8ab.js";const s={},A=e("h1",{id:"【c-c-】代码质量缺陷规则包",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#【c-c-】代码质量缺陷规则包","aria-hidden":"true"},"#"),r(" 【C/C++】代码质量缺陷规则包")],-1),h={href:"https://tencent.github.io/CodeAnalysis/zh/quickStarted/enhanceDeploy.html",target:"_blank",rel:"noopener noreferrer"},_=e("h2",{id:"规则列表",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#规则列表","aria-hidden":"true"},"#"),r(" 规则列表")],-1),d={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#array_overflow",target:"_blank",rel:"noopener noreferrer"},c={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#buff_overflow",target:"_blank",rel:"noopener noreferrer"},E={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#dead_lock",target:"_blank",rel:"noopener noreferrer"},u={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#func_ret_null",target:"_blank",rel:"noopener noreferrer"},B={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#missing_lock",target:"_blank",rel:"noopener noreferrer"},f={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#resource_leak",target:"_blank",rel:"noopener noreferrer"},g={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#unused_value",target:"_blank",rel:"noopener noreferrer"},p={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#dead_branch",target:"_blank",rel:"noopener noreferrer"},m={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#forward_null",target:"_blank",rel:"noopener noreferrer"},b={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#reverse_null",target:"_blank",rel:"noopener noreferrer"},C={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#dead_code",target:"_blank",rel:"noopener noreferrer"},y={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-Q1.html#uinit",target:"_blank",rel:"noopener noreferrer"};function k(T,z){const n=l("ExternalLinkIcon");return a(),i("div",null,[A,e("p",null,[r("采用自研工具检查Cpp代码缺陷,需要使用license;属于 TCA 增强分析模块的能力之一,请参考"),e("a",h,[r("增强分析模块部署"),t(n)]),r("文档进行部署。")]),_,e("ul",null,[e("li",null,[e("a",d,[r("array_overflow"),t(n)])]),e("li",null,[e("a",c,[r("buff_overflow"),t(n)])]),e("li",null,[e("a",E,[r("dead_lock"),t(n)])]),e("li",null,[e("a",u,[r("func_ret_null"),t(n)])]),e("li",null,[e("a",B,[r("missing_lock"),t(n)])]),e("li",null,[e("a",f,[r("resource_leak"),t(n)])]),e("li",null,[e("a",g,[r("unused_value"),t(n)])]),e("li",null,[e("a",p,[r("dead_branch"),t(n)])]),e("li",null,[e("a",m,[r("forward_null"),t(n)])]),e("li",null,[e("a",b,[r("reverse_null"),t(n)])]),e("li",null,[e("a",C,[r("dead_code"),t(n)])]),e("li",null,[e("a",y,[r("uinit"),t(n)])])])])}const Q=o(s,[["render",k],["__file","cpp_doc.html.vue"]]);export{Q as default}; diff --git a/assets/creataAnalysePlan-cef75d2f.png b/assets/creataAnalysePlan-cef75d2f.png new file mode 100644 index 000000000..82cdbeeb9 Binary files /dev/null and b/assets/creataAnalysePlan-cef75d2f.png differ diff --git a/assets/create_repo-d6d12fcc.png b/assets/create_repo-d6d12fcc.png new file mode 100644 index 000000000..2dab3e3cf Binary files /dev/null and b/assets/create_repo-d6d12fcc.png differ diff --git a/assets/create_team-e3e2cf05.png b/assets/create_team-e3e2cf05.png new file mode 100644 index 000000000..05fca9102 Binary files /dev/null and b/assets/create_team-e3e2cf05.png differ diff --git a/assets/create_team_group-a704de08.png b/assets/create_team_group-a704de08.png new file mode 100644 index 000000000..41c0fc4d9 Binary files /dev/null and b/assets/create_team_group-a704de08.png differ diff --git a/assets/createcustomrule-3919c596.js b/assets/createcustomrule-3919c596.js new file mode 100644 index 000000000..0b52b6b85 --- /dev/null +++ b/assets/createcustomrule-3919c596.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/addcustomrules-220aab00.png",a="/CodeAnalysis/assets/createcustomrule-54c07258.png";export{s as _,a}; diff --git a/assets/createcustomrule-54c07258.png b/assets/createcustomrule-54c07258.png new file mode 100644 index 000000000..faad029e5 Binary files /dev/null and b/assets/createcustomrule-54c07258.png differ diff --git a/assets/customtool_01-9e3e2bf5.png b/assets/customtool_01-9e3e2bf5.png new file mode 100644 index 000000000..80d9364f2 Binary files /dev/null and b/assets/customtool_01-9e3e2bf5.png differ diff --git a/assets/customtool_02-59fa95a2.png b/assets/customtool_02-59fa95a2.png new file mode 100644 index 000000000..6e5d788ac Binary files /dev/null and b/assets/customtool_02-59fa95a2.png differ diff --git a/assets/customtool_03-b18281ea.png b/assets/customtool_03-b18281ea.png new file mode 100644 index 000000000..eca12883a Binary files /dev/null and b/assets/customtool_03-b18281ea.png differ diff --git a/assets/customtool_04-9b94978f.png b/assets/customtool_04-9b94978f.png new file mode 100644 index 000000000..47f34630e Binary files /dev/null and b/assets/customtool_04-9b94978f.png differ diff --git a/assets/customtool_05-8d60b225.png b/assets/customtool_05-8d60b225.png new file mode 100644 index 000000000..25bd2c203 Binary files /dev/null and b/assets/customtool_05-8d60b225.png differ diff --git a/assets/customtool_06-8ec07c7b.js b/assets/customtool_06-8ec07c7b.js new file mode 100644 index 000000000..a3f3b1e68 --- /dev/null +++ b/assets/customtool_06-8ec07c7b.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/customtool_01-9e3e2bf5.png",o="/CodeAnalysis/assets/customtool_02-59fa95a2.png",t="/CodeAnalysis/assets/customtool_03-b18281ea.png",a="/CodeAnalysis/assets/customtool_04-9b94978f.png",_="/CodeAnalysis/assets/customtool_05-8d60b225.png",n="/CodeAnalysis/assets/customtool_06-cd5acb80.png";export{s as _,o as a,t as b,a as c,_ as d,n as e}; diff --git a/assets/customtool_06-cd5acb80.png b/assets/customtool_06-cd5acb80.png new file mode 100644 index 000000000..af530ad1b Binary files /dev/null and b/assets/customtool_06-cd5acb80.png differ diff --git a/assets/dependency_vul.html-387d064d.js b/assets/dependency_vul.html-387d064d.js new file mode 100644 index 000000000..5a2dd82c1 --- /dev/null +++ b/assets/dependency_vul.html-387d064d.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7981d049","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul.html","title":"依赖漏洞扫描规则包","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"概述","slug":"概述","link":"#概述","children":[]},{"level":2,"title":"示例","slug":"示例","link":"#示例","children":[]},{"level":2,"title":"快速体验","slug":"快速体验","link":"#快速体验","children":[{"level":3,"title":"启用规则包","slug":"启用规则包","link":"#启用规则包","children":[]},{"level":3,"title":"更多","slug":"更多","link":"#更多","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/规则包/dependency_vul.md"}');export{e as data}; diff --git a/assets/dependency_vul.html-6e099c3e.js b/assets/dependency_vul.html-6e099c3e.js new file mode 100644 index 000000000..88a633909 --- /dev/null +++ b/assets/dependency_vul.html-6e099c3e.js @@ -0,0 +1,39 @@ +import{_ as e,o as n,c as i,e as t}from"./app-2a91d8ab.js";const l={},a=t(`

    依赖漏洞扫描规则包

    概述

    该规则包可分析项目依赖组件,以及依赖组件中是否存在漏洞等问题。辅助开发者准确分析到依赖组件的安全性,选用安全可靠的依赖组件。

    规则包中将漏洞规则分为“低危漏洞”、“中危漏洞”、“高危漏洞”三个等级,扫描出有漏洞的组件,TCA会提供问题组件名称和版本、漏洞情况介绍,以及可用的修复版本(如获取到)。

    已支持语言:C/C++、C#、Go、Java、JavaScript、PHP、Python、Ruby、Scala、TypeScript等。

    示例

    <?xml version="1.0" encoding="UTF-8"?>
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    +
    +    <parent>
    +        <groupId>org.javaweb.vuln</groupId>
    +        <artifactId>javaweb-vuln</artifactId>
    +        <version>3.0.3</version>
    +    </parent>
    +
    +    <dependencies>
    +
    +        <dependency>
    +            <groupId>org.apache.struts</groupId>
    +            <artifactId>struts2-core</artifactId>
    +            <!-- 触发规则  -->
    +            <version>2.1.8</version>
    +            <exclusions>
    +                <exclusion>
    +                    <groupId>org.freemarker</groupId>
    +                    <artifactId>freemarker</artifactId>
    +                </exclusion>
    +
    +                <exclusion>
    +                    <groupId>org.springframework</groupId>
    +                    <artifactId>spring-test</artifactId>
    +                </exclusion>
    +
    +                <exclusion>
    +                    <groupId>commons-fileupload</groupId>
    +                    <artifactId>commons-fileupload</artifactId>
    +                </exclusion>
    +            </exclusions>
    +        </dependency>
    +
    +    </dependencies>
    +
    +</project>
    +

    快速体验

    TCA 现已支持依赖漏洞扫描规则包,可以在 TCA 分析方案中搜索勾选该规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 ->【Objective-C】代码规范规则包 -> 启用/查看规则。

    更多

    更多场景支持,欢迎提 issue 进行咨询扩展。

    `,13),d=[a];function s(r,c){return n(),i("div",null,d)}const u=e(l,[["render",s],["__file","dependency_vul.html.vue"]]);export{u as default}; diff --git a/assets/dependency_vul.html-da9f0e2b.js b/assets/dependency_vul.html-da9f0e2b.js new file mode 100644 index 000000000..88a633909 --- /dev/null +++ b/assets/dependency_vul.html-da9f0e2b.js @@ -0,0 +1,39 @@ +import{_ as e,o as n,c as i,e as t}from"./app-2a91d8ab.js";const l={},a=t(`

    依赖漏洞扫描规则包

    概述

    该规则包可分析项目依赖组件,以及依赖组件中是否存在漏洞等问题。辅助开发者准确分析到依赖组件的安全性,选用安全可靠的依赖组件。

    规则包中将漏洞规则分为“低危漏洞”、“中危漏洞”、“高危漏洞”三个等级,扫描出有漏洞的组件,TCA会提供问题组件名称和版本、漏洞情况介绍,以及可用的修复版本(如获取到)。

    已支持语言:C/C++、C#、Go、Java、JavaScript、PHP、Python、Ruby、Scala、TypeScript等。

    示例

    <?xml version="1.0" encoding="UTF-8"?>
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    +
    +    <parent>
    +        <groupId>org.javaweb.vuln</groupId>
    +        <artifactId>javaweb-vuln</artifactId>
    +        <version>3.0.3</version>
    +    </parent>
    +
    +    <dependencies>
    +
    +        <dependency>
    +            <groupId>org.apache.struts</groupId>
    +            <artifactId>struts2-core</artifactId>
    +            <!-- 触发规则  -->
    +            <version>2.1.8</version>
    +            <exclusions>
    +                <exclusion>
    +                    <groupId>org.freemarker</groupId>
    +                    <artifactId>freemarker</artifactId>
    +                </exclusion>
    +
    +                <exclusion>
    +                    <groupId>org.springframework</groupId>
    +                    <artifactId>spring-test</artifactId>
    +                </exclusion>
    +
    +                <exclusion>
    +                    <groupId>commons-fileupload</groupId>
    +                    <artifactId>commons-fileupload</artifactId>
    +                </exclusion>
    +            </exclusions>
    +        </dependency>
    +
    +    </dependencies>
    +
    +</project>
    +

    快速体验

    TCA 现已支持依赖漏洞扫描规则包,可以在 TCA 分析方案中搜索勾选该规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 ->【Objective-C】代码规范规则包 -> 启用/查看规则。

    更多

    更多场景支持,欢迎提 issue 进行咨询扩展。

    `,13),d=[a];function s(r,c){return n(),i("div",null,d)}const u=e(l,[["render",s],["__file","dependency_vul.html.vue"]]);export{u as default}; diff --git a/assets/dependency_vul.html-f875aa89.js b/assets/dependency_vul.html-f875aa89.js new file mode 100644 index 000000000..06ffd310b --- /dev/null +++ b/assets/dependency_vul.html-f875aa89.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-c54ad424","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/dependency_vul.html","title":"依赖漏洞扫描规则包","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"概述","slug":"概述","link":"#概述","children":[]},{"level":2,"title":"示例","slug":"示例","link":"#示例","children":[]},{"level":2,"title":"快速体验","slug":"快速体验","link":"#快速体验","children":[{"level":3,"title":"启用规则包","slug":"启用规则包","link":"#启用规则包","children":[]},{"level":3,"title":"更多","slug":"更多","link":"#更多","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/规则包/dependency_vul.md"}');export{e as data}; diff --git a/assets/deployClient.html-26310b53.js b/assets/deployClient.html-26310b53.js new file mode 100644 index 000000000..1053a7b88 --- /dev/null +++ b/assets/deployClient.html-26310b53.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-2af89834","path":"/zh/quickStarted/deployClient.html","title":"部署与配置客户端","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"通过源代码","slug":"通过源代码","link":"#通过源代码","children":[{"level":3,"title":"依赖环境","slug":"依赖环境","link":"#依赖环境","children":[]},{"level":3,"title":"使用步骤","slug":"使用步骤","link":"#使用步骤","children":[]}]},{"level":2,"title":"通过Docker-Compose","slug":"通过docker-compose","link":"#通过docker-compose","children":[{"level":3,"title":"使用步骤","slug":"使用步骤-1","link":"#使用步骤-1","children":[]}]},{"level":2,"title":"通过可执行文件","slug":"通过可执行文件","link":"#通过可执行文件","children":[{"level":3,"title":"依赖环境","slug":"依赖环境-1","link":"#依赖环境-1","children":[]},{"level":3,"title":"使用步骤","slug":"使用步骤-2","link":"#使用步骤-2","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/deployClient.md"}');export{l as data}; diff --git a/assets/deployClient.html-9dc0de26.js b/assets/deployClient.html-9dc0de26.js new file mode 100644 index 000000000..238868ae7 --- /dev/null +++ b/assets/deployClient.html-9dc0de26.js @@ -0,0 +1,25 @@ +import{_ as o}from"./personalToken-2ae175b9.js";import{_ as t,r as c,o as r,c as h,a as e,b as n,d as i,w as l,e as a}from"./app-2a91d8ab.js";const u={},p=a('

    部署与配置客户端

    通过源代码

    依赖环境

    ',3),m=e("li",null,[e("p",null,"系统环境"),e("ul",null,[e("li",null,"Linux,Windows或macOS")])],-1),v=e("p",null,"环境准备",-1),_=e("strong",null,"Python 3.7",-1),b=a(`

    使用步骤

    安装第三方库

    # 源码根目录下执行
    +pip3 install -r client/requirements/app_reqs.pip
    +

    安装第三方工具

    # 源码根目录
    +cd client/requirements
    +
    +# 执行安装脚本
    +# Linux/macOS环境
    +./install.sh
    +# Windows环境
    +./install.bat
    +

    配置客户端

    • 配置 client/config.ini 文件

      <Server IP地址> 替换成实际的serve ip(可包含端口号)。

      客户端执行环境配置

    • 配置 client/codedog.ini 文件

      必填项:tokenorg_sidteam_namesource_dir

      • 个人令牌 - token:从 TCA 页面获取,前往[个人中心]-[个人令牌]-复制Token

        personalToken

      • 团队编号 - org_sid:进入 TCA 项目概览页,从 URL 中获取

      • 项目名称 - team_name::进入 TCA 项目概览页,从 URL 中获取

        TIP

        项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile

      • 分析路径 - source_dir: 本地代码目录路径

      TIP

      • 如果项目代码为编译型语言(比如:C/C++,C#,Go,Java,Kotlin,Objective-C等),且使用的分析方案中配置了编译型工具(如图,使用了OC推荐规则包),需要填写build_cmd编译命令。

      • 其他可选项按需填写,不填写时按默认配置执行

    启动客户端

    # 源码根目录
    +cd client
    +
    +# 执行客户端脚本
    +python3 codepuppy.py localscan
    +

    WARNING

    Client 的实现及启动脚本均依赖 Python3 版本为 3.7,可执行 python3 --version 查看版本。若版本有误,可安装版本为3.7的python并软链接到python3命令。

    `,10),g={class:"custom-container tip"},f=e("p",{class:"custom-container-title"},"TIP",-1),x=e("li",null,[e("p",null,[e("code",null,"codedog.ini"),n(" 各项参数可由命令行传入,获取详细参数说明可运行 "),e("code",null,"python3 codepuppy.py localscan -h")])],-1),k=e("code",null,"localscan",-1),E=a('

    通过Docker-Compose

    TIP

    适用于快速上手体验。使用docker运行,可以免去客户端环境依赖的安装,避免环境兼容性问题。

    但是由于环境受限于docker,会无法复用本地的编译环境,部分需要编译的工具无法使用。

    使用步骤

    配置客户端

    • 配置 client/config.ini 文件

    • 配置 client/codedog.ini 文件

    ',5),C={class:"custom-container tip"},A=e("p",{class:"custom-container-title"},"TIP",-1),y=e("h4",{id:"构建镜像",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#构建镜像","aria-hidden":"true"},"#"),n(" 构建镜像")],-1),B={href:"https://docs.docker.com/engine/install/",target:"_blank",rel:"noopener noreferrer"},R={href:"https://docs.docker.com/compose/install/",target:"_blank",rel:"noopener noreferrer"},I=e("li",null,[e("p",null,[n("进入"),e("code",null,"client"),n("目录,构建docker镜像")])],-1),D=a(`
    docker build -t tca-client .
    +

    启动客户端

    方案一:直接使用docker运行

    进入client目录,执行以下命令

    # 按照实际情况填写\`SOURCE_DIR\`环境变量值
    +export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +
    方案二:使用docker内bash终端运行
    1. 进入docker容器内的bash终端

      # 按照实际情况填写\`SOURCE_DIR\`环境变量值
      +export SOURCE_DIR=需要扫描的代码目录绝对路径
      +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src --name tca-client tca-client bash
      +
    2. 通过命令行启动client代码

      python3 codepuppy.py localscan
      +

    通过可执行文件

    依赖环境

    • 系统环境

      • Linux,Windows或macOS

    使用步骤

    下载客户端

    `,12),S={href:"https://github.com/Tencent/CodeAnalysis/releases",target:"_blank",rel:"noopener noreferrer"},T=e("li",null,[e("p",null,"解压缩。")],-1),O=e("h4",{id:"配置客户端-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#配置客户端-2","aria-hidden":"true"},"#"),n(" 配置客户端")],-1),P=e("ul",null,[e("li",null,[e("p",null,[n("配置 "),e("code",null,"client/config.ini"),n(" 文件")])]),e("li",null,[e("p",null,[n("配置 "),e("code",null,"client/codedog.ini"),n(" 文件")])])],-1),w={class:"custom-container tip"},L=e("p",{class:"custom-container-title"},"TIP",-1),U=a(`

    启动客户端

    进入到client目录下,执行客户端

    ./codepuppy localscan
    +
    `,3);function q(F,N){const d=c("RouterLink"),s=c("ExternalLinkIcon");return r(),h("div",null,[p,e("ul",null,[m,e("li",null,[v,e("ul",null,[e("li",null,[_,n(","),i(d,{to:"/en/quickStarted/references/install_python37_on_centos.html"},{default:l(()=>[n("安装指引")]),_:1})])])])]),b,e("div",g,[f,e("ul",null,[x,e("li",null,[e("p",null,[n("使用"),k,n("命令启动本地单次的代码分析,如需启动分布式并行分析任务,请参考"),i(d,{to:"/en/client/#%E4%BA%94%E4%BD%BF%E7%94%A8%E5%88%86%E5%B8%83%E5%BC%8F%E8%8A%82%E7%82%B9%E6%A8%A1%E5%BC%8F%E6%89%A7%E8%A1%8C%E5%AE%A2%E6%88%B7%E7%AB%AF"},{default:l(()=>[n("使用分布式节点模式")]),_:1}),n("进行配置。")])])])]),E,e("div",C,[A,e("p",null,[n("同通过源代码使用-"),i(d,{to:"/en/quickStarted/deployClient.html#%E9%85%8D%E7%BD%AE%E5%AE%A2%E6%88%B7%E7%AB%AF"},{default:l(()=>[n("配置客户端")]),_:1})])]),y,e("ol",null,[e("li",null,[e("p",null,[n("安装Docker,安装教程:"),e("a",B,[n("官方文档"),i(s)])])]),e("li",null,[e("p",null,[n("安装Docker-Compose,安装教程:"),e("a",R,[n("官方文档"),i(s)])])]),I]),D,e("ol",null,[e("li",null,[e("p",null,[n("从"),e("a",S,[n("发布页面"),i(s)]),n("下载与系统相对应的客户端压缩包到本地。")])]),T]),O,P,e("div",w,[L,e("p",null,[n("同通过源代码使用-"),i(d,{to:"/en/quickStarted/deployClient.html#%E9%85%8D%E7%BD%AE%E5%AE%A2%E6%88%B7%E7%AB%AF"},{default:l(()=>[n("配置客户端")]),_:1})])]),U])}const $=t(u,[["render",q],["__file","deployClient.html.vue"]]);export{$ as default}; diff --git a/assets/deployClient.html-a08e0f33.js b/assets/deployClient.html-a08e0f33.js new file mode 100644 index 000000000..eeffef3d7 --- /dev/null +++ b/assets/deployClient.html-a08e0f33.js @@ -0,0 +1,25 @@ +import{_ as o}from"./personalToken-2ae175b9.js";import{_ as t,r as c,o as r,c as h,a as e,b as n,d as i,w as l,e as a}from"./app-2a91d8ab.js";const u={},p=a('

    部署与配置客户端

    通过源代码

    依赖环境

    ',3),m=e("li",null,[e("p",null,"系统环境"),e("ul",null,[e("li",null,"Linux,Windows或macOS")])],-1),v=e("p",null,"环境准备",-1),_=e("strong",null,"Python 3.7",-1),b=a(`

    使用步骤

    安装第三方库

    # 源码根目录下执行
    +pip3 install -r client/requirements/app_reqs.pip
    +

    安装第三方工具

    # 源码根目录
    +cd client/requirements
    +
    +# 执行安装脚本
    +# Linux/macOS环境
    +./install.sh
    +# Windows环境
    +./install.bat
    +

    配置客户端

    • 配置 client/config.ini 文件

      <Server IP地址> 替换成实际的serve ip(可包含端口号)。

      客户端执行环境配置

    • 配置 client/codedog.ini 文件

      必填项:tokenorg_sidteam_namesource_dir

      • 个人令牌 - token:从 TCA 页面获取,前往[个人中心]-[个人令牌]-复制Token

        personalToken

      • 团队编号 - org_sid:进入 TCA 项目概览页,从 URL 中获取

      • 项目名称 - team_name::进入 TCA 项目概览页,从 URL 中获取

        提示

        项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile

      • 分析路径 - source_dir: 本地代码目录路径

      提示

      • 如果项目代码为编译型语言(比如:C/C++,C#,Go,Java,Kotlin,Objective-C等),且使用的分析方案中配置了编译型工具(如图,使用了OC推荐规则包),需要填写build_cmd编译命令。

      • 其他可选项按需填写,不填写时按默认配置执行

    启动客户端

    # 源码根目录
    +cd client
    +
    +# 执行客户端脚本
    +python3 codepuppy.py localscan
    +

    注意

    Client 的实现及启动脚本均依赖 Python3 版本为 3.7,可执行 python3 --version 查看版本。若版本有误,可安装版本为3.7的python并软链接到python3命令。

    `,10),g={class:"custom-container tip"},f=e("p",{class:"custom-container-title"},"提示",-1),x=e("li",null,[e("p",null,[e("code",null,"codedog.ini"),n(" 各项参数可由命令行传入,获取详细参数说明可运行 "),e("code",null,"python3 codepuppy.py localscan -h")])],-1),k=e("code",null,"localscan",-1),E=a('

    通过Docker-Compose

    提示

    适用于快速上手体验。使用docker运行,可以免去客户端环境依赖的安装,避免环境兼容性问题。

    但是由于环境受限于docker,会无法复用本地的编译环境,部分需要编译的工具无法使用。

    使用步骤

    配置客户端

    • 配置 client/config.ini 文件

    • 配置 client/codedog.ini 文件

    ',5),C={class:"custom-container tip"},A=e("p",{class:"custom-container-title"},"提示",-1),y=e("h4",{id:"构建镜像",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#构建镜像","aria-hidden":"true"},"#"),n(" 构建镜像")],-1),B={href:"https://docs.docker.com/engine/install/",target:"_blank",rel:"noopener noreferrer"},R={href:"https://docs.docker.com/compose/install/",target:"_blank",rel:"noopener noreferrer"},D=e("li",null,[e("p",null,[n("进入"),e("code",null,"client"),n("目录,构建docker镜像")])],-1),S=a(`
    docker build -t tca-client .
    +

    启动客户端

    方案一:直接使用docker运行

    进入client目录,执行以下命令

    # 按照实际情况填写\`SOURCE_DIR\`环境变量值
    +export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +
    方案二:使用docker内bash终端运行
    1. 进入docker容器内的bash终端

      # 按照实际情况填写\`SOURCE_DIR\`环境变量值
      +export SOURCE_DIR=需要扫描的代码目录绝对路径
      +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src --name tca-client tca-client bash
      +
    2. 通过命令行启动client代码

      python3 codepuppy.py localscan
      +

    通过可执行文件

    依赖环境

    • 系统环境

      • Linux,Windows或macOS

    使用步骤

    下载客户端

    `,12),O={href:"https://github.com/Tencent/CodeAnalysis/releases",target:"_blank",rel:"noopener noreferrer"},w=e("li",null,[e("p",null,"解压缩。")],-1),I=e("h4",{id:"配置客户端-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#配置客户端-2","aria-hidden":"true"},"#"),n(" 配置客户端")],-1),L=e("ul",null,[e("li",null,[e("p",null,[n("配置 "),e("code",null,"client/config.ini"),n(" 文件")])]),e("li",null,[e("p",null,[n("配置 "),e("code",null,"client/codedog.ini"),n(" 文件")])])],-1),U={class:"custom-container tip"},T=e("p",{class:"custom-container-title"},"提示",-1),q=a(`

    启动客户端

    进入到client目录下,执行客户端

    ./codepuppy localscan
    +
    `,3);function F(P,W){const d=c("RouterLink"),s=c("ExternalLinkIcon");return r(),h("div",null,[p,e("ul",null,[m,e("li",null,[v,e("ul",null,[e("li",null,[_,n(","),i(d,{to:"/zh/quickStarted/references/install_python37_on_centos.html"},{default:l(()=>[n("安装指引")]),_:1})])])])]),b,e("div",g,[f,e("ul",null,[x,e("li",null,[e("p",null,[n("使用"),k,n("命令启动本地单次的代码分析,如需启动分布式并行分析任务,请参考"),i(d,{to:"/zh/client/#%E4%BA%94%E4%BD%BF%E7%94%A8%E5%88%86%E5%B8%83%E5%BC%8F%E8%8A%82%E7%82%B9%E6%A8%A1%E5%BC%8F%E6%89%A7%E8%A1%8C%E5%AE%A2%E6%88%B7%E7%AB%AF"},{default:l(()=>[n("使用分布式节点模式")]),_:1}),n("进行配置。")])])])]),E,e("div",C,[A,e("p",null,[n("同通过源代码使用-"),i(d,{to:"/zh/quickStarted/deployClient.html#%E9%85%8D%E7%BD%AE%E5%AE%A2%E6%88%B7%E7%AB%AF"},{default:l(()=>[n("配置客户端")]),_:1})])]),y,e("ol",null,[e("li",null,[e("p",null,[n("安装Docker,安装教程:"),e("a",B,[n("官方文档"),i(s)])])]),e("li",null,[e("p",null,[n("安装Docker-Compose,安装教程:"),e("a",R,[n("官方文档"),i(s)])])]),D]),S,e("ol",null,[e("li",null,[e("p",null,[n("从"),e("a",O,[n("发布页面"),i(s)]),n("下载与系统相对应的客户端压缩包到本地。")])]),w]),I,L,e("div",U,[T,e("p",null,[n("同通过源代码使用-"),i(d,{to:"/zh/quickStarted/deployClient.html#%E9%85%8D%E7%BD%AE%E5%AE%A2%E6%88%B7%E7%AB%AF"},{default:l(()=>[n("配置客户端")]),_:1})])]),q])}const V=t(u,[["render",F],["__file","deployClient.html.vue"]]);export{V as default}; diff --git a/assets/deployClient.html-f23ed8d2.js b/assets/deployClient.html-f23ed8d2.js new file mode 100644 index 000000000..b3ba00d3a --- /dev/null +++ b/assets/deployClient.html-f23ed8d2.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0967ab59","path":"/en/quickStarted/deployClient.html","title":"部署与配置客户端","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"通过源代码","slug":"通过源代码","link":"#通过源代码","children":[{"level":3,"title":"依赖环境","slug":"依赖环境","link":"#依赖环境","children":[]},{"level":3,"title":"使用步骤","slug":"使用步骤","link":"#使用步骤","children":[]}]},{"level":2,"title":"通过Docker-Compose","slug":"通过docker-compose","link":"#通过docker-compose","children":[{"level":3,"title":"使用步骤","slug":"使用步骤-1","link":"#使用步骤-1","children":[]}]},{"level":2,"title":"通过可执行文件","slug":"通过可执行文件","link":"#通过可执行文件","children":[{"level":3,"title":"依赖环境","slug":"依赖环境-1","link":"#依赖环境-1","children":[]},{"level":3,"title":"使用步骤","slug":"使用步骤-2","link":"#使用步骤-2","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/deployClient.md"}');export{e as data}; diff --git a/assets/deploySever.html-1f528b16.js b/assets/deploySever.html-1f528b16.js new file mode 100644 index 000000000..d66a12a5d --- /dev/null +++ b/assets/deploySever.html-1f528b16.js @@ -0,0 +1,4 @@ +import{_ as s,a as o,b as c}from"./planPage-27225805.js";import{_ as r}from"./start_scan_02-3fe00a0e.js";import{_ as n,a as h,b as u}from"./start_scan_04-65ab4d48.js";import{_ as p,r as _,o as m,c as E,a as e,b as a,d,w as l,e as t}from"./app-2a91d8ab.js";const A={},b=e("h1",{id:"部署-tca",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#部署-tca","aria-hidden":"true"},"#"),a(" 部署 TCA")],-1),v=e("br",null,null,-1),f=t(`

    Docker快速部署

    WARNING

    仅适用于Docker部署体验,生产环境建议使用专业的 MySQL、Redis 等服务

    依赖环境

    • 系统环境
      • Linux、macOS、Windows
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备
      • Docker
    • 权限准备
      • 需要开放80、8000端口的访问权限(80为TCA平台访问端口,8000为TCA Server访问端口)

    部署对象

    Server、Web 与 Client

    操作说明

    首次启动操作

    1. 进入CodeAnalysis工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径
    2. 执行命令:
      bash ./quick_install.sh docker deploy
      +

    TIP

    通过Docker部署默认会在当前根目录下的挂载三个路径:

    • .docker_temp/logs:容器内的/var/log/tca/,存放TCA平台的日输出文件;
    • .docker_temp/data:容器内的/var/opt/tca/, 存放TCA平台的服务数据,主要是Mariadb、Redis;
    • .docker_temp/configs:容器内的/etc/tca,存放TCA平台的配置文件,主要是config.sh

    更新操作

    1. 更新代码
    2. 执行以下命令:
      • TCA_IMAGE_BUILD=true ./quick_install.sh docker deploy:重新构建并启动tca容器

    TIP

    TCA_IMAGE_BUILD=true表示从本地构建TCA镜像运行

    运行容器

    如果已经在机器上执行过docker deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行TCA

    bash ./quick_install.sh docker start
    +

    停止容器

    如果容器正在运行,希望停止容器,可以运行

    bash ./quick_install.sh docker stop
    +

    使用TCA

    成功部署TCA后,请开始您的代码分析。

    进入平台页面

    在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可跳转到团队列表页

    TIP

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    创建团队及项目

    • 完成团队创建

    • 完成项目创建

    登记代码库

    登记代码库,输入代码库地址以及凭证信息等,完成代码库登记。

    registerCodeRepo

    创建分析项目

    开始分析

    TIP

    1. 用户可选择使用分析方案模板,或创建分析方案的方式,利用方案的分析配置进行代码分析。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目。

    分析方案说明

    ',33),g=e("li",null,[e("p",null,"分析方案是用于对代码库进行分析的一套配置集合。")],-1),x=e("p",null,[e("img",{src:o,alt:"creataAnalysePlan"})],-1),C={class:"custom-container tip"},k=e("p",{class:"custom-container-title"},"TIP",-1),B=e("p",null,[e("img",{src:c,alt:"planPage"})],-1),T=e("h2",{id:"执行代码分析",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#执行代码分析","aria-hidden":"true"},"#"),a(" 执行代码分析")],-1),D=e("p",null,[a("初始化创建项目后,可通过 "),e("code",null,"在线分析"),a(" 或 "),e("code",null,"客户端分析"),a(" 来启动代码分析。")],-1),I=e("p",null,[e("img",{src:n,alt:"代码分析"})],-1),y={class:"custom-container tip"},S=e("p",{class:"custom-container-title"},"TIP",-1),P=e("li",null,[a("TCA推荐使用"),e("code",null,"在线分析"),a(",您可根据具体使用场景选择其一。")],-1),L=e("li",null,[e("code",null,"在线分析"),a("表示配置代码库链接后,TCA客户端拉取代码后进行分析;"),e("code",null,"客户端分析"),a("在配置本地待扫描代码路径后,无需代码拉取直接分析本地代码。")],-1),q=e("code",null,"在线分析",-1),F=e("code",null,"客户端分析",-1),N=t('

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    ',4),R=e("p",null,[e("img",{src:u,alt:"分支概览"})],-1);function G(w,M){const i=_("RouterLink");return m(),E("div",null,[b,e("p",null,[a("TCA提供部署脚本,支持一键式快速部署Server、Web、Client。"),v,a(" 脚本共提供三种部署方式:Docker部署(推荐)、"),d(i,{to:"/en/quickStarted/dockercomposeDeploy.html"},{default:l(()=>[a("Docker-Compose部署")]),_:1}),a("、"),d(i,{to:"/en/quickStarted/codeDeploy.html"},{default:l(()=>[a("源码部署")]),_:1}),a(",可根据您的具体使用场景任意选择其一进行部署。")]),f,e("ul",null,[g,e("li",null,[e("p",null,[a("更多分析方案配置可查阅"),d(i,{to:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html"},{default:l(()=>[a("帮助文档-分析方案")]),_:1})])])]),x,e("div",C,[k,e("p",null,[a("本次部署会默认启动运行环境为「Codedog_Linux」的客户端,若需扩展更多运行环境,详见客户端"),d(i,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html"},{default:l(()=>[a("常驻节点分析")]),_:1})])]),B,T,D,I,e("div",y,[S,e("ul",null,[P,L,e("li",null,[q,a("与"),F,a("具体详情及配置参考"),d(i,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%A6%E6%83%85.html"},{default:l(()=>[a("TCA客户端配置详情")]),_:1})])])]),N,e("p",null,[a("分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 "),d(i,{to:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html"},{default:l(()=>[a("问题列表")]),_:1}),a(" 等。")]),R])}const Q=p(A,[["render",G],["__file","deploySever.html.vue"]]);export{Q as default}; diff --git a/assets/deploySever.html-2b7d9acd.js b/assets/deploySever.html-2b7d9acd.js new file mode 100644 index 000000000..71c969b94 --- /dev/null +++ b/assets/deploySever.html-2b7d9acd.js @@ -0,0 +1,4 @@ +import{_ as o,a as s,b as c}from"./planPage-27225805.js";import{_ as r}from"./start_scan_02-3fe00a0e.js";import{_ as n,a as h,b as u}from"./start_scan_04-65ab4d48.js";import{_ as p,r as _,o as m,c as E,a as e,b as a,d as l,w as d,e as t}from"./app-2a91d8ab.js";const b={},A=e("h1",{id:"部署-tca",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#部署-tca","aria-hidden":"true"},"#"),a(" 部署 TCA")],-1),v=e("br",null,null,-1),f=t(`

    Docker快速部署

    注意

    仅适用于Docker部署体验,生产环境建议使用专业的 MySQL、Redis 等服务

    依赖环境

    • 系统环境
      • Linux、macOS、Windows
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备
      • Docker
    • 权限准备
      • 需要开放80、8000端口的访问权限(80为TCA平台访问端口,8000为TCA Server访问端口)

    部署对象

    Server、Web 与 Client

    操作说明

    首次启动操作

    1. 进入CodeAnalysis工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径
    2. 执行命令:
      bash ./quick_install.sh docker deploy
      +

    提示

    1. 通过Docker部署默认会从DockerHub上拉取 tencenttca/tca:latest 镜像
    2. 通过Docker部署默认会在当前根目录下的挂载三个路径:
      • .docker_temp/logs:容器内的/var/log/tca/,存放TCA平台的日输出文件;
      • .docker_temp/data:容器内的/var/opt/tca/, 存放TCA平台的服务数据,主要是Mariadb、Redis;
      • .docker_temp/configs:容器内的/etc/tca,存放TCA平台的配置文件,主要是config.sh

    更新操作

    1. 更新代码
    2. 执行以下命令:
      • TCA_IMAGE_BUILD=true ./quick_install.sh docker deploy:重新构建并启动tca容器

    提示

    TCA_IMAGE_BUILD=true表示从本地构建TCA镜像运行

    运行容器

    如果已经在机器上执行过docker deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行TCA

    bash ./quick_install.sh docker start
    +

    停止容器

    如果容器正在运行,希望停止容器,可以运行

    bash ./quick_install.sh docker stop
    +

    使用TCA

    成功部署TCA后,请开始您的代码分析。

    进入平台页面

    在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可跳转到团队列表页

    提示

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    创建团队及项目

    • 完成团队创建

    • 完成项目创建

    登记代码库

    登记代码库,输入代码库地址以及凭证信息等,完成代码库登记。

    registerCodeRepo

    创建分析项目

    开始分析

    提示

    1. 用户可选择使用分析方案模板,或创建分析方案的方式,利用方案的分析配置进行代码分析。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目。

    分析方案说明

    ',33),g=e("li",null,[e("p",null,"分析方案是用于对代码库进行分析的一套配置集合。")],-1),k=e("p",null,[e("img",{src:s,alt:"creataAnalysePlan"})],-1),x={class:"custom-container tip"},C=e("p",{class:"custom-container-title"},"提示",-1),B=e("p",null,[e("img",{src:c,alt:"planPage"})],-1),D=e("h2",{id:"执行代码分析",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#执行代码分析","aria-hidden":"true"},"#"),a(" 执行代码分析")],-1),T=e("p",null,[a("初始化创建项目后,可通过 "),e("code",null,"在线分析"),a(" 或 "),e("code",null,"客户端分析"),a(" 来启动代码分析。")],-1),y=e("p",null,[e("img",{src:n,alt:"代码分析"})],-1),S={class:"custom-container tip"},L=e("p",{class:"custom-container-title"},"提示",-1),q=e("li",null,[a("TCA推荐使用"),e("code",null,"在线分析"),a(",您可根据具体使用场景选择其一。")],-1),z=e("li",null,[e("code",null,"在线分析"),a("表示配置代码库链接后,TCA客户端拉取代码后进行分析;"),e("code",null,"客户端分析"),a("在配置本地待扫描代码路径后,无需代码拉取直接分析本地代码。")],-1),F=e("code",null,"在线分析",-1),I=e("code",null,"客户端分析",-1),R=t('

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    ',4),w=e("p",null,[e("img",{src:u,alt:"分支概览"})],-1);function G(M,N){const i=_("RouterLink");return m(),E("div",null,[A,e("p",null,[a("TCA提供部署脚本,支持一键式快速部署Server、Web、Client。"),v,a(" 脚本共提供三种部署方式:Docker部署(推荐)、"),l(i,{to:"/zh/quickStarted/dockercomposeDeploy.html"},{default:d(()=>[a("Docker-Compose部署")]),_:1}),a("、"),l(i,{to:"/zh/quickStarted/codeDeploy.html"},{default:d(()=>[a("源码部署")]),_:1}),a(",可根据您的具体使用场景任意选择其一进行部署。")]),f,e("ul",null,[g,e("li",null,[e("p",null,[a("更多分析方案配置可查阅"),l(i,{to:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html"},{default:d(()=>[a("帮助文档-分析方案")]),_:1})])])]),k,e("div",x,[C,e("p",null,[a("本次部署会默认启动运行环境为「Codedog_Linux」的客户端,若需扩展更多运行环境,详见客户端"),l(i,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html"},{default:d(()=>[a("常驻节点分析")]),_:1})])]),B,D,T,y,e("div",S,[L,e("ul",null,[q,z,e("li",null,[F,a("与"),I,a("具体详情及配置参考"),l(i,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%A6%E6%83%85.html"},{default:d(()=>[a("TCA客户端配置详情")]),_:1})])])]),R,e("p",null,[a("分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 "),l(i,{to:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html"},{default:d(()=>[a("问题列表")]),_:1}),a(" 等。")]),w])}const H=p(b,[["render",G],["__file","deploySever.html.vue"]]);export{H as default}; diff --git a/assets/deploySever.html-acb534b2.js b/assets/deploySever.html-acb534b2.js new file mode 100644 index 000000000..bd2005c88 --- /dev/null +++ b/assets/deploySever.html-acb534b2.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-0ceb929d","path":"/en/quickStarted/deploySever.html","title":"部署 TCA","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Docker快速部署","slug":"docker快速部署","link":"#docker快速部署","children":[{"level":3,"title":"依赖环境","slug":"依赖环境","link":"#依赖环境","children":[]},{"level":3,"title":"部署对象","slug":"部署对象","link":"#部署对象","children":[]},{"level":3,"title":"操作说明","slug":"操作说明","link":"#操作说明","children":[]}]},{"level":2,"title":"进入平台页面","slug":"进入平台页面","link":"#进入平台页面","children":[]},{"level":2,"title":"创建团队及项目","slug":"创建团队及项目","link":"#创建团队及项目","children":[]},{"level":2,"title":"登记代码库","slug":"登记代码库","link":"#登记代码库","children":[]},{"level":2,"title":"创建分析项目","slug":"创建分析项目","link":"#创建分析项目","children":[{"level":3,"title":"分析方案说明","slug":"分析方案说明","link":"#分析方案说明","children":[]}]},{"level":2,"title":"执行代码分析","slug":"执行代码分析","link":"#执行代码分析","children":[]},{"level":2,"title":"查看分析历史","slug":"查看分析历史","link":"#查看分析历史","children":[]},{"level":2,"title":"查看分析概览","slug":"查看分析概览","link":"#查看分析概览","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/deploySever.md"}');export{l as data}; diff --git a/assets/deploySever.html-cd918886.js b/assets/deploySever.html-cd918886.js new file mode 100644 index 000000000..d0456b051 --- /dev/null +++ b/assets/deploySever.html-cd918886.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-8927c33c","path":"/zh/quickStarted/deploySever.html","title":"部署 TCA","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"Docker快速部署","slug":"docker快速部署","link":"#docker快速部署","children":[{"level":3,"title":"依赖环境","slug":"依赖环境","link":"#依赖环境","children":[]},{"level":3,"title":"部署对象","slug":"部署对象","link":"#部署对象","children":[]},{"level":3,"title":"操作说明","slug":"操作说明","link":"#操作说明","children":[]}]},{"level":2,"title":"进入平台页面","slug":"进入平台页面","link":"#进入平台页面","children":[]},{"level":2,"title":"创建团队及项目","slug":"创建团队及项目","link":"#创建团队及项目","children":[]},{"level":2,"title":"登记代码库","slug":"登记代码库","link":"#登记代码库","children":[]},{"level":2,"title":"创建分析项目","slug":"创建分析项目","link":"#创建分析项目","children":[{"level":3,"title":"分析方案说明","slug":"分析方案说明","link":"#分析方案说明","children":[]}]},{"level":2,"title":"执行代码分析","slug":"执行代码分析","link":"#执行代码分析","children":[]},{"level":2,"title":"查看分析历史","slug":"查看分析历史","link":"#查看分析历史","children":[]},{"level":2,"title":"查看分析概览","slug":"查看分析概览","link":"#查看分析概览","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/deploySever.md"}');export{l as data}; diff --git a/assets/deploySource.html-52110188.js b/assets/deploySource.html-52110188.js new file mode 100644 index 000000000..36963b264 --- /dev/null +++ b/assets/deploySource.html-52110188.js @@ -0,0 +1,3 @@ +import{_ as e,o as a,c as i,e as s}from"./app-2a91d8ab.js";const d={},o=s(`

    VM 部署文档

    前置条件

    1. Linux 环境

    2. 系统已安装 nginx

    3. TCA Server 服务已部署完毕,具备后端服务地址

    部署步骤

    1. 进入前端部署源码目录

      进入web服务目录,并切换至tca-deploy-source目录,将其视为工作目录(假设工作目录为 /data/CodeAnalysis/web/tca-deploy-source

    2. 部署/更新前端服务

      # 部署、更新都使用此命令
      +sh ./scripts/deploy.sh init -d
      +

      具体请查阅部署脚本内容,可根据业务调整配置。

    3. 额外说明

      tca-deploy-source/scripts/config.sh 已配置默认环境变量,用户可根据需要调整环境变量再部署前端服务,具体可查阅脚本内容。

    `,5),r=[o];function c(n,l){return a(),i("div",null,r)}const p=e(d,[["render",c],["__file","deploySource.html.vue"]]);export{p as default}; diff --git a/assets/deploySource.html-956fd91c.js b/assets/deploySource.html-956fd91c.js new file mode 100644 index 000000000..4668a3d17 --- /dev/null +++ b/assets/deploySource.html-956fd91c.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b654617e","path":"/zh/guide/web/deploySource.html","title":"VM 部署文档","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"前置条件","slug":"前置条件","link":"#前置条件","children":[]},{"level":2,"title":"部署步骤","slug":"部署步骤","link":"#部署步骤","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/web/deploySource.md"}');export{e as data}; diff --git a/assets/deploySource.html-c424f754.js b/assets/deploySource.html-c424f754.js new file mode 100644 index 000000000..36963b264 --- /dev/null +++ b/assets/deploySource.html-c424f754.js @@ -0,0 +1,3 @@ +import{_ as e,o as a,c as i,e as s}from"./app-2a91d8ab.js";const d={},o=s(`

    VM 部署文档

    前置条件

    1. Linux 环境

    2. 系统已安装 nginx

    3. TCA Server 服务已部署完毕,具备后端服务地址

    部署步骤

    1. 进入前端部署源码目录

      进入web服务目录,并切换至tca-deploy-source目录,将其视为工作目录(假设工作目录为 /data/CodeAnalysis/web/tca-deploy-source

    2. 部署/更新前端服务

      # 部署、更新都使用此命令
      +sh ./scripts/deploy.sh init -d
      +

      具体请查阅部署脚本内容,可根据业务调整配置。

    3. 额外说明

      tca-deploy-source/scripts/config.sh 已配置默认环境变量,用户可根据需要调整环境变量再部署前端服务,具体可查阅脚本内容。

    `,5),r=[o];function c(n,l){return a(),i("div",null,r)}const p=e(d,[["render",c],["__file","deploySource.html.vue"]]);export{p as default}; diff --git a/assets/deploySource.html-ef8635a2.js b/assets/deploySource.html-ef8635a2.js new file mode 100644 index 000000000..9e8f40365 --- /dev/null +++ b/assets/deploySource.html-ef8635a2.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e2e9d388","path":"/en/guide/web/deploySource.html","title":"VM 部署文档","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"前置条件","slug":"前置条件","link":"#前置条件","children":[]},{"level":2,"title":"部署步骤","slug":"部署步骤","link":"#部署步骤","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/web/deploySource.md"}');export{e as data}; diff --git a/assets/deploy_with_minio.html-49f7112e.js b/assets/deploy_with_minio.html-49f7112e.js new file mode 100644 index 000000000..43807725f --- /dev/null +++ b/assets/deploy_with_minio.html-49f7112e.js @@ -0,0 +1,21 @@ +import{_ as e,o as n,c as i,e as a}from"./app-2a91d8ab.js";const d={},s=a(`

    基于MinIO部署文件服务器

    TCA的file服务支持对接MinIO作为底层存储,将文件转发到已部署的MinIO平台上进行持久化存储

    本地部署

    注意:如果之前已经使用本地进行存储,切换为MinIO后,之前已经上传的文件只能到服务部署的目录server/projects/file/data查看,不支持通过页面进行下载

    前置步骤

    获取MinIO平台登录的账号密码,用于上传文件

    配置步骤

    1. 调整file服务的配置

    修改server/configs/django/local_file.py文件,取消以下代码的注释

    # MINIO
    +STORAGE = {
    +    "CLIENT": os.environ.get("FILE_STORAGE_CLIENT", "MINIO"),  # 存储方式
    +    "OPTIONS": {
    +        "MINIO_ENTRYPOINT": os.environ.get("FILE_MINIO_ENTRYPOINT"),
    +        "MINIO_ACCESS_KEY": os.environ.get("FILE_MINIO_ACCESS_KEY"),
    +        "MINIO_SECRET_KEY": os.environ.get("FILE_MINIO_SECRET_KEY"),
    +    }
    +}
    +

    修改server/scripts/config.sh文件,填写MinIO的信息

    export FILE_MINIO_ENTRYPOINT=<MinIO平台的地址>
    +export FILE_MINIO_ACCESS_KEY=<MinIO平台的登录账号>
    +export FILE_MINIO_SECRET_KEY=<MinIO平台的登录密码>
    +

    修改完配置后,如果服务已经正在运行,则执行以下命令重启服务

    $ cd server
    +$ ./scripts/deploy.sh start
    +

    2. 修改nginx服务的配置文件

    删除nginx已有的文件服务器配置文件/etc/nginx/conf.d/tca_file_local.conf文件,然后执行

    rm /etc/nginx/conf.d/tca_file_local.conf
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_minio.conf /etc/nginx/conf.d/tca_file_local.conf
    +

    也可以修改server/scripts/init_config.sh

    # 注释这一行
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_local.conf /etc/nginx/conf.d/tca_file_local.conf
    +# 取消注释这一行
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_minio.conf /etc/nginx/conf.d/tca_file_local.conf
    +

    修改完配置后,如果nginx已经正在运行,则执行nginx -s reload

    结尾

    以上两个步骤操作完成后,就可以通过MinIO存储文件了~

    `,21),c=[s];function o(l,r){return n(),i("div",null,c)}const u=e(d,[["render",o],["__file","deploy_with_minio.html.vue"]]);export{u as default}; diff --git a/assets/deploy_with_minio.html-5815abcc.js b/assets/deploy_with_minio.html-5815abcc.js new file mode 100644 index 000000000..ebdf04680 --- /dev/null +++ b/assets/deploy_with_minio.html-5815abcc.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-374a553a","path":"/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio.html","title":"基于MinIO部署文件服务器","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"本地部署","slug":"本地部署","link":"#本地部署","children":[{"level":3,"title":"前置步骤","slug":"前置步骤","link":"#前置步骤","children":[]},{"level":3,"title":"配置步骤","slug":"配置步骤","link":"#配置步骤","children":[]},{"level":3,"title":"结尾","slug":"结尾","link":"#结尾","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/服务端/deploy_with_minio.md"}');export{e as data}; diff --git a/assets/deploy_with_minio.html-8ed46649.js b/assets/deploy_with_minio.html-8ed46649.js new file mode 100644 index 000000000..43807725f --- /dev/null +++ b/assets/deploy_with_minio.html-8ed46649.js @@ -0,0 +1,21 @@ +import{_ as e,o as n,c as i,e as a}from"./app-2a91d8ab.js";const d={},s=a(`

    基于MinIO部署文件服务器

    TCA的file服务支持对接MinIO作为底层存储,将文件转发到已部署的MinIO平台上进行持久化存储

    本地部署

    注意:如果之前已经使用本地进行存储,切换为MinIO后,之前已经上传的文件只能到服务部署的目录server/projects/file/data查看,不支持通过页面进行下载

    前置步骤

    获取MinIO平台登录的账号密码,用于上传文件

    配置步骤

    1. 调整file服务的配置

    修改server/configs/django/local_file.py文件,取消以下代码的注释

    # MINIO
    +STORAGE = {
    +    "CLIENT": os.environ.get("FILE_STORAGE_CLIENT", "MINIO"),  # 存储方式
    +    "OPTIONS": {
    +        "MINIO_ENTRYPOINT": os.environ.get("FILE_MINIO_ENTRYPOINT"),
    +        "MINIO_ACCESS_KEY": os.environ.get("FILE_MINIO_ACCESS_KEY"),
    +        "MINIO_SECRET_KEY": os.environ.get("FILE_MINIO_SECRET_KEY"),
    +    }
    +}
    +

    修改server/scripts/config.sh文件,填写MinIO的信息

    export FILE_MINIO_ENTRYPOINT=<MinIO平台的地址>
    +export FILE_MINIO_ACCESS_KEY=<MinIO平台的登录账号>
    +export FILE_MINIO_SECRET_KEY=<MinIO平台的登录密码>
    +

    修改完配置后,如果服务已经正在运行,则执行以下命令重启服务

    $ cd server
    +$ ./scripts/deploy.sh start
    +

    2. 修改nginx服务的配置文件

    删除nginx已有的文件服务器配置文件/etc/nginx/conf.d/tca_file_local.conf文件,然后执行

    rm /etc/nginx/conf.d/tca_file_local.conf
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_minio.conf /etc/nginx/conf.d/tca_file_local.conf
    +

    也可以修改server/scripts/init_config.sh

    # 注释这一行
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_local.conf /etc/nginx/conf.d/tca_file_local.conf
    +# 取消注释这一行
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_minio.conf /etc/nginx/conf.d/tca_file_local.conf
    +

    修改完配置后,如果nginx已经正在运行,则执行nginx -s reload

    结尾

    以上两个步骤操作完成后,就可以通过MinIO存储文件了~

    `,21),c=[s];function o(l,r){return n(),i("div",null,c)}const u=e(d,[["render",o],["__file","deploy_with_minio.html.vue"]]);export{u as default}; diff --git a/assets/deploy_with_minio.html-cbb3a284.js b/assets/deploy_with_minio.html-cbb3a284.js new file mode 100644 index 000000000..5cecc1478 --- /dev/null +++ b/assets/deploy_with_minio.html-cbb3a284.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-48a59655","path":"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_with_minio.html","title":"基于MinIO部署文件服务器","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"本地部署","slug":"本地部署","link":"#本地部署","children":[{"level":3,"title":"前置步骤","slug":"前置步骤","link":"#前置步骤","children":[]},{"level":3,"title":"配置步骤","slug":"配置步骤","link":"#配置步骤","children":[]},{"level":3,"title":"结尾","slug":"结尾","link":"#结尾","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/服务端/deploy_with_minio.md"}');export{e as data}; diff --git a/assets/deploy_without_migrate.html-1e77db2a.js b/assets/deploy_without_migrate.html-1e77db2a.js new file mode 100644 index 000000000..539c6ff3e --- /dev/null +++ b/assets/deploy_without_migrate.html-1e77db2a.js @@ -0,0 +1 @@ +import{_ as s,r as t,o as i,c as d,a as e,b as o,d as c,w as n,e as _}from"./app-2a91d8ab.js";const a={},r=e("p",null,"在实际的生产环境的部署过程中,团队的MySQL的管理员可能不会给到应用账号create等比较敏感的权限,这种情况下,我们可以通过手动迁移数据的方式起到和等同Django migrate的效果。",-1),u=e("p",null,"操作步骤:",-1),h=e("li",null,[o("进入Server服务工作目录后(假设工作目录为 "),e("code",null,"/data/CodeAnalysis/server/"),o(",以下路径均为工作目录内的相对路径)")],-1),p=e("code",null,"vi ./scripts/config.sh",-1),S=e("li",null,[o("执行"),e("code",null,"bash ./scripts/deploy.sh init"),o(":初始化DB、安装依赖和运行初始化脚本")],-1),m=e("li",null,[o("使用MySQLDump工具导出表结构与数据:"),e("code",null,"mysqldump -u user -p –databases codedog_main codedog_analysis codedog_file codedog_login > codedog_all.sql")],-1),y=_("
  • 在生产环境建数据库,详情见:server/sql/init.sql
  • 连接MySQL,导入数据:
    • 临时关闭外键检查: SET SESSION FOREIGN_KEY_CHECKS=0,否则会因为数据中有外键关联导致导入失败
    • 导入表结构与数据: source /youdir/codedog_all.sql;
    • 开启外键检查: SET SESSION FOREIGN_KEY_CHECKS=1
  • 启动服务: 直接执行 bash ./scripts/deploy.sh start,无需执行 init方法,否则会导致数据重复写入
  • ",3);function g(E,f){const l=t("RouterLink");return i(),d("div",null,[r,u,e("ol",null,[h,e("li",null,[o("在开发环境一个有全部权限的MySQL地址,初始化数据(MySQL版本运行版本:5.7) "),e("ul",null,[e("li",null,[o("执行"),p,o(":填写一个有全部权限的MySQL数据库地址和Redis信息以及根据需要调整配置信息,主要的工程配置已提供默认值,字段说明可以查看"),c(l,{to:"/en/guide/server/"},{default:n(()=>[o("文档")]),_:1})]),S,m])]),y])])}const L=s(a,[["render",g],["__file","deploy_without_migrate.html.vue"]]);export{L as default}; diff --git a/assets/deploy_without_migrate.html-5b1052ed.js b/assets/deploy_without_migrate.html-5b1052ed.js new file mode 100644 index 000000000..a81688d2d --- /dev/null +++ b/assets/deploy_without_migrate.html-5b1052ed.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5c7ce0e5","path":"/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate.html","title":"","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/服务端/deploy_without_migrate.md"}');export{e as data}; diff --git a/assets/deploy_without_migrate.html-90300af0.js b/assets/deploy_without_migrate.html-90300af0.js new file mode 100644 index 000000000..74cdaf14f --- /dev/null +++ b/assets/deploy_without_migrate.html-90300af0.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-051518aa","path":"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/deploy_without_migrate.html","title":"","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/服务端/deploy_without_migrate.md"}');export{t as data}; diff --git a/assets/deploy_without_migrate.html-9c6f524c.js b/assets/deploy_without_migrate.html-9c6f524c.js new file mode 100644 index 000000000..e42d65251 --- /dev/null +++ b/assets/deploy_without_migrate.html-9c6f524c.js @@ -0,0 +1 @@ +import{_ as s,r as t,o as i,c as d,a as e,b as o,d as c,w as n,e as _}from"./app-2a91d8ab.js";const a={},r=e("p",null,"在实际的生产环境的部署过程中,团队的MySQL的管理员可能不会给到应用账号create等比较敏感的权限,这种情况下,我们可以通过手动迁移数据的方式起到和等同Django migrate的效果。",-1),u=e("p",null,"操作步骤:",-1),h=e("li",null,[o("进入Server服务工作目录后(假设工作目录为 "),e("code",null,"/data/CodeAnalysis/server/"),o(",以下路径均为工作目录内的相对路径)")],-1),p=e("code",null,"vi ./scripts/config.sh",-1),S=e("li",null,[o("执行"),e("code",null,"bash ./scripts/deploy.sh init"),o(":初始化DB、安装依赖和运行初始化脚本")],-1),m=e("li",null,[o("使用MySQLDump工具导出表结构与数据:"),e("code",null,"mysqldump -u user -p –databases codedog_main codedog_analysis codedog_file codedog_login > codedog_all.sql")],-1),y=_("
  • 在生产环境建数据库,详情见:server/sql/init.sql
  • 连接MySQL,导入数据:
    • 临时关闭外键检查: SET SESSION FOREIGN_KEY_CHECKS=0,否则会因为数据中有外键关联导致导入失败
    • 导入表结构与数据: source /youdir/codedog_all.sql;
    • 开启外键检查: SET SESSION FOREIGN_KEY_CHECKS=1
  • 启动服务: 直接执行 bash ./scripts/deploy.sh start,无需执行 init方法,否则会导致数据重复写入
  • ",3);function g(E,f){const l=t("RouterLink");return i(),d("div",null,[r,u,e("ol",null,[h,e("li",null,[o("在开发环境一个有全部权限的MySQL地址,初始化数据(MySQL版本运行版本:5.7) "),e("ul",null,[e("li",null,[o("执行"),p,o(":填写一个有全部权限的MySQL数据库地址和Redis信息以及根据需要调整配置信息,主要的工程配置已提供默认值,字段说明可以查看"),c(l,{to:"/zh/guide/server/"},{default:n(()=>[o("文档")]),_:1})]),S,m])]),y])])}const L=s(a,[["render",g],["__file","deploy_without_migrate.html.vue"]]);export{L as default}; diff --git a/assets/dockerDeploy.html-4ecfde5f.js b/assets/dockerDeploy.html-4ecfde5f.js new file mode 100644 index 000000000..c3a7f6f18 --- /dev/null +++ b/assets/dockerDeploy.html-4ecfde5f.js @@ -0,0 +1,5 @@ +import{_ as t,r as o,o as n,c as d,a as e,b as a,d as r,w as c,e as s}from"./app-2a91d8ab.js";const l={},u=s(`

    Docker rapid deployment(Recommended for a out of the box try)

    WARNING

    Docker deployment include Mariadb and Redis. Configuration file can be modified to indicate a MySQL/Mariadb and Redis, which satisfied operation and maintenance specification for extensive use.

    Requirements

    • System
      • Linux, macOS or Windows
      • Minimum requirement:2-core processor, 4GB RAM, 100 GB available disk space
    • Environment
      • Docker
    • Privilege
      • Open port 80, 8000's access(80 for TCA's requests, 8000 for TCA Server)

    To be deployed

    Server, Web and Client

    Operating instructions

    First start
    1. Enter the CodeAnalysis's work directory (e.g ~/CodeAnalysis), the following paths are relative paths within the directory.
    2. Execute command:
      bash ./quick_install.sh docker deploy
      +

    TIP

    1. During docker deployment, the tencenttca/tca:latest image will be pulled from dockerhub by default.
    2. During docker deployment, three paths will be mounted under the current root directory by default:
      • .docker_temp/logs/var/log/tca/ in container,TCA daily log output;
      • .docker_temp/data/var/opt/tca/ in container, TCA service data, mainly about Mariadb,Redis;
      • .docker_temp/configs/etc/tca in container,TCA configuration file,mainly config.sh
    Update
    1. Update the code.
    2. Execute command below:
    TCA_IMAGE_BUILD=true ./quick_install.sh docker deploy  # Re-build and start TCA Container
    +

    TIP

    TCA_IMAGE_BUILD=true Indicates that the TCA image is built locally to run

    Run a Docker container

    If docker deploy has been executed on the machine and the container data is retained, you can execute the following command to start the container and continue to run TCA

    bash ./quick_install.sh docker start
    +
    Stop a Docker container

    If a container is running and you want to stop it, you can run command

    bash ./quick_install.sh docker stop
    +

    Use your TCA

    `,21),h=e("code",null,"http://",-1),p=e("br",null,null,-1),m=e("div",{class:"custom-container tip"},[e("p",{class:"custom-container-title"},"TIP"),e("p",null,"Default account/Password:CodeDog/admin"),e("p",null,"If the default account password has been modified during deployment, please login according to the modified account and password.")],-1);function b(f,y){const i=o("RouterLink");return n(),d("div",null,[u,e("p",null,[a("Now, you have done the deployment of your first TCA. Please type "),h,a(' in your browser. click "立即体验", after login you can start your Tencent Code Analysis trip.'),p,a(" More operation instructions please check:"),r(i,{to:"/en/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html"},{default:c(()=>[a("Quick start a code analysis")]),_:1})]),m])}const g=t(l,[["render",b],["__file","dockerDeploy.html.vue"]]);export{g as default}; diff --git a/assets/dockerDeploy.html-91ffd251.js b/assets/dockerDeploy.html-91ffd251.js new file mode 100644 index 000000000..dd3a11f28 --- /dev/null +++ b/assets/dockerDeploy.html-91ffd251.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2d129638","path":"/en/quickStarted/dockerDeploy.html","title":"Docker rapid deployment(Recommended for a out of the box try)","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/dockerDeploy.md"}');export{e as data}; diff --git a/assets/dockerDeploy.html-c1c22390.js b/assets/dockerDeploy.html-c1c22390.js new file mode 100644 index 000000000..a73eaaea3 --- /dev/null +++ b/assets/dockerDeploy.html-c1c22390.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0b07a1bf","path":"/zh/quickStarted/dockerDeploy.html","title":"Docker快速部署(平台体验首推)","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/dockerDeploy.md"}');export{e as data}; diff --git a/assets/dockerDeploy.html-cd423864.js b/assets/dockerDeploy.html-cd423864.js new file mode 100644 index 000000000..4ee695714 --- /dev/null +++ b/assets/dockerDeploy.html-cd423864.js @@ -0,0 +1,5 @@ +import{_ as d,r as c,o as l,c as s,a as e,b as a,d as o,w as r,e as n}from"./app-2a91d8ab.js";const t={},h=n(`

    Docker快速部署(平台体验首推)

    注意

    Docker部署会包含Mariadb和Redis,如果需要更大规模使用,可以调整配置文件使用运维规范的 MySQL/Mariadb 和 Redis。

    依赖环境

    • 系统环境
      • Linux、macOS、Windows
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备
      • Docker
    • 权限准备
      • 需要开放80、8000端口的访问权限(80为TCA平台访问端口,8000为TCA Server访问端口)

    部署对象

    Server、Web 与 Client

    操作说明

    首次启动操作
    1. 进入CodeAnalysis工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径
    2. 执行命令:
      bash ./quick_install.sh docker deploy
      +

    提示

    1. 通过Docker部署默认会从DockerHub上拉取tencenttca/tca:latest镜像
    2. 通过Docker部署默认会在当前根目录下的挂载三个路径:
      • .docker_temp/logs:容器内的/var/log/tca/,存放TCA平台的日输出文件;
      • .docker_temp/data:容器内的/var/opt/tca/, 存放TCA平台的服务数据,主要是Mariadb、Redis;
      • .docker_temp/configs:容器内的/etc/tca,存放TCA平台的配置文件,主要是config.sh
    更新操作
    1. 更新代码
    2. 执行以下命令:
    TCA_IMAGE_BUILD=true ./quick_install.sh docker deploy  #重新构建并启动tca容器
    +

    提示

    TCA_IMAGE_BUILD=true表示从本地构建TCA镜像运行

    运行容器

    如果已经在机器上执行过docker deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行TCA

    bash ./quick_install.sh docker start
    +
    停止容器

    如果容器正在运行,希望停止容器,可以运行

    bash ./quick_install.sh docker stop
    +

    使用TCA

    `,21),u=e("code",null,"http://部署机器IP/",-1),p=e("br",null,null,-1),b=e("div",{class:"custom-container tip"},[e("p",{class:"custom-container-title"},"提示"),e("p",null,"默认平台登录账号/密码:CodeDog/admin"),e("p",null,"如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录")],-1);function m(v,_){const i=c("RouterLink");return l(),s("div",null,[h,e("p",null,[a("至此,您已完成第一个TCA平台部署,请在浏览器输入"),u,a(",点击立即体验,完成登录后即可开启您的腾讯云代码分析。"),p,a(" 平台内操作指引请查看:"),o(i,{to:"/zh/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html"},{default:r(()=>[a("快速启动一次代码分析")]),_:1})]),b])}const A=d(t,[["render",m],["__file","dockerDeploy.html.vue"]]);export{A as default}; diff --git a/assets/dockercomposeDeploy.html-295cc18e.js b/assets/dockercomposeDeploy.html-295cc18e.js new file mode 100644 index 000000000..be456086f --- /dev/null +++ b/assets/dockercomposeDeploy.html-295cc18e.js @@ -0,0 +1,8 @@ +import{_ as l,r as c,o as n,c as r,a,b as e,d,w as i,e as o}from"./app-2a91d8ab.js";const t={},h=a("h1",{id:"docker-compose快速部署",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#docker-compose快速部署","aria-hidden":"true"},"#"),e(" Docker-Compose快速部署")],-1),u=a("br",null,null,-1),p=o(`

    部署对象

    Server、Web 与 Client

    注意

    仅适用于 Docker-Compose 部署体验,生产环境建议使用专业的 MySQL、Redis 等服务

    操作说明

    首次启动操作
    1. 进入 CodeAnalysis 工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径

    2. 执行命令:

    bash ./quick_install.sh docker-compose deploy #启动tca_server容器
    +

    注意:通过 Docker-Compose 部署默认会在当前根目录下的挂载三个路径:

    • .docker_data/logs:存放 TCA 平台的各个服务日志输出目录;
    • .docker_data/mysql:存放 TCA 平台的 MySQL 数据
    • .docker_data/redis:存放 TCA 平台的 Redis 数据
    • .docker_data/filedata:存放 TCA 平台文件服务器的文件
    `,9),m={class:"custom-container tip"},b=a("p",{class:"custom-container-title"},"提示",-1),_=a("code",null,"http://部署机器IP/",-1),v=a("br",null,null,-1),k=a("p",null,"默认平台登录账号/密码:CodeDog/admin",-1),g=a("p",null,"如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录",-1),A=o(`
    更新操作
    1. 更新代码

    2. 执行以下命令:

    bash ./quick_install.sh docker-compose build  #重新构建TCA相关镜像
    +bash ./quick_install.sh docker-compose stop  #停止运行中的TCA容器
    +bash ./quick_install.sh docker-compose deploy  #重新部署TCA相关容器与初始化(或刷新数据)
    +
    运行操作

    如果已经在机器上执行过docker-compose deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行 TCA

    bash ./quick_install.sh docker-compose start
    +
    停止操作

    如果容器正在运行,希望停止容器,可以执行以下命令

    bash ./quick_install.sh docker-compose stop
    +
    构建镜像操作

    如果希望构建镜像,可以执行以下命令

    bash ./quick_install.sh docker-compose build
    +
    `,12);function C(f,x){const s=c("RouterLink");return n(),r("div",null,[h,a("p",null,[e("TCA提供部署脚本,支持一键式快速部署 Server、Web、Client。"),u,e(" 脚本共提供三种部署方式:"),d(s,{to:"/zh/quickStarted/dockerDeploy.html"},{default:i(()=>[e("Docker部署(平台体验首推)")]),_:1}),e("、Docker-Compose部署、"),d(s,{to:"/zh/quickStarted/codeDeploy.html"},{default:i(()=>[e("源码部署")]),_:1}),e(", 可根据您的具体使用场景任意选择其一进行部署。")]),p,a("div",m,[b,a("p",null,[e("完成 TCA 平台部署后,请在浏览器输入"),_,e(",点击立即体验,完成登录后即可开启您的腾讯云代码分析。"),v,e(" 平台内操作指引请查看:"),d(s,{to:"/zh/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html"},{default:i(()=>[e("快速启动一次代码分析")]),_:1})]),k,g]),A])}const y=l(t,[["render",C],["__file","dockercomposeDeploy.html.vue"]]);export{y as default}; diff --git a/assets/dockercomposeDeploy.html-427f62d1.js b/assets/dockercomposeDeploy.html-427f62d1.js new file mode 100644 index 000000000..bbf7ff026 --- /dev/null +++ b/assets/dockercomposeDeploy.html-427f62d1.js @@ -0,0 +1,8 @@ +import{_ as l,r as c,o as n,c as r,a,b as e,d,w as i,e as o}from"./app-2a91d8ab.js";const t={},h=a("h1",{id:"docker-compose快速部署",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#docker-compose快速部署","aria-hidden":"true"},"#"),e(" Docker-Compose快速部署")],-1),u=a("br",null,null,-1),p=o(`

    部署对象

    Server、Web 与 Client

    WARNING

    仅适用于 Docker-Compose 部署体验,生产环境建议使用专业的 MySQL、Redis 等服务

    操作说明

    首次启动操作
    1. 进入 CodeAnalysis 工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径

    2. 执行命令:

    bash ./quick_install.sh docker-compose deploy #启动tca_server容器
    +

    注意:通过 Docker-Compose 部署默认会在当前根目录下的挂载三个路径:

    • .docker_data/logs:存放 TCA 平台的各个服务日志输出目录;
    • .docker_data/mysql:存放 TCA 平台的 MySQL 数据
    • .docker_data/redis:存放 TCA 平台的 Redis 数据
    • .docker_data/filedata:存放 TCA 平台文件服务器的文件
    `,9),m={class:"custom-container tip"},b=a("p",{class:"custom-container-title"},"TIP",-1),_=a("code",null,"http://部署机器IP/",-1),v=a("br",null,null,-1),k=a("p",null,"默认平台登录账号/密码:CodeDog/admin",-1),g=a("p",null,"如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录",-1),A=o(`
    更新操作
    1. 更新代码

    2. 执行以下命令:

    bash ./quick_install.sh docker-compose build  #重新构建TCA相关镜像
    +bash ./quick_install.sh docker-compose stop  #停止运行中的TCA容器
    +bash ./quick_install.sh docker-compose deploy  #重新部署TCA相关容器与初始化(或刷新数据)
    +
    运行操作

    如果已经在机器上执行过docker-compose deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行 TCA

    bash ./quick_install.sh docker-compose start
    +
    停止操作

    如果容器正在运行,希望停止容器,可以执行以下命令

    bash ./quick_install.sh docker-compose stop
    +
    构建镜像操作

    如果希望构建镜像,可以执行以下命令

    bash ./quick_install.sh docker-compose build
    +
    `,12);function C(f,x){const s=c("RouterLink");return n(),r("div",null,[h,a("p",null,[e("TCA提供部署脚本,支持一键式快速部署 Server、Web、Client。"),u,e(" 脚本共提供三种部署方式:"),d(s,{to:"/en/quickStarted/dockerDeploy.html"},{default:i(()=>[e("Docker部署(平台体验首推)")]),_:1}),e("、Docker-Compose部署、"),d(s,{to:"/en/quickStarted/codeDeploy.html"},{default:i(()=>[e("源码部署")]),_:1}),e(", 可根据您的具体使用场景任意选择其一进行部署。")]),p,a("div",m,[b,a("p",null,[e("完成 TCA 平台部署后,请在浏览器输入"),_,e(",点击立即体验,完成登录后即可开启您的腾讯云代码分析。"),v,e(" 平台内操作指引请查看:"),d(s,{to:"/en/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html"},{default:i(()=>[e("快速启动一次代码分析")]),_:1})]),k,g]),A])}const y=l(t,[["render",C],["__file","dockercomposeDeploy.html.vue"]]);export{y as default}; diff --git a/assets/dockercomposeDeploy.html-c2efd135.js b/assets/dockercomposeDeploy.html-c2efd135.js new file mode 100644 index 000000000..43168b1c2 --- /dev/null +++ b/assets/dockercomposeDeploy.html-c2efd135.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-1c65d59a","path":"/zh/quickStarted/dockercomposeDeploy.html","title":"Docker-Compose快速部署","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/dockercomposeDeploy.md"}');export{e as data}; diff --git a/assets/dockercomposeDeploy.html-d6c28f23.js b/assets/dockercomposeDeploy.html-d6c28f23.js new file mode 100644 index 000000000..b2e900f0c --- /dev/null +++ b/assets/dockercomposeDeploy.html-d6c28f23.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-fb43c324","path":"/en/quickStarted/dockercomposeDeploy.html","title":"Docker-Compose快速部署","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/dockercomposeDeploy.md"}');export{e as data}; diff --git a/assets/enhanceDeploy.html-165efbbb.js b/assets/enhanceDeploy.html-165efbbb.js new file mode 100644 index 000000000..06853dc5a --- /dev/null +++ b/assets/enhanceDeploy.html-165efbbb.js @@ -0,0 +1,32 @@ +import{_ as a,r as c,o as d,c as r,a as e,b as i,d as n,e as s}from"./app-2a91d8ab.js";const t={},o=s('

    增强分析模块部署

    TCA 除开集成业界知名的分析工具之外,也有自主研发的独立工具,作为 TCA 的增强分析模块。

    TCA 增强分析模块,需要用户额外部署 License 鉴权微服务,并邮件申请 License 。

    提示

    1. License申请完全免费! 2. 优先企业或高校申请License。

    概念

    • 独立工具:TCA 自主研发的代码分析工具;
    • CLS(Common License Server): TCA 独立工具的 License 鉴权微服务。

    模块功能

    • 支持Objective-C/C++代码规范检查;
    • 支持分析项目的依赖组件;
    • 支持分析依赖组件是否存在漏洞等问题;
    • 支持Java/Kotlin API和函数调用链分析;
    • 支持代码安全、空指针检查、内存泄漏等规则。

    持续更新中……

    TCA 官网版增强能力申请

    ',10),u={href:"https://tca.tencent.com/",target:"_blank",rel:"noopener noreferrer"},h={href:"https://tca.tencent.com/document/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%8E%A5%E5%85%A5/License%E9%85%8D%E7%BD%AE.html",target:"_blank",rel:"noopener noreferrer"},v=s('

    TCA 私有化部署增强能力申请

    如果用户是在企业内网环境内使用 TCA,并想在内网体验 TCA 的增强分析模块能力,可以参考下面步骤申请。

    准备

    • 一台 CLS 微服务专属机器,CLS 微服务需要跟该机器绑定

    注意

    注意:不能随意删除CLS目录

    步骤

    ',6),m={href:"https://github.com/Tencent/CodeAnalysis/tree/main/server/cls",target:"_blank",rel:"noopener noreferrer"},p=e("code",null,"server/cls",-1),b=e("code",null,"Server ID",-1),g=e("code",null,"Client License",-1),_=s(`

    注意

    注意:需要在 CLS 目录下执行命令

    # 安装 Git LFS
    +$ bash ./scripts/base/install_git_lfs.sh
    +# 如果在该目录下没有找到 cls 二进制文件,可以执行以下命令进行同步
    +$ bash ./scripts/base/install_bin.sh
    +$ cd server/cls
    +$ ./cls server
    +2022-04-13 18:35:29.356510559 +0800 CST [INFO] Version: 20220328.1
    +2022-04-13 18:35:29.44083463 +0800 CST [INFO] The client license is:
    +xxx
    +2022-04-13 18:35:29.454552966 +0800 CST [INFO] License Server ID: xxx
    +
    • Server ID: 机器码,用于向 TCA 团队申请 License 授权
    • Client License: 提供给 TCA Client,方便 TCA Client 进行工具鉴权(重要,建议备份留底)
    `,3),C={start:"2"},L={href:"https://github.com/Tencent/CodeAnalysis/blob/main/client/config.ini",target:"_blank",rel:"noopener noreferrer"},f=e("code",null,"config.ini",-1),A=s(`
    [LICENSE_CONFIG]
    +; [可选]使用独立工具时,需要填写,默认不需要
    +; License服务的域名和端口
    +URL=http://<IP或者域名>:<port>
    +BASE_PATH=
    +LICENSE=<Client License>
    +

    注意

    注意:URL对应值的最后不需要跟斜杆/.

    注意

    不同的部署方式可以根据下面方法修改config.ini配置

    • 源码部署:
      • 修改源码目录下的client/config.ini
      • 重启客户端:./quick_install.sh local start client
    • Docker部署:
      • 方式1: 修改源码目录下的.docker_temp/configs/client/config.ini,并重启tca-services容器
      • 方式2: 进入tca-service容器后,修改/CodeAnalysis/client/config.ini,并退出重启tca-services容器
      • 重启容器方式:docker restart tca-service
    • Docker-Compose部署:
      • 修改源码目录下的client/config.ini,并重启client容器
      • 重启容器方式:docker-compose restart client
    1. 在 TCA 云官网上提交私有云 License 申请
    `,4),S={href:"https://tca.tencent.com/",target:"_blank",rel:"noopener noreferrer"},x=s("
  • (2) 进入需要申请私有云 License 申请的团队(如果没有的话需要创建对应团队);
  • (3) 在团队页面上,依次进入【节点管理】->【私有云 License 配置】页面,然后点击右上角的【申请License】按钮,填写相关信息即可提交申请。具体的信息内容如下:
    • 申请人名称
    • 申请人所在组织名称
    • 申请人所在组织类型:公司/高校/个人
    • 申请人邮箱
    • 申请人手机号码
    • Server ID:步骤一中输出的Server ID,首次登记的机器码
    • Client License:步骤一中输出的Client License
    • 应用场景
  • (4) 然后等待申请License审核通过,即可拷贝出该私有云 License 继续进行下面第4步的操作。
  • ",3),T={start:"4"},k={href:"https://github.com/Tencent/CodeAnalysis/blob/main/server/cls/config.yaml",target:"_blank",rel:"noopener noreferrer"},I=e("code",null,"config.yaml",-1),E=s(`

    注意

    注意:遵从 yaml 格式,比如:

    • 键值对中,冒号 : 后面跟一个空白字符,示例 key: value
    1. 执行以下命令启动 CLS
    ./cls server -d
    +
    1. 验证 CLS 进程正常启动
    # 查找是否存在CLS进程
    +ps aux|grep cls
    +
    `,5),D={class:"custom-container warning"},y=e("p",{class:"custom-container-title"},"注意",-1),N=e("br",null,null,-1),P={href:"https://github.com/Tencent/CodeAnalysis/blob/main/server/cls/config.yaml",target:"_blank",rel:"noopener noreferrer"},w=e("code",null,"config.yaml",-1),B=s(`
    1. 启动 TCA 分析任务 在 TCA 平台的分析方案里面勾选独立工具相关的规则包,比如依赖组件分析规则包,然后启动一次分析任务,执行正常则表明设置生效。

    CLS 运维

    自动重启

    # 查找CLS进程ID
    +ps aux|grep cls
    +# 重启微服务
    +kill -USR2 <pid>
    +

    网络异常

    如果以上部署步骤已经完成,但是增强功能还是出现 License check failed! Please check the license. License Server is not available! 异常。可以按照以下步骤进行排查:

    • 进入任务页面,点击异常工具,下载该工具的执行日志。如果日志中出现以下日志,则表明网络访问CLS异常;
    method(head) call fails on error: <urlopen error [Errno 111] Connection refused>
    +
    • 继续验证。如果是 Docker 或者 Docker-Compose 部署方式的话,进入 TCA Client 所在容器中。如果是源码部署,则来到 TCA Client 所在机器上。执行以下命令确认网络是否通路:
    ping <config.ini中填写的 CLS IP或者域名>
    +telnet <config.ini中填写的 CLS IP或者域名> <对应端口>
    +
    • 如果网络不通,请排查:
      • 防火墙是否开启对应端口;
      • CLS 对应域名是否在host中设置;
      • 是否IP设置错误。
    案例分享

    背景: 小明以 Docker 方式部署 TCA,并在相同宿主机上部署 CLS 服务,然后在 config.ini 中设置的 URL 中的 IP 为 127.0.0.1, 重启后启动增强功能任务遇到上述网络不通异常。
    原因: 原因是此时的 127.0.0.1 指向的是 TCA Client 容器自身,而不是部署在宿主机上的 CLS 服务。
    解决方案: 将 127.0.0.1 改成宿主机自身IP即可。

    CLS 更新

    1. 使用以下命令查找 cls 进程并杀掉进程
    # 查找CLS进程ID
    +ps aux|grep cls
    +# 重启微服务
    +kill -9 <pid>
    +
    1. 下载最新版的 cls 并覆盖掉其中的 cls 二进制文件

    注意

    注意:不能删除原来的 cls 目录,只需要替换其中的 cls 二进制文件即可。

    1. 使用以下命令重启 cls 服务
    ./cls server -d
    +
    `,20);function F(O,V){const l=c("ExternalLinkIcon");return d(),r("div",null,[o,e("p",null,[i("如果用户平常使用的是 "),e("a",u,[i("TCA 官网版公共服务"),n(l)]),i(",并想在官网版上体验到增强分析模块的分析能力,可以按照"),e("a",h,[i("这篇帮助文档"),n(l)]),i("进行申请配置。")]),v,e("ol",null,[e("li",null,[i("在 TCA 源码中"),e("a",m,[p,n(l)]),i(" 目录下执行以下命令,获取 "),b,i(" 和 "),g])]),_,e("ol",C,[e("li",null,[i("在 TCA Client目录的 "),e("a",L,[f,n(l)]),i(" 中配置 CLS 微服务信息,比如")])]),A,e("ul",null,[e("li",null,[i("(1) 在 "),e("a",S,[i("TCA 云官网"),n(l)]),i("上注册或登录账号;")]),x]),e("ol",T,[e("li",null,[i("在 CLS 目录下的 "),e("a",k,[I,n(l)]),i(" 文件中填写License")])]),E,e("div",D,[y,e("p",null,[i("注意:如果以上命令没有发现 CLS 的进程,则说明 CLS 没有正常启动。"),N,i(" 请尝试更改 "),e("a",P,[w,n(l)]),i(" 文件中的 port 为其他 port,比如8080,目前默认是80端口,然后重新执行步骤5的命令。")])]),B])}const U=a(t,[["render",F],["__file","enhanceDeploy.html.vue"]]);export{U as default}; diff --git a/assets/enhanceDeploy.html-56e5c83c.js b/assets/enhanceDeploy.html-56e5c83c.js new file mode 100644 index 000000000..713558695 --- /dev/null +++ b/assets/enhanceDeploy.html-56e5c83c.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6825e832","path":"/en/quickStarted/enhanceDeploy.html","title":"Enhanced Analysis Module Deployment","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Concepts","slug":"concepts","link":"#concepts","children":[]},{"level":2,"title":"Module Features","slug":"module-features","link":"#module-features","children":[]},{"level":2,"title":"TCA official website version enhanced capability application","slug":"tca-official-website-version-enhanced-capability-application","link":"#tca-official-website-version-enhanced-capability-application","children":[]},{"level":2,"title":"TCA Private Deployment Enhanced Capability Application","slug":"tca-private-deployment-enhanced-capability-application","link":"#tca-private-deployment-enhanced-capability-application","children":[{"level":3,"title":"Preparation","slug":"preparation","link":"#preparation","children":[]},{"level":3,"title":"Steps","slug":"steps","link":"#steps","children":[]},{"level":3,"title":"CLS Operation and Maintenance","slug":"cls-operation-and-maintenance","link":"#cls-operation-and-maintenance","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/enhanceDeploy.md"}');export{e as data}; diff --git a/assets/enhanceDeploy.html-7b9945cc.js b/assets/enhanceDeploy.html-7b9945cc.js new file mode 100644 index 000000000..c589379b1 --- /dev/null +++ b/assets/enhanceDeploy.html-7b9945cc.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-78b296b7","path":"/zh/quickStarted/enhanceDeploy.html","title":"增强分析模块部署","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"概念","slug":"概念","link":"#概念","children":[]},{"level":2,"title":"模块功能","slug":"模块功能","link":"#模块功能","children":[]},{"level":2,"title":"TCA 官网版增强能力申请","slug":"tca-官网版增强能力申请","link":"#tca-官网版增强能力申请","children":[]},{"level":2,"title":"TCA 私有化部署增强能力申请","slug":"tca-私有化部署增强能力申请","link":"#tca-私有化部署增强能力申请","children":[{"level":3,"title":"准备","slug":"准备","link":"#准备","children":[]},{"level":3,"title":"步骤","slug":"步骤","link":"#步骤","children":[]},{"level":3,"title":"CLS 运维","slug":"cls-运维","link":"#cls-运维","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/enhanceDeploy.md"}');export{l as data}; diff --git a/assets/enhanceDeploy.html-8c0e7dac.js b/assets/enhanceDeploy.html-8c0e7dac.js new file mode 100644 index 000000000..cd4be59c1 --- /dev/null +++ b/assets/enhanceDeploy.html-8c0e7dac.js @@ -0,0 +1,32 @@ +import{_ as o,r as l,o as s,c,a as i,b as e,d as a,e as n}from"./app-2a91d8ab.js";const r={},d=n('

    Enhanced Analysis Module Deployment

    In addition to integrating well-known analysis tools in the industry, TCA also has its own independently developed tools, which serve as the enhanced analysis module of TCA.

    The TCA enhanced analysis module requires users to additionally deploy the License authentication microservice and apply for a License by email.

    TIP

    1. License application is completely free! 2. Enterprises or universities are given priority in applying for a License.

    Concepts

    • Independent tools: Code analysis tools independently developed by TCA;
    • CLS(Common License Server): The License authentication microservice for TCA independent tools.

    Module Features

    • Supports Objective-C/C++ code specification check;
    • Supports analysis of project dependency components;
    • Supports analysis of whether dependency components have vulnerabilities and other issues;
    • Supports Java/Kotlin API and function call chain analysis;
    • Supports code safety, null pointer check, memory leak, and other rules.

    Continuously updating...

    TCA official website version enhanced capability application

    ',10),h={href:"https://tca.tencent.com/",target:"_blank",rel:"noopener noreferrer"},p={href:"https://tca.tencent.com/document/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%8E%A5%E5%85%A5/License%E9%85%8D%E7%BD%AE.html",target:"_blank",rel:"noopener noreferrer"},u=n(`

    TCA Private Deployment Enhanced Capability Application

    If you are using TCA in an enterprise intranet environment and want to experience the enhanced analysis module capabilities of TCA on the intranet, you can apply as follows.

    Preparation

    • A dedicated machine for the CLS microservice, the CLS microservice needs to be bound to this machine

    WARNING

    Note: The CLS directory cannot be deleted at will

    Steps

    1. Execute the following command in the server/cls directory of the TCA source code to obtain the Server ID and Client License

    WARNING

    Note: The command needs to be executed in the CLS directory

    # install Git LFS
    +$ bash ./scripts/base/install_git_lfs.sh
    +# If the cls binary is not found in this directory, you can execute the following command to synchronize.
    +$ bash ./scripts/base/install_bin.sh
    +$ cd server/cls
    +$ ./cls server
    +2022-04-13 18:35:29.356510559 +0800 CST [INFO] Version: 20220328.1
    +2022-04-13 18:35:29.44083463 +0800 CST [INFO] The client license is:
    +xxx
    +2022-04-13 18:35:29.454552966 +0800 CST [INFO] License Server ID: xxx
    +
    • Server ID: Machine code, used to apply for License authorization from the TCA team
    • Client License: Provided to the TCA Client to facilitate tool authentication (important, it is recommended to back up)
    1. Configure the CLS microservice information in the config.ini of the TCA Client directory, for example
    [LICENSE_CONFIG]
    +; [optional] Fill in when using independent tools, no need by default
    +; Domain name and port of the License service
    +URL=http://<IP or domain name>:<port>
    +BASE_PATH=
    +LICENSE=<Client License>
    +

    WARNING

    Note: The URL corresponding value does not need to follow the slash / at the end.

    WARNING

    Different deployment methods can modify the config.ini configuration according to the following methods:

    • Source code deployment:
      • Modify the client/config.ini in the source code directory
      • Restart the client: ./quick_install.sh local start client
    • Docker deployment:
      • Method 1: Modify the .docker_temp/configs/client/config.ini in the source code directory and restart the tca-services container
      • Method 2: Enter the tca-service container, modify /CodeAnalysis/client/config.ini, and exit and restart the tca-services container
      • Restart the container method: docker restart tca-service
    • Docker-Compose deployment:
      • Modify the client/config.ini in the source code directory and restart the client container
      • Restart the container method: docker-compose restart client
    1. Submit a private cloud license application on the TCA Cloud official website
    `,15),m={href:"https://tca.tencent.com/",target:"_blank",rel:"noopener noreferrer"},v=n("
  • (2) Enter the team that needs to apply for a private cloud license (if there is no team, you need to create a corresponding team);
  • (3) On the team page, enter the [Node Management]->[Private Cloud License Configuration] page in turn, then click the [Apply for License] button in the upper right corner, fill in the relevant information and submit the application. The specific information is as follows:
    • Applicant name
    • Applicant's organization name
    • Applicant's organization type: company/university/individual
    • Applicant's email address
    • Applicant's mobile phone number
    • Server ID: Server ID output in step 1, the machine code for the first registration
    • Client License: Client License output in step 1
    • Application scenario
  • (4) Then wait for the application license to be reviewed and approved, you can copy the private cloud license and continue with the following step 4.
  • ",3),f=n(`
    1. Fill in the License in the config.yaml file in the CLS directory

    WARNING

    Note: Follow the yaml format, for example:

    • In key-value pairs, there is a blank character after the colon :, for example key: value.
    1. Execute the following command to start CLS
    ./cls server -d
    +
    1. Verify that the CLS process starts normally
    # Find if there is a CLS process
    +ps aux|grep cls
    +

    WARNING

    Note: If the above command does not find the CLS process, it means that CLS did not start normally.
    Please try to change the port in the config.yaml file to another port, such as 8080, the default is port 80, and then re-execute the command in step 5.

    1. Start the TCA analysis task Check the independent tool-related rule package in the analysis plan on the TCA platform, such as the dependency component analysis rule package, and then start an analysis task. If it runs normally, it means the setting takes effect.

    CLS Operation and Maintenance

    Automatic Restart

    # Find the CLS process ID
    +ps aux|grep cls
    +# Restart the microservice
    +kill -USR2 <pid>
    +

    Network Exception

    If the above deployment steps have been completed, but the enhanced function still encounters the License check failed! Please check the license. License Server is not available! exception. You can troubleshoot as follows:

    • Enter the task page, click on the abnormal tool, and download the execution log of the tool. If the following logs appear in the log, it means that the network access to CLS is abnormal;
    method(head) call fails on error: <urlopen error [Errno 111] Connection refused>
    +
    • Continue to verify. If it is Docker or Docker-Compose deployment method, enter the TCA Client container. If it is a source code deployment, go to the TCA Client machine. Execute the following command to confirm whether the network is accessible:
    ping <CLS IP or domain name filled in config.ini>
    +telnet <CLS IP or domain name filled in config.ini> <corresponding port>
    +
    • If the network is not accessible, please check:
      • Whether the firewall has opened the corresponding port;
      • Whether the corresponding domain name of CLS is set in the host;
      • Whether the IP setting is wrong.
    Case Sharing

    Background: Xiao Ming deployed TCA in Docker mode and deployed the CLS service on the same host. Then he set the IP in the URL in config.ini to 127.0.0.1, restarted and started the enhanced function task and encountered the above network disconnection exception.
    Reason: The reason is that the 127.0.0.1 at this time points to the TCA Client container itself, not the CLS service deployed on the host.
    Solution: Change 127.0.0.1 to the host's own IP.

    CLS Update

    1. Use the following command to find the cls process and kill the process
    # Find the CLS process ID
    +ps aux|grep cls
    +# Restart the microservice
    +kill -9 <pid>
    +
    1. Download the latest version of cls and replace the cls binary file in it

    WARNING

    Note: You cannot delete the original cls directory, you only need to replace the cls binary file in it.

    1. Use the following command to restart the cls service
    ./cls server -d
    +
    `,27);function g(b,y){const t=l("ExternalLinkIcon");return s(),c("div",null,[d,i("p",null,[e("If users usually use "),i("a",h,[e("TCA official website version public service"),a(t)]),e(" and want to experience the analysis capabilities of the enhanced analysis module on the official website version, they can follow "),i("a",p,[e("this help document"),a(t)]),e(" to apply for configuration.")]),u,i("ul",null,[i("li",null,[e("(1) Register or log in to an account on the "),i("a",m,[e("TCA Cloud official website"),a(t)]),e(";")]),v]),f])}const w=o(r,[["render",g],["__file","enhanceDeploy.html.vue"]]);export{w as default}; diff --git a/assets/enhanced_safety_java.html-006895cc.js b/assets/enhanced_safety_java.html-006895cc.js new file mode 100644 index 000000000..7a5fcca5d --- /dev/null +++ b/assets/enhanced_safety_java.html-006895cc.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-dd34d7c8","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java.html","title":"【Java】强化安全规则包","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"规则列表","slug":"规则列表","link":"#规则列表","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/规则包/enhanced_safety_java.md"}');export{e as data}; diff --git a/assets/enhanced_safety_java.html-6d9266e1.js b/assets/enhanced_safety_java.html-6d9266e1.js new file mode 100644 index 000000000..bf9ceff67 --- /dev/null +++ b/assets/enhanced_safety_java.html-6d9266e1.js @@ -0,0 +1 @@ +import{_ as a,r as o,o as l,c as s,a as e,b as t,d as r}from"./app-2a91d8ab.js";const h={},i=e("h1",{id:"【java】强化安全规则包",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#【java】强化安全规则包","aria-hidden":"true"},"#"),t(" 【Java】强化安全规则包")],-1),c={href:"https://tencent.github.io/CodeAnalysis/zh/quickStarted/enhanceDeploy.html",target:"_blank",rel:"noopener noreferrer"},d=e("h2",{id:"规则列表",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#规则列表","aria-hidden":"true"},"#"),t(" 规则列表")],-1),A={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#CmdInject",target:"_blank",rel:"noopener noreferrer"},_={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#PathTraversal",target:"_blank",rel:"noopener noreferrer"},E={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#SQLInject",target:"_blank",rel:"noopener noreferrer"},u={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#SSRF",target:"_blank",rel:"noopener noreferrer"},f={href:"https://tencent.github.io/CodeAnalysis/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#XSS",target:"_blank",rel:"noopener noreferrer"};function B(m,p){const n=o("ExternalLinkIcon");return l(),s("div",null,[i,e("p",null,[t("针对 Java 语言的强化代码安全规则包,属于 TCA 增强分析模块的能力之一,请参考"),e("a",c,[t("增强分析模块部署"),r(n)]),t("文档进行部署。")]),d,e("ul",null,[e("li",null,[e("a",A,[t("CmdInject"),r(n)])]),e("li",null,[e("a",_,[t("PathTraversal"),r(n)])]),e("li",null,[e("a",E,[t("SQLInject"),r(n)])]),e("li",null,[e("a",u,[t("SSRF"),r(n)])]),e("li",null,[e("a",f,[t("XSS"),r(n)])])])])}const g=a(h,[["render",B],["__file","enhanced_safety_java.html.vue"]]);export{g as default}; diff --git a/assets/enhanced_safety_java.html-7731bb0b.js b/assets/enhanced_safety_java.html-7731bb0b.js new file mode 100644 index 000000000..23a35f9c9 --- /dev/null +++ b/assets/enhanced_safety_java.html-7731bb0b.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-918a6bfe","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/enhanced_safety_java.html","title":"【Java】强化安全规则包","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"规则列表","slug":"规则列表","link":"#规则列表","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/规则包/enhanced_safety_java.md"}');export{e as data}; diff --git a/assets/enhanced_safety_java.html-7a9b7b0d.js b/assets/enhanced_safety_java.html-7a9b7b0d.js new file mode 100644 index 000000000..cae0ab32a --- /dev/null +++ b/assets/enhanced_safety_java.html-7a9b7b0d.js @@ -0,0 +1 @@ +import{_ as a,r as o,o as l,c as s,a as e,b as n,d as r}from"./app-2a91d8ab.js";const i={},h=e("h1",{id:"【java】强化安全规则包",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#【java】强化安全规则包","aria-hidden":"true"},"#"),n(" 【Java】强化安全规则包")],-1),c={href:"https://tencent.github.io/CodeAnalysis/zh/quickStarted/enhanceDeploy.html",target:"_blank",rel:"noopener noreferrer"},d=e("h2",{id:"规则列表",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#规则列表","aria-hidden":"true"},"#"),n(" 规则列表")],-1),A={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#CmdInject",target:"_blank",rel:"noopener noreferrer"},_={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#PathTraversal",target:"_blank",rel:"noopener noreferrer"},E={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#SQLInject",target:"_blank",rel:"noopener noreferrer"},u={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#SSRF",target:"_blank",rel:"noopener noreferrer"},f={href:"https://tencent.github.io/CodeAnalysis/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-C1.html#XSS",target:"_blank",rel:"noopener noreferrer"};function B(m,p){const t=o("ExternalLinkIcon");return l(),s("div",null,[h,e("p",null,[n("针对 Java 语言的强化代码安全规则包,属于 TCA 增强分析模块的能力之一,请参考"),e("a",c,[n("增强分析模块部署"),r(t)]),n("文档进行部署。")]),d,e("ul",null,[e("li",null,[e("a",A,[n("CmdInject"),r(t)])]),e("li",null,[e("a",_,[n("PathTraversal"),r(t)])]),e("li",null,[e("a",E,[n("SQLInject"),r(t)])]),e("li",null,[e("a",u,[n("SSRF"),r(t)])]),e("li",null,[e("a",f,[n("XSS"),r(t)])])])])}const g=a(i,[["render",B],["__file","enhanced_safety_java.html.vue"]]);export{g as default}; diff --git a/assets/eslint.html-0421823e.js b/assets/eslint.html-0421823e.js new file mode 100644 index 000000000..943ede9fa --- /dev/null +++ b/assets/eslint.html-0421823e.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-438ad62a","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint.html","title":"Eslint 使用手册","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"适用场景","slug":"适用场景","link":"#适用场景","children":[]},{"level":2,"title":"快速接入","slug":"快速接入","link":"#快速接入","children":[]},{"level":2,"title":"高级配置","slug":"高级配置","link":"#高级配置","children":[{"level":3,"title":"基础概念","slug":"基础概念","link":"#基础概念","children":[]},{"level":3,"title":"设置 Globals","slug":"设置-globals","link":"#设置-globals","children":[]},{"level":3,"title":"指定参数配置文件","slug":"指定参数配置文件","link":"#指定参数配置文件","children":[]},{"level":3,"title":"指定 Eslint 配置文件","slug":"指定-eslint-配置文件","link":"#指定-eslint-配置文件","children":[]},{"level":3,"title":"设置配置类型","slug":"设置配置类型","link":"#设置配置类型","children":[]},{"level":3,"title":"配置优先顺序","slug":"配置优先顺序","link":"#配置优先顺序","children":[]},{"level":3,"title":"分析路径配置","slug":"分析路径配置","link":"#分析路径配置","children":[]}]},{"level":2,"title":"Q&A","slug":"q-a","link":"#q-a","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/工具/eslint.md"}');export{l as data}; diff --git a/assets/eslint.html-4b6f5c3f.js b/assets/eslint.html-4b6f5c3f.js new file mode 100644 index 000000000..4b8462316 --- /dev/null +++ b/assets/eslint.html-4b6f5c3f.js @@ -0,0 +1,4 @@ +import{_ as t,o as e,c as l,e as i}from"./app-2a91d8ab.js";const a={},d=i(`

    Eslint 使用手册

    代码分析支持 Eslint 分析,并支持用户自由扩展配置。

    适用场景

    目前 TCA-Eslint 的适用场景很广,灵活扩展:

    • JavaScript
    • TypeScript
    • React
    • Vue
    • Google 代码规范分析
    • 其他,包括项目自己维护的 Eslint 配置

    快速接入

    以下是接入步骤:

    1. 在代码分析创建项目,会自动匹配 JavaScript 或者 TypeScript 对应的推荐规则集
    2. 启动分析即可

    高级配置

    基础概念

    在进行高级配置之前,这里先普及下代码分析这边的基础概念——Eslint 类型。 由于 JavaScript 语法、 Vue 语法和 TypeScript 语法之间的区别,三者使用的语法解析器也是不一样的,这里基于其使用的语法解析器的不同,从 Eslint 中拆分出来了 Eslint_vue 和 Eslint_typescript 工具。可以根据需要选择对应工具下的规则进行分析。而配置也会基于类型的不同匹配到对应的工具中。 目前代码分析上 Eslint 类型有:

    • JAVASCRIPT
      分析 JavaScript 以及基于 JavaScript 写的 React 代码,默认分析文件后缀名为.js,.jsx
    • VUE
      分析 Vue 框架的代码,默认分析文件后缀名为.vue
    • TYPESCRIPT
      分析 TypeScript 以及基于 TypeScript 写的 React 代码,默认分析文件后缀名为.ts,tsx

    设置 Globals

    因为项目会用到各式各样的框架,其中会有全局变量是 Eslint 无法识别到的,比如 _ 或者 jtest,从而导致分析出不少误报。这里支持使用下面环境变量设置这些全局变量,减少误报。可以在代码分析项目中设置对应的环境变量。

    环境变量名称描述
    ESLINT_JAVASCRIPT_GLOBALS字符串,以分号分割
    ESLINT_VUE_GLOBALS字符串,以分号分割
    ESLINT_TYPESCRIPT_GLOBALS字符串,以分号分割

    比如:

    ESLINT_JAVASCRIPT_GLOBALS=_:readonly;jtest:readonly
    +

    其中,

    • writable 表示允许重写变量
    • readonly 表示不允许重写变量
    • off 表示禁用该全局变量

    指定参数配置文件

    代码分析执行 Eslint 分析,默认会使用 Alloy Team 的 Eslint 配置来分析,但是也支持修改配置。

    1. 在代码库中创建一个参数配置 Json 文件,结果类似 Eslint 的 Json 配置文件
    2. 在代码分析项目设置下面对应环境变量,指向这个参数配置文件 指定了参数配置文件之后,Eslint 分析时候就会自动将代码分析默认的配置与该参数配置文件进行合并。
    3. 启动全量分析即可
    环境变量名称描述
    ESLINT_JAVASCRIPT_OPTIONS字符串,相对代码库根目录路径
    ESLINT_VUE_OPTIONS字符串,相对代码库根目录路径
    ESLINT_TYPESCRIPT_OPTIONS字符串,相对代码库根目录路径

    指定 Eslint 配置文件

    代码分析也支持用户指定自己维护的 Eslint 配置文件进行分析。

    环境变量名称描述
    ESLINT_JAVASCRIPT_CONFIG字符串,相对代码库根目录路径
    ESLINT_VUE_CONFIG字符串,相对代码库根目录路径
    ESLINT_TYPESCRIPT_CONFIG字符串,相对代码库根目录路径

    设置配置类型

    代码分析自带支持 Google 代码规范,可以在代码分析项目设置对应环境变量,使用对应的配置文件。

    环境变量名称描述
    ESLINT_JAVASCRIPT_CONFIG_TYPE字符串, google,default,custom
    ESLINT_VUE_CONFIG_TYPE字符串, 可选:default,custom
    ESLINT_TYPESCRIPT_CONFIG_TYPE字符串, 可选:default,custom

    其中:

    • google,表示使用 google 代码规范配置文件
    • default,表示使用代码分析维护的配置文件
    • custom,表示使用项目代码库中 Eslint 配置文件

    配置优先顺序

    这里介绍 TCA-Eslint 的配置使用顺序:

    1. 优先检查是否设置对应的 ESLINT_CONFIG 环境变量,比如 ESLINT_JAVASCRIPT_CONFIG
    2. 然后检查是否设置对应的 ESLINT_CONFIG_TYPE 环境变量,比如 ESLINT_JAVASCRIPT_CONFIG_TYPE
    3. 若是 JAVASCRIPT 类型的项目,会自动检测代码库根目录下是否有 ESLINT 配置文件,若有则使用该配置文件进行分析,其他类型的项目便不会有这一步
    4. 使用代码分析维护的 Alloy Team 的配置文件进行分析

    分析路径配置

    可以在代码分析页面上设置分析路径设置,这里建议多使用 Exclude 设置,因为 Eslint 工具本身对 include 支持不友好。

    Q&A

    Q:JavaScript 内存溢出

    A:Eslint 执行可能会出现 Js 内存溢出,以下有三种方案可以解决:

    • 可以设置环境变量 NODE_OPTIONS,比如
    NODE_OPTIONS="--max-old-space-size=4096"
    +
    • 设置环境变量 ESLINT_MAX_OLD_SPACE_SIZE,比如
    ESLINT_MAX_OLD_SPACE_SIZE=4096
    +
    • 设置分析路径过滤,将无用的文件进行过滤

    Q:一个配置同时分析 JS 和 TS

    A:若代码库中既有 JavaScript 代码,又有 TypeScript 代码,并且共用一个配置文件。 若规则集中既有 Eslint 规则又有 Eslint_typescript 规则,为了避免执行两次 Eslint 以及可能出现重复单的情况,并且因为 Eslint_typescript 的语法解析器也能够解析 JavaScript 代码,所以这里将这样的项目当作 TypeScript 项目。

    1. 这里建议只指定 ESLINT_TYPESCRIPT_CONFIG 环境变量
    2. 规则集中剔除 Eslint 的规则,只保留 Eslint_typescript 规则。
    3. 并指定 ESLINT_TYPESCRIPT_EXT=.js,.jsx,.ts,.tsx

    Q:找不到依赖

    A:用户自己配置的配置文件中,可能会用到代码分析没有管理到的规则插件,导致分析时候找不到对应的依赖,这里有两个方案提供解决:

    • 在代码库根目录下 npm 安装对应插件,并设置分析路径过滤 node_modules

    Q:custom 与指定配置文件的区别

    A:- custom 模式,会检测代码库中的 Eslint 配置文件进行分析,包括子目录和代码注释中设置的配置,都是可以生效的。

    • 相对的,指定配置文件的方式,只会对指定的配置文件中的配置会生效。
    `,53),s=[d];function n(r,h){return e(),l("div",null,s)}const o=t(a,[["render",n],["__file","eslint.html.vue"]]);export{o as default}; diff --git a/assets/eslint.html-6696da7c.js b/assets/eslint.html-6696da7c.js new file mode 100644 index 000000000..4d3ef729a --- /dev/null +++ b/assets/eslint.html-6696da7c.js @@ -0,0 +1,4 @@ +import{_ as t,o as e,c as l,e as i}from"./app-2a91d8ab.js";const a={},d=i(`

    Eslint 使用手册

    代码分析支持 Eslint 分析,并支持用户自由扩展配置。

    适用场景

    目前 TCA-Eslint 的适用场景很广,灵活扩展:

    • JavaScript
    • TypeScript
    • React
    • Vue
    • Google 代码规范分析
    • 其他,包括项目自己维护的 Eslint 配置

    快速接入

    以下是接入步骤:

    1. 在代码分析创建项目,会自动匹配 JavaScript 或者 TypeScript 对应的推荐规则集
    2. 启动分析即可

    高级配置

    基础概念

    在进行高级配置之前,这里先普及下代码分析这边的基础概念——Eslint 类型。 由于 JavaScript 语法、 Vue 语法和 TypeScript 语法之间的区别,三者使用的语法解析器也是不一样的,这里基于其使用的语法解析器的不同,从 Eslint 中拆分出来了 Eslint_vue 和 Eslint_typescript 工具。可以根据需要选择对应工具下的规则进行分析。而配置也会基于类型的不同匹配到对应的工具中。 目前代码分析上 Eslint 类型有:

    • JAVASCRIPT 分析 JavaScript 以及基于 JavaScript 写的 React 代码,默认分析文件后缀名为.js,.jsx
    • VUE 分析 Vue 框架的代码,默认分析文件后缀名为.vue
    • TYPESCRIPT 分析 TypeScript 以及基于 TypeScript 写的 React 代码,默认分析文件后缀名为.ts,tsx

    设置 Globals

    因为项目会用到各式各样的框架,其中会有全局变量是 Eslint 无法识别到的,比如 _ 或者 jtest,从而导致分析出不少误报。这里支持使用下面环境变量设置这些全局变量,减少误报。可以在代码分析项目中设置对应的环境变量。

    环境变量名称描述
    ESLINT_JAVASCRIPT_GLOBALS字符串,以分号分割
    ESLINT_VUE_GLOBALS字符串,以分号分割
    ESLINT_TYPESCRIPT_GLOBALS字符串,以分号分割

    比如:

    ESLINT_JAVASCRIPT_GLOBALS=_:readonly;jtest:readonly
    +

    其中,

    • writable 表示允许重写变量
    • readonly 表示不允许重写变量
    • off 表示禁用该全局变量

    指定参数配置文件

    代码分析执行 Eslint 分析,默认会使用 Alloy Team 的 Eslint 配置来分析,但是也支持修改配置。

    1. 在代码库中创建一个参数配置 Json 文件,结果类似 Eslint 的 Json 配置文件
    2. 在代码分析项目设置下面对应环境变量,指向这个参数配置文件 指定了参数配置文件之后,Eslint 分析时候就会自动将代码分析默认的配置与该参数配置文件进行合并。
    3. 启动全量分析即可
    环境变量名称描述
    ESLINT_JAVASCRIPT_OPTIONS字符串,相对代码库根目录路径
    ESLINT_VUE_OPTIONS字符串,相对代码库根目录路径
    ESLINT_TYPESCRIPT_OPTIONS字符串,相对代码库根目录路径

    指定 Eslint 配置文件

    代码分析也支持用户指定自己维护的 Eslint 配置文件进行分析。

    环境变量名称描述
    ESLINT_JAVASCRIPT_CONFIG字符串,相对代码库根目录路径
    ESLINT_VUE_CONFIG字符串,相对代码库根目录路径
    ESLINT_TYPESCRIPT_CONFIG字符串,相对代码库根目录路径

    设置配置类型

    代码分析自带支持 Google 代码规范,可以在代码分析项目设置对应环境变量,使用对应的配置文件。

    环境变量名称描述
    ESLINT_JAVASCRIPT_CONFIG_TYPE字符串, google,default,custom
    ESLINT_VUE_CONFIG_TYPE字符串, 可选:default,custom
    ESLINT_TYPESCRIPT_CONFIG_TYPE字符串, 可选:default,custom

    其中:

    • google,表示使用 google 代码规范配置文件
    • default,表示使用代码分析维护的配置文件
    • custom,表示使用项目代码库中 Eslint 配置文件

    配置优先顺序

    这里介绍 TCA-Eslint 的配置使用顺序:

    1. 优先检查是否设置对应的 ESLINT_CONFIG 环境变量,比如 ESLINT_JAVASCRIPT_CONFIG
    2. 然后检查是否设置对应的 ESLINT_CONFIG_TYPE 环境变量,比如 ESLINT_JAVASCRIPT_CONFIG_TYPE
    3. 若是 JAVASCRIPT 类型的项目,会自动检测代码库根目录下是否有 ESLINT 配置文件,若有则使用该配置文件进行分析,其他类型的项目便不会有这一步
    4. 使用代码分析维护的 Alloy Team 的配置文件进行分析

    分析路径配置

    可以在代码分析页面上设置分析路径设置,这里建议多使用 Exclude 设置,因为 Eslint 工具本身对 include 支持不友好。

    Q&A

    Q:JavaScript 内存溢出

    A:Eslint 执行可能会出现 Js 内存溢出,以下有三种方案可以解决:

    • 可以设置环境变量 NODE_OPTIONS,比如
    NODE_OPTIONS="--max-old-space-size=4096"
    +
    • 设置环境变量 ESLINT_MAX_OLD_SPACE_SIZE,比如
    ESLINT_MAX_OLD_SPACE_SIZE=4096
    +
    • 设置分析路径过滤,将无用的文件进行过滤

    Q:一个配置同时分析 JS 和 TS

    A:若代码库中既有 JavaScript 代码,又有 TypeScript 代码,并且共用一个配置文件。 若规则集中既有 Eslint 规则又有 Eslint_typescript 规则,为了避免执行两次 Eslint 以及可能出现重复单的情况,并且因为 Eslint_typescript 的语法解析器也能够解析 JavaScript 代码,所以这里将这样的项目当作 TypeScript 项目。

    1. 这里建议只指定 ESLINT_TYPESCRIPT_CONFIG 环境变量
    2. 规则集中剔除 Eslint 的规则,只保留 Eslint_typescript 规则。
    3. 并指定 ESLINT_TYPESCRIPT_EXT=.js,.jsx,.ts,.tsx

    Q:找不到依赖

    A:用户自己配置的配置文件中,可能会用到代码分析没有管理到的规则插件,导致分析时候找不到对应的依赖,这里有两个方案提供解决:

    • 在代码库根目录下 npm 安装对应插件,并设置分析路径过滤 node_modules

    Q:custom 与指定配置文件的区别

    A:- custom 模式,会检测代码库中的 Eslint 配置文件进行分析,包括子目录和代码注释中设置的配置,都是可以生效的。

    • 相对的,指定配置文件的方式,只会对指定的配置文件中的配置会生效。
    `,53),s=[d];function n(r,h){return e(),l("div",null,s)}const o=t(a,[["render",n],["__file","eslint.html.vue"]]);export{o as default}; diff --git a/assets/eslint.html-fbc7baff.js b/assets/eslint.html-fbc7baff.js new file mode 100644 index 000000000..3de7c2af9 --- /dev/null +++ b/assets/eslint.html-fbc7baff.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-0db91de5","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/eslint.html","title":"Eslint 使用手册","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"适用场景","slug":"适用场景","link":"#适用场景","children":[]},{"level":2,"title":"快速接入","slug":"快速接入","link":"#快速接入","children":[]},{"level":2,"title":"高级配置","slug":"高级配置","link":"#高级配置","children":[{"level":3,"title":"基础概念","slug":"基础概念","link":"#基础概念","children":[]},{"level":3,"title":"设置 Globals","slug":"设置-globals","link":"#设置-globals","children":[]},{"level":3,"title":"指定参数配置文件","slug":"指定参数配置文件","link":"#指定参数配置文件","children":[]},{"level":3,"title":"指定 Eslint 配置文件","slug":"指定-eslint-配置文件","link":"#指定-eslint-配置文件","children":[]},{"level":3,"title":"设置配置类型","slug":"设置配置类型","link":"#设置配置类型","children":[]},{"level":3,"title":"配置优先顺序","slug":"配置优先顺序","link":"#配置优先顺序","children":[]},{"level":3,"title":"分析路径配置","slug":"分析路径配置","link":"#分析路径配置","children":[]}]},{"level":2,"title":"Q&A","slug":"q-a","link":"#q-a","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/工具/eslint.md"}');export{l as data}; diff --git a/assets/fork1-f2dae6f2.png b/assets/fork1-f2dae6f2.png new file mode 100644 index 000000000..f93cdcbe5 Binary files /dev/null and b/assets/fork1-f2dae6f2.png differ diff --git a/assets/front_end_framework_check.html-1cb6c259.js b/assets/front_end_framework_check.html-1cb6c259.js new file mode 100644 index 000000000..46a550cf4 --- /dev/null +++ b/assets/front_end_framework_check.html-1cb6c259.js @@ -0,0 +1,13 @@ +import{_ as e,o as a,c as i,e as n}from"./app-2a91d8ab.js";const d={},r=n(`

    前端框架检查规则包

    背景

    前端项目在长期发展过程中,由于框架开源许可证变更、框架性能外观等不适用等因素,需要对前端框架进行平滑切换,而这就需要腾讯云代码分析 TCA 的介入,方便对企业内所有前端项目进行批量分析统计,方便管理。

    需求

    • 检查代码仓库中使用到指定前端框架的代码位置。

    示例

    {
    +  "name": "framework",
    +  "version": "1.0.0",
    +  "dependencies": {
    +    "react": "^17.0.2", // 触发规则
    +    "react-dom": "^17.0.2", // 触发规则
    +    "react-hotkeys-hook": "^3.4.3", // 触发规则
    +    "react-redux": "^7.2.5", // 触发规则
    +    "single-spa": "^5.9.3",
    +    "universal-cookie": "^4.0.4"
    +  },
    +}
    +

    快速体验

    TCA 现已支持前端框架检查规则包,可以在 TCA 分析方案中搜索勾选以下规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 -> 前端框架检查规则包 -> 启用/查看规则

    支持框架

    • TDesign
    • AntD
    • React
    • Vue

    更多

    更多框架支持,欢迎提 issue 进行咨询扩展。

    `,15),t=[r];function o(s,u){return a(),i("div",null,t)}const c=e(d,[["render",o],["__file","front_end_framework_check.html.vue"]]);export{c as default}; diff --git a/assets/front_end_framework_check.html-2b5efba2.js b/assets/front_end_framework_check.html-2b5efba2.js new file mode 100644 index 000000000..46a550cf4 --- /dev/null +++ b/assets/front_end_framework_check.html-2b5efba2.js @@ -0,0 +1,13 @@ +import{_ as e,o as a,c as i,e as n}from"./app-2a91d8ab.js";const d={},r=n(`

    前端框架检查规则包

    背景

    前端项目在长期发展过程中,由于框架开源许可证变更、框架性能外观等不适用等因素,需要对前端框架进行平滑切换,而这就需要腾讯云代码分析 TCA 的介入,方便对企业内所有前端项目进行批量分析统计,方便管理。

    需求

    • 检查代码仓库中使用到指定前端框架的代码位置。

    示例

    {
    +  "name": "framework",
    +  "version": "1.0.0",
    +  "dependencies": {
    +    "react": "^17.0.2", // 触发规则
    +    "react-dom": "^17.0.2", // 触发规则
    +    "react-hotkeys-hook": "^3.4.3", // 触发规则
    +    "react-redux": "^7.2.5", // 触发规则
    +    "single-spa": "^5.9.3",
    +    "universal-cookie": "^4.0.4"
    +  },
    +}
    +

    快速体验

    TCA 现已支持前端框架检查规则包,可以在 TCA 分析方案中搜索勾选以下规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 -> 前端框架检查规则包 -> 启用/查看规则

    支持框架

    • TDesign
    • AntD
    • React
    • Vue

    更多

    更多框架支持,欢迎提 issue 进行咨询扩展。

    `,15),t=[r];function o(s,u){return a(),i("div",null,t)}const c=e(d,[["render",o],["__file","front_end_framework_check.html.vue"]]);export{c as default}; diff --git a/assets/front_end_framework_check.html-755e8478.js b/assets/front_end_framework_check.html-755e8478.js new file mode 100644 index 000000000..e42be40ec --- /dev/null +++ b/assets/front_end_framework_check.html-755e8478.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6908b43a","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check.html","title":"前端框架检查规则包","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"背景","slug":"背景","link":"#背景","children":[]},{"level":2,"title":"需求","slug":"需求","link":"#需求","children":[{"level":3,"title":"示例","slug":"示例","link":"#示例","children":[]}]},{"level":2,"title":"快速体验","slug":"快速体验","link":"#快速体验","children":[{"level":3,"title":"启用规则包","slug":"启用规则包","link":"#启用规则包","children":[]},{"level":3,"title":"支持框架","slug":"支持框架","link":"#支持框架","children":[]},{"level":3,"title":"更多","slug":"更多","link":"#更多","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/规则包/front_end_framework_check.md"}');export{e as data}; diff --git a/assets/front_end_framework_check.html-bc39db93.js b/assets/front_end_framework_check.html-bc39db93.js new file mode 100644 index 000000000..f0da00e0d --- /dev/null +++ b/assets/front_end_framework_check.html-bc39db93.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0b3551c4","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/front_end_framework_check.html","title":"前端框架检查规则包","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"背景","slug":"背景","link":"#背景","children":[]},{"level":2,"title":"需求","slug":"需求","link":"#需求","children":[{"level":3,"title":"示例","slug":"示例","link":"#示例","children":[]}]},{"level":2,"title":"快速体验","slug":"快速体验","link":"#快速体验","children":[{"level":3,"title":"启用规则包","slug":"启用规则包","link":"#启用规则包","children":[]},{"level":3,"title":"支持框架","slug":"支持框架","link":"#支持框架","children":[]},{"level":3,"title":"更多","slug":"更多","link":"#更多","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/规则包/front_end_framework_check.md"}');export{e as data}; diff --git a/assets/gitlab_application_01-7866c7ca.png b/assets/gitlab_application_01-7866c7ca.png new file mode 100644 index 000000000..dc85658ba Binary files /dev/null and b/assets/gitlab_application_01-7866c7ca.png differ diff --git a/assets/gitlab_application_02-6f821932.png b/assets/gitlab_application_02-6f821932.png new file mode 100644 index 000000000..89942faf9 Binary files /dev/null and b/assets/gitlab_application_02-6f821932.png differ diff --git a/assets/gitlab_application_03-41a33813.png b/assets/gitlab_application_03-41a33813.png new file mode 100644 index 000000000..09e999b89 Binary files /dev/null and b/assets/gitlab_application_03-41a33813.png differ diff --git a/assets/gitlab_application_04-01ff3c53.png b/assets/gitlab_application_04-01ff3c53.png new file mode 100644 index 000000000..d18799d31 Binary files /dev/null and b/assets/gitlab_application_04-01ff3c53.png differ diff --git a/assets/gitlab_oauth_QA_01-00f480f3.png b/assets/gitlab_oauth_QA_01-00f480f3.png new file mode 100644 index 000000000..f0e51e148 Binary files /dev/null and b/assets/gitlab_oauth_QA_01-00f480f3.png differ diff --git a/assets/gitlab_oauth_QA_02-02424dd0.png b/assets/gitlab_oauth_QA_02-02424dd0.png new file mode 100644 index 000000000..a6b8b478e Binary files /dev/null and b/assets/gitlab_oauth_QA_02-02424dd0.png differ diff --git a/assets/gitlab_oauth_QA_03-f1493e02.png b/assets/gitlab_oauth_QA_03-f1493e02.png new file mode 100644 index 000000000..35673c555 Binary files /dev/null and b/assets/gitlab_oauth_QA_03-f1493e02.png differ diff --git a/assets/gitlab_oauth_QA_05-8d166cf1.png b/assets/gitlab_oauth_QA_05-8d166cf1.png new file mode 100644 index 000000000..197ebdc24 Binary files /dev/null and b/assets/gitlab_oauth_QA_05-8d166cf1.png differ diff --git a/assets/gitlab_oauth_QA_06-3f3cc486.png b/assets/gitlab_oauth_QA_06-3f3cc486.png new file mode 100644 index 000000000..88a141aa0 Binary files /dev/null and b/assets/gitlab_oauth_QA_06-3f3cc486.png differ diff --git a/assets/gitlab_oauth_QA_07-d3997b70.png b/assets/gitlab_oauth_QA_07-d3997b70.png new file mode 100644 index 000000000..92d330d3a Binary files /dev/null and b/assets/gitlab_oauth_QA_07-d3997b70.png differ diff --git a/assets/gitlab_oauth_disposition_01-aa54e072.png b/assets/gitlab_oauth_disposition_01-aa54e072.png new file mode 100644 index 000000000..d57ad0fb2 Binary files /dev/null and b/assets/gitlab_oauth_disposition_01-aa54e072.png differ diff --git a/assets/gitlab_oauth_disposition_02-2679e831.png b/assets/gitlab_oauth_disposition_02-2679e831.png new file mode 100644 index 000000000..36bc7afe8 Binary files /dev/null and b/assets/gitlab_oauth_disposition_02-2679e831.png differ diff --git a/assets/gitlab_oauth_disposition_03-07d21c14.png b/assets/gitlab_oauth_disposition_03-07d21c14.png new file mode 100644 index 000000000..88e929ccd Binary files /dev/null and b/assets/gitlab_oauth_disposition_03-07d21c14.png differ diff --git a/assets/gitlab_oauth_disposition_04-4506c3a9.png b/assets/gitlab_oauth_disposition_04-4506c3a9.png new file mode 100644 index 000000000..e46ec0306 Binary files /dev/null and b/assets/gitlab_oauth_disposition_04-4506c3a9.png differ diff --git a/assets/gitlab_oauth_disposition_05-983333e5.png b/assets/gitlab_oauth_disposition_05-983333e5.png new file mode 100644 index 000000000..18c0fc327 Binary files /dev/null and b/assets/gitlab_oauth_disposition_05-983333e5.png differ diff --git a/assets/gitlab_oauth_disposition_06-21fa11a0.png b/assets/gitlab_oauth_disposition_06-21fa11a0.png new file mode 100644 index 000000000..36ebbb5a9 Binary files /dev/null and b/assets/gitlab_oauth_disposition_06-21fa11a0.png differ diff --git a/assets/gitlab_oauth_disposition_07-935997e9.png b/assets/gitlab_oauth_disposition_07-935997e9.png new file mode 100644 index 000000000..b84264219 Binary files /dev/null and b/assets/gitlab_oauth_disposition_07-935997e9.png differ diff --git a/assets/gitlab_oauth_guide.html-04a9d45f.js b/assets/gitlab_oauth_guide.html-04a9d45f.js new file mode 100644 index 000000000..4e6431be9 --- /dev/null +++ b/assets/gitlab_oauth_guide.html-04a9d45f.js @@ -0,0 +1,34 @@ +import{_ as a,o as e,c as i,e as t}from"./app-2a91d8ab.js";const s="/CodeAnalysis/assets/gitlab_application_01-7866c7ca.png",d="/CodeAnalysis/assets/gitlab_application_02-6f821932.png",r="/CodeAnalysis/assets/gitlab_application_03-41a33813.png",n="/CodeAnalysis/assets/gitlab_application_04-01ff3c53.png",l="/CodeAnalysis/assets/gitlab_oauth_disposition_01-aa54e072.png",h="/CodeAnalysis/assets/gitlab_oauth_disposition_02-2679e831.png",o="/CodeAnalysis/assets/gitlab_oauth_disposition_03-07d21c14.png",c="/CodeAnalysis/assets/gitlab_oauth_disposition_04-4506c3a9.png",p="/CodeAnalysis/assets/gitlab_oauth_disposition_05-983333e5.png",u="/CodeAnalysis/assets/gitlab_oauth_disposition_06-21fa11a0.png",b="/CodeAnalysis/assets/gitlab_oauth_disposition_07-935997e9.png",A="/CodeAnalysis/assets/gitlab_oauth_QA_01-00f480f3.png",g="/CodeAnalysis/assets/gitlab_oauth_QA_02-02424dd0.png",_="/CodeAnalysis/assets/gitlab_oauth_QA_03-f1493e02.png",m="data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/sBCgoKCgoKCwwMCw8QDhAPFhQTExQWIhgaGBoYIjMgJSAgJSAzLTcsKSw3LVFAODhAUV5PSk9ecWVlcY+Ij7u7+//CABEIADoB8QMBIgACEQEDEQH/xAAvAAEAAwEBAQEAAAAAAAAAAAAAAwQFAgEGBwEBAQEAAAAAAAAAAAAAAAAAAAEC/9oADAMBAAIQAxAAAAD8z5l+h1PmW31GE0b9fPteWXDbfCY7erLlPsKNnzr6LWPh299Ufm7rmAAAAAAAAAAAAAAAAAAAAAAqzez/AA0vcwXO6AsK40uKAvxVRtVc8WNr50XtDBEfMwhTCFMIUwhWfSqsCutelRbiIlr0qLArrIrLIrLYqeXOSqmEKYQpuysmEKYQphCsckKbRMhMLuphWq0OsyFLe9g112saTyNPQ+er1q2sTg2MviSNiTEhJ6lqkamWG9zjd1rTY09k+dPHm2rGb4T+0BsTYfta+dDEbveIi/1memmzFanWUjc6w1bMWaTTs4/q2NDE6LvlBG3Qr8G3FlxWasFavLo2KPFl3b+Vvy4wIee+AIAAAAAAAAAAAA9eK9eD14PfACAAAAAAAAAAAAAr/8QALBAAAgICAgIABAUFAQAAAAAAAgMBBAAFEhMRFBAVMkAhIzEzUCAiJTQ1Qv/aAAgBAQABCACfoH+fCBKQgrOu1osUpNtFRiCYl+lJU1fHpLFRsOzS1wbGqlNqnXreXpuqrsOiitGtQLa8ha1RpaITY0ZoKvlmghAQYW9dTpm+GTRCdkfRd1B1a0gFTW6o1VFH1V0fKWOJCE1lsIxgTIY/jKzyrNQ4bG6u2JrSZ7QIJfQ7ahIQCbl9dhUrSewSbqtjG3Oyu1WMvETqbgPZq5K6T2ZnC5lmwRL0OUV8+owBe3UoWwNq3UtWzskdhdoJmwjeUlOqTL30bUVZk7mnK0+wJwEGUB9j4zxnjPGeM8Z4zx9pxjjGcRziOcRziOcRziOcRziOcRziOcRziOcRziOcRziOcRziOcRziOcRziOcRziOcRzoLq7MiuZL7IlDInxkIbM+I9V+RTsThVHjHmeo8GpYKImJqWBjzPruz13Z6zs9Z2es7Iqvn8M9OznpWcmnYj9eguvsziOcRziOcRziOdBdXZnEc4jnEc4jnEc4jhKkOPLiOcRzX60b/u5xHKQCduoB32tbWls7S7cIqElsbdpx68GXwJm1uCN5U+5rDzbN76pTFEBO7VA7Zuu1mSy6qfc1Z40zVTeQPt2nXNODL4oGg7p1/wDv08R+gZsmwakedn/0buKGCaAzfqoQsJXhbKdhf13m3FWVnYDbWEe2EReKvY2dVM3U1ZrGxLzSfV1X/wAlNOpDohK6tXC+rF/XHwH6Yx/7RfCv+yGN/bn4R+kf0B9UfCMbPhc45USzWa+W1q9gIlDaNEpqGBJQmu1mWnKPb0hG+FdiGuXYWX+OoC2jRKahgSUJrtZlpyj29IRbWq2yAgYio2ANd6aAE5atjK5miY2EVCbRqxsk0Fr/ACKGynYfNPORMjxmH37VmQ7bN6zcgIcb2slckza3WmJmu09UcRbsLFiQhzrKTiIUeyusNRnFhwgS4s3rVuBh02XyxJTFpnjibrKTiIU3Y3HEuTm0+QIJs7CzbiYb8VsNTBISsONZLl1yw9a1sXsXS2pL7l59uZgjtMcxMvbZ77ZvY+0x9hz8lzJnIe2J/D2X5FuxH4YVp5R4ntPBtPCIGJt2CjxPe7O9+d787353vyLFiM9qznt2si0ySiGWLBvstfLthceQSb9jcsDAMs3rVuBhxX7RwmCGyc/2G6011pljH7G5YGAZZvWrcDDiv2jhMFNl8jIY7YW3yEslpk6Wk3Z3HdcHYv2bMxLLF61biIbprdep8z7sn6B+8855nPM55nPM/f8A/iP5/wD/xAA1EAACAQMCBgADBQcFAAAAAAABAgMAERIEIRMiMUFRoVBhcQUQIzJyFCBCUoGisjBTVFWR/9oACAEBAAk/APJ+PsQpexIFyBt0G1SyZya0QbpawSytvkfNQiApq+AeZmBBFwTe+9SShJtQIbyQmMgnuAeoqYhF1XBayXNrE5dRTyMHeAPGyYjFwCTlkacTxLqGjeNlKgEb2uDcitFFE88cTZBnO79uZjtU/HiOrWCQFCm9Xjlm1BSKFhvhewYk08oWTUCAmSEx2J7qD1FaoyRicwykR2Kkd1BO9RRKUTRqDqFkRbtG2VuATckrWmkeFYIWIggadbyxg9HKkA1DrHICylzpMRYqDZnyNsagQ6qaJGXlfcOE3sJRcDI1Fpon4mcil2cPGFR0LgZkZ1oIrK5LloCOVN97abob0wYAkBhex+YvY/Db3jky2NjtUjkwycSzMWBbK4rSiMLqRqGDPnk4/oLCtOyFdSJ8nkMhyH9BWn4StMZXu+d2PjYWFaZhPE0Rc8TlcRgDYW26VHbPU8a9+mxFqTFtPHGo3vcx960vDVdSJ3BfLJh4NthUf4kWpMsTk3xBNyh8i9aQoUnErXlLXIN7DwKUox1XHVw26mv2tS6aRQYZRCfwIijXNmoTtaOEKj75lECnNwRVxKoODog38Iw22HYjoK0jtwUgDPaG941AJF0Le64sbhAkzBQ+yRqiBQWH8tPqw8z6ok8Fek6lQPz/AMNElbnEkWJHzG/w3yaFChQoUKFChQoUKFChQoUKFChQoUKFIcMscvn1tUZwL4X+dr2pPdJSexUfsUlh9RS0m31FR+xS+xSexSexSexSexSexUfsVH7FR7fUUhwzxy+fW1ChQoUKQ4ZY5fPrahQoUKFCkIyFxfa48ihQqTD9n0kk/S+WHahQBVp0BHkEitUztHqyoUpYodzZWv02rUykrponByOzea1EjoYIXKsxILea3ZtU4H1LVhaLUjTjFlbkQgrfGp3nw1bKXkFmS42UbnagCrTICPIJo5yDX8KO/YMDyisMYtUNOMXVuRCCt8aYq6/aVww2IIU1PI6FdM5DMSC1+tSu99ecskwscT8zX+/H/lX/AHCVPLqC+rYh5BYx4GxQbmv+RJ/lQuCwBFwvs7ComUlrb6mKb0n3RYYTr3v1YVpVBTWNGylmIkHXetFFskLE5PzDAcp5q0ka5HTBmDPcqyrtuag4Rj1Rh2YtkLXBN6g4eMYDcxbJh1bfpeuqR8R/1y7+hauscXEf9cu/oW/f+f8Apm1yrSfJpyD6Fq03DYawQYhycwfm17GlhsdasLrE7sCp8lwN6hDFNbhYlrFQCbbGtNGjB9KcwWJIKrtuSKh4brq2iNmJyBF7m9KS1lZ1Btd5t7f+WpYbHWrC6xO7AqfJcDeoQxTW4WJaxUAm2xrTRowfSnMFiSCq7bkiouEx1/AYhicg3c371p+EF1ogIDMclPm/etNhJFqSoGTEOg81EAraZW4eTsuzEWGRJArTJDO8i8bBnIQOdl5yd6aISLKVKxtI118tmBvUWGH2Tqu9+uP3Egg3BFSBsGyAxUC/kgDc0UIQWXGNEsPHKBTXMaqq7DYL0pos1kEgYQxqch3uFp7DirL0B516GsHRXyKBRGpPzwtWjjgcMCHRnJ/uY1KMo3zWyKObyQBuachTIJD+pehqTIAk2Chdz1JsBc0/NCFCGw2CdKs8Zl4rIdgzfUWNaOOBgwOaM5P9zGpd43zWyqObybDc0/KZeLaw/P5oxm7ZEiJFJP1UA/uGzIwZT4Ip7q0nEIsPzeaZWCAAHBQ1gLAFgLmiGSCRG2Rc7J2y6mnvGHZlGIXr3Nupo8RYlVAuy8i9qS4eXNlvba/StmkYtTU1P6FP6FPt9BRp7D6Cn9Cm9U3oU3oU3oU3oU/oU/oVJ6FHNAwLLsLgdr1s7uX27VNujZriAvN/NsBc1KLB8wFVU5vPKBUmQUkgBQu56k2AuadSYSpRsFyGPS5tc1zxGYSumwyNEq7SZi38JvcWqUWD5gKqpzeeUCpMgpJAChdz1JsBc06kwlSjYLkMelza5p9jLxfHP5qW5Rs1sqrzeTYbmiC5fMkgEE3v0povwyCloY1tbcdBRjyDZZLGiNfzdQKkuASbBQu57mwFzT48b7OmiTYm7taw+7yfj/k/H//EACwRAAECBAQEBQUAAAAAAAAAAAEAESExQWECElFxEIGhsSJAgsHRIFCR4fD/2gAIAQIBAT8AaV5IRZCLNYIRZtQOa0v5zSyk1kISshBmt+QGUmsm4f0PbzJkNy6E/W6wwyWPVYfCQsMGsY7rDDK9CG5CSw+Eg7dAhDLb2b4WGAFuFA1Hf3CDONM3RYZB7dl8l99OBQVfpFN+UKIU3WGDPQhtIIQyv+oU4aWJ7haKvqPeX2P/xAAoEQABAwIEBQUBAAAAAAAAAAABABEhYaECEFFxEkBBgtEwMVCBwdL/2gAIAQMBAT8AdGL2Rh6PZGH2JWtOc1rkZRm9553qUfbsZYp4qrFII3Rl9jdGXqDcusUgje6M8VXu/lGScupRdu1kerVXj0ddkfwoy9Qboy/3fLwFqv5b4P8A/9k=",v="/CodeAnalysis/assets/gitlab_oauth_QA_05-8d166cf1.png",x="/CodeAnalysis/assets/gitlab_oauth_QA_06-3f3cc486.png",f="/CodeAnalysis/assets/gitlab_oauth_QA_07-d3997b70.png",B={},C=t(`

    私有化gitlab Oauth认证

    一、操作步骤

    1、 本地gitlab 生成 application

    (1)进入Preferences模块

    (2)选择Application模块

    (3)添加新的application

    (4)填写name、Redirect url并勾选可用权限

    (5)保存application

    2、在项目配置文件中添加相关配置信息

    以下三种部署方式选择其中一项即可。

    (1)docker-compose 部署方式

    找到server/dockerconfs/ 目录下的 .env.local 文件,添加配置信息。

    #Oauth认证相关配置
    +GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行更新部署操作

    bash ./quick_install.sh docker-compose stop  #停止运行中的TCA容器
    +bash ./quick_install.sh docker-compose deploy  #重新部署TCA相关容器与初始化(或刷新数据)
    +

    (2)docker 部署方式

    在/.docker_temp/configs/config.sh 中添加以下配置 (首次部署无该文件夹)

    #Oauth认证相关配置
    +export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行更新部署操作

    bash ./quick_install.sh docker deploy
    +

    (3)源代码部署方式

    在/scripts/config.sh 中添加以下配置

    #Oauth认证相关配置
    +export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行重新启动操作

    bash ./quick_install.sh local start  #启动服务(会自动关闭之前的服务)
    +

    3、代码分析平台添加Oauth配置

    (1)进入后台管理

    (2)选择Oauth管理

    (3)创建配置,将application中的Application ID、Secret 和 Callback URL分别填入指定位置。

    (4)前往个人凭证管理,点击认证。

    (5)弹出私有化gitlab的页面,点击Authorize 进行授权。

    (6)授权成功

    二、详细操作过程说明

    1、 本地gitlab 生成 application

    (1)进入Preferences模块

    gitlab_application

    (2)选择Application模块

    gitlab_application

    (3)添加新的application

    填写重定向url,“http://<部署gitlab的ip地址>/cb_git_auth/gitlab”

    scopes尽量都勾选,以开启对私有化代码库的访问权限 gitlab_application

    保存application gitlab_application 这里的Application ID、Secret 和 Callback URL 之后需要填写到代码分析服务中。

    2、在项目配置文件中添加相关配置信息

    以下三种部署方式选择其中一项即可。

    (1)docker-compose 部署方式

    找到server/dockerconfs/ 目录下的 .env.local 文件,添加配置信息。

    #Oauth认证相关配置
    +GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行更新部署操作

    bash ./quick_install.sh docker-compose stop  #停止运行中的TCA容器
    +bash ./quick_install.sh docker-compose deploy  #重新部署TCA相关容器与初始化(或刷新数据)
    +

    (2)docker 部署方式

    在/.docker_temp/configs/config.sh 中添加以下配置 (首次部署无该文件夹)

    #Oauth认证相关配置
    +export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行更新部署操作

    bash ./quick_install.sh docker deploy
    +

    (3)源代码部署方式

    在/scripts/config.sh 中添加以下配置

    #Oauth认证相关配置
    +export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行重新启动操作

    bash ./quick_install.sh local start  #启动服务(会自动关闭之前的服务)
    +

    3、代码分析平台添加Oauth配置

    (1)进入后台管理

    gitlab_oauth_disposition

    (2)进入Oauth管理

    gitlab_oauth_disposition

    (3)创建配置

    将application中的Application ID、Secret 和 Callback URL分别填入 gitlab_oauth_disposition

    (4)前往个人凭证管理,点击认证

    gitlab_oauth_dispositiongitlab_oauth_disposition

    (5)弹出私有化gitlab的页面,点击Authorize 进行授权。

    gitlab_oauth_disposition

    (6)授权成功

    gitlab_oauth_disposition

    三、常见问题

    1、使用Oauth登录的方式,认证时跳转页面失败

    gitlab_oauth_QA

    错误详情:

    An error has occurred

    Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.

    解决方案:

    gitlab_oauth_QA

    如图,GITLAB_OAUTH_URL没有配置,默认使用 https://gitlab.com/oauth/authorize 。

    需要根据项目部署方式,修改配置信息。

    (1)docker-compose 部署方式

    找到server/dockerconfs/ 目录下的 .env.local 文件,添加配置信息

    GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +

    (2)docker 部署方式

    在/.docker_temp/configs/config.sh 中添加以下配置 (首次部署无该文件夹)

    export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +

    (3)源代码部署方式

    在/scripts/config.sh 中添加以下配置

    export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +

    2、无法找到本地部署的服务对应的前端页面

    gitlab_oauth_QA

    错误详情:

    此站点的连接不安全,发送了无效的响应。

    ERR_SSL_PROTOCOL_ERROR

    解决方案:

    配置的url存在问题,可能使用了https协议,访问本地ip不能用https协议,修改成http。

    3、认证没有跳转到正确的页面,或直接跳回到代码分析平台登陆界面。

    解决方案:

    (1)检查配置url是否加端口号,默认80端口可能已经被占用,或已经分配给代码分析平台。 gitlab_oauth_QA

    (2)检查回调地址是否填写端口号 gitlab_oauth_QA

    4、OAuth授权失败

    gitlab_oauth_QA

    错误详情:

    oauth failed, err: 未知错误: <class 'Exception'>:{method: git_oauth, error_message: [400] 授权异常,请稍后再试,异常原因:{"error":"invalid_client","error_description":"Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."}}

    解决方案:

    client.py 中存在默认的GITLAB_URL,如果在配置文件中没有设置GITLAB_URL,那么TCA将默认访问https://gitlab.com

    GITLAB_URL = os.environ.get("GITLAB_URL") or "https://gitlab.com"
    +

    客户端调用的API都需要使用到GITLAB_URL作为前缀的路径,会发送post请求到 https://gitlab.com 路径下,因此需要对路径进行修改。

    gitlab_oauth_QA

    要连接私有化的gitlab,需要根据项目部署方式,修改配置信息。

    (1)docker-compose 部署方式

    找到server/dockerconfs/ 目录下的 .env.local 文件,添加配置信息

    GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    (2)docker 部署方式

    在/.docker_temp/configs/config.sh 中添加以下配置 (首次部署无该文件夹)

    export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    (3)源代码部署方式

    在/scripts/config.sh 中添加以下配置

    export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +
    `,121),R=[C];function q(U,I){return e(),i("div",null,R)}const L=a(B,[["render",q],["__file","gitlab_oauth_guide.html.vue"]]);export{L as default}; diff --git a/assets/gitlab_oauth_guide.html-d11fffe7.js b/assets/gitlab_oauth_guide.html-d11fffe7.js new file mode 100644 index 000000000..701f75356 --- /dev/null +++ b/assets/gitlab_oauth_guide.html-d11fffe7.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-c3df2014","path":"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/gitlab_oauth_guide.html","title":"私有化gitlab Oauth认证","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"一、操作步骤","slug":"一、操作步骤","link":"#一、操作步骤","children":[{"level":3,"title":"1、 本地gitlab 生成 application","slug":"_1、-本地gitlab-生成-application","link":"#_1、-本地gitlab-生成-application","children":[]},{"level":3,"title":"2、在项目配置文件中添加相关配置信息","slug":"_2、在项目配置文件中添加相关配置信息","link":"#_2、在项目配置文件中添加相关配置信息","children":[]},{"level":3,"title":"3、代码分析平台添加Oauth配置","slug":"_3、代码分析平台添加oauth配置","link":"#_3、代码分析平台添加oauth配置","children":[]}]},{"level":2,"title":"二、详细操作过程说明","slug":"二、详细操作过程说明","link":"#二、详细操作过程说明","children":[{"level":3,"title":"1、 本地gitlab 生成 application","slug":"_1、-本地gitlab-生成-application-1","link":"#_1、-本地gitlab-生成-application-1","children":[]},{"level":3,"title":"2、在项目配置文件中添加相关配置信息","slug":"_2、在项目配置文件中添加相关配置信息-1","link":"#_2、在项目配置文件中添加相关配置信息-1","children":[]},{"level":3,"title":"3、代码分析平台添加Oauth配置","slug":"_3、代码分析平台添加oauth配置-1","link":"#_3、代码分析平台添加oauth配置-1","children":[]}]},{"level":2,"title":"三、常见问题","slug":"三、常见问题","link":"#三、常见问题","children":[{"level":3,"title":"1、使用Oauth登录的方式,认证时跳转页面失败","slug":"_1、使用oauth登录的方式-认证时跳转页面失败","link":"#_1、使用oauth登录的方式-认证时跳转页面失败","children":[]},{"level":3,"title":"2、无法找到本地部署的服务对应的前端页面","slug":"_2、无法找到本地部署的服务对应的前端页面","link":"#_2、无法找到本地部署的服务对应的前端页面","children":[]},{"level":3,"title":"3、认证没有跳转到正确的页面,或直接跳回到代码分析平台登陆界面。","slug":"_3、认证没有跳转到正确的页面-或直接跳回到代码分析平台登陆界面。","link":"#_3、认证没有跳转到正确的页面-或直接跳回到代码分析平台登陆界面。","children":[]},{"level":3,"title":"4、OAuth授权失败","slug":"_4、oauth授权失败","link":"#_4、oauth授权失败","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/服务端/gitlab_oauth_guide.md"}');export{l as data}; diff --git a/assets/golangcilint-e31f929a.jpg b/assets/golangcilint-e31f929a.jpg new file mode 100644 index 000000000..4f90104e9 Binary files /dev/null and b/assets/golangcilint-e31f929a.jpg differ diff --git a/assets/golangcilint.html-2e27c271.js b/assets/golangcilint.html-2e27c271.js new file mode 100644 index 000000000..641d3a510 --- /dev/null +++ b/assets/golangcilint.html-2e27c271.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-33a5d252","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint.html","title":"Golangcilint 使用手册","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"对比 GoMetaLinter","slug":"对比-gometalinter","link":"#对比-gometalinter","children":[]},{"level":2,"title":"快速接入","slug":"快速接入","link":"#快速接入","children":[]},{"level":2,"title":"高级配置","slug":"高级配置","link":"#高级配置","children":[{"level":3,"title":"Include","slug":"include","link":"#include","children":[]}]},{"level":2,"title":"Q&A","slug":"q-a","link":"#q-a","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/工具/golangcilint.md"}');export{e as data}; diff --git a/assets/golangcilint.html-5390ac76.js b/assets/golangcilint.html-5390ac76.js new file mode 100644 index 000000000..b08de9a9f --- /dev/null +++ b/assets/golangcilint.html-5390ac76.js @@ -0,0 +1,4 @@ +import{_ as a,a as l}from"./golangcilintversion-56b74bb6.js";import{_ as o,r as t,o as r,c as s,a as i,b as e,d,e as c}from"./app-2a91d8ab.js";const p={},g={id:"golangcilint-使用手册",tabindex:"-1"},u=i("a",{class:"header-anchor",href:"#golangcilint-使用手册","aria-hidden":"true"},"#",-1),h={href:"https://github.com/golangci/golangci-lint",target:"_blank",rel:"noopener noreferrer"},m=c('

    对比 GoMetaLinter

    Golangci-lint 是为了解决 GoMetalinter 的弊端而改版升级的。

    1. 比 GoMetaliner 快个 2 到 7 倍

    2. 共享代码缓存,消耗内存比 Gometaliner 少 26%

    3. 更精准的 issue,会内置一些 exclude 列表过滤掉误报 issue

    4. 支持增量分析

    快速接入

    1. 在 CI 系统上选用 TCA 插件,或者下载 TCA 客户端到本地机器上

    2. 因为 GolangCiLint 要求找寻到项目需要的全部依赖,否则就会执行失败。所以这里需要在 Ci 系统或者本地机器上配置好项目的依赖,并确保能够编译通过

    3. 检查是否设置了 GOPATH 和 GOROOT,在分析方案的环境变量中设置 GOPATH=$GOPATH

    4. 在 代码分析 页面上关联待分析的代码库并创建分析方案,并在代码检查-规则设置的自定义规则包里面添加 GolangCiLint 工具规则

    5. 在分析方案中增加编译命令

    6. 然后在 CI 系统上或者本地启动代码分析即可

    高级配置

    Include

    若项目目录结构如下图,需要设置 include 执行 myproj,比如 src/myproj/*

    这是因为 GolangCiLint 分析前会优先检查所有代码文件的依赖是否齐全,所以需要设置 include,让工具只关注 include 下面的代码文件的依赖。

    在分析方案的过滤配置,路径过滤中添加 include 路径。

    include

    Q&A

    • Q:出现 no go files to analyze 问题

      A:这里可能为以下原因:

      1. 机器环境没有项目的完整依赖,使用以下命令查找对应依赖在 GOPATH 下是否存在或者 GOPATH 设置是否完整(有的项目有多个 GOPATH 内容),或者对应依赖是否存在,需要用户部署好机器环境

        grep -nr "path/to/GOPATH" .
        +
      2. 没有指定 include 分析路径过滤,这样才不会检查依赖中的依赖,而是关注源码文件的依赖完整性

      3. 也可能是某 go 文件中使用到该依赖,但是 GOPATH 没有设置正确的依赖搜索路径导致。需要找到依赖相对的当前目录:

        grep -nr "path/to/GOPATH" .
        +

        然后设置到 GOPATH 中,比如

        GOPATH=$GOPATH:$SOURCE_DIR/test
        +
      4. 还有可能是部分依赖是需要编译之后生成的,需要正确填写好编译命令,使得项目编译成功。

    • Q:could not determine GOARCH and Go compiler 问题

      A:跟问题 1 是一样的问题。解决方案也是一样。

    • Q:failed to run 'go env': exit status 1 问题

      A:原因是找不到正确的 GOPATH。解决方案是设置 GOPATH 环境变量。

    • Q:GO 版本限制

      A:因为 golangci-lint 用到了 go mod 特性,该特性是在 1.11 之后才有的。所以要求 go 版本在 1.11 版本以上。

      go版本限制

    ',13);function A(_,G){const n=t("ExternalLinkIcon");return r(),s("div",null,[i("h1",g,[u,e(),i("a",h,[e("Golangcilint"),d(n)]),e(" 使用手册")]),m])}const O=o(p,[["render",A],["__file","golangcilint.html.vue"]]);export{O as default}; diff --git a/assets/golangcilint.html-5b7c9aa6.js b/assets/golangcilint.html-5b7c9aa6.js new file mode 100644 index 000000000..b08de9a9f --- /dev/null +++ b/assets/golangcilint.html-5b7c9aa6.js @@ -0,0 +1,4 @@ +import{_ as a,a as l}from"./golangcilintversion-56b74bb6.js";import{_ as o,r as t,o as r,c as s,a as i,b as e,d,e as c}from"./app-2a91d8ab.js";const p={},g={id:"golangcilint-使用手册",tabindex:"-1"},u=i("a",{class:"header-anchor",href:"#golangcilint-使用手册","aria-hidden":"true"},"#",-1),h={href:"https://github.com/golangci/golangci-lint",target:"_blank",rel:"noopener noreferrer"},m=c('

    对比 GoMetaLinter

    Golangci-lint 是为了解决 GoMetalinter 的弊端而改版升级的。

    1. 比 GoMetaliner 快个 2 到 7 倍

    2. 共享代码缓存,消耗内存比 Gometaliner 少 26%

    3. 更精准的 issue,会内置一些 exclude 列表过滤掉误报 issue

    4. 支持增量分析

    快速接入

    1. 在 CI 系统上选用 TCA 插件,或者下载 TCA 客户端到本地机器上

    2. 因为 GolangCiLint 要求找寻到项目需要的全部依赖,否则就会执行失败。所以这里需要在 Ci 系统或者本地机器上配置好项目的依赖,并确保能够编译通过

    3. 检查是否设置了 GOPATH 和 GOROOT,在分析方案的环境变量中设置 GOPATH=$GOPATH

    4. 在 代码分析 页面上关联待分析的代码库并创建分析方案,并在代码检查-规则设置的自定义规则包里面添加 GolangCiLint 工具规则

    5. 在分析方案中增加编译命令

    6. 然后在 CI 系统上或者本地启动代码分析即可

    高级配置

    Include

    若项目目录结构如下图,需要设置 include 执行 myproj,比如 src/myproj/*

    这是因为 GolangCiLint 分析前会优先检查所有代码文件的依赖是否齐全,所以需要设置 include,让工具只关注 include 下面的代码文件的依赖。

    在分析方案的过滤配置,路径过滤中添加 include 路径。

    include

    Q&A

    • Q:出现 no go files to analyze 问题

      A:这里可能为以下原因:

      1. 机器环境没有项目的完整依赖,使用以下命令查找对应依赖在 GOPATH 下是否存在或者 GOPATH 设置是否完整(有的项目有多个 GOPATH 内容),或者对应依赖是否存在,需要用户部署好机器环境

        grep -nr "path/to/GOPATH" .
        +
      2. 没有指定 include 分析路径过滤,这样才不会检查依赖中的依赖,而是关注源码文件的依赖完整性

      3. 也可能是某 go 文件中使用到该依赖,但是 GOPATH 没有设置正确的依赖搜索路径导致。需要找到依赖相对的当前目录:

        grep -nr "path/to/GOPATH" .
        +

        然后设置到 GOPATH 中,比如

        GOPATH=$GOPATH:$SOURCE_DIR/test
        +
      4. 还有可能是部分依赖是需要编译之后生成的,需要正确填写好编译命令,使得项目编译成功。

    • Q:could not determine GOARCH and Go compiler 问题

      A:跟问题 1 是一样的问题。解决方案也是一样。

    • Q:failed to run 'go env': exit status 1 问题

      A:原因是找不到正确的 GOPATH。解决方案是设置 GOPATH 环境变量。

    • Q:GO 版本限制

      A:因为 golangci-lint 用到了 go mod 特性,该特性是在 1.11 之后才有的。所以要求 go 版本在 1.11 版本以上。

      go版本限制

    ',13);function A(_,G){const n=t("ExternalLinkIcon");return r(),s("div",null,[i("h1",g,[u,e(),i("a",h,[e("Golangcilint"),d(n)]),e(" 使用手册")]),m])}const O=o(p,[["render",A],["__file","golangcilint.html.vue"]]);export{O as default}; diff --git a/assets/golangcilint.html-70bf0a39.js b/assets/golangcilint.html-70bf0a39.js new file mode 100644 index 000000000..462b66f2f --- /dev/null +++ b/assets/golangcilint.html-70bf0a39.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-77e2c75c","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/golangcilint.html","title":"Golangcilint 使用手册","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"对比 GoMetaLinter","slug":"对比-gometalinter","link":"#对比-gometalinter","children":[]},{"level":2,"title":"快速接入","slug":"快速接入","link":"#快速接入","children":[]},{"level":2,"title":"高级配置","slug":"高级配置","link":"#高级配置","children":[{"level":3,"title":"Include","slug":"include","link":"#include","children":[]}]},{"level":2,"title":"Q&A","slug":"q-a","link":"#q-a","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/工具/golangcilint.md"}');export{l as data}; diff --git a/assets/golangcilintversion-56b74bb6.js b/assets/golangcilintversion-56b74bb6.js new file mode 100644 index 000000000..a34969a64 --- /dev/null +++ b/assets/golangcilintversion-56b74bb6.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/golangcilint-e31f929a.jpg",a="/CodeAnalysis/assets/golangcilintversion-afbdeff6.jpg";export{s as _,a}; diff --git a/assets/golangcilintversion-afbdeff6.jpg b/assets/golangcilintversion-afbdeff6.jpg new file mode 100644 index 000000000..6934a4c32 Binary files /dev/null and b/assets/golangcilintversion-afbdeff6.jpg differ diff --git a/assets/index.html-0a8ee588.js b/assets/index.html-0a8ee588.js new file mode 100644 index 000000000..a80e68fc5 --- /dev/null +++ b/assets/index.html-0a8ee588.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-53f9ca7d","path":"/zh/api/","title":"接口调用说明","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"接口地址","slug":"接口地址","link":"#接口地址","children":[]},{"level":2,"title":"接口鉴权方式","slug":"接口鉴权方式","link":"#接口鉴权方式","children":[]},{"level":2,"title":"获取 org_sid 和 project_team 信息","slug":"获取-org-sid-和-project-team-信息","link":"#获取-org-sid-和-project-team-信息","children":[]},{"level":2,"title":"Example","slug":"example","link":"#example","children":[]},{"level":2,"title":"分页方式","slug":"分页方式","link":"#分页方式","children":[]},{"level":2,"title":"响应格式","slug":"响应格式","link":"#响应格式","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/api/README.md"}');export{e as data}; diff --git a/assets/index.html-3ed6ee07.js b/assets/index.html-3ed6ee07.js new file mode 100644 index 000000000..2fb42047c --- /dev/null +++ b/assets/index.html-3ed6ee07.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-47cae8b3","path":"/zh/quickStarted/","title":"腾讯云代码分析介绍","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/README.md"}');export{t as data}; diff --git a/assets/index.html-3ffc2657.js b/assets/index.html-3ffc2657.js new file mode 100644 index 000000000..f9b125f78 --- /dev/null +++ b/assets/index.html-3ffc2657.js @@ -0,0 +1 @@ +import{_ as o,r,o as a,c,a as e,b as t,d as s}from"./app-2a91d8ab.js";const i={},d=e("h3",{id:"repo-mirror",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#repo-mirror","aria-hidden":"true"},"#"),t(" Repo Mirror")],-1),_={href:"https://git.code.tencent.com/Tencent_Open_Source/CodeAnalysis.git",target:"_blank",rel:"noopener noreferrer"},h=e("h3",{id:"wechat-group",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#wechat-group","aria-hidden":"true"},"#"),t(" WeChat Group")],-1),l=e("p",null,[e("img",{src:"https://tencent.github.io/CodeAnalysis/media/WechatQRCode.png",alt:"微信群"})],-1);function p(u,m){const n=r("ExternalLinkIcon");return a(),c("div",null,[d,e("p",null,[e("a",_,[t("https://git.code.tencent.com/Tencent_Open_Source/CodeAnalysis.git"),s(n)])]),h,l])}const g=o(i,[["render",p],["__file","index.html.vue"]]);export{g as default}; diff --git a/assets/index.html-50f0e95e.js b/assets/index.html-50f0e95e.js new file mode 100644 index 000000000..6074dd7aa --- /dev/null +++ b/assets/index.html-50f0e95e.js @@ -0,0 +1 @@ +import{_ as e,o as c,c as t,f as n}from"./app-2a91d8ab.js";const o={};function r(_,a){return c(),t("div",null,[n(" 未使用,直接使用的是doc目录下的README.md ")])}const d=e(o,[["render",r],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-5c984d6d.js b/assets/index.html-5c984d6d.js new file mode 100644 index 000000000..5c3bb6e36 --- /dev/null +++ b/assets/index.html-5c984d6d.js @@ -0,0 +1 @@ +import{_ as e,o as a,c as r,e as d}from"./app-2a91d8ab.js";const h={},n=d('

    腾讯云代码分析

    腾讯云代码分析Tencent Cloud Code Analysis, TCA)起步于 2012 年(内部代号CodeDog),是集众多代码分析工具的云原生、分布式、高性能的代码综合分析跟踪管理平台,其主要功能是精准跟踪管理代码分析发现的代码质量缺陷、代码规范、代码安全漏洞、无效代码,以及度量代码复杂度、重复代码、代码统计。持续跟踪分析代码,观测项目代码质量,支撑团队传承代码文化。

    用心关注每行代码迭代,助力传承卓越代码文化!

    代码分析是通过词法分析、语法分析、控制流、数据流分析等技术对程序代码进行扫描,对代码进行综合分析,验证代码是否满足规范性、安全性、可靠性、可维护性等指标的一种代码分析技术。

    主要功能

    代码检查

    通过代码检查精准跟踪管理发现的代码质量缺陷、代码规范、代码安全漏洞、无效代码等。

    目前已集成众多自研、知名开源分析工具,并采用了分层分离架构,可以满足团队快速自助管理工具。

    代码度量

    包含代码圈复杂度、代码重复率和代码统计等度量信息。

    代码圈复杂度

    圈复杂度也称为条件复杂度或循环复杂度,它可以用来衡量一个模块判定结构的复杂程度。圈复杂度大说明程序代码的判断逻辑复杂,可能造成代码质量低下且难于测试和维护。

    定期分析工程项目中代码的圈复杂度,可以有效地帮助开发与测试逐步优化代码质量。

    代码重复率

    定期分析工程项目中的重复代码,可以有效地帮助开发发现冗余代码,进行代码抽象和重构,降低代码风险,以便于更好的管理和维护代码。

    代码统计

    支持全量增量展示代码行数统计,包含代码行、注释行和空白行,可以有效地跟踪了解工程项目中代码量持续变化,并可以查看各个语言的占比情况。

    ',17),t=[n];function i(s,o){return a(),r("div",null,t)}const p=e(h,[["render",i],["__file","index.html.vue"]]);export{p as default}; diff --git a/assets/index.html-8632c13c.js b/assets/index.html-8632c13c.js new file mode 100644 index 000000000..12d12a83d --- /dev/null +++ b/assets/index.html-8632c13c.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-075401e2","path":"/en/api/","title":"接口调用说明","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"接口地址","slug":"接口地址","link":"#接口地址","children":[]},{"level":2,"title":"接口鉴权方式","slug":"接口鉴权方式","link":"#接口鉴权方式","children":[]},{"level":2,"title":"获取 org_sid 和 project_team 信息","slug":"获取-org-sid-和-project-team-信息","link":"#获取-org-sid-和-project-team-信息","children":[]},{"level":2,"title":"Example","slug":"example","link":"#example","children":[]},{"level":2,"title":"分页方式","slug":"分页方式","link":"#分页方式","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/api/README.md"}');export{e as data}; diff --git a/assets/index.html-892823d8.js b/assets/index.html-892823d8.js new file mode 100644 index 000000000..ec13f2c44 --- /dev/null +++ b/assets/index.html-892823d8.js @@ -0,0 +1,87 @@ +import{_ as e}from"./API的个人令牌-d33dd7b6.js";import{_ as n,o as i,c as t,e as u}from"./app-2a91d8ab.js";const s={},o=u(`

    接口调用说明

    接口地址

    http://{host}/server/

    注:host 指当前浏览器访问该文档的 URL 域名部分。

    接口鉴权方式

    发起请求时,需要在头部中添加以下格式形式,对应的 value 请看下面获取方式

    {
    +  "Authorization": "Token 当前user的token"
    +}
    +

    获取 token 位置(个人中心-个人令牌):

    API的个人令牌

    获取 org_sid 和 project_team 信息

    通过平台访问具体代码库扫描情况时,可从 URL 中获取对应 org_sid 和 project_team 字段,查看方式如下例子:

    代码库扫描地址:http://{host}/t/xxx/p/yyy/code-analysis/repos/1/projects?limit=10&offset=0

    其中,org_sid 为xxx字段,project_team 为 yyy字段

    Example

    import requests
    +# 假设:
    +# 当前域名为http://tca.com/,当前org_sid为helloworld
    +# 获取helloworld团队下的hellotca项目下登记的代码库
    +url="http://tca.com/server/main/api/orgs/helloworld/teams/hellotca/repos/?limit=12&offset=0"
    +headers = {
    +  "Authorization": "Token %s" % token,
    +}
    +
    +response = requests.get(url, headers=headers)
    +print(response.json())
    +# 结果如下:
    +{
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 23,
    +                "name": "repo_name",
    +                "scm_url": "http://git.repo.com/group/repo_name",
    +                "scm_type": "git",
    +                "branch_count": 1,
    +                "scheme_count": 1,
    +                "job_count": 1,
    +                "created_time": "2021-05-14 02:34:44.509118+00:00",
    +                "recent_active": {
    +                    "id": 27,
    +                    "branch_name": "master",
    +                    "active_time": "2021-05-14 02:34:44.509118+00:00",
    +                    "total_line_num": 1,
    +                    "code_line_num": 1
    +                },
    +                "created_from": "tca",
    +                "creator": {
    +                    "username": "author",
    +                    "nickname": "author",
    +                    "status": 1,
    +                    "avatar": "url",
    +                    "org": "org_name"
    +                },
    +                "symbol": null,
    +                "scm_auth": {
    +                    "id": 1,
    +                    "scm_account": null,
    +                    "scm_oauth": null,
    +                    "scm_ssh": {
    +                        "id": 1,
    +                        "name": "test",
    +                        "scm_platform": 2,
    +                        "scm_platform_desc": null,
    +                        "user": {
    +                            "username": "username",
    +                            "nickname": "nickname",
    +                            "status": 1,
    +                            "avatar": "url",
    +                            "org": "org_name"
    +                        }
    +                    },
    +                    "auth_type": "ssh_token",
    +                    "created_time": "2021-05-14T10:34:44.552859+08:00",
    +                    "modified_time": "2021-05-14T10:34:44.552887+08:00"
    +                },
    +                "project_team": {
    +                    "name": "test",
    +                    "display_name": "测试",
    +                    "status": 1,
    +                    "org_sid": "test"
    +                }
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    分页方式

    平台返回的数据分页格式是使用limitoffset参数进行分页处理

    比如:server/main/api/orgs/<org_sid>/teams/?limit=12&offset=12获取得到的数据是从第 13 条开始获取

    响应格式

    平台返回的响应格式如下:

    {
    +    "data": {...},      # 详细数据
    +    "code": 0,          # 请求结果码,为0表示正常
    +    "msg": "xxx" ,      # 请求结果信息
    +    "status_code": 200  # 请求响应码
    +}
    +
    `,21),d=[o];function a(l,r){return i(),t("div",null,d)}const q=n(s,[["render",a],["__file","index.html.vue"]]);export{q as default}; diff --git a/assets/index.html-91ce084b.js b/assets/index.html-91ce084b.js new file mode 100644 index 000000000..36f37dd3e --- /dev/null +++ b/assets/index.html-91ce084b.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-47357bdb","path":"/zh/guide/","title":"腾讯云代码分析","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"主要功能","slug":"主要功能","link":"#主要功能","children":[{"level":3,"title":"代码检查","slug":"代码检查","link":"#代码检查","children":[]},{"level":3,"title":"代码度量","slug":"代码度量","link":"#代码度量","children":[]},{"level":3,"title":"代码圈复杂度","slug":"代码圈复杂度","link":"#代码圈复杂度","children":[]},{"level":3,"title":"代码重复率","slug":"代码重复率","link":"#代码重复率","children":[]},{"level":3,"title":"代码统计","slug":"代码统计","link":"#代码统计","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/README.md"}');export{l as data}; diff --git a/assets/index.html-929379d0.js b/assets/index.html-929379d0.js new file mode 100644 index 000000000..5c3bb6e36 --- /dev/null +++ b/assets/index.html-929379d0.js @@ -0,0 +1 @@ +import{_ as e,o as a,c as r,e as d}from"./app-2a91d8ab.js";const h={},n=d('

    腾讯云代码分析

    腾讯云代码分析Tencent Cloud Code Analysis, TCA)起步于 2012 年(内部代号CodeDog),是集众多代码分析工具的云原生、分布式、高性能的代码综合分析跟踪管理平台,其主要功能是精准跟踪管理代码分析发现的代码质量缺陷、代码规范、代码安全漏洞、无效代码,以及度量代码复杂度、重复代码、代码统计。持续跟踪分析代码,观测项目代码质量,支撑团队传承代码文化。

    用心关注每行代码迭代,助力传承卓越代码文化!

    代码分析是通过词法分析、语法分析、控制流、数据流分析等技术对程序代码进行扫描,对代码进行综合分析,验证代码是否满足规范性、安全性、可靠性、可维护性等指标的一种代码分析技术。

    主要功能

    代码检查

    通过代码检查精准跟踪管理发现的代码质量缺陷、代码规范、代码安全漏洞、无效代码等。

    目前已集成众多自研、知名开源分析工具,并采用了分层分离架构,可以满足团队快速自助管理工具。

    代码度量

    包含代码圈复杂度、代码重复率和代码统计等度量信息。

    代码圈复杂度

    圈复杂度也称为条件复杂度或循环复杂度,它可以用来衡量一个模块判定结构的复杂程度。圈复杂度大说明程序代码的判断逻辑复杂,可能造成代码质量低下且难于测试和维护。

    定期分析工程项目中代码的圈复杂度,可以有效地帮助开发与测试逐步优化代码质量。

    代码重复率

    定期分析工程项目中的重复代码,可以有效地帮助开发发现冗余代码,进行代码抽象和重构,降低代码风险,以便于更好的管理和维护代码。

    代码统计

    支持全量增量展示代码行数统计,包含代码行、注释行和空白行,可以有效地跟踪了解工程项目中代码量持续变化,并可以查看各个语言的占比情况。

    ',17),t=[n];function i(s,o){return a(),r("div",null,t)}const p=e(h,[["render",i],["__file","index.html.vue"]]);export{p as default}; diff --git a/assets/index.html-984e57d5.js b/assets/index.html-984e57d5.js new file mode 100644 index 000000000..668f749ac --- /dev/null +++ b/assets/index.html-984e57d5.js @@ -0,0 +1 @@ +import{_ as a,r as i,o as l,c as r,a as t,b as e,d as n,w as s,e as c}from"./app-2a91d8ab.js";const d={},u=c('

    Tencent Cloud Code Analysis

    Tencent Cloud Code Analysis (TCA for short, code-named CodeDog inside the company early) is a comprehensive platform for code analysis and issue tracking. TCA consist of three components, server, web and client. It integrates of a number of self-developed tools, and also supports dynamic integration of code analysis tools in various programming languages.

    Code analysis is a technology, using lexical analysis, syntax analysis, control-flow analysis, data-flow analysis to make a comprehensive analysis of the code, so as to verify whether the code meets the requirements of normative, security, reliability, maintainability and other indicators.

    Using TCA can help team find normative, structural, security vulnerabilities and other issues in the code, continuously monitor the quality of the project code and issue alerts. At the same time, TCA opens up APIs to support connection with upstream and downstream systems, so as to integrate code analysis capabilities, ensure code quality, and be more conducive to inheriting an excellent team code culture.

    组件图

    流程图


    ',7),p=t("p",null,"If you have more environmental requirements, you can also deploy Tencent Cloud Code Analysis Platform in the following two ways:",-1);function h(m,y){const o=i("RouterLink");return l(),r("div",null,[u,t("p",null,[e("For the first experience, it is recommended that you use the "),n(o,{to:"/en/quickStarted/dockerDeploy.html"},{default:s(()=>[e("Docker deployment")]),_:1}),e(" to quickly build and experience the Tencent Cloud code analysis platform for the first experience.")]),p,t("ul",null,[t("li",null,[t("p",null,[e("Deploy through "),n(o,{to:"/en/quickStarted/dockercomposeDeploy.html"},{default:s(()=>[e("Docker-Compose")]),_:1})])]),t("li",null,[t("p",null,[e("Deploy through "),n(o,{to:"/en/quickStarted/codeDeploy.html"},{default:s(()=>[e("source code")]),_:1})])])])])}const g=a(d,[["render",h],["__file","index.html.vue"]]);export{g as default}; diff --git a/assets/index.html-9be1469b.js b/assets/index.html-9be1469b.js new file mode 100644 index 000000000..b66410f1f --- /dev/null +++ b/assets/index.html-9be1469b.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-2d0ad528","path":"/zh/","title":"","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/README.md"}');export{t as data}; diff --git a/assets/index.html-b5f8ac0e.js b/assets/index.html-b5f8ac0e.js new file mode 100644 index 000000000..da0aeacc1 --- /dev/null +++ b/assets/index.html-b5f8ac0e.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e6412400","path":"/en/guide/","title":"腾讯云代码分析","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"主要功能","slug":"主要功能","link":"#主要功能","children":[{"level":3,"title":"代码检查","slug":"代码检查","link":"#代码检查","children":[]},{"level":3,"title":"代码度量","slug":"代码度量","link":"#代码度量","children":[]},{"level":3,"title":"代码圈复杂度","slug":"代码圈复杂度","link":"#代码圈复杂度","children":[]},{"level":3,"title":"代码重复率","slug":"代码重复率","link":"#代码重复率","children":[]},{"level":3,"title":"代码统计","slug":"代码统计","link":"#代码统计","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/README.md"}');export{e as data}; diff --git a/assets/index.html-b85696fd.js b/assets/index.html-b85696fd.js new file mode 100644 index 000000000..48986a70b --- /dev/null +++ b/assets/index.html-b85696fd.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-8daa1a0e","path":"/","title":"腾讯云代码分析文档","lang":"zh-CN","frontmatter":{"home":true,"title":"腾讯云代码分析文档","heroImage":"/images/Logo.svg","actions":[{"text":"快速部署","link":"/zh/quickStarted/","type":"primary"},{"text":"帮助文档","link":"/zh/guide/","type":"secondary"}],"features":[{"title":"稳定可靠的架构","details":"支持分布式云原生计算架构,支持灵活扩缩容,执行更快更稳定。"},{"title":"多工具支持","details":"已集成众多自研、知名开源工具等,采用分层分离架构,支持团队快速自助管理工具。"},{"title":"多语言覆盖","details":"支持 Java/C++/Objective-C/C#/JavaScript/Python/Go/PHP 等数29种语言,覆盖常用编程语言。"},{"title":"增量全量分析","details":"增量分析快速发现问题,全量分析保证问题全覆盖。"},{"title":"自定义指标","details":"自定义代码标准,逐步优化代码。"},{"title":"全方位质量报告","details":"图形化可视报告,轻松监管代码综合质量趋势。"},{"title":"持续跟踪管理问题","details":"持续跟踪问题状态,支持主动标记处理问题、过滤问题。"},{"title":"标准化 API 接口","details":"提供标准化 API 接口,支持快速对接 DevOps 平台。"},{"title":"分布式客户端","details":"支持分布式客户端,包含 Linux、Mac、Windows,满足用户本地高频分析场景。"}],"footer":"MIT Licensed | Copyright © 1998-present Tencent. All Rights Reserved."},"headers":[{"level":3,"title":"腾讯工蜂代码库镜像库","slug":"腾讯工蜂代码库镜像库","link":"#腾讯工蜂代码库镜像库","children":[]},{"level":3,"title":"金牌🏅️服务微信群","slug":"金牌🏅️服务微信群","link":"#金牌🏅️服务微信群","children":[]},{"level":3,"title":"团队成员","slug":"团队成员","link":"#团队成员","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"README.md"}');export{e as data}; diff --git a/assets/index.html-bc147f42.js b/assets/index.html-bc147f42.js new file mode 100644 index 000000000..d422e2854 --- /dev/null +++ b/assets/index.html-bc147f42.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3c0f9a24","path":"/en/quickStarted/","title":"Tencent Cloud Code Analysis","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/README.md"}');export{e as data}; diff --git a/assets/index.html-d13f5268.js b/assets/index.html-d13f5268.js new file mode 100644 index 000000000..553294920 --- /dev/null +++ b/assets/index.html-d13f5268.js @@ -0,0 +1 @@ +import{_ as a,r as o,o as r,c,a as e,b as t,d as s,e as i}from"./app-2a91d8ab.js";const d={},h=e("h3",{id:"腾讯工蜂代码库镜像库",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#腾讯工蜂代码库镜像库","aria-hidden":"true"},"#"),t(" 腾讯工蜂代码库镜像库")],-1),l={href:"https://git.code.tencent.com/Tencent_Open_Source/CodeAnalysis.git",target:"_blank",rel:"noopener noreferrer"},_=i('

    金牌🏅️服务微信群

    微信群

    团队成员

    团队成员

    ',4);function p(m,u){const n=o("ExternalLinkIcon");return r(),c("div",null,[h,e("p",null,[e("a",l,[t("https://git.code.tencent.com/Tencent_Open_Source/CodeAnalysis.git"),s(n)])]),_])}const g=a(d,[["render",p],["__file","index.html.vue"]]);export{g as default}; diff --git a/assets/index.html-d386891c.js b/assets/index.html-d386891c.js new file mode 100644 index 000000000..25c0a2618 --- /dev/null +++ b/assets/index.html-d386891c.js @@ -0,0 +1,81 @@ +import{_ as e}from"./API的个人令牌-d33dd7b6.js";import{_ as n,o as i,c as t,e as u}from"./app-2a91d8ab.js";const o={},s=u(`

    接口调用说明

    接口地址

    http://{host}/server/

    注:host 指当前浏览器访问该文档的 URL 域名部分。

    接口鉴权方式

    发起请求时,需要在头部中添加以下格式形式,对应的 value 请看下面获取方式

    {
    +  "Authorization": "当前user的token"
    +}
    +

    获取 token 位置(个人中心-个人令牌):

    API的个人令牌

    获取 org_sid 和 project_team 信息

    通过平台访问具体代码库扫描情况时,可从 URL 中获取对应 org_sid 和 project_team 字段,查看方式如下例子:

    代码库扫描地址:http://{host}/t/xxx/p/yyy/code-analysis/repos/1/projects?limit=10&offset=0

    其中,org_sid 为xxx字段,project_team 为 yyy字段

    Example

    import requests
    +# 假设:
    +# 当前域名为http://tca.com/,当前org_sid为helloworld
    +# 获取helloworld团队下的hellotca项目下登记的代码库
    +url="http://tca.com/server/main/api/orgs/helloworld/teams/hellotca/repos/?limit=12&offset=0"
    +headers = {
    +  "Authorization": token,
    +}
    +
    +response = requests.get(url, headers=headers)
    +print(response.json())
    +# 结果如下:
    +{
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 23,
    +                "name": "repo_name",
    +                "scm_url": "http://git.repo.com/group/repo_name",
    +                "scm_type": "git",
    +                "branch_count": 1,
    +                "scheme_count": 1,
    +                "job_count": 1,
    +                "created_time": "2021-05-14 02:34:44.509118+00:00",
    +                "recent_active": {
    +                    "id": 27,
    +                    "branch_name": "master",
    +                    "active_time": "2021-05-14 02:34:44.509118+00:00",
    +                    "total_line_num": 1,
    +                    "code_line_num": 1
    +                },
    +                "created_from": "tca",
    +                "creator": {
    +                    "username": "author",
    +                    "nickname": "author",
    +                    "status": 1,
    +                    "avatar": "url",
    +                    "org": "org_name"
    +                },
    +                "symbol": null,
    +                "scm_auth": {
    +                    "id": 1,
    +                    "scm_account": null,
    +                    "scm_oauth": null,
    +                    "scm_ssh": {
    +                        "id": 1,
    +                        "name": "test",
    +                        "scm_platform": 2,
    +                        "scm_platform_desc": null,
    +                        "user": {
    +                            "username": "username",
    +                            "nickname": "nickname",
    +                            "status": 1,
    +                            "avatar": "url",
    +                            "org": "org_name"
    +                        }
    +                    },
    +                    "auth_type": "ssh_token",
    +                    "created_time": "2021-05-14T10:34:44.552859+08:00",
    +                    "modified_time": "2021-05-14T10:34:44.552887+08:00"
    +                },
    +                "project_team": {
    +                    "name": "test",
    +                    "display_name": "测试",
    +                    "status": 1,
    +                    "org_sid": "test"
    +                }
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    分页方式

    平台返回的数据分页格式是使用limitoffset参数进行分页处理

    比如:server/main/api/orgs/<org_sid>/teams/?limit=12&offset=12获取得到的数据是从第 13 条开始获取

    `,18),d=[s];function a(l,r){return i(),t("div",null,d)}const q=n(o,[["render",a],["__file","index.html.vue"]]);export{q as default}; diff --git a/assets/index.html-eaba2094.js b/assets/index.html-eaba2094.js new file mode 100644 index 000000000..db82ffd38 --- /dev/null +++ b/assets/index.html-eaba2094.js @@ -0,0 +1 @@ +import{_ as c,r as s,o as l,c as i,a as t,b as e,d as o,w as r,e as d}from"./app-2a91d8ab.js";const p={},h=d('

    腾讯云代码分析介绍

    腾讯云代码分析(Tencent Cloud Code Analysis,简称TCA,内部曾用研发代号 CodeDog )是集众多分析工具的云原生、分布式、高性能的代码综合分析跟踪平台,包含服务端、Web端、客户端三个组件,已集成一批自研工具,同时也支持动态集成业界各编程语言的分析工具。

    代码分析是通过词法分析、语法分析、控制流、数据流分析等技术对程序代码进行扫描,对代码进行综合分析,验证代码是否满足规范性、安全性、可靠性、可维护性等指标的一种代码分析技术。

    使用TCA可以帮助团队用代码分析技术查找代码中的规范性、结构性、安全漏洞等问题,持续监控项目代码质量并进行告警。同时TCA开放API,支持与上下游系统对接,从而集成代码分析能力,为代码质量提供保障,更有益于传承优良的团队代码文化。

    组件图

    流程图


    ',7),_={href:"https://github.com/Tencent/CodeAnalysis",target:"_blank",rel:"noopener noreferrer"},u=t("p",null,"如您更多环境需求,也可通过以下两种方式部署腾讯云代码分析平台:",-1);function m(g,k){const a=s("ExternalLinkIcon"),n=s("RouterLink");return l(),i("div",null,[h,t("p",null,[e("拉取 TCA "),t("a",_,[e("代码库"),o(a)]),e(" 后,首次体验推荐您使用"),o(n,{to:"/zh/quickStarted/dockerDeploy.html"},{default:r(()=>[e(" Docker 快速部署")]),_:1}),e("方式快速搭建和体验腾讯云代码分析平台。")]),u,t("ul",null,[t("li",null,[o(n,{to:"/zh/quickStarted/dockercomposeDeploy.html"},{default:r(()=>[e("通过 Docker-Compose 部署")]),_:1})]),t("li",null,[o(n,{to:"/zh/quickStarted/codeDeploy.html"},{default:r(()=>[e("通过源代码部署")]),_:1})])])])}const f=c(p,[["render",m],["__file","index.html.vue"]]);export{f as default}; diff --git a/assets/index.html-f6f72dd6.js b/assets/index.html-f6f72dd6.js new file mode 100644 index 000000000..073bb0549 --- /dev/null +++ b/assets/index.html-f6f72dd6.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"key":"v-2d0a870d","path":"/en/","title":"Tencent Cloud Code Analysis Doc","lang":"en-US","frontmatter":{"home":true,"title":"Tencent Cloud Code Analysis Doc","heroImage":"/images/Logo.svg","actions":[{"text":"Quick start","link":"/en/quickStarted/","type":"primary"},{"text":"Guide","link":"/en/guide/","type":"secondary"}],"features":[{"title":"Stable and reliable architecture","details":"Support distributed architecture and cloud native architecture; flexible scaling; run faster with more stability."},{"title":"Multi-tool support","details":"Integrated many self-developed and well-known open-source tools; adopted a layered separation architecture, can meet the needs of the team's rapid self-service management tools."},{"title":"Multi-language support","details":"Support Java/C++/Objective-C/C#/JavaScript/Python/Go/PHP and other 29 languages, cover frequently-used programming languages."},{"title":"Incremental/Full analysis scan","details":"Incremental analysis can quickly locate defects, while a full analysis ensure total coverage of your code."},{"title":"Customize rules","details":"Customize your rules, gradually optimize your code."},{"title":"Full range quality report","details":"Report with graphics, easy to monitor quality trend."},{"title":"Standardized API","details":"Standardized API make a fast docking to DevOps tools."},{"title":"Distributed client","details":"Distributed clients on Linux, Mac and Windows, meet local high-frequency analysis scenario."}],"footer":"MIT Licensed | Copyright © 1998-present Tencent. All Rights Reserved."},"headers":[{"level":3,"title":"Repo Mirror","slug":"repo-mirror","link":"#repo-mirror","children":[]},{"level":3,"title":"WeChat Group","slug":"wechat-group","link":"#wechat-group","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/README.md"}`);export{e as data}; diff --git a/assets/initRepo.html-145021f4.js b/assets/initRepo.html-145021f4.js new file mode 100644 index 000000000..2dfe0c64d --- /dev/null +++ b/assets/initRepo.html-145021f4.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6108bba4","path":"/zh/quickStarted/initRepo.html","title":"创建代码分析项目","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"进入平台页面","slug":"进入平台页面","link":"#进入平台页面","children":[]},{"level":2,"title":"创建团队及项目","slug":"创建团队及项目","link":"#创建团队及项目","children":[]},{"level":2,"title":"登记代码库","slug":"登记代码库","link":"#登记代码库","children":[]},{"level":2,"title":"创建分析项目","slug":"创建分析项目","link":"#创建分析项目","children":[{"level":3,"title":"分析方案说明","slug":"分析方案说明","link":"#分析方案说明","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/initRepo.md"}');export{e as data}; diff --git a/assets/initRepo.html-439e220f.js b/assets/initRepo.html-439e220f.js new file mode 100644 index 000000000..bd79d5ff7 --- /dev/null +++ b/assets/initRepo.html-439e220f.js @@ -0,0 +1 @@ +import{_ as i,a as r,b as o}from"./planPage-27225805.js";import{_ as s}from"./start_scan_02-3fe00a0e.js";import{_ as n,r as l,o as c,c as d,a as e,b as a,d as h,w as p,e as _}from"./app-2a91d8ab.js";const u={},m=_('

    创建代码分析项目

    成功部署并启动 Server 与 Web 服务后,通过以下步骤创建您的第一个代码分析项目。

    进入平台页面

    在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可跳转到团队列表页

    提示

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    创建团队及项目

    • 完成团队创建

    • 完成项目创建

    登记代码库

    登记代码库,输入代码库地址以及凭证信息等,完成代码库登记。

    registerCodeRepo

    创建分析项目

    开始分析

    提示

    1. 用户可选择使用分析方案模板,或创建分析方案的方式,利用方案的分析配置进行代码分析。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目。

    分析方案说明

    ',14),f=e("li",null,[e("p",null,"分析方案是用于对代码库进行分析的一套配置集合。")],-1),E=e("p",null,[e("img",{src:r,alt:"creataAnalysePlan"})],-1),x=e("p",null,[e("img",{src:o,alt:"planPage"})],-1);function b(g,v){const t=l("RouterLink");return c(),d("div",null,[m,e("ul",null,[f,e("li",null,[e("p",null,[a("更多分析方案配置可查阅"),h(t,{to:"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html"},{default:p(()=>[a("帮助文档-分析方案")]),_:1})])])]),E,x])}const k=n(u,[["render",b],["__file","initRepo.html.vue"]]);export{k as default}; diff --git a/assets/initRepo.html-dd029873.js b/assets/initRepo.html-dd029873.js new file mode 100644 index 000000000..005b69e8d --- /dev/null +++ b/assets/initRepo.html-dd029873.js @@ -0,0 +1 @@ +import{_ as i,a as r,b as o}from"./planPage-27225805.js";import{_ as s}from"./start_scan_02-3fe00a0e.js";import{_ as n,r as l,o as c,c as d,a as e,b as a,d as h,w as p,e as _}from"./app-2a91d8ab.js";const u={},m=_('

    创建代码分析项目

    成功部署并启动 Server 与 Web 服务后,通过以下步骤创建您的第一个代码分析项目。

    进入平台页面

    在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可跳转到团队列表页

    TIP

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    创建团队及项目

    • 完成团队创建

    • 完成项目创建

    登记代码库

    登记代码库,输入代码库地址以及凭证信息等,完成代码库登记。

    registerCodeRepo

    创建分析项目

    开始分析

    TIP

    1. 用户可选择使用分析方案模板,或创建分析方案的方式,利用方案的分析配置进行代码分析。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目。

    分析方案说明

    ',14),f=e("li",null,[e("p",null,"分析方案是用于对代码库进行分析的一套配置集合。")],-1),E=e("p",null,[e("img",{src:r,alt:"creataAnalysePlan"})],-1),x=e("p",null,[e("img",{src:o,alt:"planPage"})],-1);function b(g,v){const t=l("RouterLink");return c(),d("div",null,[m,e("ul",null,[f,e("li",null,[e("p",null,[a("更多分析方案配置可查阅"),h(t,{to:"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html"},{default:p(()=>[a("帮助文档-分析方案")]),_:1})])])]),E,x])}const R=n(u,[["render",b],["__file","initRepo.html.vue"]]);export{R as default}; diff --git a/assets/initRepo.html-dd7f39bb.js b/assets/initRepo.html-dd7f39bb.js new file mode 100644 index 000000000..45c6bcafd --- /dev/null +++ b/assets/initRepo.html-dd7f39bb.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-bb3dad6e","path":"/en/quickStarted/initRepo.html","title":"创建代码分析项目","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"进入平台页面","slug":"进入平台页面","link":"#进入平台页面","children":[]},{"level":2,"title":"创建团队及项目","slug":"创建团队及项目","link":"#创建团队及项目","children":[]},{"level":2,"title":"登记代码库","slug":"登记代码库","link":"#登记代码库","children":[]},{"level":2,"title":"创建分析项目","slug":"创建分析项目","link":"#创建分析项目","children":[{"level":3,"title":"分析方案说明","slug":"分析方案说明","link":"#分析方案说明","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/initRepo.md"}');export{e as data}; diff --git a/assets/install_mysql_on_centos.html-2c216767.js b/assets/install_mysql_on_centos.html-2c216767.js new file mode 100644 index 000000000..44a6d4c24 --- /dev/null +++ b/assets/install_mysql_on_centos.html-2c216767.js @@ -0,0 +1,29 @@ +import{_ as a,r as l,o as r,c as d,a as e,b as s,d as i,e as m}from"./app-2a91d8ab.js";const o={},c=e("h1",{id:"在-centos-安装-mysql",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#在-centos-安装-mysql","aria-hidden":"true"},"#"),s(" 在 CentOS 安装 MySQL")],-1),t=e("h2",{id:"注意",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#注意","aria-hidden":"true"},"#"),s(" 注意")],-1),u={href:"https://cloud.tencent.com/product/cdb",target:"_blank",rel:"noopener noreferrer"},y=m(`

    环境

    CentOS 7.3 版本

    安装 mysql yum源

    wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
    +yum localinstall mysql57-community-release-el7-11.noarch.rpm
    +

    安装成功后,查看MySQL版本:

    yum repolist all | grep mysql
    +

    输出结果:

    mysql-cluster-7.5-community/x86_64   MySQL Cluster 7.5 Community    禁用
    +mysql-cluster-7.5-community-source   MySQL Cluster 7.5 Community -  禁用
    +mysql-cluster-7.6-community/x86_64   MySQL Cluster 7.6 Community    禁用
    +mysql-cluster-7.6-community-source   MySQL Cluster 7.6 Community -  禁用
    +!mysql-connectors-community/x86_64   MySQL Connectors Community     启用:    221
    +mysql-connectors-community-source    MySQL Connectors Community - S 禁用
    +!mysql-tools-community/x86_64        MySQL Tools Community          启用:    135
    +mysql-tools-community-source         MySQL Tools Community - Source 禁用
    +mysql-tools-preview/x86_64           MySQL Tools Preview            禁用
    +mysql-tools-preview-source           MySQL Tools Preview - Source   禁用
    +mysql55-community/x86_64             MySQL 5.5 Community Server     禁用
    +mysql55-community-source             MySQL 5.5 Community Server - S 禁用
    +mysql56-community/x86_64             MySQL 5.6 Community Server     禁用
    +mysql56-community-source             MySQL 5.6 Community Server - S 禁用
    +!mysql57-community/x86_64            MySQL 5.7 Community Server     启用:    544
    +mysql57-community-source             MySQL 5.7 Community Server - S 禁用
    +mysql80-community/x86_64             MySQL 8.0 Community Server     禁用
    +mysql80-community-source             MySQL 8.0 Community Server - S 禁用
    +

    安装MySQL

    yum install mysql-community-server
    +

    1.如遇以下报错,可尝试运行yum install mysql-community-server --nogpgcheck安装
    Public key for mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm is not installed
    Failing package is: mysql-community-libs-compat-5.7.37-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    2.如遇以下报错,可执行yum module disable mysql后重试安装
    All matches were filtered out by modular filtering for argument: mysql-community-serve
    Error: Unable to find a match: mysql-community-server

    配置MySQL服务

    安装好的MySQL配置文件路径是/etc/my.cnf,这里可以根据需要调整,比如可以调整:

    • datadir:MySQL存放数据的路径,如果有额外挂载磁盘,可以考虑指向相关路径

    启动MySQL服务

    systemctl start mysqld
    +

    确认MySQL正常启动

    systemctl status mysqld
    +

    查看生成 MySQL root用户临时密码:

    grep 'temporary password' /var/log/mysqld.log
    +

    修改root用户密码

    连接MySQL服务

    $ mysql -uroot -p
    +# 输出上述查询到的临时密码
    +

    修改root用户的密码(下面是改成 Password@2021,这里根据自行需要进行调整):

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password@2021';
    +

    参考文档

    `,26),v={href:"https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html",target:"_blank",rel:"noopener noreferrer"};function h(b,p){const n=l("ExternalLinkIcon");return r(),d("div",null,[c,t,e("p",null,[s("本文档仅供参考,不适用于正式环境部署,正式环境建议使用专业的MySQL服务(比如"),e("a",u,[s("腾讯云的MySQL产品"),i(n)]),s(")")]),y,e("ul",null,[e("li",null,[e("a",v,[s("Installing MySQL on Linux Using the MySQL Yum Repository"),i(n)])])])])}const S=a(o,[["render",h],["__file","install_mysql_on_centos.html.vue"]]);export{S as default}; diff --git a/assets/install_mysql_on_centos.html-9000ace5.js b/assets/install_mysql_on_centos.html-9000ace5.js new file mode 100644 index 000000000..1da2521c3 --- /dev/null +++ b/assets/install_mysql_on_centos.html-9000ace5.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-2743edae","path":"/en/advanced/install_mysql_on_centos.html","title":"在 CentOS 安装 MySQL","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"注意","slug":"注意","link":"#注意","children":[]},{"level":2,"title":"环境","slug":"环境","link":"#环境","children":[]},{"level":2,"title":"安装 mysql yum源","slug":"安装-mysql-yum源","link":"#安装-mysql-yum源","children":[]},{"level":2,"title":"安装MySQL","slug":"安装mysql","link":"#安装mysql","children":[]},{"level":2,"title":"配置MySQL服务","slug":"配置mysql服务","link":"#配置mysql服务","children":[]},{"level":2,"title":"启动MySQL服务","slug":"启动mysql服务","link":"#启动mysql服务","children":[{"level":3,"title":"修改root用户密码","slug":"修改root用户密码","link":"#修改root用户密码","children":[]}]},{"level":2,"title":"参考文档","slug":"参考文档","link":"#参考文档","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/install_mysql_on_centos.md"}');export{l as data}; diff --git a/assets/install_mysql_on_centos.html-a68810ef.js b/assets/install_mysql_on_centos.html-a68810ef.js new file mode 100644 index 000000000..c988f1ce4 --- /dev/null +++ b/assets/install_mysql_on_centos.html-a68810ef.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-d29a371a","path":"/zh/advanced/install_mysql_on_centos.html","title":"在 CentOS 安装 MySQL","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"注意","slug":"注意","link":"#注意","children":[]},{"level":2,"title":"环境","slug":"环境","link":"#环境","children":[]},{"level":2,"title":"安装 mysql yum源","slug":"安装-mysql-yum源","link":"#安装-mysql-yum源","children":[]},{"level":2,"title":"安装MySQL","slug":"安装mysql","link":"#安装mysql","children":[]},{"level":2,"title":"配置MySQL服务","slug":"配置mysql服务","link":"#配置mysql服务","children":[]},{"level":2,"title":"启动MySQL服务","slug":"启动mysql服务","link":"#启动mysql服务","children":[{"level":3,"title":"修改root用户密码","slug":"修改root用户密码","link":"#修改root用户密码","children":[]}]},{"level":2,"title":"参考文档","slug":"参考文档","link":"#参考文档","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/install_mysql_on_centos.md"}');export{l as data}; diff --git a/assets/install_mysql_on_centos.html-cc6980ef.js b/assets/install_mysql_on_centos.html-cc6980ef.js new file mode 100644 index 000000000..44a6d4c24 --- /dev/null +++ b/assets/install_mysql_on_centos.html-cc6980ef.js @@ -0,0 +1,29 @@ +import{_ as a,r as l,o as r,c as d,a as e,b as s,d as i,e as m}from"./app-2a91d8ab.js";const o={},c=e("h1",{id:"在-centos-安装-mysql",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#在-centos-安装-mysql","aria-hidden":"true"},"#"),s(" 在 CentOS 安装 MySQL")],-1),t=e("h2",{id:"注意",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#注意","aria-hidden":"true"},"#"),s(" 注意")],-1),u={href:"https://cloud.tencent.com/product/cdb",target:"_blank",rel:"noopener noreferrer"},y=m(`

    环境

    CentOS 7.3 版本

    安装 mysql yum源

    wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
    +yum localinstall mysql57-community-release-el7-11.noarch.rpm
    +

    安装成功后,查看MySQL版本:

    yum repolist all | grep mysql
    +

    输出结果:

    mysql-cluster-7.5-community/x86_64   MySQL Cluster 7.5 Community    禁用
    +mysql-cluster-7.5-community-source   MySQL Cluster 7.5 Community -  禁用
    +mysql-cluster-7.6-community/x86_64   MySQL Cluster 7.6 Community    禁用
    +mysql-cluster-7.6-community-source   MySQL Cluster 7.6 Community -  禁用
    +!mysql-connectors-community/x86_64   MySQL Connectors Community     启用:    221
    +mysql-connectors-community-source    MySQL Connectors Community - S 禁用
    +!mysql-tools-community/x86_64        MySQL Tools Community          启用:    135
    +mysql-tools-community-source         MySQL Tools Community - Source 禁用
    +mysql-tools-preview/x86_64           MySQL Tools Preview            禁用
    +mysql-tools-preview-source           MySQL Tools Preview - Source   禁用
    +mysql55-community/x86_64             MySQL 5.5 Community Server     禁用
    +mysql55-community-source             MySQL 5.5 Community Server - S 禁用
    +mysql56-community/x86_64             MySQL 5.6 Community Server     禁用
    +mysql56-community-source             MySQL 5.6 Community Server - S 禁用
    +!mysql57-community/x86_64            MySQL 5.7 Community Server     启用:    544
    +mysql57-community-source             MySQL 5.7 Community Server - S 禁用
    +mysql80-community/x86_64             MySQL 8.0 Community Server     禁用
    +mysql80-community-source             MySQL 8.0 Community Server - S 禁用
    +

    安装MySQL

    yum install mysql-community-server
    +

    1.如遇以下报错,可尝试运行yum install mysql-community-server --nogpgcheck安装
    Public key for mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm is not installed
    Failing package is: mysql-community-libs-compat-5.7.37-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    2.如遇以下报错,可执行yum module disable mysql后重试安装
    All matches were filtered out by modular filtering for argument: mysql-community-serve
    Error: Unable to find a match: mysql-community-server

    配置MySQL服务

    安装好的MySQL配置文件路径是/etc/my.cnf,这里可以根据需要调整,比如可以调整:

    • datadir:MySQL存放数据的路径,如果有额外挂载磁盘,可以考虑指向相关路径

    启动MySQL服务

    systemctl start mysqld
    +

    确认MySQL正常启动

    systemctl status mysqld
    +

    查看生成 MySQL root用户临时密码:

    grep 'temporary password' /var/log/mysqld.log
    +

    修改root用户密码

    连接MySQL服务

    $ mysql -uroot -p
    +# 输出上述查询到的临时密码
    +

    修改root用户的密码(下面是改成 Password@2021,这里根据自行需要进行调整):

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password@2021';
    +

    参考文档

    `,26),v={href:"https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html",target:"_blank",rel:"noopener noreferrer"};function h(b,p){const n=l("ExternalLinkIcon");return r(),d("div",null,[c,t,e("p",null,[s("本文档仅供参考,不适用于正式环境部署,正式环境建议使用专业的MySQL服务(比如"),e("a",u,[s("腾讯云的MySQL产品"),i(n)]),s(")")]),y,e("ul",null,[e("li",null,[e("a",v,[s("Installing MySQL on Linux Using the MySQL Yum Repository"),i(n)])])])])}const S=a(o,[["render",h],["__file","install_mysql_on_centos.html.vue"]]);export{S as default}; diff --git a/assets/install_nginx_from_source.html-39cfa334.js b/assets/install_nginx_from_source.html-39cfa334.js new file mode 100644 index 000000000..542659e68 --- /dev/null +++ b/assets/install_nginx_from_source.html-39cfa334.js @@ -0,0 +1,71 @@ +import{_ as i,r as s,o as d,c as a,a as n,b as l,d as r,e as c}from"./app-2a91d8ab.js";const v={},u=c(`

    源码安装 Nginx

    运行环境

    1. 基于x86_64的CentOS
    2. 基于aarch64(鲲鹏920)的UOS V20
    3. 基于aarch64(飞腾2000)的TencentOS Server

    环境准备

    安装编译打包需要的工具

    yum -y install gcc zlib-devel pcre-devel bzip2-devel openssl-devel readline-devel
    +

    Ubuntu: apt install gcc libssl-dev zlib1g-dev libpcre3-dev libbz2-dev libreadline-dev

    下载源码

    wget http://nginx.org/download/nginx-1.20.2.tar.gz
    +

    解压安装

    # 解压
    +$ tar zvxf nginx-1.20.2.tar.gz -C /usr/local/src
    +
    +# 进入源码目录
    +$ cd /usr/local/src/nginx-1.20.2
    +
    +# 配置
    +$ ./configure \\
    +--sbin-path=/usr/local/nginx/nginx \\
    +--conf-path=/etc/nginx/nginx.conf \\
    +--pid-path=/run/nginx.pid \\
    +--with-stream \\
    +--with-http_ssl_module --with-http_v2_module --with-http_auth_request_module
    +
    +# 构建nginx
    +$ make -j4
    +$ make install
    +$ make clean
    +
    +# 建立软链
    +$ ln -s /usr/local/nginx/nginx /usr/local/bin/nginx
    +

    添加nginx配置文件

    mkdir /etc/nginx/conf.d/
    +vi /etc/nginx/nginx.conf
    +

    检查nginx.conf配置文件:

    1. 检查pid /run/nginx.pid,如果缺失或被注释则加上,加上位置如下所示:
    2. 检查是否缺失这一行include conf.d/*.conf;,如果缺失则加上,加上位置如下所示:
    # ...省略内容
    +#pid        logs/nginx.pid;  # 默认有的
    +pid         /run/nginx.pid;
    +
    +events {
    +    # ...省略内容
    +}
    +
    +# ...省略内容
    +
    +http {
    +    # ...省略内容
    +    # 
    +    include conf.d/*.conf;    
    +    server {
    +        # ...省略内容
    +    }
    +}
    +
    +

    后续可以将nginx配置文件放置到/etc/nginx/conf.d/目录下

    配置开机自动启动

    vim /usr/lib/systemd/system/nginx.service
    +

    输入以下内容:

    [Unit]
    +Description=The nginx HTTP and reverse proxy server
    +After=network-online.target remote-fs.target nss-lookup.target
    +Wants=network-online.target
    +
    +[Service]
    +Type=forking
    +PIDFile=/run/nginx.pid
    +# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
    +# SELinux context. This might happen when running \`nginx -t\` from the cmdline.
    +# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
    +ExecStartPre=/bin/rm -f /run/nginx.pid
    +ExecStartPre=/usr/local/bin/nginx -t
    +ExecStart=/usr/local/bin/nginx
    +ExecReload=/usr/local/bin/nginx -s reload
    +ExecStop=/usr/local/bin/nginx -s stop
    +KillSignal=SIGQUIT
    +TimeoutStopSec=5
    +KillMode=process
    +PrivateTmp=true
    +
    +[Install]
    +WantedBy=multi-user.target
    +

    启动nginx:

    systemctl start nginx
    +

    开机自动启动nginx:

    systemctl enable nginx
    +

    参考文档

    `,26),t={href:"https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#downloading-the-sources",target:"_blank",rel:"noopener noreferrer"};function o(b,m){const e=s("ExternalLinkIcon");return d(),a("div",null,[u,n("ul",null,[n("li",null,[n("a",t,[l("Nginx官方文档"),r(e)])])])])}const g=i(v,[["render",o],["__file","install_nginx_from_source.html.vue"]]);export{g as default}; diff --git a/assets/install_nginx_from_source.html-4d670bf5.js b/assets/install_nginx_from_source.html-4d670bf5.js new file mode 100644 index 000000000..4ebbc8b32 --- /dev/null +++ b/assets/install_nginx_from_source.html-4d670bf5.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-b650f4dc","path":"/en/advanced/install_nginx_from_source.html","title":"源码安装 Nginx","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"运行环境","slug":"运行环境","link":"#运行环境","children":[]},{"level":2,"title":"环境准备","slug":"环境准备","link":"#环境准备","children":[]},{"level":2,"title":"下载源码","slug":"下载源码","link":"#下载源码","children":[]},{"level":2,"title":"解压安装","slug":"解压安装","link":"#解压安装","children":[]},{"level":2,"title":"添加nginx配置文件","slug":"添加nginx配置文件","link":"#添加nginx配置文件","children":[]},{"level":2,"title":"配置开机自动启动","slug":"配置开机自动启动","link":"#配置开机自动启动","children":[]},{"level":2,"title":"参考文档","slug":"参考文档","link":"#参考文档","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/install_nginx_from_source.md"}');export{l as data}; diff --git a/assets/install_nginx_from_source.html-7bb4d6c5.js b/assets/install_nginx_from_source.html-7bb4d6c5.js new file mode 100644 index 000000000..542659e68 --- /dev/null +++ b/assets/install_nginx_from_source.html-7bb4d6c5.js @@ -0,0 +1,71 @@ +import{_ as i,r as s,o as d,c as a,a as n,b as l,d as r,e as c}from"./app-2a91d8ab.js";const v={},u=c(`

    源码安装 Nginx

    运行环境

    1. 基于x86_64的CentOS
    2. 基于aarch64(鲲鹏920)的UOS V20
    3. 基于aarch64(飞腾2000)的TencentOS Server

    环境准备

    安装编译打包需要的工具

    yum -y install gcc zlib-devel pcre-devel bzip2-devel openssl-devel readline-devel
    +

    Ubuntu: apt install gcc libssl-dev zlib1g-dev libpcre3-dev libbz2-dev libreadline-dev

    下载源码

    wget http://nginx.org/download/nginx-1.20.2.tar.gz
    +

    解压安装

    # 解压
    +$ tar zvxf nginx-1.20.2.tar.gz -C /usr/local/src
    +
    +# 进入源码目录
    +$ cd /usr/local/src/nginx-1.20.2
    +
    +# 配置
    +$ ./configure \\
    +--sbin-path=/usr/local/nginx/nginx \\
    +--conf-path=/etc/nginx/nginx.conf \\
    +--pid-path=/run/nginx.pid \\
    +--with-stream \\
    +--with-http_ssl_module --with-http_v2_module --with-http_auth_request_module
    +
    +# 构建nginx
    +$ make -j4
    +$ make install
    +$ make clean
    +
    +# 建立软链
    +$ ln -s /usr/local/nginx/nginx /usr/local/bin/nginx
    +

    添加nginx配置文件

    mkdir /etc/nginx/conf.d/
    +vi /etc/nginx/nginx.conf
    +

    检查nginx.conf配置文件:

    1. 检查pid /run/nginx.pid,如果缺失或被注释则加上,加上位置如下所示:
    2. 检查是否缺失这一行include conf.d/*.conf;,如果缺失则加上,加上位置如下所示:
    # ...省略内容
    +#pid        logs/nginx.pid;  # 默认有的
    +pid         /run/nginx.pid;
    +
    +events {
    +    # ...省略内容
    +}
    +
    +# ...省略内容
    +
    +http {
    +    # ...省略内容
    +    # 
    +    include conf.d/*.conf;    
    +    server {
    +        # ...省略内容
    +    }
    +}
    +
    +

    后续可以将nginx配置文件放置到/etc/nginx/conf.d/目录下

    配置开机自动启动

    vim /usr/lib/systemd/system/nginx.service
    +

    输入以下内容:

    [Unit]
    +Description=The nginx HTTP and reverse proxy server
    +After=network-online.target remote-fs.target nss-lookup.target
    +Wants=network-online.target
    +
    +[Service]
    +Type=forking
    +PIDFile=/run/nginx.pid
    +# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
    +# SELinux context. This might happen when running \`nginx -t\` from the cmdline.
    +# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
    +ExecStartPre=/bin/rm -f /run/nginx.pid
    +ExecStartPre=/usr/local/bin/nginx -t
    +ExecStart=/usr/local/bin/nginx
    +ExecReload=/usr/local/bin/nginx -s reload
    +ExecStop=/usr/local/bin/nginx -s stop
    +KillSignal=SIGQUIT
    +TimeoutStopSec=5
    +KillMode=process
    +PrivateTmp=true
    +
    +[Install]
    +WantedBy=multi-user.target
    +

    启动nginx:

    systemctl start nginx
    +

    开机自动启动nginx:

    systemctl enable nginx
    +

    参考文档

    `,26),t={href:"https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#downloading-the-sources",target:"_blank",rel:"noopener noreferrer"};function o(b,m){const e=s("ExternalLinkIcon");return d(),a("div",null,[u,n("ul",null,[n("li",null,[n("a",t,[l("Nginx官方文档"),r(e)])])])])}const g=i(v,[["render",o],["__file","install_nginx_from_source.html.vue"]]);export{g as default}; diff --git a/assets/install_nginx_from_source.html-bbfe6746.js b/assets/install_nginx_from_source.html-bbfe6746.js new file mode 100644 index 000000000..cbf6d234b --- /dev/null +++ b/assets/install_nginx_from_source.html-bbfe6746.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-173841d2","path":"/zh/advanced/install_nginx_from_source.html","title":"源码安装 Nginx","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"运行环境","slug":"运行环境","link":"#运行环境","children":[]},{"level":2,"title":"环境准备","slug":"环境准备","link":"#环境准备","children":[]},{"level":2,"title":"下载源码","slug":"下载源码","link":"#下载源码","children":[]},{"level":2,"title":"解压安装","slug":"解压安装","link":"#解压安装","children":[]},{"level":2,"title":"添加nginx配置文件","slug":"添加nginx配置文件","link":"#添加nginx配置文件","children":[]},{"level":2,"title":"配置开机自动启动","slug":"配置开机自动启动","link":"#配置开机自动启动","children":[]},{"level":2,"title":"参考文档","slug":"参考文档","link":"#参考文档","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/install_nginx_from_source.md"}');export{l as data}; diff --git a/assets/install_python37_on_centos.html-0777e70c.js b/assets/install_python37_on_centos.html-0777e70c.js new file mode 100644 index 000000000..63753f35e --- /dev/null +++ b/assets/install_python37_on_centos.html-0777e70c.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-58ad86e3","path":"/zh/advanced/install_python37_on_centos.html","title":"在 CentOS 安装 Python3.7","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"下载Python源码包","slug":"下载python源码包","link":"#下载python源码包","children":[]},{"level":2,"title":"安装前准备","slug":"安装前准备","link":"#安装前准备","children":[]},{"level":2,"title":"解压安装","slug":"解压安装","link":"#解压安装","children":[]},{"level":2,"title":"检查","slug":"检查","link":"#检查","children":[]},{"level":2,"title":"pypi下载源配置","slug":"pypi下载源配置","link":"#pypi下载源配置","children":[]},{"level":2,"title":"一键安装脚本","slug":"一键安装脚本","link":"#一键安装脚本","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/install_python37_on_centos.md"}');export{l as data}; diff --git a/assets/install_python37_on_centos.html-406b4dd9.js b/assets/install_python37_on_centos.html-406b4dd9.js new file mode 100644 index 000000000..0f8b948d8 --- /dev/null +++ b/assets/install_python37_on_centos.html-406b4dd9.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-92a2a070","path":"/en/advanced/install_python37_on_centos.html","title":"在 CentOS 安装 Python3.7","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"下载Python源码包","slug":"下载python源码包","link":"#下载python源码包","children":[]},{"level":2,"title":"安装前准备","slug":"安装前准备","link":"#安装前准备","children":[]},{"level":2,"title":"解压安装","slug":"解压安装","link":"#解压安装","children":[]},{"level":2,"title":"检查","slug":"检查","link":"#检查","children":[]},{"level":2,"title":"pypi下载源配置","slug":"pypi下载源配置","link":"#pypi下载源配置","children":[]},{"level":2,"title":"一键安装脚本","slug":"一键安装脚本","link":"#一键安装脚本","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/install_python37_on_centos.md"}');export{l as data}; diff --git a/assets/install_python37_on_centos.html-77d1e41a.js b/assets/install_python37_on_centos.html-77d1e41a.js new file mode 100644 index 000000000..a58384b47 --- /dev/null +++ b/assets/install_python37_on_centos.html-77d1e41a.js @@ -0,0 +1,63 @@ +import{_ as e,o as n,c as i,e as l}from"./app-2a91d8ab.js";const s={},d=l(`

    在 CentOS 安装 Python3.7

    下载Python源码包

    wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +

    安装前准备

    安装依赖组件

    yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel xz-devel
    +

    解压安装

    # 解压到/usr/local/src目录
    +$ tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +$ cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +$ make -j8
    +# 安装Python
    +$ make install
    +# 清理编译产出的中间文件
    +$ make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +

    检查

    检查Python版本是否安装成功

    $ python --version
    +Python 3.7.12  # 正常输出,表示安装成功
    +

    注:

    1. 链接到/usr/local/bin/目录不会影响系统软件(比如yum)的使用,因为 yum 工具指定的Python路径是/usr/bin/python
    2. 一般情况下,PATH配置是先/usr/local/bin/usr/bin
    3. 检查python -v输出结果是否为Python 3.7.12版本,如果不是该版本,可能影响后续依赖安装和服务运行

    pypi下载源配置

    pip默认是到pypi官方源下载第三方依赖包,下载速度可能会比较慢,可以考虑调整为腾讯云的pypi下载源,调整方式:

    mkdir ~/.pip/
    +echo "extra-index-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +

    一键安装脚本

    以下脚本内容是上面的步骤集合,省去了复制粘贴的重复动作。

    1. 创建文件 install_py37.sh,写入以下 shell 脚本
    2. 赋予执行权限,chmox +x install_py37.sh
    3. 执行脚本,./install_py37.sh
    #!/bin/env bash
    +
    +## 下载 Python 源码,如果已下载源码在脚本当前目录下,可注释跳过下载步骤
    +wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +
    +## 安装编译依赖组件
    +yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel xz-devel
    +
    +## 解压安装
    +# 解压到/usr/local/src目录
    +tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +make -j8
    +# 安装Python
    +make install
    +# 清理编译产出的中间文件
    +make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +ldconfig
    +
    +## 检查Python版本是否安装成功
    +echo -e "\\033[1;42;37m[$(date "+%Y/%m/%d %H:%M:%S")] [Check]: 检查Python版本\\033[0m"
    +python --version
    +echo -e "\\033[1;42;37m[$(date "+%Y/%m/%d %H:%M:%S")] [Check]: 检查Python版本\\033[0m"
    +
    +## pypi下载源配置
    +mkdir ~/.pip/
    +echo "extra-index-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +
    `,20),a=[d];function r(c,o){return n(),i("div",null,a)}const t=e(s,[["render",r],["__file","install_python37_on_centos.html.vue"]]);export{t as default}; diff --git a/assets/install_python37_on_centos.html-cd63257c.js b/assets/install_python37_on_centos.html-cd63257c.js new file mode 100644 index 000000000..a58384b47 --- /dev/null +++ b/assets/install_python37_on_centos.html-cd63257c.js @@ -0,0 +1,63 @@ +import{_ as e,o as n,c as i,e as l}from"./app-2a91d8ab.js";const s={},d=l(`

    在 CentOS 安装 Python3.7

    下载Python源码包

    wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +

    安装前准备

    安装依赖组件

    yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel xz-devel
    +

    解压安装

    # 解压到/usr/local/src目录
    +$ tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +$ cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +$ make -j8
    +# 安装Python
    +$ make install
    +# 清理编译产出的中间文件
    +$ make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +

    检查

    检查Python版本是否安装成功

    $ python --version
    +Python 3.7.12  # 正常输出,表示安装成功
    +

    注:

    1. 链接到/usr/local/bin/目录不会影响系统软件(比如yum)的使用,因为 yum 工具指定的Python路径是/usr/bin/python
    2. 一般情况下,PATH配置是先/usr/local/bin/usr/bin
    3. 检查python -v输出结果是否为Python 3.7.12版本,如果不是该版本,可能影响后续依赖安装和服务运行

    pypi下载源配置

    pip默认是到pypi官方源下载第三方依赖包,下载速度可能会比较慢,可以考虑调整为腾讯云的pypi下载源,调整方式:

    mkdir ~/.pip/
    +echo "extra-index-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +

    一键安装脚本

    以下脚本内容是上面的步骤集合,省去了复制粘贴的重复动作。

    1. 创建文件 install_py37.sh,写入以下 shell 脚本
    2. 赋予执行权限,chmox +x install_py37.sh
    3. 执行脚本,./install_py37.sh
    #!/bin/env bash
    +
    +## 下载 Python 源码,如果已下载源码在脚本当前目录下,可注释跳过下载步骤
    +wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +
    +## 安装编译依赖组件
    +yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel xz-devel
    +
    +## 解压安装
    +# 解压到/usr/local/src目录
    +tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +make -j8
    +# 安装Python
    +make install
    +# 清理编译产出的中间文件
    +make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +ldconfig
    +
    +## 检查Python版本是否安装成功
    +echo -e "\\033[1;42;37m[$(date "+%Y/%m/%d %H:%M:%S")] [Check]: 检查Python版本\\033[0m"
    +python --version
    +echo -e "\\033[1;42;37m[$(date "+%Y/%m/%d %H:%M:%S")] [Check]: 检查Python版本\\033[0m"
    +
    +## pypi下载源配置
    +mkdir ~/.pip/
    +echo "extra-index-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +
    `,20),a=[d];function r(c,o){return n(),i("div",null,a)}const t=e(s,[["render",r],["__file","install_python37_on_centos.html.vue"]]);export{t as default}; diff --git a/assets/install_python37_on_ubuntu.html-15ea3d7a.js b/assets/install_python37_on_ubuntu.html-15ea3d7a.js new file mode 100644 index 000000000..3a8268c03 --- /dev/null +++ b/assets/install_python37_on_ubuntu.html-15ea3d7a.js @@ -0,0 +1,27 @@ +import{_ as e,o as n,c as i,e as a}from"./app-2a91d8ab.js";const l={},s=a(`

    在 Ubuntu 安装 Python3.7

    注:当前Ubuntu版本为18.04

    下载Python源码包

    wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +

    安装前准备

    安装依赖组件

    apt-get update
    +apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev wget libbz2-dev tk-dev gcc make
    +

    解压安装

    # 解压到/usr/local/src目录
    +$ tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +$ cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +$ make -j8
    +# 安装Python
    +$ make install
    +# 清理编译产出的中间文件
    +$ make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +

    检查

    检查Python版本是否安装成功

    $ python --version
    +Python 3.7.12  # 正常输出,表示安装成功
    +

    注:

    1. 链接到/usr/local/bin/目录不会影响系统软件
    2. 一般情况下,PATH配置是先/usr/local/bin/usr/bin
    3. 检查python -v输出结果是否为Python 3.7.12版本,如果不是该版本,可能影响后续依赖安装和服务运行

    pypi下载源配置

    pip默认是到pypi官方源下载第三方依赖包,下载速度可能会比较慢,可以考虑调整为腾讯云的pypi下载源,调整方式:

    mkdir ~/.pip/
    +echo "[global]\\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +
    `,17),d=[s];function r(c,o){return n(),i("div",null,d)}const u=e(l,[["render",r],["__file","install_python37_on_ubuntu.html.vue"]]);export{u as default}; diff --git a/assets/install_python37_on_ubuntu.html-5c2a2a11.js b/assets/install_python37_on_ubuntu.html-5c2a2a11.js new file mode 100644 index 000000000..3a8268c03 --- /dev/null +++ b/assets/install_python37_on_ubuntu.html-5c2a2a11.js @@ -0,0 +1,27 @@ +import{_ as e,o as n,c as i,e as a}from"./app-2a91d8ab.js";const l={},s=a(`

    在 Ubuntu 安装 Python3.7

    注:当前Ubuntu版本为18.04

    下载Python源码包

    wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +

    安装前准备

    安装依赖组件

    apt-get update
    +apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev wget libbz2-dev tk-dev gcc make
    +

    解压安装

    # 解压到/usr/local/src目录
    +$ tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +$ cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +$ make -j8
    +# 安装Python
    +$ make install
    +# 清理编译产出的中间文件
    +$ make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +

    检查

    检查Python版本是否安装成功

    $ python --version
    +Python 3.7.12  # 正常输出,表示安装成功
    +

    注:

    1. 链接到/usr/local/bin/目录不会影响系统软件
    2. 一般情况下,PATH配置是先/usr/local/bin/usr/bin
    3. 检查python -v输出结果是否为Python 3.7.12版本,如果不是该版本,可能影响后续依赖安装和服务运行

    pypi下载源配置

    pip默认是到pypi官方源下载第三方依赖包,下载速度可能会比较慢,可以考虑调整为腾讯云的pypi下载源,调整方式:

    mkdir ~/.pip/
    +echo "[global]\\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +
    `,17),d=[s];function r(c,o){return n(),i("div",null,d)}const u=e(l,[["render",r],["__file","install_python37_on_ubuntu.html.vue"]]);export{u as default}; diff --git a/assets/install_python37_on_ubuntu.html-bab383eb.js b/assets/install_python37_on_ubuntu.html-bab383eb.js new file mode 100644 index 000000000..9caed7c4e --- /dev/null +++ b/assets/install_python37_on_ubuntu.html-bab383eb.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-c332cb30","path":"/zh/advanced/install_python37_on_ubuntu.html","title":"在 Ubuntu 安装 Python3.7","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"下载Python源码包","slug":"下载python源码包","link":"#下载python源码包","children":[]},{"level":2,"title":"安装前准备","slug":"安装前准备","link":"#安装前准备","children":[]},{"level":2,"title":"解压安装","slug":"解压安装","link":"#解压安装","children":[]},{"level":2,"title":"检查","slug":"检查","link":"#检查","children":[]},{"level":2,"title":"pypi下载源配置","slug":"pypi下载源配置","link":"#pypi下载源配置","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/install_python37_on_ubuntu.md"}');export{l as data}; diff --git a/assets/install_python37_on_ubuntu.html-e2ed6f5c.js b/assets/install_python37_on_ubuntu.html-e2ed6f5c.js new file mode 100644 index 000000000..9257c08c7 --- /dev/null +++ b/assets/install_python37_on_ubuntu.html-e2ed6f5c.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-07307966","path":"/en/advanced/install_python37_on_ubuntu.html","title":"在 Ubuntu 安装 Python3.7","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"下载Python源码包","slug":"下载python源码包","link":"#下载python源码包","children":[]},{"level":2,"title":"安装前准备","slug":"安装前准备","link":"#安装前准备","children":[]},{"level":2,"title":"解压安装","slug":"解压安装","link":"#解压安装","children":[]},{"level":2,"title":"检查","slug":"检查","link":"#检查","children":[]},{"level":2,"title":"pypi下载源配置","slug":"pypi下载源配置","link":"#pypi下载源配置","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/install_python37_on_ubuntu.md"}');export{l as data}; diff --git a/assets/install_redis_from_source.html-089c356a.js b/assets/install_redis_from_source.html-089c356a.js new file mode 100644 index 000000000..2cba615e9 --- /dev/null +++ b/assets/install_redis_from_source.html-089c356a.js @@ -0,0 +1,45 @@ +import{_ as s,r as a,o as d,c as n,a as e,b as r,d as l,e as c}from"./app-2a91d8ab.js";const v={},t=c(`

    源码安装 Redis

    运行环境

    1. 基于x86_64的CentOS
    2. 基于鲲鹏920(aarch64)的UOS V20
    3. 基于飞腾2000(aarch64)的TencentOS Server

    环境准备

    安装编译打包需要的工具

    yum install -y gcc make tcl wget
    +

    下载源码

    wget http://download.redis.io/releases/redis-5.0.4.tar.gz
    +

    编译安装

    # 解压
    +$ tar zvxf redis-5.0.4.tar.gz -C /usr/local/src
    +
    +# 进入源码目录
    +$ cd /usr/local/src/redis-5.0.4
    +
    +# 构建redis依赖库
    +$ cd deps; make -j4 hiredis jemalloc linenoise lua
    +$ cd ..
    +
    +# 构建redis
    +$ make -j4
    +$ make install
    +$ make clean
    +

    安装后,可以在/usr/local/src/redis-5.0.4/src目录和/usr/local/bin/目录下找到redis-serverredis-cli两个文件

    调整配置

    cp /usr/local/src/redis/redis.conf  /etc/redis.conf
    +vim /usr/local/src/redis/redis.conf 
    +
    # 设置Redis密码
    +requirepass 123456
    +
    +# 将 daemonize no 调整为 daemonize yes,将redis-server调整为默认后台启动
    +daemonize yes
    +
    +# 配置日志
    +logfile '/var/log/redis/redis-server.log'
    +

    启动服务

    redis-server /etc/redis.conf 
    +

    配置开机自动启动

    vim /etc/systemd/system/redis.service
    +

    输入以下内容:

    [Unit]
    +Description=redis-server
    +After=network.target
    +
    +[Service]
    +Type=forking
    +ExecStart=/usr/local/bin/redis-server /etc/redis.conf
    +ExecStop=/usr/local/bin/redis-cli shutdown
    +Restart=always
    +
    +PrivateTmp=true
    +
    +[Install]
    +WantedBy=multi-user.target
    +

    启动redis-server:

    systemctl start redis
    +

    开机自动启动redis:

    systemctl enable redis
    +

    参考文档

    `,25),u={href:"https://redis.io/topics/quickstart",target:"_blank",rel:"noopener noreferrer"};function o(h,m){const i=a("ExternalLinkIcon");return d(),n("div",null,[t,e("ul",null,[e("li",null,[e("a",u,[r("Redis官方文档"),l(i)])])])])}const g=s(v,[["render",o],["__file","install_redis_from_source.html.vue"]]);export{g as default}; diff --git a/assets/install_redis_from_source.html-215b8bee.js b/assets/install_redis_from_source.html-215b8bee.js new file mode 100644 index 000000000..f7cae6828 --- /dev/null +++ b/assets/install_redis_from_source.html-215b8bee.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-d81b4954","path":"/zh/advanced/install_redis_from_source.html","title":"源码安装 Redis","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"运行环境","slug":"运行环境","link":"#运行环境","children":[]},{"level":2,"title":"环境准备","slug":"环境准备","link":"#环境准备","children":[]},{"level":2,"title":"下载源码","slug":"下载源码","link":"#下载源码","children":[]},{"level":2,"title":"编译安装","slug":"编译安装","link":"#编译安装","children":[]},{"level":2,"title":"调整配置","slug":"调整配置","link":"#调整配置","children":[]},{"level":2,"title":"启动服务","slug":"启动服务","link":"#启动服务","children":[]},{"level":2,"title":"配置开机自动启动","slug":"配置开机自动启动","link":"#配置开机自动启动","children":[]},{"level":2,"title":"参考文档","slug":"参考文档","link":"#参考文档","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/install_redis_from_source.md"}');export{l as data}; diff --git a/assets/install_redis_from_source.html-91fed3be.js b/assets/install_redis_from_source.html-91fed3be.js new file mode 100644 index 000000000..2cba615e9 --- /dev/null +++ b/assets/install_redis_from_source.html-91fed3be.js @@ -0,0 +1,45 @@ +import{_ as s,r as a,o as d,c as n,a as e,b as r,d as l,e as c}from"./app-2a91d8ab.js";const v={},t=c(`

    源码安装 Redis

    运行环境

    1. 基于x86_64的CentOS
    2. 基于鲲鹏920(aarch64)的UOS V20
    3. 基于飞腾2000(aarch64)的TencentOS Server

    环境准备

    安装编译打包需要的工具

    yum install -y gcc make tcl wget
    +

    下载源码

    wget http://download.redis.io/releases/redis-5.0.4.tar.gz
    +

    编译安装

    # 解压
    +$ tar zvxf redis-5.0.4.tar.gz -C /usr/local/src
    +
    +# 进入源码目录
    +$ cd /usr/local/src/redis-5.0.4
    +
    +# 构建redis依赖库
    +$ cd deps; make -j4 hiredis jemalloc linenoise lua
    +$ cd ..
    +
    +# 构建redis
    +$ make -j4
    +$ make install
    +$ make clean
    +

    安装后,可以在/usr/local/src/redis-5.0.4/src目录和/usr/local/bin/目录下找到redis-serverredis-cli两个文件

    调整配置

    cp /usr/local/src/redis/redis.conf  /etc/redis.conf
    +vim /usr/local/src/redis/redis.conf 
    +
    # 设置Redis密码
    +requirepass 123456
    +
    +# 将 daemonize no 调整为 daemonize yes,将redis-server调整为默认后台启动
    +daemonize yes
    +
    +# 配置日志
    +logfile '/var/log/redis/redis-server.log'
    +

    启动服务

    redis-server /etc/redis.conf 
    +

    配置开机自动启动

    vim /etc/systemd/system/redis.service
    +

    输入以下内容:

    [Unit]
    +Description=redis-server
    +After=network.target
    +
    +[Service]
    +Type=forking
    +ExecStart=/usr/local/bin/redis-server /etc/redis.conf
    +ExecStop=/usr/local/bin/redis-cli shutdown
    +Restart=always
    +
    +PrivateTmp=true
    +
    +[Install]
    +WantedBy=multi-user.target
    +

    启动redis-server:

    systemctl start redis
    +

    开机自动启动redis:

    systemctl enable redis
    +

    参考文档

    `,25),u={href:"https://redis.io/topics/quickstart",target:"_blank",rel:"noopener noreferrer"};function o(h,m){const i=a("ExternalLinkIcon");return d(),n("div",null,[t,e("ul",null,[e("li",null,[e("a",u,[r("Redis官方文档"),l(i)])])])])}const g=s(v,[["render",o],["__file","install_redis_from_source.html.vue"]]);export{g as default}; diff --git a/assets/install_redis_from_source.html-d680ee1a.js b/assets/install_redis_from_source.html-d680ee1a.js new file mode 100644 index 000000000..f47b7fa37 --- /dev/null +++ b/assets/install_redis_from_source.html-d680ee1a.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-446601d1","path":"/en/advanced/install_redis_from_source.html","title":"源码安装 Redis","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"运行环境","slug":"运行环境","link":"#运行环境","children":[]},{"level":2,"title":"环境准备","slug":"环境准备","link":"#环境准备","children":[]},{"level":2,"title":"下载源码","slug":"下载源码","link":"#下载源码","children":[]},{"level":2,"title":"编译安装","slug":"编译安装","link":"#编译安装","children":[]},{"level":2,"title":"调整配置","slug":"调整配置","link":"#调整配置","children":[]},{"level":2,"title":"启动服务","slug":"启动服务","link":"#启动服务","children":[]},{"level":2,"title":"配置开机自动启动","slug":"配置开机自动启动","link":"#配置开机自动启动","children":[]},{"level":2,"title":"参考文档","slug":"参考文档","link":"#参考文档","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/install_redis_from_source.md"}');export{l as data}; diff --git a/assets/install_redis_on_centos.html-0830290e.js b/assets/install_redis_on_centos.html-0830290e.js new file mode 100644 index 000000000..3f555d21c --- /dev/null +++ b/assets/install_redis_on_centos.html-0830290e.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-85814896","path":"/en/advanced/install_redis_on_centos.html","title":"在 CentOS 安装 Redis","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"注意","slug":"注意","link":"#注意","children":[]},{"level":2,"title":"环境","slug":"环境","link":"#环境","children":[]},{"level":2,"title":"yum 安装 redis","slug":"yum-安装-redis","link":"#yum-安装-redis","children":[]},{"level":2,"title":"修改redis密码","slug":"修改redis密码","link":"#修改redis密码","children":[]},{"level":2,"title":"启动redis","slug":"启动redis","link":"#启动redis","children":[]},{"level":2,"title":"访问redis","slug":"访问redis","link":"#访问redis","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/install_redis_on_centos.md"}');export{e as data}; diff --git a/assets/install_redis_on_centos.html-6c713327.js b/assets/install_redis_on_centos.html-6c713327.js new file mode 100644 index 000000000..1e0971460 --- /dev/null +++ b/assets/install_redis_on_centos.html-6c713327.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2cae527a","path":"/zh/advanced/install_redis_on_centos.html","title":"在 CentOS 安装 Redis","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"注意","slug":"注意","link":"#注意","children":[]},{"level":2,"title":"环境","slug":"环境","link":"#环境","children":[]},{"level":2,"title":"yum 安装 redis","slug":"yum-安装-redis","link":"#yum-安装-redis","children":[]},{"level":2,"title":"修改redis密码","slug":"修改redis密码","link":"#修改redis密码","children":[]},{"level":2,"title":"启动redis","slug":"启动redis","link":"#启动redis","children":[]},{"level":2,"title":"访问redis","slug":"访问redis","link":"#访问redis","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/install_redis_on_centos.md"}');export{e as data}; diff --git a/assets/install_redis_on_centos.html-927eeae4.js b/assets/install_redis_on_centos.html-927eeae4.js new file mode 100644 index 000000000..8f1cb2921 --- /dev/null +++ b/assets/install_redis_on_centos.html-927eeae4.js @@ -0,0 +1,13 @@ +import{_ as d,r as i,o as n,c as r,a as e,b as a,d as l,e as c}from"./app-2a91d8ab.js";const t={},o=e("h1",{id:"在-centos-安装-redis",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#在-centos-安装-redis","aria-hidden":"true"},"#"),a(" 在 CentOS 安装 Redis")],-1),h=e("h2",{id:"注意",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#注意","aria-hidden":"true"},"#"),a(" 注意")],-1),u={href:"https://cloud.tencent.com/product/crs",target:"_blank",rel:"noopener noreferrer"},v=c(`

    环境

    CentOS 7.3 版本

    yum 安装 redis

    yum install redis
    +

    注:安装redis可能会出现"no package redis available"的错误提示,请执行yum install epel-release后重试redis安装命令。

    修改redis密码

    $ vi /etc/redis.conf
    +
    +# 找到 requirepass foobared
    +# 复制一行并根据自己需要调整密码,比如
    +requirepass tca123
    +

    启动redis

    systemctl start redis
    +

    查看redis运行状态

    systemctl status redis
    +

    访问redis

    $ redis-cli
    +
    +127.0.0.1:6379> auth tca123
    +OK # 鉴权通过
    +
    `,13);function b(m,p){const s=i("ExternalLinkIcon");return n(),r("div",null,[o,h,e("p",null,[a("本文档仅供参考,不适用于正式环境部署,正式环境建议使用专业的Redis服务(比如"),e("a",u,[a("腾讯云的Redis产品"),l(s)]),a(")")]),v])}const g=d(t,[["render",b],["__file","install_redis_on_centos.html.vue"]]);export{g as default}; diff --git a/assets/install_redis_on_centos.html-eb0d02c0.js b/assets/install_redis_on_centos.html-eb0d02c0.js new file mode 100644 index 000000000..8f1cb2921 --- /dev/null +++ b/assets/install_redis_on_centos.html-eb0d02c0.js @@ -0,0 +1,13 @@ +import{_ as d,r as i,o as n,c as r,a as e,b as a,d as l,e as c}from"./app-2a91d8ab.js";const t={},o=e("h1",{id:"在-centos-安装-redis",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#在-centos-安装-redis","aria-hidden":"true"},"#"),a(" 在 CentOS 安装 Redis")],-1),h=e("h2",{id:"注意",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#注意","aria-hidden":"true"},"#"),a(" 注意")],-1),u={href:"https://cloud.tencent.com/product/crs",target:"_blank",rel:"noopener noreferrer"},v=c(`

    环境

    CentOS 7.3 版本

    yum 安装 redis

    yum install redis
    +

    注:安装redis可能会出现"no package redis available"的错误提示,请执行yum install epel-release后重试redis安装命令。

    修改redis密码

    $ vi /etc/redis.conf
    +
    +# 找到 requirepass foobared
    +# 复制一行并根据自己需要调整密码,比如
    +requirepass tca123
    +

    启动redis

    systemctl start redis
    +

    查看redis运行状态

    systemctl status redis
    +

    访问redis

    $ redis-cli
    +
    +127.0.0.1:6379> auth tca123
    +OK # 鉴权通过
    +
    `,13);function b(m,p){const s=i("ExternalLinkIcon");return n(),r("div",null,[o,h,e("p",null,[a("本文档仅供参考,不适用于正式环境部署,正式环境建议使用专业的Redis服务(比如"),e("a",u,[a("腾讯云的Redis产品"),l(s)]),a(")")]),v])}const g=d(t,[["render",b],["__file","install_redis_on_centos.html.vue"]]);export{g as default}; diff --git a/assets/intro.html-218c4de3.js b/assets/intro.html-218c4de3.js new file mode 100644 index 000000000..28e6ba10b --- /dev/null +++ b/assets/intro.html-218c4de3.js @@ -0,0 +1 @@ +import{_ as r,r as c,o as d,c as i,a as e,b as t,d as o,w as a}from"./app-2a91d8ab.js";const s={},h=e("h1",{id:"平台概述",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#平台概述","aria-hidden":"true"},"#"),t(" 平台概述")],-1),u=e("p",null,[e("strong",null,"腾讯云代码分析"),t("(Tencent Cloud Code Analysis,简称TCA,内部曾用研发代号 "),e("strong",null,"CodeDog"),t(" )是集众多分析工具的云原生、分布式、高性能的代码综合分析跟踪平台,包含服务端、Web端和客户端三个组件,已集成一批自研工具,同时也支持动态集成业界各编程语言的分析工具。")],-1),_=e("h3",{id:"使用tca-action快速体验",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#使用tca-action快速体验","aria-hidden":"true"},"#"),t(" 使用TCA Action快速体验")],-1),p=e("code",null,".github/workflows/tca.yml",-1),m={href:"https://github.com/TCATools/TCA-action/blob/main/README.md",target:"_blank",rel:"noopener noreferrer"},A=e("h3",{id:"部署tca",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#部署tca","aria-hidden":"true"},"#"),t(" 部署TCA")],-1),E={href:"https://github.com/Tencent/CodeAnalysis",target:"_blank",rel:"noopener noreferrer"},f=e("h3",{id:"创建首个代码分析项目",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#创建首个代码分析项目","aria-hidden":"true"},"#"),t(" 创建首个代码分析项目")],-1),C=e("div",{class:"custom-container tip"},[e("p",{class:"custom-container-title"},"TIP"),e("p",null,"默认平台登录账号/密码:CodeDog/admin")],-1),k=e("h3",{id:"快速扩展客户端",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#快速扩展客户端","aria-hidden":"true"},"#"),t(" 快速扩展客户端")],-1),B={class:"custom-container tip"},b=e("p",{class:"custom-container-title"},"TIP",-1),T=e("h3",{id:"了解更多",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#了解更多","aria-hidden":"true"},"#"),t(" 了解更多")],-1);function x(g,v){const l=c("ExternalLinkIcon"),n=c("RouterLink");return d(),i("div",null,[h,u,_,e("p",null,[t("使用TCA Action,只需要在代码仓库中添加"),p,t("文件,就可以直接在GitHub工作流中快速体验代码分析。请参考:"),e("a",m,[t("TCA-action指引"),o(l)])]),A,e("p",null,[t("拉取 "),e("a",E,[t("代码库"),o(l)]),t(" 后,您可以通过以下三种方式部署腾讯云代码分析平台:")]),e("ul",null,[e("li",null,[e("p",null,[o(n,{to:"/en/quickStarted/deploySever.html#%E9%80%9A%E8%BF%87docker"},{default:a(()=>[t("通过 Docker 部署")]),_:1})])]),e("li",null,[e("p",null,[o(n,{to:"/en/quickStarted/codeDeploy.html#%E9%80%9A%E8%BF%87%E6%BA%90%E4%BB%A3%E7%A0%81"},{default:a(()=>[t("通过源代码")]),_:1})])]),e("li",null,[e("p",null,[o(n,{to:"/en/quickStarted/dockercomposeDeploy.html#%E9%80%9A%E8%BF%87docker-compose"},{default:a(()=>[t("通过 Docker-Compose 部署")]),_:1})])])]),f,e("p",null,[t("成功部署并启动TCA后,您可以按照 "),o(n,{to:"/en/quickStarted/deploySever.html"},{default:a(()=>[t("指引")]),_:1}),t(" 创建您的首个代码分析项目。")]),C,k,e("p",null,[t("TCA客户端支持通过可执行文件进行快速扩展部署,详见"),o(n,{to:"/en/quickStarted/deployClient.html#%E9%80%9A%E8%BF%87%E5%8F%AF%E6%89%A7%E8%A1%8C%E6%96%87%E4%BB%B6"},{default:a(()=>[t("通过可执行文件")]),_:1})]),e("div",B,[b,e("p",null,[t("客户端可在本地执行代码分析,也可以作为"),o(n,{to:"/en/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.html"},{default:a(()=>[t("在线常驻节点")]),_:1}),t("进行在线分析。")])]),T,e("p",null,[t("更多关于腾讯云代码分析平台的使用指南和配置说明,参见"),o(n,{to:"/en/guide/"},{default:a(()=>[t("帮助文档")]),_:1}),t("。")])])}const D=r(s,[["render",x],["__file","intro.html.vue"]]);export{D as default}; diff --git a/assets/intro.html-7fd28a67.js b/assets/intro.html-7fd28a67.js new file mode 100644 index 000000000..2c4d40d5f --- /dev/null +++ b/assets/intro.html-7fd28a67.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-396ae2e0","path":"/zh/quickStarted/intro.html","title":"平台概述","lang":"zh-CN","frontmatter":{},"headers":[{"level":3,"title":"使用TCA Action快速体验","slug":"使用tca-action快速体验","link":"#使用tca-action快速体验","children":[]},{"level":3,"title":"部署TCA","slug":"部署tca","link":"#部署tca","children":[]},{"level":3,"title":"创建首个代码分析项目","slug":"创建首个代码分析项目","link":"#创建首个代码分析项目","children":[]},{"level":3,"title":"快速扩展客户端","slug":"快速扩展客户端","link":"#快速扩展客户端","children":[]},{"level":3,"title":"了解更多","slug":"了解更多","link":"#了解更多","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/intro.md"}');export{t as data}; diff --git a/assets/intro.html-87dabf49.js b/assets/intro.html-87dabf49.js new file mode 100644 index 000000000..2bfe1a17a --- /dev/null +++ b/assets/intro.html-87dabf49.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-2bb8df5b","path":"/en/quickStarted/intro.html","title":"平台概述","lang":"en-US","frontmatter":{},"headers":[{"level":3,"title":"使用TCA Action快速体验","slug":"使用tca-action快速体验","link":"#使用tca-action快速体验","children":[]},{"level":3,"title":"部署TCA","slug":"部署tca","link":"#部署tca","children":[]},{"level":3,"title":"创建首个代码分析项目","slug":"创建首个代码分析项目","link":"#创建首个代码分析项目","children":[]},{"level":3,"title":"快速扩展客户端","slug":"快速扩展客户端","link":"#快速扩展客户端","children":[]},{"level":3,"title":"了解更多","slug":"了解更多","link":"#了解更多","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/intro.md"}');export{t as data}; diff --git a/assets/intro.html-df1c3002.js b/assets/intro.html-df1c3002.js new file mode 100644 index 000000000..5e224a200 --- /dev/null +++ b/assets/intro.html-df1c3002.js @@ -0,0 +1 @@ +import{_ as r,r as c,o as d,c as i,a as e,b as t,d as o,w as a}from"./app-2a91d8ab.js";const s={},h=e("h1",{id:"平台概述",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#平台概述","aria-hidden":"true"},"#"),t(" 平台概述")],-1),u=e("p",null,[e("strong",null,"腾讯云代码分析"),t("(Tencent Cloud Code Analysis,简称TCA,内部曾用研发代号 "),e("strong",null,"CodeDog"),t(" )是集众多分析工具的云原生、分布式、高性能的代码综合分析跟踪平台,包含服务端、Web端和客户端三个组件,已集成一批自研工具,同时也支持动态集成业界各编程语言的分析工具。")],-1),_=e("h3",{id:"使用tca-action快速体验",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#使用tca-action快速体验","aria-hidden":"true"},"#"),t(" 使用TCA Action快速体验")],-1),p=e("code",null,".github/workflows/tca.yml",-1),m={href:"https://github.com/TCATools/TCA-action/blob/main/README.md",target:"_blank",rel:"noopener noreferrer"},A=e("h3",{id:"部署tca",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#部署tca","aria-hidden":"true"},"#"),t(" 部署TCA")],-1),E={href:"https://github.com/Tencent/CodeAnalysis",target:"_blank",rel:"noopener noreferrer"},f=e("h3",{id:"创建首个代码分析项目",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#创建首个代码分析项目","aria-hidden":"true"},"#"),t(" 创建首个代码分析项目")],-1),C=e("div",{class:"custom-container tip"},[e("p",{class:"custom-container-title"},"提示"),e("p",null,"默认平台登录账号/密码:CodeDog/admin")],-1),k=e("h3",{id:"快速扩展客户端",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#快速扩展客户端","aria-hidden":"true"},"#"),t(" 快速扩展客户端")],-1),B={class:"custom-container tip"},b=e("p",{class:"custom-container-title"},"提示",-1),x=e("h3",{id:"了解更多",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#了解更多","aria-hidden":"true"},"#"),t(" 了解更多")],-1);function T(g,v){const l=c("ExternalLinkIcon"),n=c("RouterLink");return d(),i("div",null,[h,u,_,e("p",null,[t("使用TCA Action,只需要在代码仓库中添加"),p,t("文件,就可以直接在GitHub工作流中快速体验代码分析。请参考:"),e("a",m,[t("TCA-action指引"),o(l)])]),A,e("p",null,[t("拉取 "),e("a",E,[t("代码库"),o(l)]),t(" 后,您可以通过以下三种方式部署腾讯云代码分析平台:")]),e("ul",null,[e("li",null,[e("p",null,[o(n,{to:"/zh/quickStarted/deploySever.html#%E9%80%9A%E8%BF%87docker"},{default:a(()=>[t("通过 Docker 部署")]),_:1})])]),e("li",null,[e("p",null,[o(n,{to:"/zh/quickStarted/codeDeploy.html#%E9%80%9A%E8%BF%87%E6%BA%90%E4%BB%A3%E7%A0%81"},{default:a(()=>[t("通过源代码")]),_:1})])]),e("li",null,[e("p",null,[o(n,{to:"/zh/quickStarted/dockercomposeDeploy.html#%E9%80%9A%E8%BF%87docker-compose"},{default:a(()=>[t("通过 Docker-Compose 部署")]),_:1})])])]),f,e("p",null,[t("成功部署并启动TCA后,您可以按照 "),o(n,{to:"/zh/quickStarted/deploySever.html"},{default:a(()=>[t("指引")]),_:1}),t(" 创建您的首个代码分析项目。")]),C,k,e("p",null,[t("TCA客户端支持通过可执行文件进行快速扩展部署,详见"),o(n,{to:"/zh/quickStarted/deployClient.html#%E9%80%9A%E8%BF%87%E5%8F%AF%E6%89%A7%E8%A1%8C%E6%96%87%E4%BB%B6"},{default:a(()=>[t("通过可执行文件")]),_:1})]),e("div",B,[b,e("p",null,[t("客户端可在本地执行代码分析,也可以作为"),o(n,{to:"/zh/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.html"},{default:a(()=>[t("在线常驻节点")]),_:1}),t("进行在线分析。")])]),x,e("p",null,[t("更多关于腾讯云代码分析平台的使用指南和配置说明,参见"),o(n,{to:"/zh/guide/"},{default:a(()=>[t("帮助文档")]),_:1}),t("。")])])}const z=r(s,[["render",T],["__file","intro.html.vue"]]);export{z as default}; diff --git a/assets/jenkins_build-65827dd4.png b/assets/jenkins_build-65827dd4.png new file mode 100644 index 000000000..dc5beb320 Binary files /dev/null and b/assets/jenkins_build-65827dd4.png differ diff --git a/assets/jenkins_console_output-c755921c.png b/assets/jenkins_console_output-c755921c.png new file mode 100644 index 000000000..e16682814 Binary files /dev/null and b/assets/jenkins_console_output-c755921c.png differ diff --git a/assets/jenkins_deploy_plugin-ed721f40.png b/assets/jenkins_deploy_plugin-ed721f40.png new file mode 100644 index 000000000..6b475645d Binary files /dev/null and b/assets/jenkins_deploy_plugin-ed721f40.png differ diff --git a/assets/jenkins_environment_vars-ebf8eed3.png b/assets/jenkins_environment_vars-ebf8eed3.png new file mode 100644 index 000000000..3136f5ead Binary files /dev/null and b/assets/jenkins_environment_vars-ebf8eed3.png differ diff --git a/assets/jenkins_git_config-12805fad.png b/assets/jenkins_git_config-12805fad.png new file mode 100644 index 000000000..de8be5ee0 Binary files /dev/null and b/assets/jenkins_git_config-12805fad.png differ diff --git a/assets/jenkins_installed_plugins-d743f9e1.png b/assets/jenkins_installed_plugins-d743f9e1.png new file mode 100644 index 000000000..754e5497e Binary files /dev/null and b/assets/jenkins_installed_plugins-d743f9e1.png differ diff --git a/assets/jenkins_manage_jenkins-30e2ce5b.png b/assets/jenkins_manage_jenkins-30e2ce5b.png new file mode 100644 index 000000000..4defd730d Binary files /dev/null and b/assets/jenkins_manage_jenkins-30e2ce5b.png differ diff --git a/assets/jenkins_manage_plugins-d18d9357.png b/assets/jenkins_manage_plugins-d18d9357.png new file mode 100644 index 000000000..554fa5b22 Binary files /dev/null and b/assets/jenkins_manage_plugins-d18d9357.png differ diff --git a/assets/jenkins_new_item-a6c655ba.png b/assets/jenkins_new_item-a6c655ba.png new file mode 100644 index 000000000..2e748c77c Binary files /dev/null and b/assets/jenkins_new_item-a6c655ba.png differ diff --git a/assets/jenkins_output_url-239accff.png b/assets/jenkins_output_url-239accff.png new file mode 100644 index 000000000..66cb2d6e0 Binary files /dev/null and b/assets/jenkins_output_url-239accff.png differ diff --git a/assets/jenkins_shell-131e349c.js b/assets/jenkins_shell-131e349c.js new file mode 100644 index 000000000..a6a65d3a7 --- /dev/null +++ b/assets/jenkins_shell-131e349c.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/jenkins_manage_plugins-d18d9357.png",n="/CodeAnalysis/assets/jenkins_deploy_plugin-ed721f40.png",e="/CodeAnalysis/assets/jenkins_installed_plugins-d743f9e1.png",a="/CodeAnalysis/assets/jenkins_var_path-85458d9e.png",i="/CodeAnalysis/assets/jenkins_manage_jenkins-30e2ce5b.png",_="/CodeAnalysis/assets/jenkins_environment_vars-ebf8eed3.png",t="/CodeAnalysis/assets/jenkins_new_item-a6c655ba.png",o="/CodeAnalysis/assets/jenkins_git_config-12805fad.png",p="/CodeAnalysis/assets/jenkins_tca_plugin_config-a2e90556.png",d="/CodeAnalysis/assets/jenkins_build-65827dd4.png",l="/CodeAnalysis/assets/jenkins_console_output-c755921c.png",c="/CodeAnalysis/assets/jenkins_output_url-239accff.png",g="/CodeAnalysis/assets/jenkins_shell-7146ddf3.png";export{s as _,n as a,e as b,a as c,i as d,_ as e,t as f,o as g,p as h,d as i,l as j,c as k,g as l}; diff --git a/assets/jenkins_shell-7146ddf3.png b/assets/jenkins_shell-7146ddf3.png new file mode 100644 index 000000000..b0ff0a7af Binary files /dev/null and b/assets/jenkins_shell-7146ddf3.png differ diff --git a/assets/jenkins_tca_plugin_config-a2e90556.png b/assets/jenkins_tca_plugin_config-a2e90556.png new file mode 100644 index 000000000..b8fed42d3 Binary files /dev/null and b/assets/jenkins_tca_plugin_config-a2e90556.png differ diff --git a/assets/jenkins_var_path-85458d9e.png b/assets/jenkins_var_path-85458d9e.png new file mode 100644 index 000000000..83a285d1a Binary files /dev/null and b/assets/jenkins_var_path-85458d9e.png differ diff --git a/assets/joingroup.html-309e7f1e.js b/assets/joingroup.html-309e7f1e.js new file mode 100644 index 000000000..cfda694ed --- /dev/null +++ b/assets/joingroup.html-309e7f1e.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-2d8ab272","path":"/zh/community/joingroup.html","title":"加入社区","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/community/joingroup.md"}');export{t as data}; diff --git a/assets/joingroup.html-b3d16c20.js b/assets/joingroup.html-b3d16c20.js new file mode 100644 index 000000000..107992b27 --- /dev/null +++ b/assets/joingroup.html-b3d16c20.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-f6077552","path":"/en/community/joingroup.html","title":"加入社区","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/community/joingroup.md"}');export{t as data}; diff --git a/assets/joingroup.html-d64da6dc.js b/assets/joingroup.html-d64da6dc.js new file mode 100644 index 000000000..91266ded5 --- /dev/null +++ b/assets/joingroup.html-d64da6dc.js @@ -0,0 +1 @@ +import{_ as t,r as s,o as r,c as a,a as e,b as n,d as c}from"./app-2a91d8ab.js";const l={},i=e("h1",{id:"加入社区",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#加入社区","aria-hidden":"true"},"#"),n(" 加入社区")],-1),_=e("p",null,"如果您需要有关TCA的帮助,希望与TCA开发者们相互认识和交流,欢迎通过以下渠道加入TCA社区!",-1),d=e("li",null,"微信公众号:「腾讯云静态分析」,关注并发送“进群”即可加入官方开源交流微信群",-1),u=e("li",null,"QQ交流群:361791391",-1),h={href:"https://github.com/Tencent/CodeAnalysis/discussions",target:"_blank",rel:"noopener noreferrer"};function p(f,m){const o=s("ExternalLinkIcon");return r(),a("div",null,[i,_,e("ul",null,[d,u,e("li",null,[e("a",h,[n("GitHub讨论区"),c(o)])])])])}const b=t(l,[["render",p],["__file","joingroup.html.vue"]]);export{b as default}; diff --git a/assets/joingroup.html-fcf92f00.js b/assets/joingroup.html-fcf92f00.js new file mode 100644 index 000000000..91266ded5 --- /dev/null +++ b/assets/joingroup.html-fcf92f00.js @@ -0,0 +1 @@ +import{_ as t,r as s,o as r,c as a,a as e,b as n,d as c}from"./app-2a91d8ab.js";const l={},i=e("h1",{id:"加入社区",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#加入社区","aria-hidden":"true"},"#"),n(" 加入社区")],-1),_=e("p",null,"如果您需要有关TCA的帮助,希望与TCA开发者们相互认识和交流,欢迎通过以下渠道加入TCA社区!",-1),d=e("li",null,"微信公众号:「腾讯云静态分析」,关注并发送“进群”即可加入官方开源交流微信群",-1),u=e("li",null,"QQ交流群:361791391",-1),h={href:"https://github.com/Tencent/CodeAnalysis/discussions",target:"_blank",rel:"noopener noreferrer"};function p(f,m){const o=s("ExternalLinkIcon");return r(),a("div",null,[i,_,e("ul",null,[d,u,e("li",null,[e("a",h,[n("GitHub讨论区"),c(o)])])])])}const b=t(l,[["render",p],["__file","joingroup.html.vue"]]);export{b as default}; diff --git a/assets/manage_job_01-8f68e1e2.js b/assets/manage_job_01-8f68e1e2.js new file mode 100644 index 000000000..a630ca014 --- /dev/null +++ b/assets/manage_job_01-8f68e1e2.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/manage_job_01-c9185509.png";export{s as _}; diff --git a/assets/manage_job_01-c9185509.png b/assets/manage_job_01-c9185509.png new file mode 100644 index 000000000..973333db7 Binary files /dev/null and b/assets/manage_job_01-c9185509.png differ diff --git a/assets/manage_node_01-7bbb0814.png b/assets/manage_node_01-7bbb0814.png new file mode 100644 index 000000000..5012308be Binary files /dev/null and b/assets/manage_node_01-7bbb0814.png differ diff --git a/assets/manage_node_02-0f1b4f39.png b/assets/manage_node_02-0f1b4f39.png new file mode 100644 index 000000000..217aa7d0c Binary files /dev/null and b/assets/manage_node_02-0f1b4f39.png differ diff --git a/assets/manage_node_03-6b380f7c.png b/assets/manage_node_03-6b380f7c.png new file mode 100644 index 000000000..1b6067e8d Binary files /dev/null and b/assets/manage_node_03-6b380f7c.png differ diff --git a/assets/manage_node_04-75d05755.png b/assets/manage_node_04-75d05755.png new file mode 100644 index 000000000..d6d2c3a6d Binary files /dev/null and b/assets/manage_node_04-75d05755.png differ diff --git a/assets/manage_node_04-ba2c36cb.js b/assets/manage_node_04-ba2c36cb.js new file mode 100644 index 000000000..f7353160c --- /dev/null +++ b/assets/manage_node_04-ba2c36cb.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/manage_node_01-7bbb0814.png",a="/CodeAnalysis/assets/manage_node_02-0f1b4f39.png",n="/CodeAnalysis/assets/manage_node_03-6b380f7c.png",e="/CodeAnalysis/assets/manage_node_04-75d05755.png";export{s as _,a,n as b,e as c}; diff --git a/assets/manage_oauth_01-3e559946.png b/assets/manage_oauth_01-3e559946.png new file mode 100644 index 000000000..cbc3b1e7b Binary files /dev/null and b/assets/manage_oauth_01-3e559946.png differ diff --git a/assets/manage_oauth_02-5a0227a3.png b/assets/manage_oauth_02-5a0227a3.png new file mode 100644 index 000000000..0092c52a1 Binary files /dev/null and b/assets/manage_oauth_02-5a0227a3.png differ diff --git a/assets/manage_oauth_02-fc66f681.js b/assets/manage_oauth_02-fc66f681.js new file mode 100644 index 000000000..8a3232a1d --- /dev/null +++ b/assets/manage_oauth_02-fc66f681.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/manage_oauth_01-3e559946.png",a="/CodeAnalysis/assets/manage_oauth_02-5a0227a3.png";export{s as _,a}; diff --git a/assets/manage_org_01-4220e65f.png b/assets/manage_org_01-4220e65f.png new file mode 100644 index 000000000..37e62f2a0 Binary files /dev/null and b/assets/manage_org_01-4220e65f.png differ diff --git a/assets/manage_org_02-ce951ef7.js b/assets/manage_org_02-ce951ef7.js new file mode 100644 index 000000000..15b70d184 --- /dev/null +++ b/assets/manage_org_02-ce951ef7.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/manage_org_01-4220e65f.png",a="/CodeAnalysis/assets/manage_org_02-d813adb5.png";export{s as _,a}; diff --git a/assets/manage_org_02-d813adb5.png b/assets/manage_org_02-d813adb5.png new file mode 100644 index 000000000..52161dea1 Binary files /dev/null and b/assets/manage_org_02-d813adb5.png differ diff --git a/assets/manage_team_01-9b57a754.png b/assets/manage_team_01-9b57a754.png new file mode 100644 index 000000000..ff5908bbb Binary files /dev/null and b/assets/manage_team_01-9b57a754.png differ diff --git a/assets/manage_team_01-ead0dac9.js b/assets/manage_team_01-ead0dac9.js new file mode 100644 index 000000000..d6bbd9f0f --- /dev/null +++ b/assets/manage_team_01-ead0dac9.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/manage_team_01-9b57a754.png";export{s as _}; diff --git a/assets/manage_tool_01-405e8179.js b/assets/manage_tool_01-405e8179.js new file mode 100644 index 000000000..df5d1773c --- /dev/null +++ b/assets/manage_tool_01-405e8179.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/manage_tool_01-90fd47ba.png";export{s as _}; diff --git a/assets/manage_tool_01-90fd47ba.png b/assets/manage_tool_01-90fd47ba.png new file mode 100644 index 000000000..2cf005f66 Binary files /dev/null and b/assets/manage_tool_01-90fd47ba.png differ diff --git a/assets/manage_user_01-b9bd1cc2.png b/assets/manage_user_01-b9bd1cc2.png new file mode 100644 index 000000000..8596ee282 Binary files /dev/null and b/assets/manage_user_01-b9bd1cc2.png differ diff --git a/assets/manage_user_02-e4d7abc6.js b/assets/manage_user_02-e4d7abc6.js new file mode 100644 index 000000000..d91a87114 --- /dev/null +++ b/assets/manage_user_02-e4d7abc6.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/manage_user_01-b9bd1cc2.png",a="/CodeAnalysis/assets/manage_user_02-f8f273e7.png";export{s as _,a}; diff --git a/assets/manage_user_02-f8f273e7.png b/assets/manage_user_02-f8f273e7.png new file mode 100644 index 000000000..9a955cc49 Binary files /dev/null and b/assets/manage_user_02-f8f273e7.png differ diff --git a/assets/org_node_manager_2-a35abfd5.png b/assets/org_node_manager_2-a35abfd5.png new file mode 100644 index 000000000..db937ee4e Binary files /dev/null and b/assets/org_node_manager_2-a35abfd5.png differ diff --git a/assets/org_node_process-100ab7d5.png b/assets/org_node_process-100ab7d5.png new file mode 100644 index 000000000..758092622 Binary files /dev/null and b/assets/org_node_process-100ab7d5.png differ diff --git a/assets/org_tag_manager-09c51fa2.png b/assets/org_tag_manager-09c51fa2.png new file mode 100644 index 000000000..f3cfdaa27 Binary files /dev/null and b/assets/org_tag_manager-09c51fa2.png differ diff --git a/assets/org_tag_node-54cd3647.png b/assets/org_tag_node-54cd3647.png new file mode 100644 index 000000000..890af1469 Binary files /dev/null and b/assets/org_tag_node-54cd3647.png differ diff --git a/assets/org_tag_scheme-0392461b.js b/assets/org_tag_scheme-0392461b.js new file mode 100644 index 000000000..db8b4662b --- /dev/null +++ b/assets/org_tag_scheme-0392461b.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/org_node_manager_2-a35abfd5.png",a="/CodeAnalysis/assets/org_node_process-100ab7d5.png",o="/CodeAnalysis/assets/org_tag_manager-09c51fa2.png",_="/CodeAnalysis/assets/org_tag_node-54cd3647.png",e="/CodeAnalysis/assets/org_tag_scheme-fed7991e.png";export{s as _,a,o as b,_ as c,e as d}; diff --git a/assets/org_tag_scheme-fed7991e.png b/assets/org_tag_scheme-fed7991e.png new file mode 100644 index 000000000..b8c352587 Binary files /dev/null and b/assets/org_tag_scheme-fed7991e.png differ diff --git a/assets/personalToken-2ae175b9.js b/assets/personalToken-2ae175b9.js new file mode 100644 index 000000000..0f193ad39 --- /dev/null +++ b/assets/personalToken-2ae175b9.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/personalToken-379b8f35.png";export{s as _}; diff --git a/assets/personalToken-379b8f35.png b/assets/personalToken-379b8f35.png new file mode 100644 index 000000000..78e5cdba9 Binary files /dev/null and b/assets/personalToken-379b8f35.png differ diff --git a/assets/planPage-27225805.js b/assets/planPage-27225805.js new file mode 100644 index 000000000..cc8c5738f --- /dev/null +++ b/assets/planPage-27225805.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/registerCodeRepo-637a4b5b.png",a="/CodeAnalysis/assets/creataAnalysePlan-cef75d2f.png",e="/CodeAnalysis/assets/planPage-93c1c4f7.png";export{s as _,a,e as b}; diff --git a/assets/planPage-93c1c4f7.png b/assets/planPage-93c1c4f7.png new file mode 100644 index 000000000..eb90909fb Binary files /dev/null and b/assets/planPage-93c1c4f7.png differ diff --git a/assets/pr.html-226d6634.js b/assets/pr.html-226d6634.js new file mode 100644 index 000000000..7d1a4c96e --- /dev/null +++ b/assets/pr.html-226d6634.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-1c31906e","path":"/zh/community/pr.html","title":"PR操作流程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"一、Fork目标代码库","slug":"一、fork目标代码库","link":"#一、fork目标代码库","children":[]},{"level":2,"title":"二、克隆Fork的代码库并创建分支","slug":"二、克隆fork的代码库并创建分支","link":"#二、克隆fork的代码库并创建分支","children":[]},{"level":2,"title":"三、在目标项目中提交PR","slug":"三、在目标项目中提交pr","link":"#三、在目标项目中提交pr","children":[{"level":3,"title":"1.进入到目标项目中,点击Pull requests Tab,再点击New pull request就会进入到创建PR的页面","slug":"_1-进入到目标项目中-点击pull-requests-tab-再点击new-pull-request就会进入到创建pr的页面","link":"#_1-进入到目标项目中-点击pull-requests-tab-再点击new-pull-request就会进入到创建pr的页面","children":[]},{"level":3,"title":"2.进入PR页面后","slug":"_2-进入pr页面后","link":"#_2-进入pr页面后","children":[]}]},{"level":2,"title":"更多信息请参阅GitHub PullRequest官方文档","slug":"更多信息请参阅github-pullrequest官方文档","link":"#更多信息请参阅github-pullrequest官方文档","children":[]},{"level":2,"title":"TCA团队诚邀您的加入","slug":"tca团队诚邀您的加入","link":"#tca团队诚邀您的加入","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/community/pr.md"}');export{l as data}; diff --git a/assets/pr.html-238f6a7c.js b/assets/pr.html-238f6a7c.js new file mode 100644 index 000000000..e0cec76b8 --- /dev/null +++ b/assets/pr.html-238f6a7c.js @@ -0,0 +1,3 @@ +import{_ as o,a as i,b as l,c as n,d as h}from"./PR-48d0e900.js";import{_ as d,r as c,o as p,c as u,a as e,b as a,d as s,e as t}from"./app-2a91d8ab.js";const _={},b=t('

    Welcome

    PR全称为Pull Request,它是一种代码库的协作方式。开发者可以通过PR将自己在代码库的修改通知到代码库负责人,由原作者评审代码并决定是否能合入。

    提示

    Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

    PR操作流程

    一、Fork目标代码库

    fork

    ',6),m={href:"https://github.com/Lingghh/CodeAnalysis",target:"_blank",rel:"noopener noreferrer"},g=t(`

    二、克隆Fork的代码库并创建分支

    在本地克隆Fork的代码库并创建分支

    git clone https://github.com/Lingghh/CodeAnalysis
    +git checkout -b dev/add_qa_20220301
    +

    注:也可以在自己Fork的代码库GitHub页面上创建分支。

    fork1

    接下来就可以在本地修改代码,修改完成后先push到Fork的代码库中.

    三、在目标项目中提交PR

    1.进入到目标项目中,点击Pull requests Tab,再点击New pull request就会进入到创建PR的页面

    New pull request

    2.进入PR页面后

    • 点击compare across forks 。

    • 点击head repository 。

    • 选择自己Fork的代码库和比较的分支,比如我这里选择Lingghh/CodeAnalysis和待合入的分支dev/add_arm64_file 。

    • 最后确认commits和changed files是否准确,如果没有问题就可以点击Create pull request 。

      PR

    PR创建后,代码库管理员会评审你提交的代码,并决定是否接受该PR。

    ',12),f={id:"更多信息请参阅github-pullrequest官方文档",tabindex:"-1"},k=e("a",{class:"header-anchor",href:"#更多信息请参阅github-pullrequest官方文档","aria-hidden":"true"},"#",-1),q={href:"https://docs.github.com/cn/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests/",target:"_blank",rel:"noopener noreferrer"},v=e("h2",{id:"tca团队诚邀您的加入",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#tca团队诚邀您的加入","aria-hidden":"true"},"#"),a(" TCA团队诚邀您的加入")],-1);function x(y,P){const r=c("ExternalLinkIcon");return p(),u("div",null,[b,e("p",null,[a("点击Fork后,会在自己名下产生一个相同代码库,比如我Fork CodeAnalysis项目后,会在我名下多出一个CodeAnalysis代码库,地址为"),e("a",m,[a("https://github.com/Lingghh/CodeAnalysis"),s(r)])]),g,e("h2",f,[k,a(" 更多信息请参阅"),e("a",q,[a("GitHub PullRequest官方文档"),s(r)])]),v])}const C=d(_,[["render",x],["__file","pr.html.vue"]]);export{C as default}; diff --git a/assets/pr.html-d341e50b.js b/assets/pr.html-d341e50b.js new file mode 100644 index 000000000..19586c595 --- /dev/null +++ b/assets/pr.html-d341e50b.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-78c226f8","path":"/en/community/pr.html","title":"PR操作流程","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"一、Fork目标代码库","slug":"一、fork目标代码库","link":"#一、fork目标代码库","children":[]},{"level":2,"title":"二、克隆Fork的代码库并创建分支","slug":"二、克隆fork的代码库并创建分支","link":"#二、克隆fork的代码库并创建分支","children":[]},{"level":2,"title":"三、在目标项目中提交PR","slug":"三、在目标项目中提交pr","link":"#三、在目标项目中提交pr","children":[{"level":3,"title":"1.进入到目标项目中,点击Pull requests Tab,再点击New pull request就会进入到创建PR的页面","slug":"_1-进入到目标项目中-点击pull-requests-tab-再点击new-pull-request就会进入到创建pr的页面","link":"#_1-进入到目标项目中-点击pull-requests-tab-再点击new-pull-request就会进入到创建pr的页面","children":[]},{"level":3,"title":"2.进入PR页面后","slug":"_2-进入pr页面后","link":"#_2-进入pr页面后","children":[]}]},{"level":2,"title":"更多信息请参阅GitHub PullRequest官方文档","slug":"更多信息请参阅github-pullrequest官方文档","link":"#更多信息请参阅github-pullrequest官方文档","children":[]},{"level":2,"title":"TCA团队诚邀您的加入","slug":"tca团队诚邀您的加入","link":"#tca团队诚邀您的加入","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/community/pr.md"}');export{l as data}; diff --git a/assets/pr.html-d355a211.js b/assets/pr.html-d355a211.js new file mode 100644 index 000000000..5b0c1df38 --- /dev/null +++ b/assets/pr.html-d355a211.js @@ -0,0 +1,3 @@ +import{_ as o,a as i,b as l,c as n,d as h}from"./PR-48d0e900.js";import{_ as d,r as c,o as p,c as u,a as e,b as a,d as s,e as t}from"./app-2a91d8ab.js";const _={},b=t('

    Welcome

    PR全称为Pull Request,它是一种代码库的协作方式。开发者可以通过PR将自己在代码库的修改通知到代码库负责人,由原作者评审代码并决定是否能合入。

    TIP

    Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

    PR操作流程

    一、Fork目标代码库

    fork

    ',6),m={href:"https://github.com/Lingghh/CodeAnalysis",target:"_blank",rel:"noopener noreferrer"},g=t(`

    二、克隆Fork的代码库并创建分支

    在本地克隆Fork的代码库并创建分支

    git clone https://github.com/Lingghh/CodeAnalysis
    +git checkout -b dev/add_qa_20220301
    +

    注:也可以在自己Fork的代码库GitHub页面上创建分支。

    fork1

    接下来就可以在本地修改代码,修改完成后先push到Fork的代码库中.

    三、在目标项目中提交PR

    1.进入到目标项目中,点击Pull requests Tab,再点击New pull request就会进入到创建PR的页面

    New pull request

    2.进入PR页面后

    • 点击compare across forks 。

    • 点击head repository 。

    • 选择自己Fork的代码库和比较的分支,比如我这里选择Lingghh/CodeAnalysis和待合入的分支dev/add_arm64_file 。

    • 最后确认commits和changed files是否准确,如果没有问题就可以点击Create pull request 。

      PR

    PR创建后,代码库管理员会评审你提交的代码,并决定是否接受该PR。

    ',12),f={id:"更多信息请参阅github-pullrequest官方文档",tabindex:"-1"},k=e("a",{class:"header-anchor",href:"#更多信息请参阅github-pullrequest官方文档","aria-hidden":"true"},"#",-1),q={href:"https://docs.github.com/cn/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests/",target:"_blank",rel:"noopener noreferrer"},v=e("h2",{id:"tca团队诚邀您的加入",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#tca团队诚邀您的加入","aria-hidden":"true"},"#"),a(" TCA团队诚邀您的加入")],-1);function x(P,y){const r=c("ExternalLinkIcon");return p(),u("div",null,[b,e("p",null,[a("点击Fork后,会在自己名下产生一个相同代码库,比如我Fork CodeAnalysis项目后,会在我名下多出一个CodeAnalysis代码库,地址为"),e("a",m,[a("https://github.com/Lingghh/CodeAnalysis"),s(r)])]),g,e("h2",f,[k,a(" 更多信息请参阅"),e("a",q,[a("GitHub PullRequest官方文档"),s(r)])]),v])}const C=d(_,[["render",x],["__file","pr.html.vue"]]);export{C as default}; diff --git a/assets/registerCodeRepo-637a4b5b.png b/assets/registerCodeRepo-637a4b5b.png new file mode 100644 index 000000000..647cdb287 Binary files /dev/null and b/assets/registerCodeRepo-637a4b5b.png differ diff --git a/assets/runProject.html-083184d0.js b/assets/runProject.html-083184d0.js new file mode 100644 index 000000000..e8669832b --- /dev/null +++ b/assets/runProject.html-083184d0.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-1b6d66dd","path":"/en/quickStarted/runProject.html","title":"启动代码分析","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"执行代码分析","slug":"执行代码分析","link":"#执行代码分析","children":[]},{"level":2,"title":"查看分析历史","slug":"查看分析历史","link":"#查看分析历史","children":[]},{"level":2,"title":"查看分析概览","slug":"查看分析概览","link":"#查看分析概览","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/quickStarted/runProject.md"}');export{e as data}; diff --git a/assets/runProject.html-2ddb4214.js b/assets/runProject.html-2ddb4214.js new file mode 100644 index 000000000..df93b89f3 --- /dev/null +++ b/assets/runProject.html-2ddb4214.js @@ -0,0 +1 @@ +import{_ as c,a as d,b as s}from"./start_scan_04-65ab4d48.js";import{_ as l,r as i,o as h,c as _,a as e,b as t,d as o,w as r,e as n}from"./app-2a91d8ab.js";const u={},E=n('

    启动代码分析

    在完成 Server、Web 和 Client 相关部署和配置后,可通过平台执行代码分析。

    执行代码分析

    初始化创建项目后,可通过 在线分析客户端分析 来启动代码分析。

    代码分析

    注:

    ',6),p=e("li",null,[t("TCA推荐使用"),e("code",null,"在线分析"),t(",您可根据具体使用场景选择其一。")],-1),A=e("li",null,[e("code",null,"在线分析"),t("表示配置代码库链接后,TCA客户端拉取代码后进行分析;"),e("code",null,"客户端分析"),t("在配置本地待扫描代码路径后,无需代码拉取直接分析本地代码。")],-1),m=e("code",null,"在线分析",-1),f=e("code",null,"客户端分析",-1),B=n('

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    ',4),x=e("p",null,[e("img",{src:s,alt:"分支概览"})],-1);function C(b,g){const a=i("RouterLink");return h(),_("div",null,[E,e("ul",null,[p,A,e("li",null,[m,t("与"),f,t("具体详情及配置参考"),o(a,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%85%8D%E7%BD%AE%E8%AF%A6%E6%83%85.html"},{default:r(()=>[t("TCA客户端配置详情")]),_:1})])]),B,e("p",null,[t("分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 "),o(a,{to:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html"},{default:r(()=>[t("问题列表")]),_:1}),t(" 等。")]),x])}const v=l(u,[["render",C],["__file","runProject.html.vue"]]);export{v as default}; diff --git a/assets/runProject.html-3c0bf355.js b/assets/runProject.html-3c0bf355.js new file mode 100644 index 000000000..22add7250 --- /dev/null +++ b/assets/runProject.html-3c0bf355.js @@ -0,0 +1 @@ +import{_ as c,a as d,b as s}from"./start_scan_04-65ab4d48.js";import{_ as l,r as i,o as h,c as _,a as e,b as t,d as o,w as n,e as r}from"./app-2a91d8ab.js";const u={},E=r('

    启动代码分析

    在完成 Server、Web 和 Client 相关部署和配置后,可通过平台执行代码分析。

    执行代码分析

    初始化创建项目后,可通过 在线分析客户端分析 来启动代码分析。

    代码分析

    注:

    ',6),p=e("li",null,[t("TCA推荐使用"),e("code",null,"在线分析"),t(",您可根据具体使用场景选择其一。")],-1),A=e("li",null,[e("code",null,"在线分析"),t("表示配置代码库链接后,TCA客户端拉取代码后进行分析;"),e("code",null,"客户端分析"),t("在配置本地待扫描代码路径后,无需代码拉取直接分析本地代码。")],-1),m=e("code",null,"在线分析",-1),f=e("code",null,"客户端分析",-1),B=r('

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    ',4),x=e("p",null,[e("img",{src:s,alt:"分支概览"})],-1);function C(b,g){const a=i("RouterLink");return h(),_("div",null,[E,e("ul",null,[p,A,e("li",null,[m,t("与"),f,t("具体详情及配置参考"),o(a,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%85%8D%E7%BD%AE%E8%AF%A6%E6%83%85.html"},{default:n(()=>[t("TCA客户端配置详情")]),_:1})])]),B,e("p",null,[t("分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 "),o(a,{to:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html"},{default:n(()=>[t("问题列表")]),_:1}),t(" 等。")]),x])}const v=l(u,[["render",C],["__file","runProject.html.vue"]]);export{v as default}; diff --git a/assets/runProject.html-f5e6a3ca.js b/assets/runProject.html-f5e6a3ca.js new file mode 100644 index 000000000..8a261cd30 --- /dev/null +++ b/assets/runProject.html-f5e6a3ca.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-630c6310","path":"/zh/quickStarted/runProject.html","title":"启动代码分析","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"执行代码分析","slug":"执行代码分析","link":"#执行代码分析","children":[]},{"level":2,"title":"查看分析历史","slug":"查看分析历史","link":"#查看分析历史","children":[]},{"level":2,"title":"查看分析概览","slug":"查看分析概览","link":"#查看分析概览","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/quickStarted/runProject.md"}');export{e as data}; diff --git a/assets/scheme_codelint_01-3a155b75.png b/assets/scheme_codelint_01-3a155b75.png new file mode 100644 index 000000000..d2809c35f Binary files /dev/null and b/assets/scheme_codelint_01-3a155b75.png differ diff --git a/assets/scheme_codelint_01-9eec47a6.js b/assets/scheme_codelint_01-9eec47a6.js new file mode 100644 index 000000000..0727ceee3 --- /dev/null +++ b/assets/scheme_codelint_01-9eec47a6.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/scheme_codelint_01-3a155b75.png";export{s as _}; diff --git a/assets/scheme_codelint_02-0beb83d6.png b/assets/scheme_codelint_02-0beb83d6.png new file mode 100644 index 000000000..1bd1763f7 Binary files /dev/null and b/assets/scheme_codelint_02-0beb83d6.png differ diff --git a/assets/scheme_codelint_03-5bcd9286.js b/assets/scheme_codelint_03-5bcd9286.js new file mode 100644 index 000000000..f03eeab2f --- /dev/null +++ b/assets/scheme_codelint_03-5bcd9286.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/scheme_codelint_02-0beb83d6.png",e="/CodeAnalysis/assets/scheme_codelint_03-dd3c48db.png";export{s as _,e as a}; diff --git a/assets/scheme_codelint_03-dd3c48db.png b/assets/scheme_codelint_03-dd3c48db.png new file mode 100644 index 000000000..fe470afc2 Binary files /dev/null and b/assets/scheme_codelint_03-dd3c48db.png differ diff --git a/assets/scheme_codelint_04-1cece3c4.js b/assets/scheme_codelint_04-1cece3c4.js new file mode 100644 index 000000000..21f7532ae --- /dev/null +++ b/assets/scheme_codelint_04-1cece3c4.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/scheme_codelint_04-a63f9fcd.png";export{s as _}; diff --git a/assets/scheme_codelint_04-a63f9fcd.png b/assets/scheme_codelint_04-a63f9fcd.png new file mode 100644 index 000000000..7b83f587e Binary files /dev/null and b/assets/scheme_codelint_04-a63f9fcd.png differ diff --git a/assets/scheme_template_01-a3dfedfe.png b/assets/scheme_template_01-a3dfedfe.png new file mode 100644 index 000000000..cd002101c Binary files /dev/null and b/assets/scheme_template_01-a3dfedfe.png differ diff --git a/assets/scheme_template_02-525ea38c.png b/assets/scheme_template_02-525ea38c.png new file mode 100644 index 000000000..05e9854ee Binary files /dev/null and b/assets/scheme_template_02-525ea38c.png differ diff --git a/assets/scheme_template_02-70fd366c.js b/assets/scheme_template_02-70fd366c.js new file mode 100644 index 000000000..6d567df75 --- /dev/null +++ b/assets/scheme_template_02-70fd366c.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/scheme_template_01-a3dfedfe.png",e="/CodeAnalysis/assets/scheme_template_02-525ea38c.png";export{s as _,e as a}; diff --git a/assets/search-0782d0d1.svg b/assets/search-0782d0d1.svg new file mode 100644 index 000000000..03d83913e --- /dev/null +++ b/assets/search-0782d0d1.svg @@ -0,0 +1 @@ + diff --git a/assets/server.html-3d988e17.js b/assets/server.html-3d988e17.js new file mode 100644 index 000000000..8f3bbf680 --- /dev/null +++ b/assets/server.html-3d988e17.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-32060cba","path":"/zh/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server.html","title":"TCA Server","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"工程结构","slug":"工程结构","link":"#工程结构","children":[]},{"level":2,"title":"配置说明","slug":"配置说明","link":"#配置说明","children":[{"level":3,"title":"Main服务","slug":"main服务","link":"#main服务","children":[]},{"level":3,"title":"Analysis服务","slug":"analysis服务","link":"#analysis服务","children":[]},{"level":3,"title":"Login服务","slug":"login服务","link":"#login服务","children":[]},{"level":3,"title":"File服务","slug":"file服务","link":"#file服务","children":[]},{"level":3,"title":"ScmProxy","slug":"scmproxy","link":"#scmproxy","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/服务端/server.md"}');export{l as data}; diff --git a/assets/server.html-56940125.js b/assets/server.html-56940125.js new file mode 100644 index 000000000..246d4224a --- /dev/null +++ b/assets/server.html-56940125.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-2b8ad044","path":"/en/guide/%E6%9C%8D%E5%8A%A1%E7%AB%AF/server.html","title":"TCA Server","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"工程结构","slug":"工程结构","link":"#工程结构","children":[]},{"level":2,"title":"配置说明","slug":"配置说明","link":"#配置说明","children":[{"level":3,"title":"Main服务","slug":"main服务","link":"#main服务","children":[]},{"level":3,"title":"Analysis服务","slug":"analysis服务","link":"#analysis服务","children":[]},{"level":3,"title":"Login服务","slug":"login服务","link":"#login服务","children":[]},{"level":3,"title":"File服务","slug":"file服务","link":"#file服务","children":[]},{"level":3,"title":"ScmProxy","slug":"scmproxy","link":"#scmproxy","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/服务端/server.md"}');export{l as data}; diff --git a/assets/server.html-7ca036de.js b/assets/server.html-7ca036de.js new file mode 100644 index 000000000..0ac6569c6 --- /dev/null +++ b/assets/server.html-7ca036de.js @@ -0,0 +1,5 @@ +import{_,r as n,o,c as s,a as e,b as i,d as r,e as l}from"./app-2a91d8ab.js";const d={},c=l('

    TCA Server

    工程结构

    TCA Server由Main、Analysis、Login、File、ScmProxy五个微服务组成,主要技术栈为Django+uwsgi+nginx

    配置说明

    ',4),t={href:"https://github.com/Faberiii/CodeAnalysis/blob/main/server/scripts/config.sh",target:"_blank",rel:"noopener noreferrer"},S=l(`

    Main服务

    框架配置:

    • MAIN_DEBUG_MODE: Main服务的Debug模式,true/false
    • MAIN_SECRET_KEY: Main服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Main服务DB配置:

    • MAIN_DB_NAME:Main服务的数据库名称
    • MAIN_DB_USER:Main服务的数据库用户名
    • MAIN_DB_PASSWORD:Main服务的数据库密码
    • MAIN_DB_HOST:Main服务的数据库地址
    • MAIN_DB_PORT:Main服务的数据库端口号

    Main服务Redis配置:

    • MAIN_REDIS_HOST:Main服务访问的Redis地址
    • MAIN_REDIS_PORT:Main服务访问的Redis端口号
    • MAIN_REDIS_PASSWD:Main服务访问的Redis密码
    • MAIN_REDIS_DBID:Main服务访问的Redis DB编号,默认为1(Analysis服务默认访问0号DB)

    服务交互配置:

    • MAIN_SENTRY_DSN:Main服务异常日志上报至sentry配置
    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token
    • FILE_SERVER_TOKEN:文件服务器访问Token
    • CODEDOG_TOKEN:CodeDog默认访问的Token

    Analysis服务

    框架配置:

    • ANALYSIS_DEBUG_MODE: Analysis服务的Debug模式,true/false
    • ANALYSIS_SECRET_KEY: Analysis服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Analysis服务DB配置:

    • ANALYSIS_DB_NAME:Analysis服务的数据库名称
    • ANALYSIS_DB_USER:Analysis服务的数据库用户名
    • ANALYSIS_DB_PASSWORD:Analysis服务的数据库密码
    • ANALYSIS_DB_HOST:Analysis服务的数据库地址
    • ANALYSIS_DB_PORT:Analysis服务的数据库端口号

    Analysis服务Redis配置:

    • ANALYSIS_REDIS_HOST:Analysis服务访问的Redis地址
    • ANALYSIS_REDIS_PORT:Analysis服务访问的Redis端口号
    • ANALYSIS_REDIS_PASSWD:Analysis服务访问的Redis密码
    • ANALYSIS_REDIS_DBID:Analysis服务访问的Redis DB编号,默认为0(Main服务默认访问1号DB)

    服务交互配置:

    • ANALYSIS_SENTRY_DSN:Analysis服务异常日志上报至sentry配置
    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    Login服务

    框架配置:

    • LOGIN_DEBUG_MODE: Login服务的Debug模式,true/false
    • LOGIN_SECRET_KEY: Login服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Login服务DB配置:

    • LOGIN_DB_NAME:Login服务的数据库名称
    • LOGIN_DB_USER:Login服务的数据库用户名
    • LOGIN_DB_PASSWORD:Login服务的数据库密码
    • LOGIN_DB_HOST:Login服务的数据库地址
    • LOGIN_DB_PORT:Login服务的数据库端口号

    服务交互配置:

    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    注:配置文件中的pub_key与private_key生成方式可以参考以下方法:

    $ ssh-keygen -t rsa -b 1024 -m PEM -f tca_login.key
    +$ openssl rsa -in tca_login.key -pubout -outform PEM -out tca_login.key.pub
    +$ cat tca_login.key  # 作为private_key的内容
    +$ cat tca_login.key.pub  # 作为pub_key的内容
    +

    File服务

    框架配置:

    • FILE_DEBUG_MODE: File服务的Debug模式,true/false
    • FILE_SECRET_KEY: File服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    File服务DB配置:

    • FILE_DB_NAME:File服务的数据库名称
    • FILE_DB_USER:File服务的数据库用户名
    • FILE_DB_PASSWORD:File服务的数据库密码
    • FILE_DB_HOST:File服务的数据库地址
    • FILE_DB_PORT:File服务的数据库端口号

    服务交互配置:

    • FILE_SENTRY_DSN:File服务异常日志上报至sentry配置
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    File存储引擎配置

    • FILE_STORAGE_CLIENT: 文件存储引擎,可选项:LOCAL/MINIO/COS
      • 当配置引擎为LOCAL,可以指定FILE_STORAGE_DIR文件存放的路径
      • 当配置引擎为MINIO,可以指定以下变量:
        • FILE_MINIO_ENTRYPOINT:MINIO服务地址
        • FILE_MINIO_ACCESS_KEY:MINIO服务访问账号
        • MINIO_SECRET_KEY:MINIO服务访问密码
      • 当配置引擎为COS,可以指定以下变量
        • TENCENT_COS_APPID
        • TENCENT_COS_SECRETID
        • TENCENT_COS_SECRETKEY
        • TENCENT_COS_REGION
        • TENCENT_COS_ROOT_BUCKET:填写格式为bucket-appid

    ScmProxy

    服务配置:

    • SCMPROXY_HOST:ScmProxy服务的HOST,默认为0.0.0.0
    • SCMPROXY_PORT:ScmProxy服务监听端口,默认为8009
    • SCMPROXY_SENTRY_URL:ScmProxy服务异常日志上报至sentry配置
    • SCMPROXY: 通过本环境变量去指定其他服务调用ScmProxy服务的地址,默认值为127.0.0.1:8009
    `,39);function E(I,A){const a=n("ExternalLinkIcon");return o(),s("div",null,[c,e("p",null,[i("注意:以下配置内容可以参考 "),e("a",t,[i("config.sh"),r(a)]),i("文件进行查阅,使用时主要关注 MySQL、Redis 的配置,其他配置均已提供默认值,可以根据需要进行调整")]),S])}const T=_(d,[["render",E],["__file","server.html.vue"]]);export{T as default}; diff --git a/assets/server.html-c5f18a1a.js b/assets/server.html-c5f18a1a.js new file mode 100644 index 000000000..0ac6569c6 --- /dev/null +++ b/assets/server.html-c5f18a1a.js @@ -0,0 +1,5 @@ +import{_,r as n,o,c as s,a as e,b as i,d as r,e as l}from"./app-2a91d8ab.js";const d={},c=l('

    TCA Server

    工程结构

    TCA Server由Main、Analysis、Login、File、ScmProxy五个微服务组成,主要技术栈为Django+uwsgi+nginx

    配置说明

    ',4),t={href:"https://github.com/Faberiii/CodeAnalysis/blob/main/server/scripts/config.sh",target:"_blank",rel:"noopener noreferrer"},S=l(`

    Main服务

    框架配置:

    • MAIN_DEBUG_MODE: Main服务的Debug模式,true/false
    • MAIN_SECRET_KEY: Main服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Main服务DB配置:

    • MAIN_DB_NAME:Main服务的数据库名称
    • MAIN_DB_USER:Main服务的数据库用户名
    • MAIN_DB_PASSWORD:Main服务的数据库密码
    • MAIN_DB_HOST:Main服务的数据库地址
    • MAIN_DB_PORT:Main服务的数据库端口号

    Main服务Redis配置:

    • MAIN_REDIS_HOST:Main服务访问的Redis地址
    • MAIN_REDIS_PORT:Main服务访问的Redis端口号
    • MAIN_REDIS_PASSWD:Main服务访问的Redis密码
    • MAIN_REDIS_DBID:Main服务访问的Redis DB编号,默认为1(Analysis服务默认访问0号DB)

    服务交互配置:

    • MAIN_SENTRY_DSN:Main服务异常日志上报至sentry配置
    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token
    • FILE_SERVER_TOKEN:文件服务器访问Token
    • CODEDOG_TOKEN:CodeDog默认访问的Token

    Analysis服务

    框架配置:

    • ANALYSIS_DEBUG_MODE: Analysis服务的Debug模式,true/false
    • ANALYSIS_SECRET_KEY: Analysis服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Analysis服务DB配置:

    • ANALYSIS_DB_NAME:Analysis服务的数据库名称
    • ANALYSIS_DB_USER:Analysis服务的数据库用户名
    • ANALYSIS_DB_PASSWORD:Analysis服务的数据库密码
    • ANALYSIS_DB_HOST:Analysis服务的数据库地址
    • ANALYSIS_DB_PORT:Analysis服务的数据库端口号

    Analysis服务Redis配置:

    • ANALYSIS_REDIS_HOST:Analysis服务访问的Redis地址
    • ANALYSIS_REDIS_PORT:Analysis服务访问的Redis端口号
    • ANALYSIS_REDIS_PASSWD:Analysis服务访问的Redis密码
    • ANALYSIS_REDIS_DBID:Analysis服务访问的Redis DB编号,默认为0(Main服务默认访问1号DB)

    服务交互配置:

    • ANALYSIS_SENTRY_DSN:Analysis服务异常日志上报至sentry配置
    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    Login服务

    框架配置:

    • LOGIN_DEBUG_MODE: Login服务的Debug模式,true/false
    • LOGIN_SECRET_KEY: Login服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Login服务DB配置:

    • LOGIN_DB_NAME:Login服务的数据库名称
    • LOGIN_DB_USER:Login服务的数据库用户名
    • LOGIN_DB_PASSWORD:Login服务的数据库密码
    • LOGIN_DB_HOST:Login服务的数据库地址
    • LOGIN_DB_PORT:Login服务的数据库端口号

    服务交互配置:

    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    注:配置文件中的pub_key与private_key生成方式可以参考以下方法:

    $ ssh-keygen -t rsa -b 1024 -m PEM -f tca_login.key
    +$ openssl rsa -in tca_login.key -pubout -outform PEM -out tca_login.key.pub
    +$ cat tca_login.key  # 作为private_key的内容
    +$ cat tca_login.key.pub  # 作为pub_key的内容
    +

    File服务

    框架配置:

    • FILE_DEBUG_MODE: File服务的Debug模式,true/false
    • FILE_SECRET_KEY: File服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    File服务DB配置:

    • FILE_DB_NAME:File服务的数据库名称
    • FILE_DB_USER:File服务的数据库用户名
    • FILE_DB_PASSWORD:File服务的数据库密码
    • FILE_DB_HOST:File服务的数据库地址
    • FILE_DB_PORT:File服务的数据库端口号

    服务交互配置:

    • FILE_SENTRY_DSN:File服务异常日志上报至sentry配置
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    File存储引擎配置

    • FILE_STORAGE_CLIENT: 文件存储引擎,可选项:LOCAL/MINIO/COS
      • 当配置引擎为LOCAL,可以指定FILE_STORAGE_DIR文件存放的路径
      • 当配置引擎为MINIO,可以指定以下变量:
        • FILE_MINIO_ENTRYPOINT:MINIO服务地址
        • FILE_MINIO_ACCESS_KEY:MINIO服务访问账号
        • MINIO_SECRET_KEY:MINIO服务访问密码
      • 当配置引擎为COS,可以指定以下变量
        • TENCENT_COS_APPID
        • TENCENT_COS_SECRETID
        • TENCENT_COS_SECRETKEY
        • TENCENT_COS_REGION
        • TENCENT_COS_ROOT_BUCKET:填写格式为bucket-appid

    ScmProxy

    服务配置:

    • SCMPROXY_HOST:ScmProxy服务的HOST,默认为0.0.0.0
    • SCMPROXY_PORT:ScmProxy服务监听端口,默认为8009
    • SCMPROXY_SENTRY_URL:ScmProxy服务异常日志上报至sentry配置
    • SCMPROXY: 通过本环境变量去指定其他服务调用ScmProxy服务的地址,默认值为127.0.0.1:8009
    `,39);function E(I,A){const a=n("ExternalLinkIcon");return o(),s("div",null,[c,e("p",null,[i("注意:以下配置内容可以参考 "),e("a",t,[i("config.sh"),r(a)]),i("文件进行查阅,使用时主要关注 MySQL、Redis 的配置,其他配置均已提供默认值,可以根据需要进行调整")]),S])}const T=_(d,[["render",E],["__file","server.html.vue"]]);export{T as default}; diff --git a/assets/start_scan_01-0a970b25.png b/assets/start_scan_01-0a970b25.png new file mode 100644 index 000000000..f72d232bd Binary files /dev/null and b/assets/start_scan_01-0a970b25.png differ diff --git a/assets/start_scan_01-c88b8a36.js b/assets/start_scan_01-c88b8a36.js new file mode 100644 index 000000000..cc62ecf1b --- /dev/null +++ b/assets/start_scan_01-c88b8a36.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/create_team-e3e2cf05.png",a="/CodeAnalysis/assets/create_team_group-a704de08.png",e="/CodeAnalysis/assets/create_repo-d6d12fcc.png",t="/CodeAnalysis/assets/start_scan_01-0a970b25.png";export{s as _,a,e as b,t as c}; diff --git a/assets/start_scan_02-3fe00a0e.js b/assets/start_scan_02-3fe00a0e.js new file mode 100644 index 000000000..ed859d47f --- /dev/null +++ b/assets/start_scan_02-3fe00a0e.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/start_scan_02-cf8dcc61.png";export{s as _}; diff --git a/assets/start_scan_02-cf8dcc61.png b/assets/start_scan_02-cf8dcc61.png new file mode 100644 index 000000000..0b02dc7d0 Binary files /dev/null and b/assets/start_scan_02-cf8dcc61.png differ diff --git a/assets/start_scan_03-87d30568.png b/assets/start_scan_03-87d30568.png new file mode 100644 index 000000000..df2611126 Binary files /dev/null and b/assets/start_scan_03-87d30568.png differ diff --git a/assets/start_scan_03-f1dea0e4.js b/assets/start_scan_03-f1dea0e4.js new file mode 100644 index 000000000..b509d9f77 --- /dev/null +++ b/assets/start_scan_03-f1dea0e4.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/start_scan_03-87d30568.png";export{s as _}; diff --git a/assets/start_scan_04-263a94c3.png b/assets/start_scan_04-263a94c3.png new file mode 100644 index 000000000..f84b627dd Binary files /dev/null and b/assets/start_scan_04-263a94c3.png differ diff --git a/assets/start_scan_04-65ab4d48.js b/assets/start_scan_04-65ab4d48.js new file mode 100644 index 000000000..cbdd7a0aa --- /dev/null +++ b/assets/start_scan_04-65ab4d48.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/start_scan_06-2c5547b2.png",a="/CodeAnalysis/assets/start_scan_05-c09d1528.png",t="/CodeAnalysis/assets/start_scan_04-263a94c3.png";export{s as _,a,t as b}; diff --git a/assets/start_scan_05-c09d1528.png b/assets/start_scan_05-c09d1528.png new file mode 100644 index 000000000..881e3fe9c Binary files /dev/null and b/assets/start_scan_05-c09d1528.png differ diff --git a/assets/start_scan_06-2c5547b2.png b/assets/start_scan_06-2c5547b2.png new file mode 100644 index 000000000..eb9bfc436 Binary files /dev/null and b/assets/start_scan_06-2c5547b2.png differ diff --git a/assets/style-ab8d9291.css b/assets/style-ab8d9291.css new file mode 100644 index 000000000..8ea4e0ec7 --- /dev/null +++ b/assets/style-ab8d9291.css @@ -0,0 +1 @@ +:root{--back-to-top-z-index: 5;--back-to-top-color: #3eaf7c;--back-to-top-color-hover: #71cda3}.back-to-top{cursor:pointer;position:fixed;bottom:2rem;right:2.5rem;width:2rem;height:1.2rem;background-color:var(--back-to-top-color);-webkit-mask:url(/CodeAnalysis/assets/back-to-top-8efcbe56.svg) no-repeat;mask:url(/CodeAnalysis/assets/back-to-top-8efcbe56.svg) no-repeat;z-index:var(--back-to-top-z-index)}.back-to-top:hover{background-color:var(--back-to-top-color-hover)}@media (max-width: 959px){.back-to-top{display:none}}@media print{.back-to-top{display:none}}.back-to-top-enter-active,.back-to-top-leave-active{transition:opacity .3s}.back-to-top-enter-from,.back-to-top-leave-to{opacity:0}:root{--external-link-icon-color: #aaa}.external-link-icon{position:relative;display:inline-block;color:var(--external-link-icon-color);vertical-align:middle;top:-1px}@media print{.external-link-icon{display:none}}.external-link-icon-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}:root{--medium-zoom-z-index: 100;--medium-zoom-bg-color: #ffffff;--medium-zoom-opacity: 1}.medium-zoom-overlay{background-color:var(--medium-zoom-bg-color)!important;z-index:var(--medium-zoom-z-index)}.medium-zoom-overlay~img{z-index:calc(var(--medium-zoom-z-index) + 1)}.medium-zoom--opened .medium-zoom-overlay{opacity:var(--medium-zoom-opacity)}:root{--nprogress-color: #29d;--nprogress-z-index: 1031}#nprogress{pointer-events:none}#nprogress .bar{background:var(--nprogress-color);position:fixed;z-index:var(--nprogress-z-index);top:0;left:0;width:100%;height:2px}:root{--c-brand: #3eaf7c;--c-brand-light: #4abf8a;--c-bg: #ffffff;--c-bg-light: #f3f4f5;--c-bg-lighter: #eeeeee;--c-bg-dark: #ebebec;--c-bg-darker: #e6e6e6;--c-bg-navbar: var(--c-bg);--c-bg-sidebar: var(--c-bg);--c-bg-arrow: #cccccc;--c-text: #2c3e50;--c-text-accent: var(--c-brand);--c-text-light: #3a5169;--c-text-lighter: #4e6e8e;--c-text-lightest: #6a8bad;--c-text-quote: #999999;--c-border: #eaecef;--c-border-dark: #dfe2e5;--c-tip: #42b983;--c-tip-bg: var(--c-bg-light);--c-tip-title: var(--c-text);--c-tip-text: var(--c-text);--c-tip-text-accent: var(--c-text-accent);--c-warning: #ffc310;--c-warning-bg: #fffae3;--c-warning-bg-light: #fff3ba;--c-warning-bg-lighter: #fff0b0;--c-warning-border-dark: #f7dc91;--c-warning-details-bg: #fff5ca;--c-warning-title: #f1b300;--c-warning-text: #746000;--c-warning-text-accent: #edb100;--c-warning-text-light: #c1971c;--c-warning-text-quote: #ccab49;--c-danger: #f11e37;--c-danger-bg: #ffe0e0;--c-danger-bg-light: #ffcfde;--c-danger-bg-lighter: #ffc9c9;--c-danger-border-dark: #f1abab;--c-danger-details-bg: #ffd4d4;--c-danger-title: #ed1e2c;--c-danger-text: #660000;--c-danger-text-accent: #bd1a1a;--c-danger-text-light: #b5474d;--c-danger-text-quote: #c15b5b;--c-details-bg: #eeeeee;--c-badge-tip: var(--c-tip);--c-badge-warning: #ecc808;--c-badge-warning-text: var(--c-bg);--c-badge-danger: #dc2626;--c-badge-danger-text: var(--c-bg);--t-color: .3s ease;--t-transform: .3s ease;--code-bg-color: #282c34;--code-hl-bg-color: rgba(0, 0, 0, .66);--code-ln-color: #9e9e9e;--code-ln-wrapper-width: 3.5rem;--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--font-family-code: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;--navbar-height: 3.6rem;--navbar-padding-v: .7rem;--navbar-padding-h: 1.5rem;--sidebar-width: 20rem;--sidebar-width-mobile: calc(var(--sidebar-width) * .82);--content-width: 740px;--homepage-width: 960px}.back-to-top{--back-to-top-color: var(--c-brand);--back-to-top-color-hover: var(--c-brand-light)}.DocSearch{--docsearch-primary-color: var(--c-brand);--docsearch-text-color: var(--c-text);--docsearch-highlight-color: var(--c-brand);--docsearch-muted-color: var(--c-text-quote);--docsearch-container-background: rgba(9, 10, 17, .8);--docsearch-modal-background: var(--c-bg-light);--docsearch-searchbox-background: var(--c-bg-lighter);--docsearch-searchbox-focus-background: var(--c-bg);--docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand);--docsearch-hit-color: var(--c-text-light);--docsearch-hit-active-color: var(--c-bg);--docsearch-hit-background: var(--c-bg);--docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark);--docsearch-footer-background: var(--c-bg)}.external-link-icon{--external-link-icon-color: var(--c-text-quote)}.medium-zoom-overlay{--medium-zoom-bg-color: var(--c-bg)}#nprogress{--nprogress-color: var(--c-brand)}.pwa-popup{--pwa-popup-text-color: var(--c-text);--pwa-popup-bg-color: var(--c-bg);--pwa-popup-border-color: var(--c-brand);--pwa-popup-shadow: 0 4px 16px var(--c-brand);--pwa-popup-btn-text-color: var(--c-bg);--pwa-popup-btn-bg-color: var(--c-brand);--pwa-popup-btn-hover-bg-color: var(--c-brand-light)}.search-box{--search-bg-color: var(--c-bg);--search-accent-color: var(--c-brand);--search-text-color: var(--c-text);--search-border-color: var(--c-border);--search-item-text-color: var(--c-text-lighter);--search-item-focus-bg-color: var(--c-bg-light)}html.dark{--c-brand: #3aa675;--c-brand-light: #349469;--c-bg: #22272e;--c-bg-light: #2b313a;--c-bg-lighter: #262c34;--c-bg-dark: #343b44;--c-bg-darker: #37404c;--c-text: #adbac7;--c-text-light: #96a7b7;--c-text-lighter: #8b9eb0;--c-text-lightest: #8094a8;--c-border: #3e4c5a;--c-border-dark: #34404c;--c-tip: #318a62;--c-warning: #e0ad15;--c-warning-bg: #2d2f2d;--c-warning-bg-light: #423e2a;--c-warning-bg-lighter: #44442f;--c-warning-border-dark: #957c35;--c-warning-details-bg: #39392d;--c-warning-title: #fdca31;--c-warning-text: #d8d96d;--c-warning-text-accent: #ffbf00;--c-warning-text-light: #ddb84b;--c-warning-text-quote: #ccab49;--c-danger: #fc1e38;--c-danger-bg: #39232c;--c-danger-bg-light: #4b2b35;--c-danger-bg-lighter: #553040;--c-danger-border-dark: #a25151;--c-danger-details-bg: #482936;--c-danger-title: #fc2d3b;--c-danger-text: #ea9ca0;--c-danger-text-accent: #fd3636;--c-danger-text-light: #d9777c;--c-danger-text-quote: #d56b6b;--c-details-bg: #323843;--c-badge-warning: var(--c-warning);--c-badge-warning-text: #3c2e05;--c-badge-danger: var(--c-danger);--c-badge-danger-text: #401416;--code-hl-bg-color: #363b46}html.dark .DocSearch{--docsearch-logo-color: var(--c-text);--docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;--docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, .3);--docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21);--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, .5), 0 -4px 8px 0 rgba(0, 0, 0, .2)}html,body{padding:0;margin:0;background-color:var(--c-bg);transition:background-color var(--t-color)}html.dark{color-scheme:dark}html{font-size:16px}body{font-family:var(--font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1rem;color:var(--c-text)}a{font-weight:500;color:var(--c-text-accent);text-decoration:none;overflow-wrap:break-word}p a code{font-weight:400;color:var(--c-text-accent)}kbd{font-family:var(--font-family-code);color:var(--c-text);background:var(--c-bg-lighter);border:solid .15rem var(--c-border-dark);border-bottom:solid .25rem var(--c-border-dark);border-radius:.15rem;padding:0 .15em}code{font-family:var(--font-family-code);color:var(--c-text-lighter);padding:.25rem .5rem;margin:0;font-size:.85em;background-color:var(--c-bg-light);border-radius:3px;overflow-wrap:break-word;transition:background-color var(--t-color)}blockquote{font-size:1rem;color:var(--c-text-quote);border-left:.2rem solid var(--c-border-dark);margin:1rem 0;padding:.25rem 0 .25rem 1rem;overflow-wrap:break-word}blockquote>p{margin:0}ul,ol{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25;overflow-wrap:break-word}h1:focus-visible,h2:focus-visible,h3:focus-visible,h4:focus-visible,h5:focus-visible,h6:focus-visible{outline:none}h1:hover .header-anchor,h2:hover .header-anchor,h3:hover .header-anchor,h4:hover .header-anchor,h5:hover .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid var(--c-border);transition:border-color var(--t-color)}h3{font-size:1.35rem}h4{font-size:1.15rem}h5{font-size:1.05rem}h6{font-size:1rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media print{a.header-anchor{display:none}}a.header-anchor:hover{text-decoration:none}a.header-anchor:focus-visible{opacity:1}@media print{a[href^="http://"]:after,a[href^="https://"]:after{content:" (" attr(href) ") "}}p,ul,ol{line-height:1.7;overflow-wrap:break-word}hr{border:0;border-top:1px solid var(--c-border)}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto;transition:border-color var(--t-color)}tr{border-top:1px solid var(--c-border-dark);transition:border-color var(--t-color)}tr:nth-child(2n){background-color:var(--c-bg-light);transition:background-color var(--t-color)}tr:nth-child(2n) code{background-color:var(--c-bg-dark)}th,td{padding:.6em 1em;border:1px solid var(--c-border-dark);transition:border-color var(--t-color)}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:6px solid var(--c-bg-arrow)}.arrow.down{border-left:4px solid transparent;border-right:4px solid transparent;border-top:6px solid var(--c-bg-arrow)}.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:6px solid var(--c-bg-arrow)}.arrow.left{border-top:4px solid transparent;border-bottom:4px solid transparent;border-right:6px solid var(--c-bg-arrow)}.badge{display:inline-block;font-size:14px;font-weight:600;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:var(--c-bg);vertical-align:top;transition:color var(--t-color),background-color var(--t-color)}.badge.tip{background-color:var(--c-badge-tip)}.badge.warning{background-color:var(--c-badge-warning);color:var(--c-badge-warning-text)}.badge.danger{background-color:var(--c-badge-danger);color:var(--c-badge-danger-text)}.badge+.badge{margin-left:5px}code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:var(--font-family-code);font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#999}.token.punctuation{color:#ccc}.token.tag,.token.attr-name,.token.namespace,.token.deleted{color:#ec5975}.token.function-name{color:#6196cc}.token.boolean,.token.number,.token.function{color:#f08d49}.token.property,.token.class-name,.token.constant,.token.symbol{color:#f8c555}.token.selector,.token.important,.token.atrule,.token.keyword,.token.builtin{color:#cc99cd}.token.string,.token.char,.token.attr-value,.token.regex,.token.variable{color:#7ec699}.token.operator,.token.entity,.token.url{color:#67cdcc}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.375;padding:1.3rem 1.5rem;margin:.85rem 0;border-radius:6px;overflow:auto}.theme-default-content pre code,.theme-default-content pre[class*=language-] code{color:#fff;padding:0;background-color:transparent!important;border-radius:0;overflow-wrap:unset;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.theme-default-content .line-number{font-family:var(--font-family-code)}div[class*=language-]{position:relative;background-color:var(--code-bg-color);border-radius:6px}div[class*=language-]:before{content:attr(data-ext);position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:var(--code-ln-color)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent!important;position:relative;z-index:1}div[class*=language-] .highlight-lines{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.375}div[class*=language-] .highlight-lines .highlight-line{background-color:var(--code-hl-bg-color)}div[class*=language-]:not(.line-numbers-mode) .line-numbers{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlight-line{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlight-line:before{content:" ";position:absolute;z-index:2;left:0;top:0;display:block;width:var(--code-ln-wrapper-width);height:100%}div[class*=language-].line-numbers-mode pre{margin-left:var(--code-ln-wrapper-width);padding-left:1rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers{position:absolute;top:0;width:var(--code-ln-wrapper-width);text-align:center;color:var(--code-ln-color);padding-top:1.25rem;line-height:1.375;counter-reset:line-number}div[class*=language-].line-numbers-mode .line-numbers .line-number{position:relative;z-index:3;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:1.375em}div[class*=language-].line-numbers-mode .line-numbers .line-number:before{counter-increment:line-number;content:counter(line-number);font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;top:0;left:0;width:var(--code-ln-wrapper-width);height:100%;border-radius:6px 0 0 6px;border-right:1px solid var(--code-hl-bg-color)}@media (max-width: 419px){.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}.code-group__nav{margin-top:.85rem;margin-bottom:calc(-1.7rem - 6px);padding-bottom:calc(1.7rem - 6px);padding-left:10px;padding-top:10px;border-top-left-radius:6px;border-top-right-radius:6px;background-color:var(--code-bg-color)}.code-group__ul{margin:auto 0;padding-left:0;display:inline-flex;list-style:none}.code-group__nav-tab{border:0;padding:5px;cursor:pointer;background-color:transparent;font-size:.85em;line-height:1.4;color:#ffffffe6;font-weight:600}.code-group__nav-tab:focus{outline:none}.code-group__nav-tab:focus-visible{outline:1px solid rgba(255,255,255,.9)}.code-group__nav-tab-active{border-bottom:var(--c-brand) 1px solid}@media (max-width: 419px){.code-group__nav{margin-left:-1.5rem;margin-right:-1.5rem;border-radius:0}}.code-group-item{display:none}.code-group-item__active{display:block}.code-group-item>pre{background-color:orange}.custom-container{transition:color var(--t-color),border-color var(--t-color),background-color var(--t-color)}.custom-container .custom-container-title{font-weight:600}.custom-container .custom-container-title:not(:only-child){margin-bottom:-.4rem}.custom-container.tip,.custom-container.warning,.custom-container.danger{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-container.tip{border-color:var(--c-tip);background-color:var(--c-tip-bg);color:var(--c-tip-text)}.custom-container.tip .custom-container-title{color:var(--c-tip-title)}.custom-container.tip a{color:var(--c-tip-text-accent)}.custom-container.tip code{background-color:var(--c-bg-dark)}.custom-container.warning{border-color:var(--c-warning);background-color:var(--c-warning-bg);color:var(--c-warning-text)}.custom-container.warning .custom-container-title{color:var(--c-warning-title)}.custom-container.warning a{color:var(--c-warning-text-accent)}.custom-container.warning blockquote{border-left-color:var(--c-warning-border-dark);color:var(--c-warning-text-quote)}.custom-container.warning code{color:var(--c-warning-text-light);background-color:var(--c-warning-bg-light)}.custom-container.warning details{background-color:var(--c-warning-details-bg)}.custom-container.warning details code{background-color:var(--c-warning-bg-lighter)}.custom-container.warning .external-link-icon{--external-link-icon-color: var(--c-warning-text-quote)}.custom-container.danger{border-color:var(--c-danger);background-color:var(--c-danger-bg);color:var(--c-danger-text)}.custom-container.danger .custom-container-title{color:var(--c-danger-title)}.custom-container.danger a{color:var(--c-danger-text-accent)}.custom-container.danger blockquote{border-left-color:var(--c-danger-border-dark);color:var(--c-danger-text-quote)}.custom-container.danger code{color:var(--c-danger-text-light);background-color:var(--c-danger-bg-light)}.custom-container.danger details{background-color:var(--c-danger-details-bg)}.custom-container.danger details code{background-color:var(--c-danger-bg-lighter)}.custom-container.danger .external-link-icon{--external-link-icon-color: var(--c-danger-text-quote)}.custom-container.details{display:block;position:relative;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:var(--c-details-bg)}.custom-container.details code{background-color:var(--c-bg-darker)}.custom-container.details h4{margin-top:0}.custom-container.details figure:last-child,.custom-container.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-container.details summary{outline:none;cursor:pointer}.home{padding:var(--navbar-height) 2rem 0;max-width:var(--homepage-width);margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero h1,.home .hero .description,.home .hero .actions{margin:1.8rem auto}.home .hero .actions{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:var(--c-text-lightest)}.home .hero .action-button{display:inline-block;font-size:1.2rem;padding:.8rem 1.6rem;border-width:2px;border-style:solid;border-radius:4px;transition:background-color var(--t-color);box-sizing:border-box}.home .hero .action-button.primary{color:var(--c-bg);background-color:var(--c-brand);border-color:var(--c-brand)}.home .hero .action-button.primary:hover{background-color:var(--c-brand-light)}.home .hero .action-button.secondary{color:var(--c-brand);background-color:var(--c-bg);border-color:var(--c-brand)}.home .hero .action-button.secondary:hover{color:var(--c-bg);background-color:var(--c-brand-light)}.home .features{border-top:1px solid var(--c-border);transition:border-color var(--t-color);padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:var(--c-text-light)}.home .feature p{color:var(--c-text-lighter)}.home .theme-default-content{padding:0;margin:0}.home .footer{padding:2.5rem;border-top:1px solid var(--c-border);text-align:center;color:var(--c-text-lighter);transition:border-color var(--t-color)}@media (max-width: 719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width: 419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero h1,.home .hero .description,.home .hero .actions{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.page{padding-top:var(--navbar-height);padding-left:var(--sidebar-width)}.navbar{position:fixed;z-index:20;top:0;left:0;right:0;height:var(--navbar-height);box-sizing:border-box;border-bottom:1px solid var(--c-border);background-color:var(--c-bg-navbar);transition:background-color var(--t-color),border-color var(--t-color)}.sidebar{font-size:16px;width:var(--sidebar-width);position:fixed;z-index:10;margin:0;top:var(--navbar-height);left:0;bottom:0;box-sizing:border-box;border-right:1px solid var(--c-border);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--c-brand) var(--c-border);background-color:var(--c-bg-sidebar);transition:transform var(--t-transform),background-color var(--t-color),border-color var(--t-color)}.sidebar::-webkit-scrollbar{width:7px}.sidebar::-webkit-scrollbar-track{background-color:var(--c-border)}.sidebar::-webkit-scrollbar-thumb{background-color:var(--c-brand)}.sidebar-mask{position:fixed;z-index:9;top:0;left:0;width:100vw;height:100vh;display:none}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(1){transform:rotate(45deg) translate3d(5.5px,5.5px,0)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(2){transform:scale3d(0,1,1)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(3){transform:rotate(-45deg) translate3d(6px,-6px,0)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(1),.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(3){transform-origin:center}.theme-container.no-navbar .theme-default-content h1,.theme-container.no-navbar .theme-default-content h2,.theme-container.no-navbar .theme-default-content h3,.theme-container.no-navbar .theme-default-content h4,.theme-container.no-navbar .theme-default-content h5,.theme-container.no-navbar .theme-default-content h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .page{padding-top:0}.theme-container.no-navbar .sidebar{top:0}.theme-container.no-sidebar .sidebar{display:none}@media (max-width: 719px){.theme-container.no-sidebar .sidebar{display:block}}.theme-container.no-sidebar .page{padding-left:0}.theme-default-content a:hover{text-decoration:underline}.theme-default-content img{max-width:100%}.theme-default-content h1,.theme-default-content h2,.theme-default-content h3,.theme-default-content h4,.theme-default-content h5,.theme-default-content h6{margin-top:calc(.5rem - var(--navbar-height));padding-top:calc(1rem + var(--navbar-height));margin-bottom:0}.theme-default-content h1:first-child,.theme-default-content h2:first-child,.theme-default-content h3:first-child,.theme-default-content h4:first-child,.theme-default-content h5:first-child,.theme-default-content h6:first-child{margin-bottom:1rem}.theme-default-content h1:first-child+p,.theme-default-content h1:first-child+pre,.theme-default-content h1:first-child+.custom-container,.theme-default-content h2:first-child+p,.theme-default-content h2:first-child+pre,.theme-default-content h2:first-child+.custom-container,.theme-default-content h3:first-child+p,.theme-default-content h3:first-child+pre,.theme-default-content h3:first-child+.custom-container,.theme-default-content h4:first-child+p,.theme-default-content h4:first-child+pre,.theme-default-content h4:first-child+.custom-container,.theme-default-content h5:first-child+p,.theme-default-content h5:first-child+pre,.theme-default-content h5:first-child+.custom-container,.theme-default-content h6:first-child+p,.theme-default-content h6:first-child+pre,.theme-default-content h6:first-child+.custom-container{margin-top:2rem}@media (max-width: 959px){.sidebar{font-size:15px;width:var(--sidebar-width-mobile)}.page{padding-left:var(--sidebar-width-mobile)}}@media (max-width: 719px){.sidebar{top:0;padding-top:var(--navbar-height);transform:translate(-100%)}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translate(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width: 419px){h1{font-size:1.9rem}}.navbar{--navbar-line-height: calc( var(--navbar-height) - 2 * var(--navbar-padding-v) );padding:var(--navbar-padding-v) var(--navbar-padding-h);line-height:var(--navbar-line-height)}.navbar .logo{height:var(--navbar-line-height);margin-right:var(--navbar-padding-v);vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:var(--c-text);position:relative}.navbar .navbar-items-wrapper{display:flex;position:absolute;box-sizing:border-box;top:var(--navbar-padding-v);right:var(--navbar-padding-h);height:var(--navbar-line-height);padding-left:var(--navbar-padding-h);white-space:nowrap;font-size:.9rem}.navbar .navbar-items-wrapper .search-box{flex:0 0 auto;vertical-align:top}@media screen and (max-width: 719px){.navbar{padding-left:4rem}.navbar .site-name{display:block;width:calc(100vw - 11rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.navbar .can-hide{display:none}}.navbar-items{display:inline-block}@media print{.navbar-items{display:none}}.navbar-items a{display:inline-block;line-height:1.4rem;color:inherit}.navbar-items a:hover,.navbar-items a.router-link-active{color:var(--c-text)}.navbar-items .navbar-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:var(--navbar-line-height)}.navbar-items .navbar-item:first-child{margin-left:0}.navbar-items .navbar-item>a:hover,.navbar-items .navbar-item>a.router-link-active{margin-bottom:-2px;border-bottom:2px solid var(--c-text-accent)}@media (max-width: 719px){.navbar-items .navbar-item{margin-left:0}.navbar-items .navbar-item>a:hover,.navbar-items .navbar-item>a.router-link-active{margin-bottom:0;border-bottom:none}.navbar-items a:hover,.navbar-items a.router-link-active{color:var(--c-text-accent)}}.toggle-sidebar-button{position:absolute;top:.6rem;left:1rem;display:none;padding:.6rem;cursor:pointer}.toggle-sidebar-button .icon{display:flex;flex-direction:column;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;cursor:inherit}.toggle-sidebar-button .icon span{display:inline-block;width:100%;height:2px;border-radius:2px;background-color:var(--c-text);transition:transform var(--t-transform)}.toggle-sidebar-button .icon span:nth-child(2){margin:6px 0}@media screen and (max-width: 719px){.toggle-sidebar-button{display:block}}.toggle-color-mode-button{display:flex;margin:auto;margin-left:1rem;border:0;background:none;color:var(--c-text);opacity:.8;cursor:pointer}@media print{.toggle-color-mode-button{display:none}}.toggle-color-mode-button:hover{opacity:1}.toggle-color-mode-button .icon{width:1.25rem;height:1.25rem}.DocSearch{transition:background-color var(--t-color)}.navbar-dropdown-wrapper{cursor:pointer}.navbar-dropdown-wrapper .navbar-dropdown-title,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:var(--c-text)}.navbar-dropdown-wrapper .navbar-dropdown-title:hover,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile:hover{border-color:transparent}.navbar-dropdown-wrapper .navbar-dropdown-title .arrow,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:none;font-weight:600;font-size:inherit}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile:hover{color:var(--c-text-accent)}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item{color:inherit;line-height:1.7rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle{margin:.45rem 0 0;border-top:1px solid var(--c-border);padding:1rem 0 .45rem;font-size:.9rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>span{padding:0 1.5rem 0 1.25rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>a{font-weight:inherit}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>a.router-link-active:after{display:none}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem-wrapper{padding:0;list-style:none}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem-wrapper .navbar-dropdown-subitem{font-size:.9em}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a:hover,.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active{color:var(--c-text-accent)}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid var(--c-text-accent);border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item:first-child .navbar-dropdown-subtitle{margin-top:0;padding-top:0;border-top:0}.navbar-dropdown-wrapper.mobile.open .navbar-dropdown-title,.navbar-dropdown-wrapper.mobile.open .navbar-dropdown-title-mobile{margin-bottom:.5rem}.navbar-dropdown-wrapper.mobile .navbar-dropdown-title,.navbar-dropdown-wrapper.mobile .navbar-dropdown-title-mobile{display:none}.navbar-dropdown-wrapper.mobile .navbar-dropdown-title-mobile{display:block}.navbar-dropdown-wrapper.mobile .navbar-dropdown{transition:height .1s ease-out;overflow:hidden}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle{border-top:0;margin-top:0;padding-top:0;padding-bottom:0}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle,.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item>a{font-size:15px;line-height:2rem}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem{font-size:14px;padding-left:1rem}.navbar-dropdown-wrapper:not(.mobile){height:1.8rem}.navbar-dropdown-wrapper:not(.mobile):hover .navbar-dropdown,.navbar-dropdown-wrapper:not(.mobile).open .navbar-dropdown{display:block!important}.navbar-dropdown-wrapper:not(.mobile).open:blur{display:none}.navbar-dropdown-wrapper:not(.mobile) .navbar-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:var(--c-bg-navbar);padding:.6rem 0;border:1px solid var(--c-border);border-bottom-color:var(--c-border-dark);text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}.page{padding-bottom:2rem;display:block}.page .theme-default-content{max-width:var(--content-width);margin:0 auto;padding:2rem 2.5rem;padding-top:0}@media (max-width: 959px){.page .theme-default-content{padding:2rem}}@media (max-width: 419px){.page .theme-default-content{padding:1.5rem}}.page-meta{max-width:var(--content-width);margin:0 auto;padding:1rem 2.5rem;overflow:auto}@media (max-width: 959px){.page-meta{padding:2rem}}@media (max-width: 419px){.page-meta{padding:1.5rem}}.page-meta .meta-item{cursor:default;margin-top:.8rem}.page-meta .meta-item .meta-item-label{font-weight:500;color:var(--c-text-lighter)}.page-meta .meta-item .meta-item-info{font-weight:400;color:var(--c-text-quote)}.page-meta .edit-link{display:inline-block;margin-right:.25rem}@media print{.page-meta .edit-link{display:none}}.page-meta .last-updated{float:right}@media (max-width: 719px){.page-meta .last-updated{font-size:.8em;float:none}.page-meta .contributors{font-size:.8em}}.page-nav{max-width:var(--content-width);margin:0 auto;padding:1rem 2.5rem 2rem;padding-bottom:0}@media (max-width: 959px){.page-nav{padding:2rem}}@media (max-width: 419px){.page-nav{padding:1.5rem}}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid var(--c-border);transition:border-color var(--t-color);padding-top:1rem;overflow:auto}.page-nav .prev a:before{content:"←"}.page-nav .next{float:right}.page-nav .next a:after{content:"→"}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .navbar-items{display:none;border-bottom:1px solid var(--c-border);transition:border-color var(--t-color);padding:.5rem 0 .75rem}.sidebar .navbar-items a{font-weight:600}.sidebar .navbar-items .navbar-item{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar .sidebar-items{padding:1.5rem 0}@media (max-width: 719px){.sidebar .navbar-items{display:block}.sidebar .navbar-items .navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar .sidebar-items{padding:1rem 0}}.sidebar-item{cursor:default;border-left:.25rem solid transparent;color:var(--c-text)}.sidebar-item:focus-visible{outline-width:1px;outline-offset:-1px}.sidebar-item.active:not(p.sidebar-heading){font-weight:600;color:var(--c-text-accent);border-left-color:var(--c-text-accent)}.sidebar-item.sidebar-heading{transition:color .15s ease;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0}.sidebar-item.sidebar-heading+.sidebar-item-children{transition:height .1s ease-out;overflow:hidden;margin-bottom:.75rem}.sidebar-item.collapsible{cursor:pointer}.sidebar-item.collapsible .arrow{position:relative;top:-.12em;left:.5em}.sidebar-item:not(.sidebar-heading){font-size:1em;font-weight:400;display:inline-block;margin:0;padding:.35rem 1rem .35rem 2rem;line-height:1.4;width:100%;box-sizing:border-box}.sidebar-item:not(.sidebar-heading)+.sidebar-item-children{padding-left:1rem;font-size:.95em}.sidebar-item-children .sidebar-item-children .sidebar-item:not(.sidebar-heading){padding:.25rem 1rem .25rem 1.75rem}.sidebar-item-children .sidebar-item-children .sidebar-item:not(.sidebar-heading).active{font-weight:500;border-left-color:transparent}a.sidebar-heading+.sidebar-item-children .sidebar-item:not(.sidebar-heading).active{border-left-color:transparent}a.sidebar-item{cursor:pointer}a.sidebar-item:hover{color:var(--c-text-accent)}.table-of-contents .badge{vertical-align:middle}.dropdown-enter-from,.dropdown-leave-to{height:0!important}.fade-slide-y-enter-active{transition:all .2s ease}.fade-slide-y-leave-active{transition:all .2s cubic-bezier(1,.5,.8,1)}.fade-slide-y-enter-from,.fade-slide-y-leave-to{transform:translateY(10px);opacity:0}:root{scroll-behavior:smooth;--c-brand: #176de6;--c-brand-light: #257efa}:root .home .hero .description{font-size:18px}html.dark{--c-brand: #257efa;--c-brand-light: #176de6}.home .hero img{max-height:200px}:root{--search-bg-color: #ffffff;--search-accent-color: #3eaf7c;--search-text-color: #2c3e50;--search-border-color: #eaecef;--search-item-text-color: #5d81a5;--search-item-focus-bg-color: #f3f4f5;--search-input-width: 8rem;--search-result-width: 20rem}.search-box{display:inline-block;position:relative;margin-left:1rem}@media print{.search-box{display:none}}.search-box input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:text;width:var(--search-input-width);height:2rem;color:var(--search-text-color);display:inline-block;border:1px solid var(--search-border-color);border-radius:2rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;transition:all ease .3s;background:var(--search-bg-color) url(/CodeAnalysis/assets/search-0782d0d1.svg) .6rem .5rem no-repeat;background-size:1rem}.search-box input:focus{cursor:auto;border-color:var(--search-accent-color)}.search-box .suggestions{background:var(--search-bg-color);width:var(--search-result-width);position:absolute;top:2rem;right:0;border:1px solid var(--search-border-color);border-radius:6px;padding:.4rem;list-style-type:none}.search-box .suggestion{line-height:1.4;padding:.4rem .6rem;border-radius:4px;cursor:pointer}.search-box .suggestion.focus{background-color:var(--search-item-focus-bg-color)}.search-box .suggestion.focus a{color:var(--search-accent-color)}.search-box .suggestion a{white-space:normal;color:var(--search-item-text-color)}.search-box .suggestion .page-title{font-weight:600}.search-box .suggestion .page-header{font-size:.9em;margin-left:.25em}@media (max-width: 719px){.search-box input{cursor:pointer;width:0;border-color:transparent;position:relative}.search-box input:focus{cursor:text;left:0;width:10rem}}@media (max-width: 419px){.search-box input:focus{width:8rem}.search-box .suggestions{width:calc(100vw - 4rem);right:-.5rem}} diff --git a/assets/team_member-8942b2d5.js b/assets/team_member-8942b2d5.js new file mode 100644 index 000000000..467aa7b3e --- /dev/null +++ b/assets/team_member-8942b2d5.js @@ -0,0 +1 @@ +const s="/CodeAnalysis/assets/team_member-e8f39fb8.png";export{s as _}; diff --git a/assets/team_member-e8f39fb8.png b/assets/team_member-e8f39fb8.png new file mode 100644 index 000000000..6a6babb95 Binary files /dev/null and b/assets/team_member-e8f39fb8.png differ diff --git a/assets/test_case_verify_go.html-15d53988.js b/assets/test_case_verify_go.html-15d53988.js new file mode 100644 index 000000000..9990d4c80 --- /dev/null +++ b/assets/test_case_verify_go.html-15d53988.js @@ -0,0 +1,10 @@ +import{_ as i,r as s,o as t,c as d,a as e,b as a,d as r,e as o}from"./app-2a91d8ab.js";const c={},l=o(`

    【Go】单元测试有效性验证

    背景

    单元测试是用来对一个模块、一个函数或者一个类来进行正确性检验的测试工作。也是提升现网质量的最广泛最简单有效的方式。

    但是在实际开发工作中,由于工作繁忙而遗漏或缺乏对单元测试的正确认识,有些开发盲目追求高覆盖率,没有对单元测试做断言,这样的单元测试用例属于无效用例。 为了检测此类无效用例,业务侧找来了代码分析介入,进行单元测试有效性验证。

    需求

    • 判断一个单元测试用例中是否存在断言。

    示例

    // Bad case
    +func Test_Demo1(t *testing.T) {
    +}
    +
    +
    +// Good case
    +func Test_Demo2(t *testing.T) {
    +    assert.NoError(t, err)
    +}
    +

    快速体验

    TCA 现已支持 Go 语言的单元测试有效行验证,可以在 TCA 分析方案中搜索勾选以下规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 -> 单元测试有效性验证 -> 启用/查看规则

    支持框架

    `,13),h=e("li",null,"Go语言官方单测框架testing",-1),u={href:"https://github.com/stretchr/testify",target:"_blank",rel:"noopener noreferrer"},_={href:"https://github.com/smartystreets/goconvey",target:"_blank",rel:"noopener noreferrer"},v=e("h3",{id:"扩展",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#扩展","aria-hidden":"true"},"#"),a(" 扩展")],-1),f=e("p",null,"更多语言更多单元测试框架支持,欢迎提 issue 进行咨询扩展。",-1);function m(b,g){const n=s("ExternalLinkIcon");return t(),d("div",null,[l,e("ul",null,[h,e("li",null,[e("a",u,[a("testify"),r(n)])]),e("li",null,[e("a",_,[a("goconvey"),r(n)])])]),v,f])}const x=i(c,[["render",m],["__file","test_case_verify_go.html.vue"]]);export{x as default}; diff --git a/assets/test_case_verify_go.html-2211e0d9.js b/assets/test_case_verify_go.html-2211e0d9.js new file mode 100644 index 000000000..dcf5c0fb7 --- /dev/null +++ b/assets/test_case_verify_go.html-2211e0d9.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-f8f08cc2","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go.html","title":"【Go】单元测试有效性验证","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"背景","slug":"背景","link":"#背景","children":[]},{"level":2,"title":"需求","slug":"需求","link":"#需求","children":[{"level":3,"title":"示例","slug":"示例","link":"#示例","children":[]}]},{"level":2,"title":"快速体验","slug":"快速体验","link":"#快速体验","children":[{"level":3,"title":"启用规则包","slug":"启用规则包","link":"#启用规则包","children":[]},{"level":3,"title":"支持框架","slug":"支持框架","link":"#支持框架","children":[]},{"level":3,"title":"扩展","slug":"扩展","link":"#扩展","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/规则包/test_case_verify_go.md"}');export{e as data}; diff --git a/assets/test_case_verify_go.html-704e2cfd.js b/assets/test_case_verify_go.html-704e2cfd.js new file mode 100644 index 000000000..e9b505404 --- /dev/null +++ b/assets/test_case_verify_go.html-704e2cfd.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-87c47fb8","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E8%A7%84%E5%88%99%E5%8C%85/test_case_verify_go.html","title":"【Go】单元测试有效性验证","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"背景","slug":"背景","link":"#背景","children":[]},{"level":2,"title":"需求","slug":"需求","link":"#需求","children":[{"level":3,"title":"示例","slug":"示例","link":"#示例","children":[]}]},{"level":2,"title":"快速体验","slug":"快速体验","link":"#快速体验","children":[{"level":3,"title":"启用规则包","slug":"启用规则包","link":"#启用规则包","children":[]},{"level":3,"title":"支持框架","slug":"支持框架","link":"#支持框架","children":[]},{"level":3,"title":"扩展","slug":"扩展","link":"#扩展","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/规则包/test_case_verify_go.md"}');export{e as data}; diff --git a/assets/test_case_verify_go.html-bb4607bd.js b/assets/test_case_verify_go.html-bb4607bd.js new file mode 100644 index 000000000..9990d4c80 --- /dev/null +++ b/assets/test_case_verify_go.html-bb4607bd.js @@ -0,0 +1,10 @@ +import{_ as i,r as s,o as t,c as d,a as e,b as a,d as r,e as o}from"./app-2a91d8ab.js";const c={},l=o(`

    【Go】单元测试有效性验证

    背景

    单元测试是用来对一个模块、一个函数或者一个类来进行正确性检验的测试工作。也是提升现网质量的最广泛最简单有效的方式。

    但是在实际开发工作中,由于工作繁忙而遗漏或缺乏对单元测试的正确认识,有些开发盲目追求高覆盖率,没有对单元测试做断言,这样的单元测试用例属于无效用例。 为了检测此类无效用例,业务侧找来了代码分析介入,进行单元测试有效性验证。

    需求

    • 判断一个单元测试用例中是否存在断言。

    示例

    // Bad case
    +func Test_Demo1(t *testing.T) {
    +}
    +
    +
    +// Good case
    +func Test_Demo2(t *testing.T) {
    +    assert.NoError(t, err)
    +}
    +

    快速体验

    TCA 现已支持 Go 语言的单元测试有效行验证,可以在 TCA 分析方案中搜索勾选以下规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 -> 单元测试有效性验证 -> 启用/查看规则

    支持框架

    `,13),h=e("li",null,"Go语言官方单测框架testing",-1),u={href:"https://github.com/stretchr/testify",target:"_blank",rel:"noopener noreferrer"},_={href:"https://github.com/smartystreets/goconvey",target:"_blank",rel:"noopener noreferrer"},v=e("h3",{id:"扩展",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#扩展","aria-hidden":"true"},"#"),a(" 扩展")],-1),f=e("p",null,"更多语言更多单元测试框架支持,欢迎提 issue 进行咨询扩展。",-1);function m(b,g){const n=s("ExternalLinkIcon");return t(),d("div",null,[l,e("ul",null,[h,e("li",null,[e("a",u,[a("testify"),r(n)])]),e("li",null,[e("a",_,[a("goconvey"),r(n)])])]),v,f])}const x=i(c,[["render",m],["__file","test_case_verify_go.html.vue"]]);export{x as default}; diff --git a/assets/user_token-63a816bc.png b/assets/user_token-63a816bc.png new file mode 100644 index 000000000..3558b2d55 Binary files /dev/null and b/assets/user_token-63a816bc.png differ diff --git a/assets/web.html-1b03934f.js b/assets/web.html-1b03934f.js new file mode 100644 index 000000000..3eda4b3d3 --- /dev/null +++ b/assets/web.html-1b03934f.js @@ -0,0 +1,14 @@ +import{_ as c,r as s,o as r,c as d,a as e,b as a,d as o,e as t}from"./app-2a91d8ab.js";const i={},l=e("h1",{id:"tca-web",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#tca-web","aria-hidden":"true"},"#"),a(" TCA Web")],-1),p=e("h2",{id:"工程结构",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#工程结构","aria-hidden":"true"},"#"),a(" 工程结构")],-1),h={href:"https://www.lernajs.cn/",target:"_blank",rel:"noopener noreferrer"},u=e("code",null,"monorepo",-1),m={class:"custom-container tip"},v=e("p",{class:"custom-container-title"},"TIP",-1),b={href:"https://github.com/lerna/lerna",target:"_blank",rel:"noopener noreferrer"},_={href:"http://www.febeacon.com/lerna-docs-zh-cn/",target:"_blank",rel:"noopener noreferrer"},g=t(`

    frameworklogintca-layouttca-analysistca-manage微前端以及tca-document前端帮助文档组成。

    packages 目录说明

    • shared: 公共模块

    • framework: 微前端基座

    • login: 登录微前端

    • tca-layout: 腾讯云代码分析layout微前端

    • tca-analysis: 腾讯云代码分析analysis微前端

    • tca-manage: 腾讯云代码分析后台管理微前端

    • tca-document: 腾讯云代码分析帮助文档

    基于构建后资源部署(tca-deploy-source)

    已将当前版本各个微前端构建打包到此目录,可通过阅读该目录下的 README 直接进行前端部署。

    基于开发模式启动

    • 按上一节完成一套 TCA Web 部署

    • 根据要调整的内容,启动对应的微前端(login、tca-layout、tca-analysis),具体可进入不同 package 参考阅读其目录下的 README 进行开发。

    其他

    • 根目录下启动单个项目

      # framework
      +yarn dev --scope framework
      +# login
      +PUBLIC_PATH=http://127.0.0.1:5055/ yarn dev --scope login
      +# tca-layout
      +PUBLIC_PATH=http://127.0.0.1:5056/ yarn dev --scope tca-layout
      +# tca-analysis
      +PUBLIC_PATH=http://127.0.0.1:5057/ yarn dev --scope tca-analysis
      +# tca-manage
      +PUBLIC_PATH=http://127.0.0.1:5058/ yarn dev --scope tca-manage
      +# tca-document
      +yarn dev --scope tca-document
      +# 或进入对应项目内,查阅对应README
      +

    本地开发后构建部署

    • 如对项目进行变更,本地开发结束后,需要部署最新资源可通过执行 sh build-source.sh 将构建后资源更新到tca-deploy-source 目录内,再参考该目录下的 README 直接进行前端更新/重新部署操作。

    • 可通过阅读 build-source.sh 内容,以及 tca-deploy-source 目录下的 README,用户可根据需要自行进行前端部署。

    `,11);function f(y,k){const n=s("ExternalLinkIcon");return r(),d("div",null,[l,p,e("p",null,[a("TCA Web 采用 "),e("a",h,[a("Lerna"),o(n)]),a(" 进行 "),u,a(" 管理。")]),e("div",m,[v,e("p",null,[e("a",b,[a("Lerna GitHub地址"),o(n)])]),e("p",null,[e("a",_,[a("Lerna 中文命令文档"),o(n)])])]),g])}const x=c(i,[["render",f],["__file","web.html.vue"]]);export{x as default}; diff --git a/assets/web.html-49abd215.js b/assets/web.html-49abd215.js new file mode 100644 index 000000000..70fd462b8 --- /dev/null +++ b/assets/web.html-49abd215.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-641bec60","path":"/en/guide/web/web.html","title":"TCA Web","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"工程结构","slug":"工程结构","link":"#工程结构","children":[{"level":3,"title":"packages 目录说明","slug":"packages-目录说明","link":"#packages-目录说明","children":[]}]},{"level":2,"title":"基于构建后资源部署(tca-deploy-source)","slug":"基于构建后资源部署-tca-deploy-source","link":"#基于构建后资源部署-tca-deploy-source","children":[]},{"level":2,"title":"基于开发模式启动","slug":"基于开发模式启动","link":"#基于开发模式启动","children":[]},{"level":2,"title":"本地开发后构建部署","slug":"本地开发后构建部署","link":"#本地开发后构建部署","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/web/web.md"}');export{e as data}; diff --git a/assets/web.html-c0b4826b.js b/assets/web.html-c0b4826b.js new file mode 100644 index 000000000..8defd4436 --- /dev/null +++ b/assets/web.html-c0b4826b.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0245ec8a","path":"/zh/guide/web/web.html","title":"TCA Web","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"工程结构","slug":"工程结构","link":"#工程结构","children":[{"level":3,"title":"packages 目录说明","slug":"packages-目录说明","link":"#packages-目录说明","children":[]}]},{"level":2,"title":"基于构建后资源部署(tca-deploy-source)","slug":"基于构建后资源部署-tca-deploy-source","link":"#基于构建后资源部署-tca-deploy-source","children":[]},{"level":2,"title":"基于开发模式启动","slug":"基于开发模式启动","link":"#基于开发模式启动","children":[]},{"level":2,"title":"本地开发后构建部署","slug":"本地开发后构建部署","link":"#本地开发后构建部署","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/web/web.md"}');export{e as data}; diff --git a/assets/web.html-d1b22ea4.js b/assets/web.html-d1b22ea4.js new file mode 100644 index 000000000..98061a3e2 --- /dev/null +++ b/assets/web.html-d1b22ea4.js @@ -0,0 +1,14 @@ +import{_ as c,r as s,o as r,c as d,a as e,b as a,d as o,e as t}from"./app-2a91d8ab.js";const i={},l=e("h1",{id:"tca-web",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#tca-web","aria-hidden":"true"},"#"),a(" TCA Web")],-1),p=e("h2",{id:"工程结构",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#工程结构","aria-hidden":"true"},"#"),a(" 工程结构")],-1),h={href:"https://www.lernajs.cn/",target:"_blank",rel:"noopener noreferrer"},u=e("code",null,"monorepo",-1),m={class:"custom-container tip"},v=e("p",{class:"custom-container-title"},"提示",-1),b={href:"https://github.com/lerna/lerna",target:"_blank",rel:"noopener noreferrer"},_={href:"http://www.febeacon.com/lerna-docs-zh-cn/",target:"_blank",rel:"noopener noreferrer"},g=t(`

    frameworklogintca-layouttca-analysistca-manage微前端以及tca-document前端帮助文档组成。

    packages 目录说明

    • shared: 公共模块

    • framework: 微前端基座

    • login: 登录微前端

    • tca-layout: 腾讯云代码分析layout微前端

    • tca-analysis: 腾讯云代码分析analysis微前端

    • tca-manage: 腾讯云代码分析后台管理微前端

    • tca-document: 腾讯云代码分析帮助文档

    基于构建后资源部署(tca-deploy-source)

    已将当前版本各个微前端构建打包到此目录,可通过阅读该目录下的 README 直接进行前端部署。

    基于开发模式启动

    • 按上一节完成一套 TCA Web 部署

    • 根据要调整的内容,启动对应的微前端(login、tca-layout、tca-analysis),具体可进入不同 package 参考阅读其目录下的 README 进行开发。

    其他

    • 根目录下启动单个项目

      # framework
      +yarn dev --scope framework
      +# login
      +PUBLIC_PATH=http://127.0.0.1:5055/ yarn dev --scope login
      +# tca-layout
      +PUBLIC_PATH=http://127.0.0.1:5056/ yarn dev --scope tca-layout
      +# tca-analysis
      +PUBLIC_PATH=http://127.0.0.1:5057/ yarn dev --scope tca-analysis
      +# tca-manage
      +PUBLIC_PATH=http://127.0.0.1:5058/ yarn dev --scope tca-manage
      +# tca-document
      +yarn dev --scope tca-document
      +# 或进入对应项目内,查阅对应README
      +

    本地开发后构建部署

    • 如对项目进行变更,本地开发结束后,需要部署最新资源可通过执行 sh build-source.sh 将构建后资源更新到tca-deploy-source 目录内,再参考该目录下的 README 直接进行前端更新/重新部署操作。

    • 可通过阅读 build-source.sh 内容,以及 tca-deploy-source 目录下的 README,用户可根据需要自行进行前端部署。

    `,11);function f(y,k){const n=s("ExternalLinkIcon");return r(),d("div",null,[l,p,e("p",null,[a("TCA Web 采用 "),e("a",h,[a("Lerna"),o(n)]),a(" 进行 "),u,a(" 管理。")]),e("div",m,[v,e("p",null,[e("a",b,[a("Lerna GitHub地址"),o(n)])]),e("p",null,[e("a",_,[a("Lerna 中文命令文档"),o(n)])])]),g])}const x=c(i,[["render",f],["__file","web.html.vue"]]);export{x as default}; diff --git "a/assets/\344\270\252\344\272\272\344\273\244\347\211\214.html-546ba7e4.js" "b/assets/\344\270\252\344\272\272\344\273\244\347\211\214.html-546ba7e4.js" new file mode 100644 index 000000000..6b0e4a865 --- /dev/null +++ "b/assets/\344\270\252\344\272\272\344\273\244\347\211\214.html-546ba7e4.js" @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-67ff15d4","path":"/zh/guide/%E4%B8%AA%E4%BA%BA%E4%B8%AD%E5%BF%83/%E4%B8%AA%E4%BA%BA%E4%BB%A4%E7%89%8C.html","title":"个人令牌说明","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/个人中心/个人令牌.md"}');export{t as data}; diff --git "a/assets/\344\270\252\344\272\272\344\273\244\347\211\214.html-aa4ca908.js" "b/assets/\344\270\252\344\272\272\344\273\244\347\211\214.html-aa4ca908.js" new file mode 100644 index 000000000..c947b39c5 --- /dev/null +++ "b/assets/\344\270\252\344\272\272\344\273\244\347\211\214.html-aa4ca908.js" @@ -0,0 +1 @@ +import{_ as r,r as s,o as l,c as E,a as e,b as n,d as t}from"./app-2a91d8ab.js";const a="/CodeAnalysis/assets/user_token-63a816bc.png",_={},c=e("h1",{id:"个人令牌说明",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#个人令牌说明","aria-hidden":"true"},"#"),n(" 个人令牌说明")],-1),i={href:"/zh/api/",target:"_blank",rel:"noopener noreferrer"},h=e("p",null,[e("img",{src:a,alt:"个人令牌"})],-1),d=e("p",null,"出于安全性考虑,腾讯云代码分析平台支持用户主动刷新个人Token。",-1),A={class:"custom-container warning"},u=e("p",{class:"custom-container-title"},"注意",-1),B=e("p",null,"刷新Token后,需要更新所有用到旧Token的配置,并重启服务。",-1),p=e("p",null,"可能需要更新的位置包括:",-1),f={href:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html#%E5%88%86%E6%9E%90%E9%85%8D%E7%BD%AE",target:"_blank",rel:"noopener noreferrer"},m={href:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html#%E5%88%86%E6%9E%90%E9%85%8D%E7%BD%AE",target:"_blank",rel:"noopener noreferrer"},g={href:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html#%E8%8A%82%E7%82%B9%E9%85%8D%E7%BD%AE",target:"_blank",rel:"noopener noreferrer"},k={href:"/zh/api/#%E6%8E%A5%E5%8F%A3%E9%89%B4%E6%9D%83%E6%96%B9%E5%BC%8F",target:"_blank",rel:"noopener noreferrer"};function C(b,x){const o=s("ExternalLinkIcon");return l(),E("div",null,[c,e("p",null,[n("个人访问令牌可用于访问"),e("a",i,[n("腾讯云代码分析 API"),t(o)]),n("和启动客户端分析。")]),h,d,e("div",A,[u,B,p,e("ul",null,[e("li",null,[n("客户端codedog.ini配置("),e("a",f,[n("详细说明"),t(o)]),n(")")]),e("li",null,[n("客户端config.ini配置("),e("a",m,[n("详细说明"),t(o)]),n(")")]),e("li",null,[n("客户端节点命令行启动参数("),e("a",g,[n("详细说明"),t(o)]),n(")")]),e("li",null,[n("调用腾讯云代码分析API的请求头部参数("),e("a",k,[n("详细说明"),t(o)]),n(")")])])])])}const z=r(_,[["render",C],["__file","个人令牌.html.vue"]]);export{z as default}; diff --git "a/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-1d4edd49.js" "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-1d4edd49.js" new file mode 100644 index 000000000..72fb765da --- /dev/null +++ "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-1d4edd49.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-34e7f038","path":"/en/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"代码度量数据管理","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"查看指定项目的圈复杂度文件列表","slug":"查看指定项目的圈复杂度文件列表","link":"#查看指定项目的圈复杂度文件列表","children":[]},{"level":2,"title":"查看指定项目的圈复杂度文件问题列表","slug":"查看指定项目的圈复杂度文件问题列表","link":"#查看指定项目的圈复杂度文件问题列表","children":[]},{"level":2,"title":"查看指定项目的圈复杂度问题列表","slug":"查看指定项目的圈复杂度问题列表","link":"#查看指定项目的圈复杂度问题列表","children":[]},{"level":2,"title":"查看指定项目指定扫描的圈复杂度文件列表","slug":"查看指定项目指定扫描的圈复杂度文件列表","link":"#查看指定项目指定扫描的圈复杂度文件列表","children":[]},{"level":2,"title":"查看指定项目指定扫描的圈复杂度文件问题列表","slug":"查看指定项目指定扫描的圈复杂度文件问题列表","link":"#查看指定项目指定扫描的圈复杂度文件问题列表","children":[]},{"level":2,"title":"查看指定项目指定扫描的圈复杂度问题列表","slug":"查看指定项目指定扫描的圈复杂度问题列表","link":"#查看指定项目指定扫描的圈复杂度问题列表","children":[]},{"level":2,"title":"查看指定项目的重复文件列表","slug":"查看指定项目的重复文件列表","link":"#查看指定项目的重复文件列表","children":[]},{"level":2,"title":"查看指定项目的指定重复文件","slug":"查看指定项目的指定重复文件","link":"#查看指定项目的指定重复文件","children":[]},{"level":2,"title":"查看指定项目的指定文件的重复块列表","slug":"查看指定项目的指定文件的重复块列表","link":"#查看指定项目的指定文件的重复块列表","children":[]},{"level":2,"title":"查看指定项目的文件行数列表","slug":"查看指定项目的文件行数列表","link":"#查看指定项目的文件行数列表","children":[]},{"level":2,"title":"查看指定项目的语言列表","slug":"查看指定项目的语言列表","link":"#查看指定项目的语言列表","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/api/代码度量数据模块接口.md"}');export{l as data}; diff --git "a/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-52fdc1e8.js" "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-52fdc1e8.js" new file mode 100644 index 000000000..c812a4bd1 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-52fdc1e8.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-3f0143e9","path":"/zh/api/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"代码度量数据管理","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"查看指定项目的圈复杂度文件列表","slug":"查看指定项目的圈复杂度文件列表","link":"#查看指定项目的圈复杂度文件列表","children":[]},{"level":2,"title":"查看指定项目的圈复杂度文件问题列表","slug":"查看指定项目的圈复杂度文件问题列表","link":"#查看指定项目的圈复杂度文件问题列表","children":[]},{"level":2,"title":"查看指定项目的圈复杂度问题列表","slug":"查看指定项目的圈复杂度问题列表","link":"#查看指定项目的圈复杂度问题列表","children":[]},{"level":2,"title":"查看指定项目指定扫描的圈复杂度文件列表","slug":"查看指定项目指定扫描的圈复杂度文件列表","link":"#查看指定项目指定扫描的圈复杂度文件列表","children":[]},{"level":2,"title":"查看指定项目指定扫描的圈复杂度文件问题列表","slug":"查看指定项目指定扫描的圈复杂度文件问题列表","link":"#查看指定项目指定扫描的圈复杂度文件问题列表","children":[]},{"level":2,"title":"查看指定项目指定扫描的圈复杂度问题列表","slug":"查看指定项目指定扫描的圈复杂度问题列表","link":"#查看指定项目指定扫描的圈复杂度问题列表","children":[]},{"level":2,"title":"查看指定项目的重复文件列表","slug":"查看指定项目的重复文件列表","link":"#查看指定项目的重复文件列表","children":[]},{"level":2,"title":"查看指定项目的指定重复文件","slug":"查看指定项目的指定重复文件","link":"#查看指定项目的指定重复文件","children":[]},{"level":2,"title":"查看指定项目的指定文件的重复块列表","slug":"查看指定项目的指定文件的重复块列表","link":"#查看指定项目的指定文件的重复块列表","children":[]},{"level":2,"title":"查看指定项目的文件行数列表","slug":"查看指定项目的文件行数列表","link":"#查看指定项目的文件行数列表","children":[]},{"level":2,"title":"查看指定项目的语言列表","slug":"查看指定项目的语言列表","link":"#查看指定项目的语言列表","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/api/代码度量数据模块接口.md"}');export{l as data}; diff --git "a/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-d92729e0.js" "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-d92729e0.js" new file mode 100644 index 000000000..958e73a8c --- /dev/null +++ "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-d92729e0.js" @@ -0,0 +1,493 @@ +import{_ as t,o as e,c as i,e as n}from"./app-2a91d8ab.js";const d={},u=n(`

    代码度量数据管理

    查看指定项目的圈复杂度文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccfiles/
    +

    参数列表

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    scan_openint选填,发现问题的扫描编号
    scan_closeint选填,修复问题的扫描编号
    worseboolean选填,圈复杂度是否恶化
    over_cc_sum_gteint选填, 圈复杂度总和最小值
    over_cc_sum_lteint选填,圈复杂度总和最大值
    over_cc_avg_gteint选填,平均圈复杂度最小值
    over_cc_avg_lteint选填,平均圈复杂度总和最大值
    over_cc_func_count_gteint选填,超标圈复杂度函数个数最小值
    over_cc_func_count_lteint选填,超标圈复杂度函数个数最大值

    返回参数

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的圈复杂度文件问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccfiles/<file_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr选填,问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    ccn_gtestr选填,圈复杂度最小值
    ccn_ltestr选填,圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的圈复杂度问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccissues/
    +

    参数列表

    参数类型描述
    statusstr选填,问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    ccn_gtestr选填,圈复杂度最小值
    ccn_ltestr选填,圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccfiles/
    +

    参数列表

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    scan_open_idint选填,发现问题的扫描编号
    scan_close_idint选填,修复问题的扫描编号
    worseboolean选填,圈复杂度是否恶化
    over_cc_sum_gteint选填,圈复杂度总和最小值
    over_cc_sum_lteint选填,圈复杂度总和最大值
    over_cc_avg_gteint选填,平均圈复杂度最小值
    over_cc_avg_lteint选填,平均圈复杂度总和最大值
    over_cc_func_count_gteint选填,超标圈复杂度函数个数最小值
    over_cc_func_count_lteint选填,超标圈复杂度函数个数最大值

    返回结果

    {
    +    "data": {
    +        "count": 32,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "tapd_url": null,
    +                "created_time": "2020-06-02T10:59:09.418250+08:00",
    +                "creator": null,
    +                "modified_time": "2020-06-03T16:17:40.892224+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "over_func_cc": 0,
    +                "over_cc_sum": 0,
    +                "over_cc_avg": 0,
    +                "over_cc_func_count": 0,
    +                "diff_over_func_cc": 0,
    +                "diff_over_cc_sum": 0,
    +                "diff_over_cc_avg": 0,
    +                "diff_over_cc_func_count": 0,
    +                "worse": false,
    +                "file_path": "test/demo.py",
    +                "state": 3,
    +                "change_type": 0,
    +                "last_modifier": "author1",
    +                "author": null,
    +                "related_modifiers": "author1;author2",
    +                "file_owners": null,
    +                "language": "python",
    +                "tapd_ws_id": null,
    +                "tapd_bug_id": null,
    +                "revision": null,
    +                "ci_time": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": 2
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度文件问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccfiles/<file_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr选填,问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    ccn_gtestr选填,圈复杂度最小值
    ccn_ltestr选填,圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr选填,问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    ccn_gtestr选填,圈复杂度最小值
    ccn_ltestr选填,圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的重复文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/
    +

    参数列表

    参数类型描述
    issue__statestr选填,问题状态, 1为未处理,2为可忽略,3为关闭,可多选,格式为1,2,3
    change_typestr选填,重复文件更改类型,add为新增,del为删除,mod为删除,可多选,格式为add,del,mod
    issue__ownerstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    duplicate_rate_gteint选填,重复率最小值
    duplicate_rate_lteint选填,重复率最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "issue": {
    +                    "id": 1,
    +                    "state": 1,
    +                    "owner": "author"
    +                },
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "issue_id": 1,
    +                "issue_state": 1,
    +                "issue_owner": "author",
    +                "dir_path": "test",
    +                "file_name": "demo.py",
    +                "file_path": "test/demo.py",
    +                "duplicate_rate": 4.63,
    +                "total_line_count": 259,
    +                "total_duplicate_line_count": 12,
    +                "distinct_hash_num": 1,
    +                "block_num": 1,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "scm_revision": "12345678abc",
    +                "is_latest": true
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +} 
    +

    查看指定项目的指定重复文件

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/<file_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "repo": 1,
    +        "issue": {
    +            "id": 1,
    +            "state": 1,
    +            "owner": "author"
    +        },
    +        "blocks": [
    +            {
    +                "id": 1,
    +                "duplicate_file": 1,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "duplicate_file_id": 1,
    +                "token_num": 120,
    +                "duplicate_times": 2,
    +                "duplicate_rate": 4.63,
    +                "start_line_num": 216,
    +                "end_line_num": 227,
    +                "duplicate_line_count": 12,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "related_modifiers": "author"
    +            }
    +        ],
    +        "duplicate_rate_trend": 0.0,
    +        "project_id": 1815,
    +        "scan_id": 488,
    +        "issue_id": 3,
    +        "issue_state": 1,
    +        "issue_owner": "author",
    +        "dir_path": "test",
    +        "file_name": "demo.py",
    +        "file_path": "test/demo.py",
    +        "duplicate_rate": 4.63,
    +        "total_line_count": 259,
    +        "total_duplicate_line_count": 12,
    +        "distinct_hash_num": 1,
    +        "block_num": 1,
    +        "last_modifier": "author",
    +        "change_type": null,
    +        "scm_revision": "xxx",
    +        "is_latest": true
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的指定文件的重复块列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/<file_id>/blocks/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "duplicate_file": 1,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "duplicate_file_id": 1,
    +                "token_num": 120,
    +                "duplicate_times": 2,
    +                "duplicate_rate": 4.63,
    +                "start_line_num": 216,
    +                "end_line_num": 227,
    +                "duplicate_line_count": 12,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "related_modifiers": "author"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的文件行数列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/clocfiles/
    +

    参数列表

    参数类型描述
    change_typestr选填,改变类型(add、mod、del),支持多值,使用英文逗号','分隔
    file_pathstr选填,文件路径

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": "",
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "code_line_num": 108587,
    +                "comment_line_num": 0,
    +                "blank_line_num": 0,
    +                "total_line_num": 108587,
    +                "add_code_line_num": 108587,
    +                "add_comment_line_num": 0,
    +                "add_blank_line_num": 0,
    +                "add_total_line_num": 108587,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "is_latest": true,
    +                "dir_path": "test",
    +                "file_name": "test.json",
    +                "language": "JSON",
    +                "change_type": "add"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}    
    +

    查看指定项目的语言列表

    GET server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/cloclangs/
    +

    返回结果

    {
    +    "data": {
    +        "count": 2,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "code_line_num": 9753,
    +                "comment_line_num": 4220,
    +                "blank_line_num": 2454,
    +                "total_line_num": 16427,
    +                "add_code_line_num": 9753,
    +                "add_comment_line_num": 4220,
    +                "add_blank_line_num": 2454,
    +                "add_total_line_num": 16427,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1815,
    +                "scan_id": 695,
    +                "is_latest": true,
    +                "name": "Python",
    +                "file_num": 165
    +            },
    +            {
    +                "id": 2,
    +                "code_line_num": 379,
    +                "comment_line_num": 0,
    +                "blank_line_num": 153,
    +                "total_line_num": 532,
    +                "add_code_line_num": 379,
    +                "add_comment_line_num": 0,
    +                "add_blank_line_num": 153,
    +                "add_total_line_num": 532,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1815,
    +                "scan_id": 695,
    +                "is_latest": true,
    +                "name": "Markdown",
    +                "file_num": 7
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    `,61),l=[u];function s(o,a){return e(),i("div",null,l)}const v=t(d,[["render",s],["__file","代码度量数据模块接口.html.vue"]]);export{v as default}; diff --git "a/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-f9443a60.js" "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-f9443a60.js" new file mode 100644 index 000000000..77d838dc3 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-f9443a60.js" @@ -0,0 +1,493 @@ +import{_ as t,o as e,c as i,e as n}from"./app-2a91d8ab.js";const d={},u=n(`

    代码度量数据管理

    查看指定项目的圈复杂度文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccfiles/
    +

    参数列表

    参数类型描述
    statestr问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    scan_openint发现问题的扫描编号
    scan_closeint修复问题的扫描编号
    worseboolean圈复杂度是否恶化
    over_cc_sum_gteint圈复杂度总和最小值
    over_cc_sum_lteint圈复杂度总和最大值
    over_cc_avg_gteint平均圈复杂度最小值
    over_cc_avg_lteint平均圈复杂度总和最大值
    over_cc_func_count_gteint超标圈复杂度函数个数最小值
    over_cc_func_count_lteint超标圈复杂度函数个数最大值

    返回参数

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的圈复杂度文件问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccfiles/<file_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    ccn_gtestr圈复杂度最小值
    ccn_ltestr圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的圈复杂度问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccissues/
    +

    参数列表

    参数类型描述
    statusstr问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    ccn_gtestr圈复杂度最小值
    ccn_ltestr圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccfiles/
    +

    参数列表

    参数类型描述
    statestr问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    scan_open_idint发现问题的扫描编号
    scan_close_idint修复问题的扫描编号
    worseboolean圈复杂度是否恶化
    over_cc_sum_gteint圈复杂度总和最小值
    over_cc_sum_lteint圈复杂度总和最大值
    over_cc_avg_gteint平均圈复杂度最小值
    over_cc_avg_lteint平均圈复杂度总和最大值
    over_cc_func_count_gteint超标圈复杂度函数个数最小值
    over_cc_func_count_lteint超标圈复杂度函数个数最大值

    返回结果

    {
    +    "data": {
    +        "count": 32,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "tapd_url": null,
    +                "created_time": "2020-06-02T10:59:09.418250+08:00",
    +                "creator": null,
    +                "modified_time": "2020-06-03T16:17:40.892224+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "over_func_cc": 0,
    +                "over_cc_sum": 0,
    +                "over_cc_avg": 0,
    +                "over_cc_func_count": 0,
    +                "diff_over_func_cc": 0,
    +                "diff_over_cc_sum": 0,
    +                "diff_over_cc_avg": 0,
    +                "diff_over_cc_func_count": 0,
    +                "worse": false,
    +                "file_path": "test/demo.py",
    +                "state": 3,
    +                "change_type": 0,
    +                "last_modifier": "author1",
    +                "author": null,
    +                "related_modifiers": "author1;author2",
    +                "file_owners": null,
    +                "language": "python",
    +                "tapd_ws_id": null,
    +                "tapd_bug_id": null,
    +                "revision": null,
    +                "ci_time": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": 2
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度文件问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccfiles/<file_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    ccn_gtestr圈复杂度最小值
    ccn_ltestr圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    ccn_gtestr圈复杂度最小值
    ccn_ltestr圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的重复文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/
    +

    参数列表

    参数类型描述
    issue__statestr问题状态, 1为未处理,2为可忽略,3为关闭,可多选,格式为1,2,3
    change_typestr重复文件更改类型,add为新增,del为删除,mod为删除,可多选,格式为add,del,mod
    issue__ownerstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    duplicate_rate_gteint重复率最小值
    duplicate_rate_lteint重复率最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "issue": {
    +                    "id": 1,
    +                    "state": 1,
    +                    "owner": "author"
    +                },
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "issue_id": 1,
    +                "issue_state": 1,
    +                "issue_owner": "author",
    +                "dir_path": "test",
    +                "file_name": "demo.py",
    +                "file_path": "test/demo.py",
    +                "duplicate_rate": 4.63,
    +                "total_line_count": 259,
    +                "total_duplicate_line_count": 12,
    +                "distinct_hash_num": 1,
    +                "block_num": 1,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "scm_revision": "12345678abc",
    +                "is_latest": true
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +} 
    +

    查看指定项目的指定重复文件

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/<file_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "repo": 1,
    +        "issue": {
    +            "id": 1,
    +            "state": 1,
    +            "owner": "author"
    +        },
    +        "blocks": [
    +            {
    +                "id": 1,
    +                "duplicate_file": 1,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "duplicate_file_id": 1,
    +                "token_num": 120,
    +                "duplicate_times": 2,
    +                "duplicate_rate": 4.63,
    +                "start_line_num": 216,
    +                "end_line_num": 227,
    +                "duplicate_line_count": 12,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "related_modifiers": "author"
    +            }
    +        ],
    +        "duplicate_rate_trend": 0.0,
    +        "project_id": 1815,
    +        "scan_id": 488,
    +        "issue_id": 3,
    +        "issue_state": 1,
    +        "issue_owner": "author",
    +        "dir_path": "test",
    +        "file_name": "demo.py",
    +        "file_path": "test/demo.py",
    +        "duplicate_rate": 4.63,
    +        "total_line_count": 259,
    +        "total_duplicate_line_count": 12,
    +        "distinct_hash_num": 1,
    +        "block_num": 1,
    +        "last_modifier": "author",
    +        "change_type": null,
    +        "scm_revision": "xxx",
    +        "is_latest": true
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的指定文件的重复块列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/<file_id>/blocks/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "duplicate_file": 1,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "duplicate_file_id": 1,
    +                "token_num": 120,
    +                "duplicate_times": 2,
    +                "duplicate_rate": 4.63,
    +                "start_line_num": 216,
    +                "end_line_num": 227,
    +                "duplicate_line_count": 12,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "related_modifiers": "author"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的文件行数列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/clocfiles/
    +

    参数列表

    参数类型描述
    change_typestr改变类型(add、mod、del),支持多值,使用英文逗号','分隔
    file_pathstr文件路径

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": "",
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "code_line_num": 108587,
    +                "comment_line_num": 0,
    +                "blank_line_num": 0,
    +                "total_line_num": 108587,
    +                "add_code_line_num": 108587,
    +                "add_comment_line_num": 0,
    +                "add_blank_line_num": 0,
    +                "add_total_line_num": 108587,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "is_latest": true,
    +                "dir_path": "test",
    +                "file_name": "test.json",
    +                "language": "JSON",
    +                "change_type": "add"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}    
    +

    查看指定项目的语言列表

    GET server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/cloclangs/
    +

    返回结果

    {
    +    "data": {
    +        "count": 2,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "code_line_num": 9753,
    +                "comment_line_num": 4220,
    +                "blank_line_num": 2454,
    +                "total_line_num": 16427,
    +                "add_code_line_num": 9753,
    +                "add_comment_line_num": 4220,
    +                "add_blank_line_num": 2454,
    +                "add_total_line_num": 16427,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1815,
    +                "scan_id": 695,
    +                "is_latest": true,
    +                "name": "Python",
    +                "file_num": 165
    +            },
    +            {
    +                "id": 2,
    +                "code_line_num": 379,
    +                "comment_line_num": 0,
    +                "blank_line_num": 153,
    +                "total_line_num": 532,
    +                "add_code_line_num": 379,
    +                "add_comment_line_num": 0,
    +                "add_blank_line_num": 153,
    +                "add_total_line_num": 532,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1815,
    +                "scan_id": 695,
    +                "is_latest": true,
    +                "name": "Markdown",
    +                "file_num": 7
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    `,61),l=[u];function s(o,a){return e(),i("div",null,l)}const v=t(d,[["render",s],["__file","代码度量数据模块接口.html.vue"]]);export{v as default}; diff --git "a/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-005420db.js" "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-005420db.js" new file mode 100644 index 000000000..6d902e0be --- /dev/null +++ "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-005420db.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-c5ddf200","path":"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE.html","title":"代码度量配置","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"圈复杂度","slug":"圈复杂度","link":"#圈复杂度","children":[]},{"level":2,"title":"重复代码","slug":"重复代码","link":"#重复代码","children":[]},{"level":2,"title":"代码统计","slug":"代码统计","link":"#代码统计","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/分析方案/代码度量配置.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-03d18fab.js" "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-03d18fab.js" new file mode 100644 index 000000000..3726c2e34 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-03d18fab.js" @@ -0,0 +1 @@ +import{_ as e,o as a,c as r,e as t}from"./app-2a91d8ab.js";const i={},n=t('

    代码度量配置

    圈复杂度

    可以发现执行路径较多的方法,降低代码的圈复杂度,可测性更高

    • 检测阈值

      默认为 20,表示当一个方法的圈复杂度超过 20 时则认为该方法为超标方法,需要被关注修改。

      可以根据需要调整

    重复代码

    可以发现重复的代码,避免重复代码可以让代码更简洁,更易维护

    • 长度区间

      是一个区间值,默认代码中一个单词(变量/操作符)长度为 1。

    • 重复次数

      是一个区间值,当一段代码重复次数达到指定区间才认为是有风险的。

    • 上报限制

      限制上报的重复代码块数,可以减少开发的压力,提高修复积极性。

    代码统计

    从目录和业务纬度统计代码行数,也可以获取提交记录便于代码 Review

    ',9),s=[n];function h(o,p){return a(),r("div",null,s)}const c=e(i,[["render",h],["__file","代码度量配置.html.vue"]]);export{c as default}; diff --git "a/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-6e7a8634.js" "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-6e7a8634.js" new file mode 100644 index 000000000..bd7a7e522 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-6e7a8634.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4b5d7d25","path":"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E5%BA%A6%E9%87%8F%E9%85%8D%E7%BD%AE.html","title":"代码度量配置","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"圈复杂度","slug":"圈复杂度","link":"#圈复杂度","children":[]},{"level":2,"title":"重复代码","slug":"重复代码","link":"#重复代码","children":[]},{"level":2,"title":"代码统计","slug":"代码统计","link":"#代码统计","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/分析方案/代码度量配置.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-a0b512c6.js" "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-a0b512c6.js" new file mode 100644 index 000000000..3726c2e34 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html-a0b512c6.js" @@ -0,0 +1 @@ +import{_ as e,o as a,c as r,e as t}from"./app-2a91d8ab.js";const i={},n=t('

    代码度量配置

    圈复杂度

    可以发现执行路径较多的方法,降低代码的圈复杂度,可测性更高

    • 检测阈值

      默认为 20,表示当一个方法的圈复杂度超过 20 时则认为该方法为超标方法,需要被关注修改。

      可以根据需要调整

    重复代码

    可以发现重复的代码,避免重复代码可以让代码更简洁,更易维护

    • 长度区间

      是一个区间值,默认代码中一个单词(变量/操作符)长度为 1。

    • 重复次数

      是一个区间值,当一段代码重复次数达到指定区间才认为是有风险的。

    • 上报限制

      限制上报的重复代码块数,可以减少开发的压力,提高修复积极性。

    代码统计

    从目录和业务纬度统计代码行数,也可以获取提交记录便于代码 Review

    ',9),s=[n];function h(o,p){return a(),r("div",null,s)}const c=e(i,[["render",h],["__file","代码度量配置.html.vue"]]);export{c as default}; diff --git "a/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-4ed0e1d6.js" "b/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-4ed0e1d6.js" new file mode 100644 index 000000000..3a1f73ce1 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-4ed0e1d6.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d1cb31be","path":"/en/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"代码扫描数据管理","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"查看扫描问题列表","slug":"查看扫描问题列表","link":"#查看扫描问题列表","children":[]},{"level":2,"title":"查看问题详情","slug":"查看问题详情","link":"#查看问题详情","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/api/代码扫描数据模块接口.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-9e291d69.js" "b/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-9e291d69.js" new file mode 100644 index 000000000..d57be7118 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-9e291d69.js" @@ -0,0 +1,197 @@ +import{_ as t,o as e,c as i,e as u}from"./app-2a91d8ab.js";const n={},d=u(`

    代码扫描数据管理

    查看扫描问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/
    +

    参数

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    severitystr选填,严重程度, 1为致命,2为错误,3为警告,4为提示,可多选,格式为1,2,3,4
    resolutionstr选填,解决方式, 0为无,1为修复,2为无需修复,3为误报,4为重复单过滤,5为路径过滤,6为规则移除
    authorstr选填,问题责任人
    scan_openint选填,发现问题的扫描编号
    scan_fixint选填,修复问题的扫描编号
    ci_time_gtestr选填,修复问题的起始时间,格式为"2021-01-01 00:00:00"
    ci_time_ltestr选填,修复问题的结束时间
    file_pathstr选填,文件路径
    checkrule_display_namestr选填,检查规则名
    checkpackageint选填,问题所属的规则包

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "file_path": "test/demo.py",
    +                "project": 1,
    +                "repo": 1,
    +                "checkrule_real_name": "xxx",
    +                "checkrule_display_name": "xxx",
    +                "checktool_name": "xxx",
    +                "msg": "xxx",
    +                "state": 3,
    +                "resolution": 1,
    +                "author": "author",
    +                "author_email": null,
    +                "severity": 2,
    +                "revision": "revision",
    +                "ci_time": "2021-02-02T13:31:38+08:00",
    +                "file_owners": null,
    +                "is_external": false,
    +                "scm_url": "",
    +                "real_file_path": "",
    +                "scan_open": 1,
    +                "scan_fix": 2,
    +                "fixed_time": "2021-02-19T15:25:15.152350+08:00"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看问题详情

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/<issue_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "issue_details": [
    +            {
    +                "id": 1,
    +                "issue_refers": [],
    +                "creator": null,
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "issuedetail_uuid": "0fcc376e-7283-11eb-bd53-5254005e71ca",
    +                "checkrule_real_name": "xxx",
    +                "checktool_name": "xxx",
    +                "author": "author",
    +                "author_email": null,
    +                "line": 1809,
    +                "column": 15,
    +                "scan_revision": "scan_revision",
    +                "revision": "revision",
    +                "ci_time": "2021-02-02T13:31:38+08:00",
    +                "real_revision": "",
    +                "created_time": "2021-02-19T15:21:19.625658+08:00",
    +                "modified_time": "2021-02-19T15:21:19.625662+08:00",
    +                "issue": null,
    +                "project": 1
    +            }
    +        ],
    +        "is_external": false,
    +        "repo": 1,
    +        "author": "author",
    +        "created_time": "2021-02-19T15:21:19.625685+08:00",
    +        "creator": null,
    +        "modifier": null,
    +        "deleted_time": null,
    +        "deleter": null,
    +        "file_path": "test/demo.py",
    +        "file_hash": "xxx",
    +        "scm_url": "",
    +        "real_file_path": "",
    +        "checkrule_gid": 1,
    +        "checkrule_real_name": "xxx",
    +        "checkrule_display_name": "xxx",
    +        "checkrule_rule_title": "xxx",
    +        "checktool_name": "xxx",
    +        "category": 7,
    +        "state": 3,
    +        "resolution": 1,
    +        "scan_revision": null,
    +        "severity": 2,
    +        "language": "python",
    +        "revision": "revision",
    +        "ci_time": "2021-02-02T13:31:38+08:00",
    +        "file_owners": null,
    +        "fixed_time": "2021-02-19T15:25:15.152350+08:00",
    +        "tapd_ws_id": null,
    +        "tapd_bug_id": null,
    +        "modified_time": "2021-02-19T15:25:17.807478+08:00",
    +        "project": 1,
    +        "scan_open": 1,
    +        "scan_fix": 2
    +    },
    +    "code": 0,
    +    "msg": "xxx",
    +    "status_code": 200
    +}
    +

    查看每次扫描的问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/scans/<scan_id>/issues/
    +

    参数

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    severitystr选填,严重程度, 1为致命,2为错误,3为警告,4为提示,可多选,格式为1,2,3,4
    resolutionstr选填,解决方式, 0为无,1为修复,2为无需修复,3为误报,4为重复单过滤,5为路径过滤,6为规则移除
    authorstr选填,问题责任人
    scan_open_idint选填,发现问题的扫描编号
    scan_fix_idint选填,修复问题的扫描编号
    ci_time_gtestr选填,修复问题的起始时间
    ci_time_ltestr选填,修复问题的结束时间
    file_pathstr选填,文件路径
    checkrule_display_namestr选填,检查规则名
    checkpackageint选填,问题所属的规则包

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo_id": 1,
    +                "project_id": 1,
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "file_path": "test/demo.py",
    +                "scm_url": "",
    +                "real_file_path": "",
    +                "line": 21,
    +                "column": 68,
    +                "checkrule_gid": 1,
    +                "checkrule_real_name": "xxx",
    +                "checkrule_display_name": "xxx",
    +                "checkrule_rule_title": "xxx",
    +                "checktool_name": "xxx",
    +                "category": 7,
    +                "msg": "xxx",
    +                "state": 1,
    +                "resolution": null,
    +                "author": "author",
    +                "scan_open_id": 1,
    +                "scan_fix_id": null,
    +                "issuedetail_uuid": "26d7ba88-8268-11eb-a304-5254005e71ca",
    +                "scan_revision": "scan_revision",
    +                "real_revision": "",
    +                "severity": 2,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2019-07-01T10:28:19+08:00",
    +                "file_owners": null,
    +                "created_time": "2021-03-11T20:49:00.539537+08:00",
    +                "fixed_time": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "xxx",
    +    "status_code": 200
    +}
    +

    查看指定CR扫描的问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/crscans/<scan_id>/issues/
    +

    参数

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    severitystr选填,严重程度, 1为致命,2为错误,3为警告,4为提示,可多选,格式为1,2,3,4
    resolutionstr选填,解决方式, 0为无,1为修复,2为无需修复,3为误报,4为重复单过滤,5为路径过滤,6为规则移除
    authorstr选填,问题责任人
    scan_open_idint选填,发现问题的扫描编号
    scan_fix_idint选填,修复问题的扫描编号
    ci_time_gtestr选填,修复问题的起始时间
    ci_time_ltestr选填,修复问题的结束时间
    file_pathstr选填,文件路径
    checkrule_display_namestr选填,检查规则名
    checkpackageint选填,问题所属的规则包

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo_id": 1,
    +                "project_id": 1,
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "file_path": "test/demo.py",
    +                "scm_url": "",
    +                "real_file_path": "",
    +                "line": 21,
    +                "column": 68,
    +                "checkrule_gid": 1,
    +                "checkrule_real_name": "xxx",
    +                "checkrule_display_name": "xxx",
    +                "checkrule_rule_title": "xxx",
    +                "checktool_name": "xxx",
    +                "category": 7,
    +                "msg": "xxx",
    +                "state": 1,
    +                "resolution": null,
    +                "author": "author",
    +                "scan_open_id": 1,
    +                "scan_fix_id": null,
    +                "issuedetail_uuid": "26d7ba88-8268-11eb-a304-5254005e71ca",
    +                "scan_revision": "scan_revision",
    +                "real_revision": "",
    +                "severity": 2,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2019-07-01T10:28:19+08:00",
    +                "file_owners": null,
    +                "created_time": "2021-03-11T20:49:00.539537+08:00",
    +                "fixed_time": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "xxx",
    +    "status_code": 200
    +}
    +
    `,23),s=[d];function o(l,a){return e(),i("div",null,s)}const q=t(n,[["render",o],["__file","代码扫描数据模块接口.html.vue"]]);export{q as default}; diff --git "a/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-af83f351.js" "b/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-af83f351.js" new file mode 100644 index 000000000..7769a138e --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-af83f351.js" @@ -0,0 +1,105 @@ +import{_ as t,o as e,c as i,e as u}from"./app-2a91d8ab.js";const n={},d=u(`

    代码扫描数据管理

    查看扫描问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/
    +

    参数

    参数类型描述
    statestr问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    severitystr严重程度, 1为致命,2为错误,3为警告,4为提示,可多选,格式为1,2,3,4
    resolutionstr解决方式, 0为无,1为修复,2为无需修复,3为误报,4为重复单过滤,5为路径过滤,6为规则移除
    authorstr问题责任人
    scan_openint发现问题的扫描编号
    scan_fixint修复问题的扫描编号
    ci_time_gtestr修复问题的起始时间,格式为"2021-01-01 00:00:00"
    ci_time_ltestr修复问题的结束时间
    file_pathstr文件路径
    checkrule_display_namestr检查规则名
    checkpackageint问题所属的规则包

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "file_path": "test/demo.py",
    +                "project": 1,
    +                "repo": 1,
    +                "checkrule_real_name": "xxx",
    +                "checkrule_display_name": "xxx",
    +                "checktool_name": "xxx",
    +                "msg": "xxx",
    +                "state": 3,
    +                "resolution": 1,
    +                "author": "author",
    +                "author_email": null,
    +                "severity": 2,
    +                "revision": "revision",
    +                "ci_time": "2021-02-02T13:31:38+08:00",
    +                "file_owners": null,
    +                "is_external": false,
    +                "scm_url": "",
    +                "real_file_path": "",
    +                "scan_open": 1,
    +                "scan_fix": 2,
    +                "fixed_time": "2021-02-19T15:25:15.152350+08:00"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看问题详情

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/<issue_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "issue_details": [
    +            {
    +                "id": 1,
    +                "issue_refers": [],
    +                "creator": null,
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "issuedetail_uuid": "0fcc376e-7283-11eb-bd53-5254005e71ca",
    +                "checkrule_real_name": "xxx",
    +                "checktool_name": "xxx",
    +                "author": "author",
    +                "author_email": null,
    +                "line": 1809,
    +                "column": 15,
    +                "scan_revision": "scan_revision",
    +                "revision": "revision",
    +                "ci_time": "2021-02-02T13:31:38+08:00",
    +                "real_revision": "",
    +                "created_time": "2021-02-19T15:21:19.625658+08:00",
    +                "modified_time": "2021-02-19T15:21:19.625662+08:00",
    +                "issue": null,
    +                "project": 1
    +            }
    +        ],
    +        "is_external": false,
    +        "repo": 1,
    +        "author": "author",
    +        "created_time": "2021-02-19T15:21:19.625685+08:00",
    +        "creator": null,
    +        "modifier": null,
    +        "deleted_time": null,
    +        "deleter": null,
    +        "file_path": "test/demo.py",
    +        "file_hash": "xxx",
    +        "scm_url": "",
    +        "real_file_path": "",
    +        "checkrule_gid": 1,
    +        "checkrule_real_name": "xxx",
    +        "checkrule_display_name": "xxx",
    +        "checkrule_rule_title": "xxx",
    +        "checktool_name": "xxx",
    +        "category": 7,
    +        "state": 3,
    +        "resolution": 1,
    +        "scan_revision": null,
    +        "severity": 2,
    +        "language": "python",
    +        "revision": "revision",
    +        "ci_time": "2021-02-02T13:31:38+08:00",
    +        "file_owners": null,
    +        "fixed_time": "2021-02-19T15:25:15.152350+08:00",
    +        "tapd_ws_id": null,
    +        "tapd_bug_id": null,
    +        "modified_time": "2021-02-19T15:25:17.807478+08:00",
    +        "project": 1,
    +        "scan_open": 1,
    +        "scan_fix": 2
    +    },
    +    "code": 0,
    +    "msg": "xxx",
    +    "status_code": 200
    +}
    +
    `,11),o=[d];function s(l,a){return e(),i("div",null,o)}const q=t(n,[["render",s],["__file","代码扫描数据模块接口.html.vue"]]);export{q as default}; diff --git "a/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-f498f2d3.js" "b/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-f498f2d3.js" new file mode 100644 index 000000000..f126bf0c8 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html-f498f2d3.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-1ee0b9b4","path":"/zh/api/%E4%BB%A3%E7%A0%81%E6%89%AB%E6%8F%8F%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"代码扫描数据管理","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"查看扫描问题列表","slug":"查看扫描问题列表","link":"#查看扫描问题列表","children":[]},{"level":2,"title":"查看问题详情","slug":"查看问题详情","link":"#查看问题详情","children":[]},{"level":2,"title":"查看每次扫描的问题列表","slug":"查看每次扫描的问题列表","link":"#查看每次扫描的问题列表","children":[]},{"level":2,"title":"查看指定CR扫描的问题列表","slug":"查看指定cr扫描的问题列表","link":"#查看指定cr扫描的问题列表","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/api/代码扫描数据模块接口.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-20064d15.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-20064d15.js" new file mode 100644 index 000000000..1a2517a8a --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-20064d15.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-475a8e44","path":"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE.html","title":"代码检查-编译配置","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"编译所需环境说明(重要)","slug":"编译所需环境说明-重要","link":"#编译所需环境说明-重要","children":[]},{"level":2,"title":"编译配置字段说明","slug":"编译配置字段说明","link":"#编译配置字段说明","children":[]},{"level":2,"title":"编译配置示例","slug":"编译配置示例","link":"#编译配置示例","children":[{"level":3,"title":"JAVA 项目","slug":"java-项目","link":"#java-项目","children":[]},{"level":3,"title":"Object-C 项目","slug":"object-c-项目","link":"#object-c-项目","children":[]},{"level":3,"title":"C/C++ 项目","slug":"c-c-项目","link":"#c-c-项目","children":[]},{"level":3,"title":"C# 项目","slug":"c-项目","link":"#c-项目","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/分析方案/代码检查编译配置.md"}');export{l as data}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-6ab56434.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-6ab56434.js" new file mode 100644 index 000000000..3848eed05 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-6ab56434.js" @@ -0,0 +1,12 @@ +import{_ as e,o as a,c as i,e as d}from"./app-2a91d8ab.js";const n={},s=d(`

    代码检查-编译配置

    腾讯云代码分析平台支持给编译类的工具或编译型项目配置相关命令。

    由于对代码进行编译型分析会存在安全风险,需要用户自行进行专机扫描,申购完成后可联系平台管理员进行相关配置。

    TIP

    对于编译型语言,有些分析工具是可以通过分析编译产出的中间文件,更为准确地发现代码质量问题。


    WARNING

    由于对代码进行编译型分析会存在安全风险,需要用户自行进行专机扫描(私有化版由客户自行评估即可)。


    编译所需环境说明(重要)

    如果配置了编译命令,则需要在具有代码执行所需的编译环境的节点上执行代码分析。即需要用户在专机上提供编译环境(针对私有化版,客户可根据业务情况选择在公共节点机、用户专机、本地节点机提供编译环境即可)。

    如以下一些编译环境:

    • JDK 环境及版本

    • gradle 环境

    • cmake & make 环境

    • visual studio 环境

    • ...

    WARNING

    如果机器有多个 JDK 或者 gradle 环境,项目编译需指定 JDK 或 gradle 版本,可以在分析方案的基础属性当中设定相应环境变量。

    编译配置字段说明

    前置命令

    通常是项目编译前需要执行的命令,或用于清理之前编译过程的命令,如:make clean, xcodebuild clean [-optionName]。如无需要,可以不填。

    编译命令

    项目的编译命令,具体可以咨询该代码库所属项目的开发

    能够使项目编译成功的编译命令,可以填写多行或用 && 连接命令。

    TIP

    前置命令与编译命令是隔离的,即在前置命令中的操作不会对编译命令产生影响。

    如在前置命令中 cd src && export TEST=src,在执行编译命令时并不会跳到src目录和获取TEST环境变量。

    编译配置示例

    TIP

    咨询该代码库所属项目的开发,先确保先在本地工程根目录调试通过

    JAVA 项目

    编译命令

    android-studio 项目编译命令示例

    gradle compileDebugSources --no-daemon -Dorg.gradle.jvmargs=
    +

    ant 项目编译命令示例

    ant build
    +

    Object-C 项目

    编译命令

    xcodebuild 命令(确保先在本地工程根目录调试通过)

    xcodebuild -target dailybuildipa -configuration DailyBuild -sdk iphonesimulator
    +

    环境变量(分析方案-基础属性中配置):

    XCODE_VERISON=10.1
    +

    C/C++ 项目

    编译命令

    VS 项目编译命令示例

    devenv.com demo.sln /Build "Debug|Win32"
    +# 或
    +msbuild demo.sln /t:Build /p:Configuration=DebugCopy
    +

    make 项目编译命令示例

    make all
    +

    C# 项目

    编译命令

    VS 项目编译命令示例

    devenv.com demo.sln /Build "Debug|Win32"
    +# 或
    +msbuild demo.sln /t:Build /p:Configuration=Debug
    +
    `,43),c=[s];function r(l,t){return a(),i("div",null,c)}const p=e(n,[["render",r],["__file","代码检查编译配置.html.vue"]]);export{p as default}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-b9cea002.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-b9cea002.js" new file mode 100644 index 000000000..2056ed41b --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-b9cea002.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-8554b5ae","path":"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E9%85%8D%E7%BD%AE.html","title":"代码检查-编译配置","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"编译所需环境说明(重要)","slug":"编译所需环境说明-重要","link":"#编译所需环境说明-重要","children":[]},{"level":2,"title":"编译配置字段说明","slug":"编译配置字段说明","link":"#编译配置字段说明","children":[]},{"level":2,"title":"编译配置示例","slug":"编译配置示例","link":"#编译配置示例","children":[{"level":3,"title":"JAVA 项目","slug":"java-项目","link":"#java-项目","children":[]},{"level":3,"title":"Object-C 项目","slug":"object-c-项目","link":"#object-c-项目","children":[]},{"level":3,"title":"C/C++ 项目","slug":"c-c-项目","link":"#c-c-项目","children":[]},{"level":3,"title":"C# 项目","slug":"c-项目","link":"#c-项目","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/分析方案/代码检查编译配置.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-ecee328e.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-ecee328e.js" new file mode 100644 index 000000000..db5e536fd --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html-ecee328e.js" @@ -0,0 +1,12 @@ +import{_ as e,o as a,c as i,e as d}from"./app-2a91d8ab.js";const n={},s=d(`

    代码检查-编译配置

    腾讯云代码分析平台支持给编译类的工具或编译型项目配置相关命令。

    由于对代码进行编译型分析会存在安全风险,需要用户自行进行专机扫描,申购完成后可联系平台管理员进行相关配置。

    提示

    对于编译型语言,有些分析工具是可以通过分析编译产出的中间文件,更为准确地发现代码质量问题。


    注意

    由于对代码进行编译型分析会存在安全风险,需要用户自行进行专机扫描(私有化版由客户自行评估即可)。


    编译所需环境说明(重要)

    如果配置了编译命令,则需要在具有代码执行所需的编译环境的节点上执行代码分析。即需要用户在专机上提供编译环境(针对私有化版,客户可根据业务情况选择在公共节点机、用户专机、本地节点机提供编译环境即可)。

    如以下一些编译环境:

    • JDK 环境及版本

    • gradle 环境

    • cmake & make 环境

    • visual studio 环境

    • ...

    注意

    如果机器有多个 JDK 或者 gradle 环境,项目编译需指定 JDK 或 gradle 版本,可以在分析方案的基础属性当中设定相应环境变量。

    编译配置字段说明

    前置命令

    通常是项目编译前需要执行的命令,或用于清理之前编译过程的命令,如:make clean, xcodebuild clean [-optionName]。如无需要,可以不填。

    编译命令

    项目的编译命令,具体可以咨询该代码库所属项目的开发

    能够使项目编译成功的编译命令,可以填写多行或用 && 连接命令。

    提示

    前置命令与编译命令是隔离的,即在前置命令中的操作不会对编译命令产生影响。

    如在前置命令中 cd src && export TEST=src,在执行编译命令时并不会跳到src目录和获取TEST环境变量。

    编译配置示例

    提示

    咨询该代码库所属项目的开发,先确保先在本地工程根目录调试通过

    JAVA 项目

    编译命令

    android-studio 项目编译命令示例

    gradle compileDebugSources --no-daemon -Dorg.gradle.jvmargs=
    +

    ant 项目编译命令示例

    ant build
    +

    Object-C 项目

    编译命令

    xcodebuild 命令(确保先在本地工程根目录调试通过)

    xcodebuild -target dailybuildipa -configuration DailyBuild -sdk iphonesimulator
    +

    环境变量(分析方案-基础属性中配置):

    XCODE_VERISON=10.1
    +

    C/C++ 项目

    编译命令

    VS 项目编译命令示例

    devenv.com demo.sln /Build "Debug|Win32"
    +# 或
    +msbuild demo.sln /t:Build /p:Configuration=DebugCopy
    +

    make 项目编译命令示例

    make all
    +

    C# 项目

    编译命令

    VS 项目编译命令示例

    devenv.com demo.sln /Build "Debug|Win32"
    +# 或
    +msbuild demo.sln /t:Build /p:Configuration=Debug
    +
    `,43),c=[s];function r(l,t){return a(),i("div",null,c)}const p=e(n,[["render",r],["__file","代码检查编译配置.html.vue"]]);export{p as default}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-00c1c969.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-00c1c969.js" new file mode 100644 index 000000000..072cf67a0 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-00c1c969.js" @@ -0,0 +1 @@ +import{_ as t,a as r,b as s}from"./AddRule3-9d6ed3bf.js";import{_ as a,a as i}from"./scheme_codelint_03-5bcd9286.js";import{_ as p}from"./scheme_codelint_04-1cece3c4.js";import{_ as o,o as e,c as n,e as c}from"./app-2a91d8ab.js";const _={},l=c('

    代码检查-规则配置

    在上一节文档代码检查配置中我们大致已经了解规则配置主要由官方规则包自定义规则包构成,本节将详细描述规则配置。

    官方规则包是由腾讯云代码分析平台经过多年深耕,在业务中不断实践整理而出的规则集合包,然而平台有超过**10000+**的规则,有些规则并未放到官方规则包中,甚至有些规则是由用户自定义的规则。此外,有些官方规则包中的规则,对于不同的团队所需可能存在差异,因此产生了如下几种问题:

    • 在规则配置中,如何添加规则?

    • 在规则配置中,如果将官方规则包中的规则进行调整?

    在规则配置中,如何添加规则?

    添加规则存在两种入口

    TIP

    无论何种,最终都是将规则添加到自定义规则包中

    • 用户可直接点击页面中的添加规则

      添加规则配置

    • 用户可点击自定义规则,进入自定义规则包后,再点击添加规则

      点击自定义规则包

      添加规则

    在添加规则过程中,可以单选或者批量多选规则,可以根据搜索栏进行多维度查询规则

    添加规则配置

    添加规则配置

    在规则配置中,如果将官方规则包中的规则进行调整?

    用户可以点击进入官方规则包,进入官方规则包中,对已存在的规则进行编辑。

    WARNING

    在官方规则包中对规则的任意操作,实质上是将对应规则增加到自定义规则包中进行了相关操作。

    自定义规则包中的规则配置会默认覆盖其他官方包中相同规则的配置。

    编辑官方规则包规则

    ',15),m=[l];function d(h,g){return e(),n("div",null,m)}const b=o(_,[["render",d],["__file","代码检查规则配置.html.vue"]]);export{b as default}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-15e89585.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-15e89585.js" new file mode 100644 index 000000000..02a01ed84 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-15e89585.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d5a7ceb6","path":"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html","title":"代码检查-规则配置","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"在规则配置中,如何添加规则?","slug":"在规则配置中-如何添加规则","link":"#在规则配置中-如何添加规则","children":[]},{"level":2,"title":"在规则配置中,如果将官方规则包中的规则进行调整?","slug":"在规则配置中-如果将官方规则包中的规则进行调整","link":"#在规则配置中-如果将官方规则包中的规则进行调整","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/分析方案/代码检查规则配置.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-30e38919.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-30e38919.js" new file mode 100644 index 000000000..7d2af34d0 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-30e38919.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0b272f8a","path":"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html","title":"代码检查-规则配置","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"在规则配置中,如何添加规则?","slug":"在规则配置中-如何添加规则","link":"#在规则配置中-如何添加规则","children":[]},{"level":2,"title":"在规则配置中,如果将官方规则包中的规则进行调整?","slug":"在规则配置中-如果将官方规则包中的规则进行调整","link":"#在规则配置中-如果将官方规则包中的规则进行调整","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/分析方案/代码检查规则配置.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-366b55db.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-366b55db.js" new file mode 100644 index 000000000..4707ce342 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html-366b55db.js" @@ -0,0 +1 @@ +import{_ as t,a as r,b as s}from"./AddRule3-9d6ed3bf.js";import{_ as a,a as i}from"./scheme_codelint_03-5bcd9286.js";import{_ as p}from"./scheme_codelint_04-1cece3c4.js";import{_ as o,o as e,c as n,e as c}from"./app-2a91d8ab.js";const _={},l=c('

    代码检查-规则配置

    在上一节文档代码检查配置中我们大致已经了解规则配置主要由官方规则包自定义规则包构成,本节将详细描述规则配置。

    官方规则包是由腾讯云代码分析平台经过多年深耕,在业务中不断实践整理而出的规则集合包,然而平台有超过**10000+**的规则,有些规则并未放到官方规则包中,甚至有些规则是由用户自定义的规则。此外,有些官方规则包中的规则,对于不同的团队所需可能存在差异,因此产生了如下几种问题:

    • 在规则配置中,如何添加规则?

    • 在规则配置中,如果将官方规则包中的规则进行调整?

    在规则配置中,如何添加规则?

    添加规则存在两种入口

    提示

    无论何种,最终都是将规则添加到自定义规则包中

    • 用户可直接点击页面中的添加规则

      添加规则配置

    • 用户可点击自定义规则,进入自定义规则包后,再点击添加规则

      点击自定义规则包

      添加规则

    在添加规则过程中,可以单选或者批量多选规则,可以根据搜索栏进行多维度查询规则

    添加规则配置

    添加规则配置

    在规则配置中,如果将官方规则包中的规则进行调整?

    用户可以点击进入官方规则包,进入官方规则包中,对已存在的规则进行编辑。

    注意

    在官方规则包中对规则的任意操作,实质上是将对应规则增加到自定义规则包中进行了相关操作。

    自定义规则包中的规则配置会默认覆盖其他官方包中相同规则的配置。

    编辑官方规则包规则

    ',15),m=[l];function d(h,g){return e(),n("div",null,m)}const b=o(_,[["render",d],["__file","代码检查规则配置.html.vue"]]);export{b as default}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-1f9708fb.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-1f9708fb.js" new file mode 100644 index 000000000..b1246f5e6 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-1f9708fb.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-11ec007c","path":"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE.html","title":"代码检查配置","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"规则配置","slug":"规则配置","link":"#规则配置","children":[]},{"level":2,"title":"编译配置","slug":"编译配置","link":"#编译配置","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/分析方案/代码检查配置.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-bfaaf5f0.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-bfaaf5f0.js" new file mode 100644 index 000000000..5433d7223 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-bfaaf5f0.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7f8f12be","path":"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E9%85%8D%E7%BD%AE.html","title":"代码检查配置","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"规则配置","slug":"规则配置","link":"#规则配置","children":[]},{"level":2,"title":"编译配置","slug":"编译配置","link":"#编译配置","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/分析方案/代码检查配置.md"}');export{e as data}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-cb330737.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-cb330737.js" new file mode 100644 index 000000000..d8125fca0 --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-cb330737.js" @@ -0,0 +1 @@ +import{_ as e}from"./scheme_codelint_01-9eec47a6.js";import{_ as a,o as t,c as r,e as s}from"./app-2a91d8ab.js";const c={},n=s('

    代码检查配置

    腾讯云代码分析采用业界/自研的 80+ 款工具,配置代码检查项能够有效地发现代码中存在的异味代码

    规则配置

    规则配置主要是以规则包为元素,由官方规则包自定义规则包两部分组成。平台提供一些系列的官方规则包,覆盖规范、安全、推荐等方面。

    用户可根据项目语言、规则包类型筛选不同的规则包,并启用/关闭规则包。

    提示

    用户可以根据需要选择官方规则包进行扫描,并可以在官方规则包的基础上屏蔽某些规则或者调整默认的优先级,设置指定参数。这些操作都会记录在自定义规则包中。

    自定义规则包是提供给用户自由选择工具规则的包。官方规则包上的调整实质上会记录到自定义规则包中,当自定义规则包中的规则和官方规则包的规则发生冲突,则自定义规则包优先级更高。

    创建项目

    编译配置

    通过编译(代码解析和翻译过程)分析中间代码进行辅助分析,能更精准地发现更多潜在的代码问题。

    ',9),o=[n];function i(_,d){return t(),r("div",null,o)}const l=a(c,[["render",i],["__file","代码检查配置.html.vue"]]);export{l as default}; diff --git "a/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-daa38911.js" "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-daa38911.js" new file mode 100644 index 000000000..b5bc480ef --- /dev/null +++ "b/assets/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html-daa38911.js" @@ -0,0 +1 @@ +import{_ as e}from"./scheme_codelint_01-9eec47a6.js";import{_ as a,o as t,c as r,e as s}from"./app-2a91d8ab.js";const c={},n=s('

    代码检查配置

    腾讯云代码分析采用业界/自研的 80+ 款工具,配置代码检查项能够有效地发现代码中存在的异味代码

    规则配置

    规则配置主要是以规则包为元素,由官方规则包自定义规则包两部分组成。平台提供一些系列的官方规则包,覆盖规范、安全、推荐等方面。

    用户可根据项目语言、规则包类型筛选不同的规则包,并启用/关闭规则包。

    TIP

    用户可以根据需要选择官方规则包进行扫描,并可以在官方规则包的基础上屏蔽某些规则或者调整默认的优先级,设置指定参数。这些操作都会记录在自定义规则包中。

    自定义规则包是提供给用户自由选择工具规则的包。官方规则包上的调整实质上会记录到自定义规则包中,当自定义规则包中的规则和官方规则包的规则发生冲突,则自定义规则包优先级更高。

    创建项目

    编译配置

    通过编译(代码解析和翻译过程)分析中间代码进行辅助分析,能更精准地发现更多潜在的代码问题。

    ',9),o=[n];function i(_,d){return t(),r("div",null,o)}const l=a(c,[["render",i],["__file","代码检查配置.html.vue"]]);export{l as default}; diff --git "a/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-6ed77c45.js" "b/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-6ed77c45.js" new file mode 100644 index 000000000..10d6c9311 --- /dev/null +++ "b/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-6ed77c45.js" @@ -0,0 +1 @@ +import{_ as t,r as i,o as l,c as r,a as n,b as e,d as o,w as c,e as s}from"./app-2a91d8ab.js";const d={},p=s('

    任务分布式执行

    适用场景

    • 以往的单机器单进程,性能比较低,工具排队等待时间过长。希望通过并行执行分析来提高分析效率。

    • 希望尽量使用公共资源或使用专机资源。

    为了满足以上需求,TCA已经进行如下支持:

    • 支持工具在多台机器上并行执行。

    • 支持指定工具在指定的机器上运行。

    • 支持与本地启动的任务衔接,加速本地任务扫描。

    • 配套任务状态监控能力,及时重置初始化超时或机器掉线的任务。

    TIP

    TCA 客户端除了通过 localscan 命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。和本地分析一样,需要先安装环境和必要的工具,并配置好服务端地址。

    常驻节点配置

    ',7);function h(_,u){const a=i("RouterLink");return l(),r("div",null,[p,n("p",null,[e("请参考"),o(a,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html"},{default:c(()=>[e("客户端-常驻节点分析")]),_:1})])])}const f=t(d,[["render",h],["__file","任务分布式执行.html.vue"]]);export{f as default}; diff --git "a/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-7aaf7465.js" "b/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-7aaf7465.js" new file mode 100644 index 000000000..04eae7e90 --- /dev/null +++ "b/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-7aaf7465.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4b1e72ba","path":"/zh/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.html","title":"任务分布式执行","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"适用场景","slug":"适用场景","link":"#适用场景","children":[]},{"level":2,"title":"常驻节点配置","slug":"常驻节点配置","link":"#常驻节点配置","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/任务分布式执行.md"}');export{e as data}; diff --git "a/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-bc7f33c5.js" "b/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-bc7f33c5.js" new file mode 100644 index 000000000..e621b61cb --- /dev/null +++ "b/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-bc7f33c5.js" @@ -0,0 +1 @@ +import{_ as t,r as i,o as l,c as r,a as n,b as e,d as o,w as c,e as s}from"./app-2a91d8ab.js";const d={},p=s('

    任务分布式执行

    适用场景

    • 以往的单机器单进程,性能比较低,工具排队等待时间过长。希望通过并行执行分析来提高分析效率。

    • 希望尽量使用公共资源或使用专机资源。

    为了满足以上需求,TCA已经进行如下支持:

    • 支持工具在多台机器上并行执行。

    • 支持指定工具在指定的机器上运行。

    • 支持与本地启动的任务衔接,加速本地任务扫描。

    • 配套任务状态监控能力,及时重置初始化超时或机器掉线的任务。

    提示

    TCA客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。和本地分析一样,需要先安装环境和必要的工具,并配置好服务端地址。

    常驻节点配置

    ',7);function h(_,u){const a=i("RouterLink");return l(),r("div",null,[p,n("p",null,[e("请参考"),o(a,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html"},{default:c(()=>[e("客户端-常驻节点分析")]),_:1})])])}const f=t(d,[["render",h],["__file","任务分布式执行.html.vue"]]);export{f as default}; diff --git "a/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-ea0b9d04.js" "b/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-ea0b9d04.js" new file mode 100644 index 000000000..0695e597f --- /dev/null +++ "b/assets/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html-ea0b9d04.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5f228e44","path":"/en/advanced/%E4%BB%BB%E5%8A%A1%E5%88%86%E5%B8%83%E5%BC%8F%E6%89%A7%E8%A1%8C.html","title":"任务分布式执行","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"适用场景","slug":"适用场景","link":"#适用场景","children":[]},{"level":2,"title":"常驻节点配置","slug":"常驻节点配置","link":"#常驻节点配置","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/任务分布式执行.md"}');export{e as data}; diff --git "a/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-13248996.js" "b/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-13248996.js" new file mode 100644 index 000000000..20bf7dc3a --- /dev/null +++ "b/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-13248996.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-736a6678","path":"/zh/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"任务管理模块","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"执行指定代码库指定分析项目扫描任务","slug":"执行指定代码库指定分析项目扫描任务","link":"#执行指定代码库指定分析项目扫描任务","children":[]},{"level":2,"title":"查看指定项目的任务列表","slug":"查看指定项目的任务列表","link":"#查看指定项目的任务列表","children":[]},{"level":2,"title":"查看指定项目的指定任务详情","slug":"查看指定项目的指定任务详情","link":"#查看指定项目的指定任务详情","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/api/任务管理模块接口.md"}');export{e as data}; diff --git "a/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-b2f03717.js" "b/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-b2f03717.js" new file mode 100644 index 000000000..606b5fbc7 --- /dev/null +++ "b/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-b2f03717.js" @@ -0,0 +1,84 @@ +import{_ as t,o as e,c as d,e as i}from"./app-2a91d8ab.js";const n={},s=i(`

    任务管理模块

    执行指定代码库指定分析项目扫描任务

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/scans/create/
    +

    参数列表

    参数类型描述
    incr_scanbool增量扫描标志,true表示增量,false表示全量
    async_flagbool异步启动标志,true表示异步,false表示同步,建议选择异步
    force_createbool强制启动标志,true表示强制启动,不等待上一个任务结束

    返回结果

    {
    +    "job": {
    +        "id": 7974
    +    },
    +    "scan": {
    +        "id": 5528
    +    }
    +}
    +

    查看指定项目的任务列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/
    +

    参数列表

    参数类型描述
    create_time_gtedatetime最小任务启动时间
    create_time_ltedatetime最大任务启动时间
    result_code_gteint最小错误码值
    result_code_lteint最大错误码值
    result_msgstr结果信息
    stateint任务状态, 0为等待中,1为执行中,2为关闭,3为入库中,可多选,格式为1,2,3
    created_fromstr创建来源
    creatorstr创建用户

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "state": 2,
    +                "result_code": 0,
    +                "result_msg": "success",
    +                "code_line_num": 1000,
    +                "comment_line_num": 5,
    +                "blank_line_num": 305,
    +                "total_line_num": 1400
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的指定任务详情

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/<job_id>/detail/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "scan_id": 1,
    +        "create_time": "2021-01-28T10:27:26.442961+08:00",
    +        "waiting_time": "1",
    +        "start_time": "2021-01-28T11:14:56.760427+08:00",
    +        "execute_time": "3",
    +        "project": {
    +            "id": 1,
    +            "branch": "master",
    +            "repo_id": 1,
    +            "scan_scheme": 1,
    +            "repo_scm_url": "http://github.com/xxx/test_demo.git"
    +        },
    +        "end_time": "2021-01-28T11:14:59.760427+08:00",
    +        "expire_time": "2021-01-28T14:07:52.968932+08:00",
    +        "task_num": 1,
    +        "task_done": 1,
    +        "tasks": [
    +            {
    +                "id": 1,
    +                "module": "codelint",
    +                "task_name": "pylint",
    +                "progress_rate": 1,
    +                "state": 2,
    +                "result_code": 0,
    +                "result_msg": "success",
    +                "result_path": null
    +            }
    +        ],
    +        "co_jobs": [],
    +        "state": 2,
    +        "result_code": 0,
    +        "result_code_msg": null,
    +        "result_msg": "success",
    +        "result_path": null,
    +        "remarks": null,
    +        "remarked_by": null,
    +        "code_line_num": 1000,
    +        "comment_line_num": 5,
    +        "blank_line_num": 305,
    +        "total_line_num": 1400,
    +        "created_from": "codedog_web",
    +        "creator": "creator"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    `,17),u=[s];function a(l,r){return e(),d("div",null,u)}const c=t(n,[["render",a],["__file","任务管理模块接口.html.vue"]]);export{c as default}; diff --git "a/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-d04cb684.js" "b/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-d04cb684.js" new file mode 100644 index 000000000..e14c9abb4 --- /dev/null +++ "b/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-d04cb684.js" @@ -0,0 +1,84 @@ +import{_ as t,o as e,c as d,e as i}from"./app-2a91d8ab.js";const n={},s=i(`

    任务管理模块

    执行指定代码库指定分析项目扫描任务

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/scans/create/
    +

    参数列表

    参数类型描述
    incr_scanbool选填,增量扫描标志,true表示增量,false表示全量
    async_flagbool选填,异步启动标志,true表示异步,false表示同步,建议选择异步
    force_createbool选填,强制启动标志,true表示强制启动,不等待上一个任务结束

    返回结果

    {
    +    "job": {
    +        "id": 7974
    +    },
    +    "scan": {
    +        "id": 5528
    +    }
    +}
    +

    查看指定项目的任务列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/
    +

    参数列表

    参数类型描述
    create_time_gtedatetime选填,最小任务启动时间
    create_time_ltedatetime选填,最大任务启动时间
    result_code_gteint选填,最小错误码值
    result_code_lteint选填,最大错误码值
    result_msgstr选填,结果信息
    stateint选填,任务状态, 0为等待中,1为执行中,2为关闭,3为入库中,可多选,格式为1,2,3
    created_fromstr选填,创建来源
    creatorstr选填,创建用户

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "state": 2,
    +                "result_code": 0,
    +                "result_msg": "success",
    +                "code_line_num": 1000,
    +                "comment_line_num": 5,
    +                "blank_line_num": 305,
    +                "total_line_num": 1400
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的指定任务详情

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/<job_id>/detail/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "scan_id": 1,
    +        "create_time": "2021-01-28T10:27:26.442961+08:00",
    +        "waiting_time": "1",
    +        "start_time": "2021-01-28T11:14:56.760427+08:00",
    +        "execute_time": "3",
    +        "project": {
    +            "id": 1,
    +            "branch": "master",
    +            "repo_id": 1,
    +            "scan_scheme": 1,
    +            "repo_scm_url": "http://github.com/xxx/test_demo.git"
    +        },
    +        "end_time": "2021-01-28T11:14:59.760427+08:00",
    +        "expire_time": "2021-01-28T14:07:52.968932+08:00",
    +        "task_num": 1,
    +        "task_done": 1,
    +        "tasks": [
    +            {
    +                "id": 1,
    +                "module": "codelint",
    +                "task_name": "pylint",
    +                "progress_rate": 1,
    +                "state": 2,
    +                "result_code": 0,
    +                "result_msg": "success",
    +                "result_path": null
    +            }
    +        ],
    +        "co_jobs": [],
    +        "state": 2,
    +        "result_code": 0,
    +        "result_code_msg": null,
    +        "result_msg": "success",
    +        "result_path": null,
    +        "remarks": null,
    +        "remarked_by": null,
    +        "code_line_num": 1000,
    +        "comment_line_num": 5,
    +        "blank_line_num": 305,
    +        "total_line_num": 1400,
    +        "created_from": "codedog_web",
    +        "creator": "creator"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    `,17),u=[s];function a(l,r){return e(),d("div",null,u)}const c=t(n,[["render",a],["__file","任务管理模块接口.html.vue"]]);export{c as default}; diff --git "a/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-ed2aa571.js" "b/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-ed2aa571.js" new file mode 100644 index 000000000..bf7aa13cd --- /dev/null +++ "b/assets/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-ed2aa571.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6981ad02","path":"/en/api/%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"任务管理模块","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"执行指定代码库指定分析项目扫描任务","slug":"执行指定代码库指定分析项目扫描任务","link":"#执行指定代码库指定分析项目扫描任务","children":[]},{"level":2,"title":"查看指定项目的任务列表","slug":"查看指定项目的任务列表","link":"#查看指定项目的任务列表","children":[]},{"level":2,"title":"查看指定项目的指定任务详情","slug":"查看指定项目的指定任务详情","link":"#查看指定项目的指定任务详情","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/api/任务管理模块接口.md"}');export{e as data}; diff --git "a/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-787a0684.js" "b/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-787a0684.js" new file mode 100644 index 000000000..e22a6a22b --- /dev/null +++ "b/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-787a0684.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-f9c3256c","path":"/en/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93.html","title":"使用自建工具git库","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"为什么要自建工具库","slug":"为什么要自建工具库","link":"#为什么要自建工具库","children":[]},{"level":2,"title":"如何使用其他工具库","slug":"如何使用其他工具库","link":"#如何使用其他工具库","children":[]},{"level":2,"title":"其他工具库建议","slug":"其他工具库建议","link":"#其他工具库建议","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/使用自建工具git库.md"}');export{e as data}; diff --git "a/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-8a45c991.js" "b/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-8a45c991.js" new file mode 100644 index 000000000..5c5eaf116 --- /dev/null +++ "b/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-8a45c991.js" @@ -0,0 +1,69 @@ +import{_ as s,r as d,o as a,c as v,a as n,b as e,d as l,e as r}from"./app-2a91d8ab.js";const t={},c=r(`

    使用自建工具git库

    为什么要自建工具库

    • Github 对lfs流量有控制导致部分工具拉不下来
    • Github 下载速度有差异,为保证拉取速度建议使用流畅的工具库

    如何使用其他工具库

    1. 工具相对应的仓库地址,环境变量全部存储在puppy-tools-config仓库中,可通过fork该仓库,修改指定的工具仓库
    2. 修改client/config.ini中的字段指定puppy-tools-config,如下
    [COMMON]
    +; [必填]工具配置库git地址
    +; 如果github网络慢,建议修改为腾讯工蜂地址:https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git
    +; 这里可以修改为自己维护的puppy-tools-config
    +TOOL_CONFIG_URL=
    +PASSWORD_KEY=
    +; [可选]日志级别,默认为info级别,设置为True则调整为debug级别
    +DEBUG=
    +; [可选]是否使用本地工具目录,默认为False,如果设置为True,不从git拉取(需要事先准备好工具,存放到tools目录下)
    +USE_LOCAL_TOOL=
    +
    +[TOOL_LOAD_ACCOUNT]
    +; [可选]拉取工具库的账号密码
    +; 如果TOOL_CONFIG_URL使用的是腾讯工蜂,账号密码必填(如果没有,可以先去https://git.code.tencent.com注册)
    +USERNAME=
    +PASSWORD=
    +
    1. 修改puppy-tools-config,如下例
    ; ---------------------------------------------------------------------------------------------------------------------
    +; 配置文件填写说明:
    +; 填写过程中,如果有多个值,用英文分号分隔
    +; [env_path]    - 环境变量路径定义,基于tools目录的相对路径,比如:PYLINT_HOME : puppy_tools_common/pylint-1.4.5
    +; [env_value]   - 环境变量值定义,比如:GIT_SSL_NO_VERIFY : 1
    +; [tool_url]    - 工具库地址定义,格式:工具名:url,比如 CHECKSTYLE : http://xxxxxx.git
    +; [common]      - 公共环境配置,比如git环境变量等, 包含以下4个字段
    +;                 env_path  - 需要的环境变量路径,填写[env_path]中的KEY值,比如 env_path : ANDROID_HOME;CHECKSTYLE_HOME
    +;                 env_value - 需要的环境变量值,填写[env_value]中的KEY值,比如 env_value : GIT_SSL_NO_VERIFY
    +;                 path      - 需要加到path环境变量中的路径,基于tools目录的相对路径,推荐使用变量格式,比如 path : \${env_path:PYLINT_HOME}/bin
    +;                 tool_url  - 需要拉取的工具库,多个地址用英文分号分隔,推荐使用变量格式,比如 tool_url : \${tool_url:PYLINT}
    +; [工具名]       - 各工具配置,工具名需要与tool目录下的模块名匹配,字段格式参考[common]
    +; ---------------------------------------------------------------------------------------------------------------------
    +[base_value]
    +git_url=https://github.com/TCATools
    +
    +;------------------
    +;  1.环境变量路径定义
    +;------------------
    +; 用来记录工具路径,会在工具执行时写入到环境变量中
    +[env_path]
    +CPPLINT_HOME      : cpplint
    +
    +;------------------
    +;  2.环境变量值定义
    +;------------------
    +; 记录部分环境变量并在执行时写入环境变量
    +[env_value]
    +PYTHON_VERSION    : 3
    +
    +
    +;------------------
    +;  3.工具git库定义
    +;------------------
    +; 拉工具的仓库地址
    +[tool_url]
    +CPPLINT       : \${base_value:git_url}/cpplint.git
    +
    +;------------------
    +;  5.各个工具配置
    +;------------------
    +; 整合工具配置
    +[cpplint]
    +env_path  : CPPLINT_HOME
    +env_value : PYTHON_VERSION
    +path      : \${env_path:CPPLINT_HOME}
    +tool_url  : \${tool_url:CPPLINT}
    +
    1. 修改拉取工具需要的账号密码 账号密码需在client/config.ini中指定
    [TOOL_LOAD_ACCOUNT]
    +; [可选]拉取工具库的账号密码
    +; 如果使用的工具仓库必须账号密码才能拉取则必须填写
    +USERNAME=
    +PASSWORD=
    +

    其他工具库建议

    `,11),u={href:"https://git.code.tencent.com/groups/TCA/tca-tools/-/projects/list",target:"_blank",rel:"noopener noreferrer"},o={href:"https://docs.gitlab.cn/jh/install/docker.html",target:"_blank",rel:"noopener noreferrer"};function m(b,_){const i=d("ExternalLinkIcon");return a(),v("div",null,[c,n("ol",null,[n("li",null,[n("a",u,[e("腾讯工蜂"),l(i)])]),n("li",null,[n("a",o,[e("自建GitLab"),l(i)])])])])}const p=s(t,[["render",m],["__file","使用自建工具git库.html.vue"]]);export{p as default}; diff --git "a/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-b41c8e9c.js" "b/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-b41c8e9c.js" new file mode 100644 index 000000000..fae829e64 --- /dev/null +++ "b/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-b41c8e9c.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-281ecd65","path":"/zh/advanced/%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E5%85%B7git%E5%BA%93.html","title":"使用自建工具git库","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"为什么要自建工具库","slug":"为什么要自建工具库","link":"#为什么要自建工具库","children":[]},{"level":2,"title":"如何使用其他工具库","slug":"如何使用其他工具库","link":"#如何使用其他工具库","children":[]},{"level":2,"title":"其他工具库建议","slug":"其他工具库建议","link":"#其他工具库建议","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/使用自建工具git库.md"}');export{e as data}; diff --git "a/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-ba1393b3.js" "b/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-ba1393b3.js" new file mode 100644 index 000000000..5c5eaf116 --- /dev/null +++ "b/assets/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html-ba1393b3.js" @@ -0,0 +1,69 @@ +import{_ as s,r as d,o as a,c as v,a as n,b as e,d as l,e as r}from"./app-2a91d8ab.js";const t={},c=r(`

    使用自建工具git库

    为什么要自建工具库

    • Github 对lfs流量有控制导致部分工具拉不下来
    • Github 下载速度有差异,为保证拉取速度建议使用流畅的工具库

    如何使用其他工具库

    1. 工具相对应的仓库地址,环境变量全部存储在puppy-tools-config仓库中,可通过fork该仓库,修改指定的工具仓库
    2. 修改client/config.ini中的字段指定puppy-tools-config,如下
    [COMMON]
    +; [必填]工具配置库git地址
    +; 如果github网络慢,建议修改为腾讯工蜂地址:https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git
    +; 这里可以修改为自己维护的puppy-tools-config
    +TOOL_CONFIG_URL=
    +PASSWORD_KEY=
    +; [可选]日志级别,默认为info级别,设置为True则调整为debug级别
    +DEBUG=
    +; [可选]是否使用本地工具目录,默认为False,如果设置为True,不从git拉取(需要事先准备好工具,存放到tools目录下)
    +USE_LOCAL_TOOL=
    +
    +[TOOL_LOAD_ACCOUNT]
    +; [可选]拉取工具库的账号密码
    +; 如果TOOL_CONFIG_URL使用的是腾讯工蜂,账号密码必填(如果没有,可以先去https://git.code.tencent.com注册)
    +USERNAME=
    +PASSWORD=
    +
    1. 修改puppy-tools-config,如下例
    ; ---------------------------------------------------------------------------------------------------------------------
    +; 配置文件填写说明:
    +; 填写过程中,如果有多个值,用英文分号分隔
    +; [env_path]    - 环境变量路径定义,基于tools目录的相对路径,比如:PYLINT_HOME : puppy_tools_common/pylint-1.4.5
    +; [env_value]   - 环境变量值定义,比如:GIT_SSL_NO_VERIFY : 1
    +; [tool_url]    - 工具库地址定义,格式:工具名:url,比如 CHECKSTYLE : http://xxxxxx.git
    +; [common]      - 公共环境配置,比如git环境变量等, 包含以下4个字段
    +;                 env_path  - 需要的环境变量路径,填写[env_path]中的KEY值,比如 env_path : ANDROID_HOME;CHECKSTYLE_HOME
    +;                 env_value - 需要的环境变量值,填写[env_value]中的KEY值,比如 env_value : GIT_SSL_NO_VERIFY
    +;                 path      - 需要加到path环境变量中的路径,基于tools目录的相对路径,推荐使用变量格式,比如 path : \${env_path:PYLINT_HOME}/bin
    +;                 tool_url  - 需要拉取的工具库,多个地址用英文分号分隔,推荐使用变量格式,比如 tool_url : \${tool_url:PYLINT}
    +; [工具名]       - 各工具配置,工具名需要与tool目录下的模块名匹配,字段格式参考[common]
    +; ---------------------------------------------------------------------------------------------------------------------
    +[base_value]
    +git_url=https://github.com/TCATools
    +
    +;------------------
    +;  1.环境变量路径定义
    +;------------------
    +; 用来记录工具路径,会在工具执行时写入到环境变量中
    +[env_path]
    +CPPLINT_HOME      : cpplint
    +
    +;------------------
    +;  2.环境变量值定义
    +;------------------
    +; 记录部分环境变量并在执行时写入环境变量
    +[env_value]
    +PYTHON_VERSION    : 3
    +
    +
    +;------------------
    +;  3.工具git库定义
    +;------------------
    +; 拉工具的仓库地址
    +[tool_url]
    +CPPLINT       : \${base_value:git_url}/cpplint.git
    +
    +;------------------
    +;  5.各个工具配置
    +;------------------
    +; 整合工具配置
    +[cpplint]
    +env_path  : CPPLINT_HOME
    +env_value : PYTHON_VERSION
    +path      : \${env_path:CPPLINT_HOME}
    +tool_url  : \${tool_url:CPPLINT}
    +
    1. 修改拉取工具需要的账号密码 账号密码需在client/config.ini中指定
    [TOOL_LOAD_ACCOUNT]
    +; [可选]拉取工具库的账号密码
    +; 如果使用的工具仓库必须账号密码才能拉取则必须填写
    +USERNAME=
    +PASSWORD=
    +

    其他工具库建议

    `,11),u={href:"https://git.code.tencent.com/groups/TCA/tca-tools/-/projects/list",target:"_blank",rel:"noopener noreferrer"},o={href:"https://docs.gitlab.cn/jh/install/docker.html",target:"_blank",rel:"noopener noreferrer"};function m(b,_){const i=d("ExternalLinkIcon");return a(),v("div",null,[c,n("ol",null,[n("li",null,[n("a",u,[e("腾讯工蜂"),l(i)])]),n("li",null,[n("a",o,[e("自建GitLab"),l(i)])])])])}const p=s(t,[["render",m],["__file","使用自建工具git库.html.vue"]]);export{p as default}; diff --git "a/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-21ce6df9.js" "b/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-21ce6df9.js" new file mode 100644 index 000000000..b51f91b60 --- /dev/null +++ "b/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-21ce6df9.js" @@ -0,0 +1,2 @@ +import{_ as o,o as e,c as i,e as c}from"./app-2a91d8ab.js";const d={},t=c(`

    其他配置与用法

    1. 配置使用本地工具

    注意

    如果由于网络原因,执行时无法从github自动拉取工具,或拉取比较慢,可以参考基础配置腾讯工蜂工具地址,或使用以下方式预先下载好工具,配置使用本地工具目录。

    • (1)如果使用的是开源版Client源码,需要在命令行(windows环境下可以启动git bash)中执行以下命令:
    bash ./scripts/base/install_bin.sh
    +
    • (2)下载工具配置库 https://github.com/TCATools/puppy-tools-config.git ,存放到 tools目录下(如果未生成,可先创建该目录)。
    • (3)根据当前机器操作系统,查看puppy-tools-config目录下的linux_tools.inimac_tools.iniwindows_tools.ini文件,将[tool_url]中声明的所有工具下载到 tools目录下。
    • (4)填写client/config.ini中的配置:USE_LOCAL_TOOL=True,即可使用下载好的本地工具,不自动拉取和更新工具。

    2. 使用自建git server存放工具

    注意

    如果自己搭建了一套git server,可以将工具配置库 https://github.com/TCATools/puppy-tools-config.git 以及里面声明的工具仓库,存放到自建git serevr上。

    • (1)将工具配置库 https://github.com/TCATools/puppy-tools-config.git 上传到自建git仓库。
    • (2)按所需的操作系统,将puppy-tools-config仓库下的linux_tools.inimac_tools.iniwindows_tools.ini文件中[tool_url]声明的所有工具库,上传到自建git仓库。
    • (3)修改linux_tools.inimac_tools.iniwindows_tools.ini文件中[base_value]中的git_url为自建git server地址。
    • (4)修改client/config.ini中的TOOL_CONFIG_URL为自建git server的puppy-tools-config仓库地址。
    • (5)填写client/config.ini中的[TOOL_LOAD_ACCOUNT]配置,输入有拉取权限的用户名密码,即可使用自建git server拉取工具。

    3. git lfs带宽和存储配额不够问题

    • 如果git拉取工具时,出现git lfs拉取失败,可能是lfs带宽和存储配额不够,可以打开对应的工具github页面,通过Download ZIP的方式下载工具压缩包,再解压到tools目录下。
    `,11),l=[t];function s(n,a){return e(),i("div",null,l)}const u=o(d,[["render",s],["__file","其他配置.html.vue"]]);export{u as default}; diff --git "a/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-44a6f109.js" "b/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-44a6f109.js" new file mode 100644 index 000000000..798230841 --- /dev/null +++ "b/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-44a6f109.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6f03892b","path":"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.html","title":"其他配置与用法","lang":"zh-CN","frontmatter":{},"headers":[{"level":3,"title":"1. 配置使用本地工具","slug":"_1-配置使用本地工具","link":"#_1-配置使用本地工具","children":[]},{"level":3,"title":"2. 使用自建git server存放工具","slug":"_2-使用自建git-server存放工具","link":"#_2-使用自建git-server存放工具","children":[]},{"level":3,"title":"3. git lfs带宽和存储配额不够问题","slug":"_3-git-lfs带宽和存储配额不够问题","link":"#_3-git-lfs带宽和存储配额不够问题","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/客户端/其他配置.md"}');export{e as data}; diff --git "a/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-5d155cf4.js" "b/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-5d155cf4.js" new file mode 100644 index 000000000..2e91a5055 --- /dev/null +++ "b/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-5d155cf4.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-66bece26","path":"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.html","title":"其他配置与用法","lang":"en-US","frontmatter":{},"headers":[{"level":3,"title":"1. 配置使用本地工具","slug":"_1-配置使用本地工具","link":"#_1-配置使用本地工具","children":[]},{"level":3,"title":"2. 使用自建git server存放工具","slug":"_2-使用自建git-server存放工具","link":"#_2-使用自建git-server存放工具","children":[]},{"level":3,"title":"3. git lfs带宽和存储配额不够问题","slug":"_3-git-lfs带宽和存储配额不够问题","link":"#_3-git-lfs带宽和存储配额不够问题","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/客户端/其他配置.md"}');export{e as data}; diff --git "a/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-91b8f003.js" "b/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-91b8f003.js" new file mode 100644 index 000000000..04667a4e9 --- /dev/null +++ "b/assets/\345\205\266\344\273\226\351\205\215\347\275\256.html-91b8f003.js" @@ -0,0 +1,2 @@ +import{_ as o,o as e,c as i,e as c}from"./app-2a91d8ab.js";const d={},t=c(`

    其他配置与用法

    1. 配置使用本地工具

    WARNING

    如果由于网络原因,执行时无法从github自动拉取工具,或拉取比较慢,可以参考基础配置腾讯工蜂工具地址,或使用以下方式预先下载好工具,配置使用本地工具目录。

    • (1)如果使用的是开源版Client源码,需要在命令行(windows环境下可以启动git bash)中执行以下命令:
    bash ./scripts/base/install_bin.sh
    +
    • (2)下载工具配置库 https://github.com/TCATools/puppy-tools-config.git ,存放到 tools目录下(如果未生成,可先创建该目录)。
    • (3)根据当前机器操作系统,查看puppy-tools-config目录下的linux_tools.inimac_tools.iniwindows_tools.ini文件,将[tool_url]中声明的所有工具下载到 tools目录下。
    • (4)填写client/config.ini中的配置:USE_LOCAL_TOOL=True,即可使用下载好的本地工具,不自动拉取和更新工具。

    2. 使用自建git server存放工具

    WARNING

    如果自己搭建了一套git server,可以将工具配置库 https://github.com/TCATools/puppy-tools-config.git 以及里面声明的工具仓库,存放到自建git serevr上。

    • (1)将工具配置库 https://github.com/TCATools/puppy-tools-config.git 上传到自建git仓库。
    • (2)按所需的操作系统,将puppy-tools-config仓库下的linux_tools.inimac_tools.iniwindows_tools.ini文件中[tool_url]声明的所有工具库,上传到自建git仓库。
    • (3)修改linux_tools.inimac_tools.iniwindows_tools.ini文件中[base_value]中的git_url为自建git server地址。
    • (4)修改client/config.ini中的TOOL_CONFIG_URL为自建git server的puppy-tools-config仓库地址。
    • (5)填写client/config.ini中的[TOOL_LOAD_ACCOUNT]配置,输入有拉取权限的用户名密码,即可使用自建git server拉取工具。

    3. git lfs带宽和存储配额不够问题

    • 如果git拉取工具时,出现git lfs拉取失败,可能是lfs带宽和存储配额不够,可以打开对应的工具github页面,通过Download ZIP的方式下载工具压缩包,再解压到tools目录下。
    `,11),l=[t];function s(n,a){return e(),i("div",null,l)}const u=o(d,[["render",s],["__file","其他配置.html.vue"]]);export{u as default}; diff --git "a/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-2b92cddd.js" "b/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-2b92cddd.js" new file mode 100644 index 000000000..fea675e5a --- /dev/null +++ "b/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-2b92cddd.js" @@ -0,0 +1 @@ +import{_ as t,a as r}from"./scheme_template_02-70fd366c.js";import{_ as e,o as s,c as a,e as o}from"./app-2a91d8ab.js";const i={},p=o('

    分析方案模版

    为便于用户快速创建代码库进行分析,复用同类型的分析配置,平台提供了分析方案模板功能。

    分析方案模板分为系统方案模板个人自定义方案模板

    • 系统方案模板

      全局可用。但是用户无法变更系统方案模板内容。如系统方案模板产生变更,需用户自行拉取最新模板内容。

      同步分析方案模板配置

    • 个人自定义方案模板

      自定义方案模板与团队挂钩,用户可自行创建、更新、同步方案模板,以及可进行权限控制。默认自定义方案模板团队内都可见。

      自定义方案模板权限管理

    分析方案模版用于在创建分析方案时作为模版参考。分析方案模版全局可用,不用和某个代码库关联。

    使用说明

    • 创建分析项目时,可选择使用分析方案模板创建。默认会根据该分析方案模板创建出一个新的分析方案,并用该方案配置进行分析项目创建。

    • 创建分析方案时,可选择使用分析方案模板创建。

    • 用模版生成的分析方案和模版建立关联关系,当模版和生成的方案由差异时,可以由用户选择是否同步模版的内容到方案。并可以选择拉群哪些功能模块的配置。

    ',7),n=[p];function _(l,c){return s(),a("div",null,n)}const g=e(i,[["render",_],["__file","分析方案模板说明.html.vue"]]);export{g as default}; diff --git "a/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-93191e95.js" "b/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-93191e95.js" new file mode 100644 index 000000000..fd679eb5d --- /dev/null +++ "b/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-93191e95.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-05649ec6","path":"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E.html","title":"分析方案模版","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用说明","slug":"使用说明","link":"#使用说明","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/分析方案/分析方案模板说明.md"}');export{e as data}; diff --git "a/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-d1dabf97.js" "b/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-d1dabf97.js" new file mode 100644 index 000000000..fea675e5a --- /dev/null +++ "b/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-d1dabf97.js" @@ -0,0 +1 @@ +import{_ as t,a as r}from"./scheme_template_02-70fd366c.js";import{_ as e,o as s,c as a,e as o}from"./app-2a91d8ab.js";const i={},p=o('

    分析方案模版

    为便于用户快速创建代码库进行分析,复用同类型的分析配置,平台提供了分析方案模板功能。

    分析方案模板分为系统方案模板个人自定义方案模板

    • 系统方案模板

      全局可用。但是用户无法变更系统方案模板内容。如系统方案模板产生变更,需用户自行拉取最新模板内容。

      同步分析方案模板配置

    • 个人自定义方案模板

      自定义方案模板与团队挂钩,用户可自行创建、更新、同步方案模板,以及可进行权限控制。默认自定义方案模板团队内都可见。

      自定义方案模板权限管理

    分析方案模版用于在创建分析方案时作为模版参考。分析方案模版全局可用,不用和某个代码库关联。

    使用说明

    • 创建分析项目时,可选择使用分析方案模板创建。默认会根据该分析方案模板创建出一个新的分析方案,并用该方案配置进行分析项目创建。

    • 创建分析方案时,可选择使用分析方案模板创建。

    • 用模版生成的分析方案和模版建立关联关系,当模版和生成的方案由差异时,可以由用户选择是否同步模版的内容到方案。并可以选择拉群哪些功能模块的配置。

    ',7),n=[p];function _(l,c){return s(),a("div",null,n)}const g=e(i,[["render",_],["__file","分析方案模板说明.html.vue"]]);export{g as default}; diff --git "a/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-d6a11aa1.js" "b/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-d6a11aa1.js" new file mode 100644 index 000000000..f1c5aabac --- /dev/null +++ "b/assets/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html-d6a11aa1.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7b5fb5ab","path":"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88%E6%A8%A1%E6%9D%BF%E8%AF%B4%E6%98%8E.html","title":"分析方案模版","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"使用说明","slug":"使用说明","link":"#使用说明","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/分析方案/分析方案模板说明.md"}');export{e as data}; diff --git "a/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-2dac9266.js" "b/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-2dac9266.js" new file mode 100644 index 000000000..2d7213547 --- /dev/null +++ "b/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-2dac9266.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2aa9208a","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html","title":"代码检查结果查看","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"问题列表","slug":"问题列表","link":"#问题列表","children":[]},{"level":2,"title":"问题详情","slug":"问题详情","link":"#问题详情","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/分析结果查看.md"}');export{e as data}; diff --git "a/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-d5884e54.js" "b/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-d5884e54.js" new file mode 100644 index 000000000..48b74a9f5 --- /dev/null +++ "b/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-d5884e54.js" @@ -0,0 +1 @@ +import{_ as e,a,b as r}from"./codelint_03-8fa68424.js";import{_ as t,o,c as s,e as i}from"./app-2a91d8ab.js";const c={},p=i('

    代码检查结果查看

    客户端分析完毕后,如果分析方案含有代码检查功能,则代码分析结束后会上报结果信息到腾讯云代码分析平台,用户可在平台上查看问题列表及详情。

    问题列表

    问题列表

    进入代码检查问题列表页面后,默认展示**当前分支 + 当前分析方案(即分析项目)**发现的全部未处理问题。

    如果仅希望查看增量问题,可以进入分析历史页面,指定查看某一次的扫描结果即可。也可以在过滤筛选项中填入发现问题的扫描 id进行筛选查看结果(该id为扫描任务 ID,需要到扫描任务列表中查询)。

    • 责任人说明

      责任人为 git blame操作得到的代码提交人。

    • 问题级别说明

      代码检查的问题级别是根据对应分析方案中规则设置的严重级别定义的,从高到低分为 致命、错误、警告、提示 。如果调整问题级别,则需要进入分析方案中调整这个规则的严重级别,调整后需要进行全量扫描使得调整生效。

    • 批量处理说明

      问题列表支持批量修改问题状态。

      批量处理

    问题详情

    点击规则信息可以查看规则说明。

    查看规则详情

    ',10),d=[p];function n(_,l){return o(),s("div",null,d)}const g=t(c,[["render",n],["__file","分析结果查看.html.vue"]]);export{g as default}; diff --git "a/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-effefb84.js" "b/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-effefb84.js" new file mode 100644 index 000000000..382cabf07 --- /dev/null +++ "b/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-effefb84.js" @@ -0,0 +1 @@ +import{_ as e,a as o,b as t}from"./codelint_03-8fa68424.js";import{_ as a,o as r,c as s,e as c}from"./app-2a91d8ab.js";const i="/CodeAnalysis/assets/codelint_04-0c416697.png",d={},p=c('

    代码检查结果查看

    代码分析完毕后,可在分支概览页面查看分析结果概览。如果分析方案含有代码检查功能,则会上报代码检查结果信息到腾讯云代码分析平台,用户可在平台上查看问题列表及问题详情。 问题列表

    问题列表

    问题列表

    进入代码检查问题列表页面后,默认展示当前分析项目发现的全部未处理问题。

    如果仅希望查看增量问题,可以进入分析历史页面,指定查看某一次的扫描结果即可。也可以在过滤筛选项中填入发现问题的扫描 id进行筛选查看结果(该id为扫描任务 ID,需要到扫描任务列表中查询)。

    • 责任人说明

      责任人为 git blame操作得到的代码提交人。

    • 问题级别说明

      代码检查的问题级别是根据对应分析方案中规则设置的严重级别定义的,从高到低分为 致命、错误、警告、提示 。如果调整问题级别,则需要进入分析方案中调整这个规则的严重级别,调整后需要进行全量扫描使得调整生效。

    • 批量处理说明

      问题列表支持批量修改问题状态。

      批量处理

    问题详情

    点击规则信息可以查看规则说明。

    查看规则详情

    ',10),n=[p];function _(l,h){return r(),s("div",null,n)}const f=a(d,[["render",_],["__file","分析结果查看.html.vue"]]);export{f as default}; diff --git "a/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-f1a2e8c4.js" "b/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-f1a2e8c4.js" new file mode 100644 index 000000000..512b03a92 --- /dev/null +++ "b/assets/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html-f1a2e8c4.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3c5ef996","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html","title":"代码检查结果查看","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"问题列表","slug":"问题列表","link":"#问题列表","children":[]},{"level":2,"title":"问题详情","slug":"问题详情","link":"#问题详情","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/分析结果查看.md"}');export{e as data}; diff --git "a/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-130acaf2.js" "b/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-130acaf2.js" new file mode 100644 index 000000000..f4f859e4b --- /dev/null +++ "b/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-130acaf2.js" @@ -0,0 +1 @@ +import{_ as l}from"./manage_job_01-8f68e1e2.js";import{_,o as n,c as o,a as e,b as t}from"./app-2a91d8ab.js";const s={},r=e("h1",{id:"分析记录管理",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#分析记录管理","aria-hidden":"true"},"#"),t(" 分析记录管理")],-1),a=e("ul",null,[e("li",null,[e("p",null,[t("可查看平台"),e("strong",null,"全部分析记录"),t("。")])]),e("li",null,[e("p",null,[t("可点击查阅"),e("strong",null,"分析记录详情"),t("。")])])],-1),c=e("p",null,[e("img",{src:l,alt:"分析记录列表"})],-1),i=[r,a,c];function d(u,h){return n(),o("div",null,i)}const p=_(s,[["render",d],["__file","分析记录管理.html.vue"]]);export{p as default}; diff --git "a/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-560b2bd2.js" "b/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-560b2bd2.js" new file mode 100644 index 000000000..4fcb6f1cd --- /dev/null +++ "b/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-560b2bd2.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-46f099d9","path":"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86.html","title":"分析记录管理","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/后台管理/分析记录管理.md"}');export{e as data}; diff --git "a/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-613c8218.js" "b/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-613c8218.js" new file mode 100644 index 000000000..f4f859e4b --- /dev/null +++ "b/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-613c8218.js" @@ -0,0 +1 @@ +import{_ as l}from"./manage_job_01-8f68e1e2.js";import{_,o as n,c as o,a as e,b as t}from"./app-2a91d8ab.js";const s={},r=e("h1",{id:"分析记录管理",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#分析记录管理","aria-hidden":"true"},"#"),t(" 分析记录管理")],-1),a=e("ul",null,[e("li",null,[e("p",null,[t("可查看平台"),e("strong",null,"全部分析记录"),t("。")])]),e("li",null,[e("p",null,[t("可点击查阅"),e("strong",null,"分析记录详情"),t("。")])])],-1),c=e("p",null,[e("img",{src:l,alt:"分析记录列表"})],-1),i=[r,a,c];function d(u,h){return n(),o("div",null,i)}const p=_(s,[["render",d],["__file","分析记录管理.html.vue"]]);export{p as default}; diff --git "a/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-94fd5a90.js" "b/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-94fd5a90.js" new file mode 100644 index 000000000..c626889a4 --- /dev/null +++ "b/assets/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html-94fd5a90.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-ceb7b898","path":"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%88%86%E6%9E%90%E8%AE%B0%E5%BD%95%E7%AE%A1%E7%90%86.html","title":"分析记录管理","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/后台管理/分析记录管理.md"}');export{e as data}; diff --git "a/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-2e60458d.js" "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-2e60458d.js" new file mode 100644 index 000000000..28c4aa01a --- /dev/null +++ "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-2e60458d.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e38c74ec","path":"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html","title":"团队管理","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/后台管理/团队管理.md"}');export{e as data}; diff --git "a/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-4a60f4f5.js" "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-4a60f4f5.js" new file mode 100644 index 000000000..8a0f98005 --- /dev/null +++ "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-4a60f4f5.js" @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-04f2bfb6","path":"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html","title":"团队管理","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/后台管理/团队管理.md"}');export{t as data}; diff --git "a/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-5ebf6b40.js" "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-5ebf6b40.js" new file mode 100644 index 000000000..7bc80b49e --- /dev/null +++ "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-5ebf6b40.js" @@ -0,0 +1 @@ +import{_ as t,a as e}from"./manage_org_02-ce951ef7.js";import{_ as r,o as s,c as o,e as _}from"./app-2a91d8ab.js";const a={},c=_('

    团队管理

    • 可查看平台创建的团队列表,并提供了相应筛选

    • 禁用恢复团队

    团队列表

    团队操作

    ',4),i=[c];function n(l,p){return s(),o("div",null,i)}const h=r(a,[["render",n],["__file","团队管理.html.vue"]]);export{h as default}; diff --git "a/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-77ccbb28.js" "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-77ccbb28.js" new file mode 100644 index 000000000..7bc80b49e --- /dev/null +++ "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-77ccbb28.js" @@ -0,0 +1 @@ +import{_ as t,a as e}from"./manage_org_02-ce951ef7.js";import{_ as r,o as s,c as o,e as _}from"./app-2a91d8ab.js";const a={},c=_('

    团队管理

    • 可查看平台创建的团队列表,并提供了相应筛选

    • 禁用恢复团队

    团队列表

    团队操作

    ',4),i=[c];function n(l,p){return s(),o("div",null,i)}const h=r(a,[["render",n],["__file","团队管理.html.vue"]]);export{h as default}; diff --git "a/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-8144a48b.js" "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-8144a48b.js" new file mode 100644 index 000000000..f2f46a4a8 --- /dev/null +++ "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-8144a48b.js" @@ -0,0 +1 @@ +import{_ as r}from"./team_member-8942b2d5.js";import{_ as o,r as n,o as s,c as i,a as e,b as t,d,w as c,e as h}from"./app-2a91d8ab.js";const _={},l=h('

    团队说明

    成员权限

    层级关系

    团队 > 项目 > 代码库 > 分析项目

    您可以创建一个团队,并可以在团队中创建多个项目来进行项目区分和项目管理。可以在一个项目中创建多个代码库进行代码分析。

    权限控制

    • 团队成员分为管理员和普通成员两类。团队管理员具备团队全部权限。

    • 项目成员分为管理员和普通成员两类。项目管理员具备项目全部权限。

    ',7),p=e("h2",{id:"邀请团队成员",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#邀请团队成员","aria-hidden":"true"},"#"),t(" 邀请团队成员")],-1),u=e("p",null,"管理员可以通过成员管理为您的团队添加成员,通过分享邀请链接的方式邀请您的团队。",-1);function f(g,m){const a=n("RouterLink");return s(),i("div",null,[l,e("p",null,[t("成员权限的区分,具体点击查看"),d(a,{to:"/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.html"},{default:c(()=>[t("成员权限")]),_:1})]),p,u])}const b=o(_,[["render",f],["__file","团队管理.html.vue"]]);export{b as default}; diff --git "a/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-9abe4210.js" "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-9abe4210.js" new file mode 100644 index 000000000..ee61b2945 --- /dev/null +++ "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-9abe4210.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-1759972c","path":"/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html","title":"团队说明","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"层级关系","slug":"层级关系","link":"#层级关系","children":[]},{"level":2,"title":"权限控制","slug":"权限控制","link":"#权限控制","children":[]},{"level":2,"title":"邀请团队成员","slug":"邀请团队成员","link":"#邀请团队成员","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/团队管理/团队管理.md"}');export{e as data}; diff --git "a/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-a21de07f.js" "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-a21de07f.js" new file mode 100644 index 000000000..d05f89ece --- /dev/null +++ "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-a21de07f.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-63a00f05","path":"/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html","title":"团队说明","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"层级关系","slug":"层级关系","link":"#层级关系","children":[]},{"level":2,"title":"权限控制","slug":"权限控制","link":"#权限控制","children":[]},{"level":2,"title":"邀请团队成员","slug":"邀请团队成员","link":"#邀请团队成员","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/团队管理/团队管理.md"}');export{e as data}; diff --git "a/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-adf41fb7.js" "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-adf41fb7.js" new file mode 100644 index 000000000..ffc9e9407 --- /dev/null +++ "b/assets/\345\233\242\351\230\237\347\256\241\347\220\206.html-adf41fb7.js" @@ -0,0 +1 @@ +import{_ as r}from"./team_member-8942b2d5.js";import{_ as o,r as n,o as s,c as i,a as e,b as t,d,w as c,e as h}from"./app-2a91d8ab.js";const _={},l=h('

    团队说明

    成员权限

    层级关系

    团队 > 项目 > 代码库 > 分析项目

    您可以创建一个团队,并可以在团队中创建多个项目来进行项目区分和项目管理。可以在一个项目中创建多个代码库进行代码分析。

    权限控制

    • 团队成员分为管理员和普通成员两类。团队管理员具备团队全部权限。

    • 项目成员分为管理员和普通成员两类。项目管理员具备项目全部权限。

    ',7),p=e("h2",{id:"邀请团队成员",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#邀请团队成员","aria-hidden":"true"},"#"),t(" 邀请团队成员")],-1),u=e("p",null,"管理员可以通过成员管理为您的团队添加成员,通过分享邀请链接的方式邀请您的团队。",-1);function f(g,m){const a=n("RouterLink");return s(),i("div",null,[l,e("p",null,[t("成员权限的区分,具体点击查看"),d(a,{to:"/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.html"},{default:c(()=>[t("成员权限")]),_:1})]),p,u])}const b=o(_,[["render",f],["__file","团队管理.html.vue"]]);export{b as default}; diff --git "a/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-7158c85c.js" "b/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-7158c85c.js" new file mode 100644 index 000000000..1cc067144 --- /dev/null +++ "b/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-7158c85c.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-aa47e304","path":"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html","title":"基础属性配置","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/分析方案/基础属性配置.md"}');export{e as data}; diff --git "a/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-b1c09b73.js" "b/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-b1c09b73.js" new file mode 100644 index 000000000..97781ce9c --- /dev/null +++ "b/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-b1c09b73.js" @@ -0,0 +1 @@ +import{_ as t,o,c as e,e as n}from"./app-2a91d8ab.js";const s={},r=n('

    基础属性配置

    • 方案名称

      用于标示一个方案,每个方案名称都是唯一的。

    • 分析语言

      用于指明该方案是针对代码库何种语言进行分析。初次创建分析方案时会根据语言初始化分析方案相关配置。

    • 运行环境

      用于将任务分配到指定的环境节点机器上执行代码分析,需考虑项目在对应环境的节点机器上能否正常执行。

    • 环境变量

      每行 key-value 形式,非必填项。

      • 可用于指定特殊编译环境:如机器有多个 JDK 或者 gradle 环境,项目编译需指定 JDK 或 gradle 版本的可以设定相应环境变量。

      • 可用于工具传递参数: 如ESLINT_MAX_OLD_SPACE_SIZE=4096配置 Js 内存大小

      • 可用于指定项目配置,如PYTHON_VERSION=2 指定为 python2 项目

        TIP

        对 Python 的分析默认采用 Python3,如果需要分析 Python2 请在环境变量中设置:PYTHON_VERSION=2

    ',2),l=[r];function i(p,c){return o(),e("div",null,l)}const a=t(s,[["render",i],["__file","基础属性配置.html.vue"]]);export{a as default}; diff --git "a/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-bc124671.js" "b/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-bc124671.js" new file mode 100644 index 000000000..f2e729e11 --- /dev/null +++ "b/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-bc124671.js" @@ -0,0 +1 @@ +import{_ as t,o,c as e,e as n}from"./app-2a91d8ab.js";const s={},r=n('

    基础属性配置

    • 方案名称

      用于标示一个方案,每个方案名称都是唯一的。

    • 分析语言

      用于指明该方案是针对代码库何种语言进行分析。初次创建分析方案时会根据语言初始化分析方案相关配置。

    • 运行环境

      用于将任务分配到指定的环境节点机器上执行代码分析,需考虑项目在对应环境的节点机器上能否正常执行。

    • 环境变量

      每行 key-value 形式,非必填项。

      • 可用于指定特殊编译环境:如机器有多个 JDK 或者 gradle 环境,项目编译需指定 JDK 或 gradle 版本的可以设定相应环境变量。

      • 可用于工具传递参数: 如ESLINT_MAX_OLD_SPACE_SIZE=4096配置 Js 内存大小

      • 可用于指定项目配置,如PYTHON_VERSION=2 指定为 python2 项目

        提示

        对 Python 的分析默认采用 Python3,如果需要分析 Python2 请在环境变量中设置:PYTHON_VERSION=2

    ',2),l=[r];function i(p,c){return o(),e("div",null,l)}const a=t(s,[["render",i],["__file","基础属性配置.html.vue"]]);export{a as default}; diff --git "a/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-d6db40b1.js" "b/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-d6db40b1.js" new file mode 100644 index 000000000..2ffe2a073 --- /dev/null +++ "b/assets/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html-d6db40b1.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-592884a3","path":"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E5%9F%BA%E7%A1%80%E5%B1%9E%E6%80%A7%E9%85%8D%E7%BD%AE.html","title":"基础属性配置","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/分析方案/基础属性配置.md"}');export{e as data}; diff --git "a/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-1ec7c601.js" "b/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-1ec7c601.js" new file mode 100644 index 000000000..3f688848c --- /dev/null +++ "b/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-1ec7c601.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2fb80293","path":"/en/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.html","title":"对象主要字段说明","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"团队(org):","slug":"团队-org","link":"#团队-org","children":[]},{"level":2,"title":"项目(team):","slug":"项目-team","link":"#项目-team","children":[]},{"level":2,"title":"代码库(repository):","slug":"代码库-repository","link":"#代码库-repository","children":[]},{"level":2,"title":"扫描方案(scanscheme):","slug":"扫描方案-scanscheme","link":"#扫描方案-scanscheme","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/api/对象主要字段说明.md"}');export{e as data}; diff --git "a/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-77986132.js" "b/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-77986132.js" new file mode 100644 index 000000000..1a5fb27e3 --- /dev/null +++ "b/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-77986132.js" @@ -0,0 +1,41 @@ +import{_ as e,o as i,c as n,e as s}from"./app-2a91d8ab.js";const a={},d=s(`

    对象主要字段说明

    注:以下字段用于参考,具体字段格式需要以具体接口返回为准

    团队(org):

    org_sid: str,团队编号
    +name: str,团队名称
    +description: str,团队描述
    +certificated: boolean,团队认证标志位
    +created_time: datetime,团队创建时间
    +updated_time: datetime,团队更新时间
    +admins: list,管理员列表
    +project_count: int,分析任务数量
    +team_count: int,项目组数量
    +user_count: int,成员数量
    +owner: str,负责人名称
    +tel_number: str,负责人电话
    +address: str,办公地址
    +

    项目(team):

    name: str,项目组名称
    +display_name: str,项目组展示名称
    +description: str,项目组描述信息
    +

    代码库(repository):

    name: str,代码库名称
    +scm_url: str,代码库地址
    +scm_type: int,代码库类型
    +created_from: str,创建来源
    +state:str,代码库状态,1表示活跃,2表示失活,3表示暂停使用
    +labels:list,标签
    +project_team: 项目
    +organization: 团队
    +

    扫描方案(scanscheme):

    name: str,扫描方案名称
    +repo:关联的代码库
    +refer_scheme: 参照的扫描方案
    +description: str,描述
    +tag: 执行标签
    +languages: 包含语言
    +default_flag: boolean,默认方案标志
    +created_from: str,创建来源
    +ignore_merged_issue: boolean,过滤其他分支引入的问题,默认False,不过滤
    +ignore_branch_issue: str,过滤指定分支引入的问题
    +ignore_submodule_clone: boolean,不拉取子模块,默认False
    +ignore_submodule_issue: boolean,忽略子模块问题,默认False
    +issue_global_ignore: boolean,开启问题全局忽略,默认False
    +daily_save: boolean,日常扫描记录保存7天开关,默认False
    +lfs_flag: boolean,自动拉取lfs文件,默认True
    +status: int,扫描方案状态,1为活跃,2为废弃
    +
    `,10),r=[d];function l(t,c){return i(),n("div",null,r)}const u=e(a,[["render",l],["__file","对象主要字段说明.html.vue"]]);export{u as default}; diff --git "a/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-a10f4785.js" "b/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-a10f4785.js" new file mode 100644 index 000000000..1a5fb27e3 --- /dev/null +++ "b/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-a10f4785.js" @@ -0,0 +1,41 @@ +import{_ as e,o as i,c as n,e as s}from"./app-2a91d8ab.js";const a={},d=s(`

    对象主要字段说明

    注:以下字段用于参考,具体字段格式需要以具体接口返回为准

    团队(org):

    org_sid: str,团队编号
    +name: str,团队名称
    +description: str,团队描述
    +certificated: boolean,团队认证标志位
    +created_time: datetime,团队创建时间
    +updated_time: datetime,团队更新时间
    +admins: list,管理员列表
    +project_count: int,分析任务数量
    +team_count: int,项目组数量
    +user_count: int,成员数量
    +owner: str,负责人名称
    +tel_number: str,负责人电话
    +address: str,办公地址
    +

    项目(team):

    name: str,项目组名称
    +display_name: str,项目组展示名称
    +description: str,项目组描述信息
    +

    代码库(repository):

    name: str,代码库名称
    +scm_url: str,代码库地址
    +scm_type: int,代码库类型
    +created_from: str,创建来源
    +state:str,代码库状态,1表示活跃,2表示失活,3表示暂停使用
    +labels:list,标签
    +project_team: 项目
    +organization: 团队
    +

    扫描方案(scanscheme):

    name: str,扫描方案名称
    +repo:关联的代码库
    +refer_scheme: 参照的扫描方案
    +description: str,描述
    +tag: 执行标签
    +languages: 包含语言
    +default_flag: boolean,默认方案标志
    +created_from: str,创建来源
    +ignore_merged_issue: boolean,过滤其他分支引入的问题,默认False,不过滤
    +ignore_branch_issue: str,过滤指定分支引入的问题
    +ignore_submodule_clone: boolean,不拉取子模块,默认False
    +ignore_submodule_issue: boolean,忽略子模块问题,默认False
    +issue_global_ignore: boolean,开启问题全局忽略,默认False
    +daily_save: boolean,日常扫描记录保存7天开关,默认False
    +lfs_flag: boolean,自动拉取lfs文件,默认True
    +status: int,扫描方案状态,1为活跃,2为废弃
    +
    `,10),r=[d];function l(t,c){return i(),n("div",null,r)}const u=e(a,[["render",l],["__file","对象主要字段说明.html.vue"]]);export{u as default}; diff --git "a/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-af9a65f8.js" "b/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-af9a65f8.js" new file mode 100644 index 000000000..ce4477883 --- /dev/null +++ "b/assets/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html-af9a65f8.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2ac3a5d8","path":"/zh/api/%E5%AF%B9%E8%B1%A1%E4%B8%BB%E8%A6%81%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E.html","title":"对象主要字段说明","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"团队(org):","slug":"团队-org","link":"#团队-org","children":[]},{"level":2,"title":"项目(team):","slug":"项目-team","link":"#项目-team","children":[]},{"level":2,"title":"代码库(repository):","slug":"代码库-repository","link":"#代码库-repository","children":[]},{"level":2,"title":"扫描方案(scanscheme):","slug":"扫描方案-scanscheme","link":"#扫描方案-scanscheme","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/api/对象主要字段说明.md"}');export{e as data}; diff --git "a/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-4ae75a79.js" "b/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-4ae75a79.js" new file mode 100644 index 000000000..bc836d7d0 --- /dev/null +++ "b/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-4ae75a79.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5b6aff19","path":"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8.html","title":"工具列表","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/工具管理/工具列表.md"}');export{e as data}; diff --git "a/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-6d320578.js" "b/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-6d320578.js" new file mode 100644 index 000000000..0c4f4b69b --- /dev/null +++ "b/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-6d320578.js" @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-6a904c98","path":"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E5%88%97%E8%A1%A8.html","title":"工具列表","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/工具管理/工具列表.md"}');export{t as data}; diff --git "a/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-761dad60.js" "b/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-761dad60.js" new file mode 100644 index 000000000..b1549e01f --- /dev/null +++ "b/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-761dad60.js" @@ -0,0 +1 @@ +import{_ as s,r,o,c,a as t,b as e,d as l}from"./app-2a91d8ab.js";const i={},a=t("h1",{id:"工具列表",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#工具列表","aria-hidden":"true"},"#"),e(" 工具列表")],-1),_=t("p",null,"目前 TCA 支持以下工具:",-1),d=t("thead",null,[t("tr",null,[t("th",{style:{"text-align":"center"}},"官方工具"),t("th",{style:{"text-align":"center"}},"第三方工具")])],-1),h={style:{"text-align":"center"}},g={href:"https://github.com/TCATools/codedog_0Day_checker",target:"_blank",rel:"noopener noreferrer"},u=t("td",{style:{"text-align":"center"}},"androidlint",-1),y=t("tr",null,[t("td",{style:{"text-align":"center"}},"clangwarning"),t("td",{style:{"text-align":"center"}},"checkstyle")],-1),x=t("tr",null,[t("td",{style:{"text-align":"center"}},"codecount"),t("td",{style:{"text-align":"center"}},"clang")],-1),p=t("tr",null,[t("td",{style:{"text-align":"center"}},"customfilescan"),t("td",{style:{"text-align":"center"}},"cobra")],-1),b=t("tr",null,[t("td",{style:{"text-align":"center"}},"customscan"),t("td",{style:{"text-align":"center"}},"cpd")],-1),f=t("tr",null,[t("td",{style:{"text-align":"center"}},"fbrjs"),t("td",{style:{"text-align":"center"}},"cppcheck")],-1),m=t("tr",null,[t("td",{style:{"text-align":"center"}},"javawarning"),t("td",{style:{"text-align":"center"}},"cpplint")],-1),k=t("tr",null,[t("td",{style:{"text-align":"center"}},"regexfilescan"),t("td",{style:{"text-align":"center"}},"dart_code_metrics")],-1),T=t("tr",null,[t("td",{style:{"text-align":"center"}},"regexscan"),t("td",{style:{"text-align":"center"}},"dartanalyzer")],-1),C={style:{"text-align":"center"}},A={href:"https://github.com/TCATools/TCA-Armory.git",target:"_blank",rel:"noopener noreferrer"},q=t("td",{style:{"text-align":"center"}},"detekt",-1),v={style:{"text-align":"center"}},w={href:"https://github.com/TCATools/loong_beta",target:"_blank",rel:"noopener noreferrer"},j=t("td",{style:{"text-align":"center"}},"eslint",-1),L=t("tr",null,[t("td",{style:{"text-align":"center"}},"unusedresource"),t("td",{style:{"text-align":"center"}},"eslint_typescript")],-1),B=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"eslint_vue")],-1),E=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"findbugs")],-1),G=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"flake8")],-1),N=t("td",{style:{"text-align":"center"}},null,-1),V={style:{"text-align":"center"}},z={href:"https://github.com/TCATools/flawfinder",target:"_blank",rel:"noopener noreferrer"},D=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"flow")],-1),I=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"golangcilint")],-1),M=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"gometalinter")],-1),F=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"htmlcs")],-1),H=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"infer_cpp")],-1),J=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"infer_java")],-1),K=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"infer_objectivec")],-1),O=t("td",{style:{"text-align":"center"}},null,-1),P={style:{"text-align":"center"}},Q={href:"https://github.com/TCATools/custom-ktlint",target:"_blank",rel:"noopener noreferrer"},R=t("td",{style:{"text-align":"center"}},null,-1),S={style:{"text-align":"center"}},U={href:"https://github.com/TCATools/common-kunlun.git",target:"_blank",rel:"noopener noreferrer"},W=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"lizard")],-1),X=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"luacheck")],-1),Y=t("td",{style:{"text-align":"center"}},null,-1),Z={style:{"text-align":"center"}},$={href:"https://github.com/TCATools/custom-phpcs",target:"_blank",rel:"noopener noreferrer"},tt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"pmd")],-1),et=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"pylint")],-1),nt=t("td",{style:{"text-align":"center"}},null,-1),lt={style:{"text-align":"center"}},st={href:"https://github.com/TCATools/rips-scanner",target:"_blank",rel:"noopener noreferrer"},rt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"scalastyle")],-1),ot=t("td",{style:{"text-align":"center"}},null,-1),ct={style:{"text-align":"center"}},it={href:"https://github.com/TCATools/custom-semgrep",target:"_blank",rel:"noopener noreferrer"},at=t("td",{style:{"text-align":"center"}},null,-1),_t={style:{"text-align":"center"}},dt={href:"https://github.com/TCATools/shellcheck",target:"_blank",rel:"noopener noreferrer"},ht=t("td",{style:{"text-align":"center"}},null,-1),gt={style:{"text-align":"center"}},ut={href:"https://github.com/TCATools/spotbugs",target:"_blank",rel:"noopener noreferrer"},yt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"stylecop")],-1),xt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"stylelint")],-1),pt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"swiftlint")],-1),bt=t("td",{style:{"text-align":"center"}},null,-1),ft={style:{"text-align":"center"}},mt={href:"https://github.com/GabrielLegend/tca_plugin_sonarqube/blob/main/src/sq.py",target:"_blank",rel:"noopener noreferrer"},kt=t("td",{style:{"text-align":"center"}},null,-1),Tt={style:{"text-align":"center"}},Ct={href:"https://github.com/GabrielLegend/tca_plugin_sonarqube/blob/main/src/sq_java.py",target:"_blank",rel:"noopener noreferrer"},At=t("td",{style:{"text-align":"center"}},null,-1),qt={style:{"text-align":"center"}},vt={href:"https://github.com/GabrielLegend/tca_plugin_sonarqube/blob/main/src/sq_cs.py",target:"_blank",rel:"noopener noreferrer"},wt=t("td",{style:{"text-align":"center"}},null,-1),jt={style:{"text-align":"center"}},Lt={href:"https://github.com/TCATools/tca_plugin_sqlcheck",target:"_blank",rel:"noopener noreferrer"},Bt=t("td",{style:{"text-align":"center"}},null,-1),Et={style:{"text-align":"center"}},Gt={href:"https://github.com/Tencent/TscanCode",target:"_blank",rel:"noopener noreferrer"},Nt=t("td",{style:{"text-align":"center"}},null,-1),Vt={style:{"text-align":"center"}},zt={href:"https://github.com/Tencent/TscanCode",target:"_blank",rel:"noopener noreferrer"},Dt=t("td",{style:{"text-align":"center"}},null,-1),It={style:{"text-align":"center"}},Mt={href:"https://github.com/Tencent/TscanCode",target:"_blank",rel:"noopener noreferrer"},Ft=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"include-what-you-use")],-1);function Ht(Jt,Kt){const n=r("ExternalLinkIcon");return o(),c("div",null,[a,_,t("table",null,[d,t("tbody",null,[t("tr",null,[t("td",h,[t("a",g,[e("TCA-0Day_Checker(测试版)"),l(n)])]),u]),y,x,p,b,f,m,k,T,t("tr",null,[t("td",C,[t("a",A,[e("TCA-Armory(测试版)"),l(n)])]),q]),t("tr",null,[t("td",v,[t("a",w,[e("TCA-Loong_Beta龙(测试版)"),l(n)])]),j]),L,B,E,G,t("tr",null,[N,t("td",V,[t("a",z,[e("flawfinder"),l(n)])])]),D,I,M,F,H,J,K,t("tr",null,[O,t("td",P,[t("a",Q,[e("ktlint"),l(n)])])]),t("tr",null,[R,t("td",S,[t("a",U,[e("kunlun-M"),l(n)])])]),W,X,t("tr",null,[Y,t("td",Z,[t("a",$,[e("phpcs"),l(n)])])]),tt,et,t("tr",null,[nt,t("td",lt,[t("a",st,[e("rips"),l(n)])])]),rt,t("tr",null,[ot,t("td",ct,[t("a",it,[e("semgrep"),l(n)])])]),t("tr",null,[at,t("td",_t,[t("a",dt,[e("shellcheck"),l(n)])])]),t("tr",null,[ht,t("td",gt,[t("a",ut,[e("spotbugs"),l(n)])])]),yt,xt,pt,t("tr",null,[bt,t("td",ft,[t("a",mt,[e("sonarqube"),l(n)])])]),t("tr",null,[kt,t("td",Tt,[t("a",Ct,[e("sonarqube_java"),l(n)])])]),t("tr",null,[At,t("td",qt,[t("a",vt,[e("sonarqube_cs"),l(n)])])]),t("tr",null,[wt,t("td",jt,[t("a",Lt,[e("tca_plugin_sqlcheck"),l(n)])])]),t("tr",null,[Bt,t("td",Et,[t("a",Gt,[e("tscan_cpp"),l(n)])])]),t("tr",null,[Nt,t("td",Vt,[t("a",zt,[e("tscan_csharp"),l(n)])])]),t("tr",null,[Dt,t("td",It,[t("a",Mt,[e("tscan_lua"),l(n)])])]),Ft])])])}const Pt=s(i,[["render",Ht],["__file","工具列表.html.vue"]]);export{Pt as default}; diff --git "a/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-99ed1bf3.js" "b/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-99ed1bf3.js" new file mode 100644 index 000000000..b1549e01f --- /dev/null +++ "b/assets/\345\267\245\345\205\267\345\210\227\350\241\250.html-99ed1bf3.js" @@ -0,0 +1 @@ +import{_ as s,r,o,c,a as t,b as e,d as l}from"./app-2a91d8ab.js";const i={},a=t("h1",{id:"工具列表",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#工具列表","aria-hidden":"true"},"#"),e(" 工具列表")],-1),_=t("p",null,"目前 TCA 支持以下工具:",-1),d=t("thead",null,[t("tr",null,[t("th",{style:{"text-align":"center"}},"官方工具"),t("th",{style:{"text-align":"center"}},"第三方工具")])],-1),h={style:{"text-align":"center"}},g={href:"https://github.com/TCATools/codedog_0Day_checker",target:"_blank",rel:"noopener noreferrer"},u=t("td",{style:{"text-align":"center"}},"androidlint",-1),y=t("tr",null,[t("td",{style:{"text-align":"center"}},"clangwarning"),t("td",{style:{"text-align":"center"}},"checkstyle")],-1),x=t("tr",null,[t("td",{style:{"text-align":"center"}},"codecount"),t("td",{style:{"text-align":"center"}},"clang")],-1),p=t("tr",null,[t("td",{style:{"text-align":"center"}},"customfilescan"),t("td",{style:{"text-align":"center"}},"cobra")],-1),b=t("tr",null,[t("td",{style:{"text-align":"center"}},"customscan"),t("td",{style:{"text-align":"center"}},"cpd")],-1),f=t("tr",null,[t("td",{style:{"text-align":"center"}},"fbrjs"),t("td",{style:{"text-align":"center"}},"cppcheck")],-1),m=t("tr",null,[t("td",{style:{"text-align":"center"}},"javawarning"),t("td",{style:{"text-align":"center"}},"cpplint")],-1),k=t("tr",null,[t("td",{style:{"text-align":"center"}},"regexfilescan"),t("td",{style:{"text-align":"center"}},"dart_code_metrics")],-1),T=t("tr",null,[t("td",{style:{"text-align":"center"}},"regexscan"),t("td",{style:{"text-align":"center"}},"dartanalyzer")],-1),C={style:{"text-align":"center"}},A={href:"https://github.com/TCATools/TCA-Armory.git",target:"_blank",rel:"noopener noreferrer"},q=t("td",{style:{"text-align":"center"}},"detekt",-1),v={style:{"text-align":"center"}},w={href:"https://github.com/TCATools/loong_beta",target:"_blank",rel:"noopener noreferrer"},j=t("td",{style:{"text-align":"center"}},"eslint",-1),L=t("tr",null,[t("td",{style:{"text-align":"center"}},"unusedresource"),t("td",{style:{"text-align":"center"}},"eslint_typescript")],-1),B=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"eslint_vue")],-1),E=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"findbugs")],-1),G=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"flake8")],-1),N=t("td",{style:{"text-align":"center"}},null,-1),V={style:{"text-align":"center"}},z={href:"https://github.com/TCATools/flawfinder",target:"_blank",rel:"noopener noreferrer"},D=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"flow")],-1),I=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"golangcilint")],-1),M=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"gometalinter")],-1),F=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"htmlcs")],-1),H=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"infer_cpp")],-1),J=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"infer_java")],-1),K=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"infer_objectivec")],-1),O=t("td",{style:{"text-align":"center"}},null,-1),P={style:{"text-align":"center"}},Q={href:"https://github.com/TCATools/custom-ktlint",target:"_blank",rel:"noopener noreferrer"},R=t("td",{style:{"text-align":"center"}},null,-1),S={style:{"text-align":"center"}},U={href:"https://github.com/TCATools/common-kunlun.git",target:"_blank",rel:"noopener noreferrer"},W=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"lizard")],-1),X=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"luacheck")],-1),Y=t("td",{style:{"text-align":"center"}},null,-1),Z={style:{"text-align":"center"}},$={href:"https://github.com/TCATools/custom-phpcs",target:"_blank",rel:"noopener noreferrer"},tt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"pmd")],-1),et=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"pylint")],-1),nt=t("td",{style:{"text-align":"center"}},null,-1),lt={style:{"text-align":"center"}},st={href:"https://github.com/TCATools/rips-scanner",target:"_blank",rel:"noopener noreferrer"},rt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"scalastyle")],-1),ot=t("td",{style:{"text-align":"center"}},null,-1),ct={style:{"text-align":"center"}},it={href:"https://github.com/TCATools/custom-semgrep",target:"_blank",rel:"noopener noreferrer"},at=t("td",{style:{"text-align":"center"}},null,-1),_t={style:{"text-align":"center"}},dt={href:"https://github.com/TCATools/shellcheck",target:"_blank",rel:"noopener noreferrer"},ht=t("td",{style:{"text-align":"center"}},null,-1),gt={style:{"text-align":"center"}},ut={href:"https://github.com/TCATools/spotbugs",target:"_blank",rel:"noopener noreferrer"},yt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"stylecop")],-1),xt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"stylelint")],-1),pt=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"swiftlint")],-1),bt=t("td",{style:{"text-align":"center"}},null,-1),ft={style:{"text-align":"center"}},mt={href:"https://github.com/GabrielLegend/tca_plugin_sonarqube/blob/main/src/sq.py",target:"_blank",rel:"noopener noreferrer"},kt=t("td",{style:{"text-align":"center"}},null,-1),Tt={style:{"text-align":"center"}},Ct={href:"https://github.com/GabrielLegend/tca_plugin_sonarqube/blob/main/src/sq_java.py",target:"_blank",rel:"noopener noreferrer"},At=t("td",{style:{"text-align":"center"}},null,-1),qt={style:{"text-align":"center"}},vt={href:"https://github.com/GabrielLegend/tca_plugin_sonarqube/blob/main/src/sq_cs.py",target:"_blank",rel:"noopener noreferrer"},wt=t("td",{style:{"text-align":"center"}},null,-1),jt={style:{"text-align":"center"}},Lt={href:"https://github.com/TCATools/tca_plugin_sqlcheck",target:"_blank",rel:"noopener noreferrer"},Bt=t("td",{style:{"text-align":"center"}},null,-1),Et={style:{"text-align":"center"}},Gt={href:"https://github.com/Tencent/TscanCode",target:"_blank",rel:"noopener noreferrer"},Nt=t("td",{style:{"text-align":"center"}},null,-1),Vt={style:{"text-align":"center"}},zt={href:"https://github.com/Tencent/TscanCode",target:"_blank",rel:"noopener noreferrer"},Dt=t("td",{style:{"text-align":"center"}},null,-1),It={style:{"text-align":"center"}},Mt={href:"https://github.com/Tencent/TscanCode",target:"_blank",rel:"noopener noreferrer"},Ft=t("tr",null,[t("td",{style:{"text-align":"center"}}),t("td",{style:{"text-align":"center"}},"include-what-you-use")],-1);function Ht(Jt,Kt){const n=r("ExternalLinkIcon");return o(),c("div",null,[a,_,t("table",null,[d,t("tbody",null,[t("tr",null,[t("td",h,[t("a",g,[e("TCA-0Day_Checker(测试版)"),l(n)])]),u]),y,x,p,b,f,m,k,T,t("tr",null,[t("td",C,[t("a",A,[e("TCA-Armory(测试版)"),l(n)])]),q]),t("tr",null,[t("td",v,[t("a",w,[e("TCA-Loong_Beta龙(测试版)"),l(n)])]),j]),L,B,E,G,t("tr",null,[N,t("td",V,[t("a",z,[e("flawfinder"),l(n)])])]),D,I,M,F,H,J,K,t("tr",null,[O,t("td",P,[t("a",Q,[e("ktlint"),l(n)])])]),t("tr",null,[R,t("td",S,[t("a",U,[e("kunlun-M"),l(n)])])]),W,X,t("tr",null,[Y,t("td",Z,[t("a",$,[e("phpcs"),l(n)])])]),tt,et,t("tr",null,[nt,t("td",lt,[t("a",st,[e("rips"),l(n)])])]),rt,t("tr",null,[ot,t("td",ct,[t("a",it,[e("semgrep"),l(n)])])]),t("tr",null,[at,t("td",_t,[t("a",dt,[e("shellcheck"),l(n)])])]),t("tr",null,[ht,t("td",gt,[t("a",ut,[e("spotbugs"),l(n)])])]),yt,xt,pt,t("tr",null,[bt,t("td",ft,[t("a",mt,[e("sonarqube"),l(n)])])]),t("tr",null,[kt,t("td",Tt,[t("a",Ct,[e("sonarqube_java"),l(n)])])]),t("tr",null,[At,t("td",qt,[t("a",vt,[e("sonarqube_cs"),l(n)])])]),t("tr",null,[wt,t("td",jt,[t("a",Lt,[e("tca_plugin_sqlcheck"),l(n)])])]),t("tr",null,[Bt,t("td",Et,[t("a",Gt,[e("tscan_cpp"),l(n)])])]),t("tr",null,[Nt,t("td",Vt,[t("a",zt,[e("tscan_csharp"),l(n)])])]),t("tr",null,[Dt,t("td",It,[t("a",Mt,[e("tscan_lua"),l(n)])])]),Ft])])])}const Pt=s(i,[["render",Ht],["__file","工具列表.html.vue"]]);export{Pt as default}; diff --git "a/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-1eb7e99b.js" "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-1eb7e99b.js" new file mode 100644 index 000000000..410df7bcf --- /dev/null +++ "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-1eb7e99b.js" @@ -0,0 +1 @@ +import{_ as t}from"./manage_tool_01-405e8179.js";import{_ as s,o,c as r,e as n}from"./app-2a91d8ab.js";const i={},e=n('

    工具管理

    • 可查看全部工具(包含平台提供工具、团队自定义工具)。

    • 查看编辑工具。

    • 可变更工具权限状态

    工具管理

    提示

    工具的权限状态仅能由平台管理员进行变更调整,需谨慎调整

    • 团队内可用:即工具配置了可用团队白名单的团队可以使用该工具,默认创建工具的团队已在白名单内

    • 全平台可用:即不同团队都可见可用该工具

    • 支持自定义规则,全平台可用:即该工具不同团队都可见可用,且支持用户添加团队所需的自定义规则,该自定义规则存在团队隔离,仅团队内可以,其他团队不可使用

    ',4),l=[e];function c(a,p){return o(),r("div",null,l)}const d=s(i,[["render",c],["__file","工具管理.html.vue"]]);export{d as default}; diff --git "a/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-3ac7c59a.js" "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-3ac7c59a.js" new file mode 100644 index 000000000..be0ecb421 --- /dev/null +++ "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-3ac7c59a.js" @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-6b614576","path":"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86.html","title":"工具管理","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/后台管理/工具管理.md"}');export{t as data}; diff --git "a/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-404b9f7d.js" "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-404b9f7d.js" new file mode 100644 index 000000000..6f3fbdee3 --- /dev/null +++ "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-404b9f7d.js" @@ -0,0 +1 @@ +import{_ as t}from"./manage_tool_01-405e8179.js";import{_ as s,o,c as r,e as n}from"./app-2a91d8ab.js";const i={},e=n('

    工具管理

    • 可查看全部工具(包含平台提供工具、团队自定义工具)。

    • 查看编辑工具。

    • 可变更工具权限状态

    工具管理

    TIP

    工具的权限状态仅能由平台管理员进行变更调整,需谨慎调整

    • 团队内可用:即工具配置了可用团队白名单的团队可以使用该工具,默认创建工具的团队已在白名单内

    • 全平台可用:即不同团队都可见可用该工具

    • 支持自定义规则,全平台可用:即该工具不同团队都可见可用,且支持用户添加团队所需的自定义规则,该自定义规则存在团队隔离,仅团队内可以,其他团队不可使用

    ',4),l=[e];function c(a,p){return o(),r("div",null,l)}const d=s(i,[["render",c],["__file","工具管理.html.vue"]]);export{d as default}; diff --git "a/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-fb279444.js" "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-fb279444.js" new file mode 100644 index 000000000..2343eafc7 --- /dev/null +++ "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206.html-fb279444.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-07d72a4a","path":"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86.html","title":"工具管理","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/后台管理/工具管理.md"}');export{e as data}; diff --git "a/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-6f52ba51.js" "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-6f52ba51.js" new file mode 100644 index 000000000..c67bbb16f --- /dev/null +++ "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-6f52ba51.js" @@ -0,0 +1 @@ +import{_ as o,r,o as s,c as i,a as t,b as e,d as l,w as c,e as a}from"./app-2a91d8ab.js";const d={},h=a('

    工具管理说明

    腾讯云代码分析平台目前已集成众多自研、知名开源工具,并采用分层分离的架构,可以快速对接企业内部团队研发的工具,并将其集成到平台内供企业内部团队使用,满足快速自助的管理工具。

    • 按工具来源划分,工具包含平台提供的工具,以及团队接入的工具。

      平台提供工具:由腾讯云代码分析平台提供的一系列自研、知名开源工具,此类工具都为公开工具,任何团队都可以使用此工具及工具规则进行代码分析。

      团队接入:由团队自行接入的工具,默认该工具仅能在团队内使用,如需跨团队使用或任何团队都可以使用需联系平台管理员进行配置。

    • 按工具使用划分,工具包含可自定义规则工具可使用工具两种。

      可自定义规则工具:该工具任何团队都可以使用,且该工具可以支持添加团队所需的自定义规则。如RegexScan工具,各个团队都可以使用该工具提供的规则,也可以自定义规则,此自定义规则团队隔离。

      可使用工具:该工具团队内可使用,但不能添加自定义规则

    ',3),p={class:"custom-container tip"},_=t("p",{class:"custom-container-title"},"TIP",-1),u=t("code",null,"RegexFileScan",-1),g=t("code",null,"RegexScan",-1),A=t("p",null,[e("需平台管理员在"),t("strong",null,"后台管理"),e("-"),t("strong",null,"工具管理"),e("中找到对应工具,并将其权限状态调整为"),t("strong",null,"支持自定义规则"),e("。")],-1),m=a('

    自定义工具

    工具白名单

    默认自定义工具只能当前团队内使用,添加 工具白名单 后可以让其他团队使用。

    使用场景说明

    TIP

    添加工具、添加工具规则、添加自定义规则等均需团队内管理员可操作。分析。


    【用户 A1】【用户 A2】为【团队 O1】的管理员,【用户 A3】为【团队 O2】的普通成员。

    【用户 B1】【用户 B2】为【团队 O2】的管理员,【用户 A3】为【团队 O2】的普通成员。

    场景 1

    • 【用户 A1】在工具管理页面添加了【工具 T1】,该工具为团队内工具; -【用户 A1】【用户 A2】均可操作该工具,如修改工具信息、添加工具规则等,【用户 A3】仅可以使用该工具,如在规则配置页面添加该工具规则;

    • 由于【工具 T1】目前仅【团队 O1】可用,【团队 O2】中无法看到此工具,即【团队 O2】内的成员无法使用该工具。

    • 如需【工具 T1】也让【团队 O2】使用有两种解决方法:1. 【工具 T1】将【团队 O2】加入使用白名单;2. 向平台发起申请,由平台管理员将【工具 T1】调整为全部团队都可使用。

    场景 2

    • 【用户 A3】在工具管理页面发现了可自定义规则的工具,如正则工具 RegexScan,进入工具-自定义规则栏,发现没有添加规则的入口;
    • 由于【用户 A3】仅为普通成员权限,因此无法添加规则,此时需要【团队 O1】的管理员才能操作;
    • 添加【自定义规则 R1】完成后,团队内全部成员均可使用该自定义规则,如在规则配置页面添加该自定义规则;
    • 由于【自定义规则 R1】是团队隔离的,即【团队 O1】创建的自定义规则,在【团队 O2】中并看不到,且无法使用该规则;
    • 如需【自定义规则 R1】也让【团队 O2】使用,则仅能向工具方发起申请,由工具方将该自定义规则调整为工具规则。
    ',12);function x(f,O){const n=r("RouterLink");return s(),i("div",null,[h,t("div",p,[_,t("p",null,[e("目前开源版仅**"),u,e("、"),g,e("、"),l(n,{to:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html"},{default:c(()=>[e("TCA-Armory-R")]),_:1}),e("**等三款工具支持用户自定义规则")]),A]),m])}const T=o(d,[["render",x],["__file","工具管理说明.html.vue"]]);export{T as default}; diff --git "a/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-9d64fce3.js" "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-9d64fce3.js" new file mode 100644 index 000000000..6c68e27a0 --- /dev/null +++ "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-9d64fce3.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-15a53546","path":"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E.html","title":"工具管理说明","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"自定义工具","slug":"自定义工具","link":"#自定义工具","children":[{"level":3,"title":"工具白名单","slug":"工具白名单","link":"#工具白名单","children":[]}]},{"level":2,"title":"使用场景说明","slug":"使用场景说明","link":"#使用场景说明","children":[{"level":3,"title":"场景 1","slug":"场景-1","link":"#场景-1","children":[]},{"level":3,"title":"场景 2","slug":"场景-2","link":"#场景-2","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/工具管理/工具管理说明.md"}');export{l as data}; diff --git "a/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-eb2175ad.js" "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-eb2175ad.js" new file mode 100644 index 000000000..14d6ab619 --- /dev/null +++ "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-eb2175ad.js" @@ -0,0 +1 @@ +import{_ as o,r,o as s,c as i,a as t,b as e,d as l,w as c,e as a}from"./app-2a91d8ab.js";const d={},h=a('

    工具管理说明

    腾讯云代码分析平台目前已集成众多自研、知名开源工具,并采用分层分离的架构,可以快速对接企业内部团队研发的工具,并将其集成到平台内供企业内部团队使用,满足快速自助的管理工具。

    • 按工具来源划分,工具包含平台提供的工具,以及团队接入的工具。

      平台提供工具:由腾讯云代码分析平台提供的一系列自研、知名开源工具,此类工具都为公开工具,任何团队都可以使用此工具及工具规则进行代码分析。

      团队接入:由团队自行接入的工具,默认该工具仅能在团队内使用,如需跨团队使用或任何团队都可以使用需联系平台管理员进行配置。

    • 按工具使用划分,工具包含可自定义规则工具可使用工具两种。

      可自定义规则工具:该工具任何团队都可以使用,且该工具可以支持添加团队所需的自定义规则。如RegexScan工具,各个团队都可以使用该工具提供的规则,也可以自定义规则,此自定义规则团队隔离。

      可使用工具:该工具团队内可使用,但不能添加自定义规则

    ',3),p={class:"custom-container tip"},_=t("p",{class:"custom-container-title"},"提示",-1),u=t("code",null,"RegexFileScan",-1),g=t("code",null,"RegexScan",-1),A=t("p",null,[e("需平台管理员在"),t("strong",null,"后台管理"),e("-"),t("strong",null,"工具管理"),e("中找到对应工具,并将其权限状态调整为"),t("strong",null,"支持自定义规则"),e("。")],-1),m=a('

    自定义工具

    工具白名单

    默认自定义工具只能当前团队内使用,添加 工具白名单 后可以让其他团队使用。

    使用场景说明

    提示

    添加工具、添加工具规则、添加自定义规则等均需团队内管理员可操作。分析。


    【用户 A1】【用户 A2】为【团队 O1】的管理员,【用户 A3】为【团队 O2】的普通成员。

    【用户 B1】【用户 B2】为【团队 O2】的管理员,【用户 A3】为【团队 O2】的普通成员。

    场景 1

    • 【用户 A1】在工具管理页面添加了【工具 T1】,该工具为团队内工具; -【用户 A1】【用户 A2】均可操作该工具,如修改工具信息、添加工具规则等,【用户 A3】仅可以使用该工具,如在规则配置页面添加该工具规则;

    • 由于【工具 T1】目前仅【团队 O1】可用,【团队 O2】中无法看到此工具,即【团队 O2】内的成员无法使用该工具。

    • 如需【工具 T1】也让【团队 O2】使用有两种解决方法:1. 【工具 T1】将【团队 O2】加入使用白名单;2. 向平台发起申请,由平台管理员将【工具 T1】调整为全部团队都可使用。

    场景 2

    • 【用户 A3】在工具管理页面发现了可自定义规则的工具,如正则工具 RegexScan,进入工具-自定义规则栏,发现没有添加规则的入口;
    • 由于【用户 A3】仅为普通成员权限,因此无法添加规则,此时需要【团队 O1】的管理员才能操作;
    • 添加【自定义规则 R1】完成后,团队内全部成员均可使用该自定义规则,如在规则配置页面添加该自定义规则;
    • 由于【自定义规则 R1】是团队隔离的,即【团队 O1】创建的自定义规则,在【团队 O2】中并看不到,且无法使用该规则;
    • 如需【自定义规则 R1】也让【团队 O2】使用,则仅能向工具方发起申请,由工具方将该自定义规则调整为工具规则。
    ',12);function x(f,O){const n=r("RouterLink");return s(),i("div",null,[h,t("div",p,[_,t("p",null,[e("目前开源版仅**"),u,e("、"),g,e("、"),l(n,{to:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html"},{default:c(()=>[e("TCA-Armory-R")]),_:1}),e("**等三款工具支持用户自定义规则")]),A]),m])}const B=o(d,[["render",x],["__file","工具管理说明.html.vue"]]);export{B as default}; diff --git "a/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-ed593bde.js" "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-ed593bde.js" new file mode 100644 index 000000000..52344795b --- /dev/null +++ "b/assets/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html-ed593bde.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-781ca92a","path":"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86%E8%AF%B4%E6%98%8E.html","title":"工具管理说明","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"自定义工具","slug":"自定义工具","link":"#自定义工具","children":[{"level":3,"title":"工具白名单","slug":"工具白名单","link":"#工具白名单","children":[]}]},{"level":2,"title":"使用场景说明","slug":"使用场景说明","link":"#使用场景说明","children":[{"level":3,"title":"场景 1","slug":"场景-1","link":"#场景-1","children":[]},{"level":3,"title":"场景 2","slug":"场景-2","link":"#场景-2","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/工具管理/工具管理说明.md"}');export{e as data}; diff --git "a/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-192fbab3.js" "b/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-192fbab3.js" new file mode 100644 index 000000000..e542d5099 --- /dev/null +++ "b/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-192fbab3.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-1c5e67c8","path":"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html","title":"常驻节点分析","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用场景","slug":"使用场景","link":"#使用场景","children":[]},{"level":2,"title":"前置步骤","slug":"前置步骤","link":"#前置步骤","children":[]},{"level":2,"title":"节点配置","slug":"节点配置","link":"#节点配置","children":[{"level":3,"title":"配置 config.ini 文件","slug":"配置-config-ini-文件","link":"#配置-config-ini-文件","children":[]},{"level":3,"title":"启动常驻节点","slug":"启动常驻节点","link":"#启动常驻节点","children":[]},{"level":3,"title":"管理节点","slug":"管理节点","link":"#管理节点","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/客户端/常驻节点分析.md"}');export{l as data}; diff --git "a/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-449bc857.js" "b/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-449bc857.js" new file mode 100644 index 000000000..48cc76f77 --- /dev/null +++ "b/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-449bc857.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-78d0e857","path":"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html","title":"常驻节点分析","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"使用场景","slug":"使用场景","link":"#使用场景","children":[]},{"level":2,"title":"前置步骤","slug":"前置步骤","link":"#前置步骤","children":[]},{"level":2,"title":"节点配置","slug":"节点配置","link":"#节点配置","children":[{"level":3,"title":"配置 config.ini 文件","slug":"配置-config-ini-文件","link":"#配置-config-ini-文件","children":[]},{"level":3,"title":"启动常驻节点","slug":"启动常驻节点","link":"#启动常驻节点","children":[]},{"level":3,"title":"管理节点","slug":"管理节点","link":"#管理节点","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/客户端/常驻节点分析.md"}');export{e as data}; diff --git "a/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-502c6050.js" "b/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-502c6050.js" new file mode 100644 index 000000000..70c77d7e8 --- /dev/null +++ "b/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-502c6050.js" @@ -0,0 +1,5 @@ +import{_ as s,r as l,o as c,c as r,a as e,b as o,d as t,w as n,e as a}from"./app-2a91d8ab.js";const h={},p=a('

    常驻节点分析

    提示

    TCA 客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。

    和本地分析一样,需要先安装环境和必要的工具,并配置好服务端地址。

    使用场景

    • 希望通过并行执行分析来提高分析效率

    • 希望尽量使用公共资源或使用专机资源

    前置步骤

    ',5),u=a('

    节点配置

    配置 config.ini 文件

    1. <Server IP地址>替换成实际的 TCA 平台 IP(可包含端口号)。

    2. 国内使用 github 拉取网络较慢,推荐使用腾讯工蜂拉取,需要修改以下配置:

    ',3),_=e("li",null,[o("修改 "),e("code",null,"TOOL_CONFIG_URL=https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git")],-1),g={href:"https://git.code.tencent.com",target:"_blank",rel:"noopener noreferrer"},m=e("code",null,"TOOL_LOAD_ACCOUNT ",-1),b=e("h3",{id:"启动常驻节点",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#启动常驻节点","aria-hidden":"true"},"#"),o(" 启动常驻节点")],-1),v=e("p",null,[o("从TCA前端页面中获取 "),e("code",null,"token"),o(",前往 "),e("strong",null,"个人中心-个人令牌-复制Token")],-1),E={class:"custom-container tip"},f=e("p",{class:"custom-container-title"},"提示",-1),A=e("p",null,[o("节点仅能分析该"),e("code",null,"token"),o("具有权限的项目,因此如设置公共的分析节点,推荐使用超级管理员的token。")],-1),x=e("li",null,[e("p",null,[o("如启动团队节点,还需获取团队编号:org_sid,获取方式: 从 TCA 平台项目概览页面URL中获取,项目概览URL格式:"),e("code",null,"http://{域名}/t/{org_sid}/p/{team_name}/profile")])],-1),k=a(`

    两种方式可选启动客户端:

    使用客户端源码启动常驻节点

    • 如启动公共节点,需进入到源码的client目录下,执行命令:
    python3 codepuppy.py -l codepuppy.log start -t <token>
    +
    • 如启动团队节点,需增加参数 org_sid:
    python3 codepuppy.py -l codepuppy.log start -t <token> --org-sid <org_sid>
    +

    启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    使用客户端二进制启动常驻节点

    • 如启动公共节点,需进入到源码的client目录下,执行命令:
    ./codepuppy -l codepuppy.log start -t <token>
    +
    • 如启动团队节点,需增加参数 org_sid:
    ./codepuppy -l codepuppy.log start -t <token> --org-sid <org_sid>
    +

    启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    管理节点

    常驻节点首次启动后,需要到节点管理页面管理节点状态:

    1. 设置节点状态: 进入 TCA 节点管理页面。管理入口-节点管理,可以看到当前在线的节点,节点状态默认为不可用,需将其设置为**活跃**才可用于接收和执行任务。 也可以按需修改节点名称、标签、负责人等信息。

    2. (按需可选)配置节点工具进程: 进入工具进程配置页面,对节点支持的工具进程进行管理(默认会全部勾选),未勾选的工具进程,将不会在该节点上执行。

    3. (按需可选)设置节点标签: 节点标签会与分析方案中的运行环境标签进行匹配,只有相同标签的任务才会下发到该机器节点上。

    `,16);function y(C,T){const d=l("RouterLink"),i=l("ExternalLinkIcon");return c(),r("div",null,[p,e("p",null,[o("节点机器上具备客户端及客户端相关依赖环境,可查阅"),t(d,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html#%E5%89%8D%E7%BD%AE%E6%AD%A5%E9%AA%A4"},{default:n(()=>[o("本地分析-前置步骤")]),_:1}),o("部分进行配置。")]),u,e("ul",null,[_,e("li",null,[o("将"),e("a",g,[o("腾讯工蜂"),t(i)]),o("的账号密码填写到"),m,o("中。(注:没有腾讯工蜂账号的需要注册;由于腾讯工蜂的开源仓库也要求使用账号才能拉取,所以此处必须填写账号密码)")])]),b,e("ul",null,[e("li",null,[v,e("div",E,[f,A,e("p",null,[o("可以通过"),t(d,{to:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.html"},{default:n(()=>[o("用户管理页面")]),_:1}),o("查看到哪些用户是超级管理员。")])])]),x]),k])}const B=s(h,[["render",y],["__file","常驻节点分析.html.vue"]]);export{B as default}; diff --git "a/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-b27148e9.js" "b/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-b27148e9.js" new file mode 100644 index 000000000..bc234a056 --- /dev/null +++ "b/assets/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html-b27148e9.js" @@ -0,0 +1,5 @@ +import{_ as s,r as n,o as c,c as r,a as e,b as o,d as t,w as l,e as a}from"./app-2a91d8ab.js";const p={},h=a('

    常驻节点分析

    TIP

    TCA 客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。

    和本地分析一样,需要先安装环境和必要的工具,并配置好服务端地址。

    使用场景

    • 希望通过并行执行分析来提高分析效率

    • 希望尽量使用公共资源或使用专机资源

    前置步骤

    ',5),u=a('

    节点配置

    配置 config.ini 文件

    1. <Server IP地址>替换成实际的 TCA 平台 IP(可包含端口号)。

    2. 国内使用 github 拉取网络较慢,推荐使用腾讯工蜂拉取,需要修改以下配置:

    ',3),_=e("li",null,[o("修改 "),e("code",null,"TOOL_CONFIG_URL=https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git")],-1),g={href:"https://git.code.tencent.com",target:"_blank",rel:"noopener noreferrer"},m=e("code",null,"TOOL_LOAD_ACCOUNT ",-1),b=e("h3",{id:"启动常驻节点",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#启动常驻节点","aria-hidden":"true"},"#"),o(" 启动常驻节点")],-1),v=e("p",null,[o("从TCA前端页面中获取 "),e("code",null,"token"),o(",前往 "),e("strong",null,"个人中心-个人令牌-复制Token")],-1),E={class:"custom-container tip"},f=e("p",{class:"custom-container-title"},"TIP",-1),A=e("p",null,[o("节点仅能分析该"),e("code",null,"token"),o("具有权限的项目,因此如设置公共的分析节点,推荐使用超级管理员的token。")],-1),x=e("li",null,[e("p",null,[o("如启动团队节点,还需获取团队编号:org_sid,获取方式: 从 TCA 平台项目概览页面URL中获取,项目概览URL格式:"),e("code",null,"http://{域名}/t/{org_sid}/p/{team_name}/profile")])],-1),k=a(`

    两种方式可选启动客户端:

    使用客户端源码启动常驻节点

    • 如启动公共节点,需进入到源码的client目录下,执行命令:
    python3 codepuppy.py -l codepuppy.log start -t <token>
    +
    • 如启动团队节点,需增加参数 org_sid:
    python3 codepuppy.py -l codepuppy.log start -t <token> --org-sid <org_sid>
    +

    启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    使用客户端二进制启动常驻节点

    • 如启动公共节点,需进入到源码的client目录下,执行命令:
    ./codepuppy -l codepuppy.log start -t <token>
    +
    • 如启动团队节点,需增加参数 org_sid:
    ./codepuppy -l codepuppy.log start -t <token> --org-sid <org_sid>
    +

    启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    管理节点

    常驻节点首次启动后,需要到节点管理页面管理节点状态:

    1. 设置节点状态: 进入 TCA 节点管理页面。管理入口-节点管理,可以看到当前在线的节点,节点状态默认为不可用,需将其设置为**活跃**才可用于接收和执行任务。 也可以按需修改节点名称、标签、负责人等信息。

    2. (按需可选)配置节点工具进程: 进入工具进程配置页面,对节点支持的工具进程进行管理(默认会全部勾选),未勾选的工具进程,将不会在该节点上执行。

    3. (按需可选)设置节点标签: 节点标签会与分析方案中的运行环境标签进行匹配,只有相同标签的任务才会下发到该机器节点上。

    `,16);function y(C,T){const d=n("RouterLink"),i=n("ExternalLinkIcon");return c(),r("div",null,[h,e("p",null,[o("节点机器上具备客户端及客户端相关依赖环境,可查阅"),t(d,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html#%E5%89%8D%E7%BD%AE%E6%AD%A5%E9%AA%A4"},{default:l(()=>[o("本地分析-前置步骤")]),_:1}),o("部分进行配置。")]),u,e("ul",null,[_,e("li",null,[o("将"),e("a",g,[o("腾讯工蜂"),t(i)]),o("的账号密码填写到"),m,o("中。(注:没有腾讯工蜂账号的需要注册;由于腾讯工蜂的开源仓库也要求使用账号才能拉取,所以此处必须填写账号密码)")])]),b,e("ul",null,[e("li",null,[v,e("div",E,[f,A,e("p",null,[o("可以通过"),t(d,{to:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.html"},{default:l(()=>[o("用户管理页面")]),_:1}),o("查看到哪些用户是超级管理员。")])])]),x]),k])}const B=s(p,[["render",y],["__file","常驻节点分析.html.vue"]]);export{B as default}; diff --git "a/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-1aa3a7e8.js" "b/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-1aa3a7e8.js" new file mode 100644 index 000000000..fe8a1c998 --- /dev/null +++ "b/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-1aa3a7e8.js" @@ -0,0 +1 @@ +import{_ as l,a as r,b as n,c as d}from"./start_scan_01-c88b8a36.js";import{_ as h}from"./start_scan_02-3fe00a0e.js";import{_ as c,a as _,b as u}from"./start_scan_04-65ab4d48.js";import{_ as E,r as p,o as m,c as A,a as e,b as t,d as i,w as s,e as o}from"./app-2a91d8ab.js";const f={},B=e("h1",{id:"快速启动一次代码分析",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#快速启动一次代码分析","aria-hidden":"true"},"#"),t(" 快速启动一次代码分析")],-1),g=e("h2",{id:"创建团队及项目",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#创建团队及项目","aria-hidden":"true"},"#"),t(" 创建团队及项目")],-1),x=e("strong",null,"创建团队",-1),b=e("br",null,null,-1),C=e("p",null,[e("img",{src:l,alt:"创建团队"})],-1),v=e("li",null,[e("p",null,[e("strong",null,"为团队创建一个项目,或选择一个已有项目,并进入项目内")]),e("p",null,[e("img",{src:r,alt:"创建项目"})])],-1),F=o('

    登记代码库

    • 完成代码库登记,并点击进入代码分析

      代码库登记

      进入代码分析

    启动代码分析

    执行初始化创建

    开始分析

    提示

    1. 首次开启代码分析,用户可选择使用已有的分析方案模板,或创建分析方案的。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目,供用户启动代码分析。

    执行代码分析

    初始化创建项目后,可通过 在线分析客户端分析 来启动代码分析。

    代码分析

    在线分析

    在线分析即是通过Server端将分析任务注册到执行队列中,并将任务分配到平台配置的常驻分析节点上进行,分析完毕后将分析结果上报入库。

    ',11),k={class:"custom-container tip"},z=e("p",{class:"custom-container-title"},"提示",-1),N=e("p",null,"使用在线分析要求平台具有常驻分析节点:",-1),V=e("p",null,[e("strong",null,"如无分析节点,在线分析任务将无法完成分配,未分配任务将于超时后自动注销"),t("。")],-1),w=e("h4",{id:"客户端分析",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#客户端分析","aria-hidden":"true"},"#"),t(" 客户端分析")],-1),D=e("code",null,"codedog.ini",-1),L=o('

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    ',4),R=e("p",null,[e("img",{src:u,alt:"分支概览"})],-1);function S(T,j){const a=p("RouterLink");return m(),A("div",null,[B,g,e("ul",null,[e("li",null,[e("p",null,[x,b,t(" 点击了解"),i(a,{to:"/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html"},{default:s(()=>[t("团队管理")]),_:1})]),C]),v]),F,e("div",k,[z,N,e("ul",null,[e("li",null,[e("p",null,[t("如您的TCA平台是使用官方一键部署脚本完成的环境部署(Docker部署、Docker-Compose部署、源码部署三种),默认已启动一个分析节点(即客户端),可直接用于在线分析。可查看"),i(a,{to:"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html"},{default:s(()=>[t("管理入口-节点管理")]),_:1}),t("确认该节点状态。")])]),e("li",null,[e("p",null,[t("您也可自行接入更多分析节点实现并行执行代码分析,接入节点操作请查阅"),i(a,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html"},{default:s(()=>[t("常驻节点分析")]),_:1})])])]),V]),w,e("p",null,[t("客户端分析即是本地分析,需要在本地有客户端,并配置好客户端配置文件 "),D,t(",详细操作参考:"),i(a,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html"},{default:s(()=>[t("启动客户端分析")]),_:1}),t("。分析完毕后会将数据上报入库。")]),L,e("p",null,[t("分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 "),i(a,{to:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html"},{default:s(()=>[t("问题列表")]),_:1}),t("等。")]),R])}const I=E(f,[["render",S],["__file","快速启动一次代码分析.html.vue"]]);export{I as default}; diff --git "a/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-1fdc91f9.js" "b/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-1fdc91f9.js" new file mode 100644 index 000000000..d4d196260 --- /dev/null +++ "b/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-1fdc91f9.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-11cec998","path":"/zh/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html","title":"快速启动一次代码分析","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"创建团队及项目","slug":"创建团队及项目","link":"#创建团队及项目","children":[]},{"level":2,"title":"登记代码库","slug":"登记代码库","link":"#登记代码库","children":[]},{"level":2,"title":"启动代码分析","slug":"启动代码分析","link":"#启动代码分析","children":[{"level":3,"title":"执行初始化创建","slug":"执行初始化创建","link":"#执行初始化创建","children":[]},{"level":3,"title":"执行代码分析","slug":"执行代码分析","link":"#执行代码分析","children":[]}]},{"level":2,"title":"查看分析历史","slug":"查看分析历史","link":"#查看分析历史","children":[]},{"level":2,"title":"查看分析概览","slug":"查看分析概览","link":"#查看分析概览","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/快速入门/快速启动一次代码分析.md"}');export{l as data}; diff --git "a/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-212cdb47.js" "b/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-212cdb47.js" new file mode 100644 index 000000000..e324a2220 --- /dev/null +++ "b/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-212cdb47.js" @@ -0,0 +1 @@ +import{_ as o,a as l,b as r,c}from"./start_scan_01-c88b8a36.js";import{_ as d}from"./start_scan_02-3fe00a0e.js";import{_ as h,a as u,b as y}from"./start_scan_04-65ab4d48.js";import{_ as p,r as _,o as m,c as E,a as e,b as a,d as t,w as n,e as i}from"./app-2a91d8ab.js";const f={},g=e("h1",{id:"quick-start-a-code-analysis",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#quick-start-a-code-analysis","aria-hidden":"true"},"#"),a(" Quick start a code analysis")],-1),A=e("h2",{id:"create-teams-and-projects",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#create-teams-and-projects","aria-hidden":"true"},"#"),a(" Create teams and projects")],-1),b=e("strong",null,"Create a new team",-1),B=e("br",null,null,-1),v=e("p",null,[e("img",{src:o,alt:"Create a new team"})],-1),C=e("li",null,[e("p",null,[e("strong",null,"Create a new project for your team, or select an existing project then open the project")]),e("p",null,[e("img",{src:l,alt:"Create a new project"})])],-1),w=i('

    Register your repository

    • Register your repository and go to code analysis

      Register your repository

      Go to code analysis

    Start code analysis

    Initialization

    Start a analysis

    TIP

    1. When starting code analysis for the first time, you can choose an existing analysis scheme template or create one.
    2. When you click "确认", the TCA will first create an analysis scheme for your repository, and create branch projects based on repository's branches and current analysis scheme for users to start code analysis.

    Run a code analysis

    After initialization, you can use Online analysis or Client analysis to start a code analysis。

    Code analysis

    Online analysis

    Online analysis means that the analysis task is registered to the execution queue in the server, and the task is assigned to the resident analysis node configured in the TCA. After the analysis is completed, the analysis result will upload to the TCA.

    ',11),x={class:"custom-container tip"},k=e("p",{class:"custom-container-title"},"TIP",-1),T=e("p",null,"Use online analysis, the TCA must have at least resident analysis node:",-1),j=e("p",null,[e("strong",null,"If there is no node avaliable, online analysis tasks cannot be assigned. Unassigned tasks will be automatically cancelled after timeout"),a("。")],-1),F=e("h4",{id:"client-analysis",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#client-analysis","aria-hidden":"true"},"#"),a(" Client analysis")],-1),R=e("code",null," codelog.ini",-1),q=i('

    Analysis history

    After the analysis, the data will be reported to the server. You can enter the analysis history page to check the analysis records and results.

    Analysis history

    Analysis overview

    ',4),I=e("code",null,"Branch overview",-1),N=e("p",null,[e("img",{src:y,alt:"Branch overview"})],-1);function z(S,V){const s=_("RouterLink");return m(),E("div",null,[g,A,e("ul",null,[e("li",null,[e("p",null,[b,B,a(" Check here about "),t(s,{to:"/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86.html"},{default:n(()=>[a("Team manage")]),_:1})]),v]),C]),w,e("div",x,[k,T,e("ul",null,[e("li",null,[e("p",null,[a("If your TCA is deployed using the official out-of-the-box deployment script (Docker deployment, Docker-compose deployment, and source code deployment), an analysis node (client) has been started by default, which can be directly used for online analysis. Check here about "),t(s,{to:"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html"},{default:n(()=>[a("Node management")]),_:1}),a(".")])]),e("li",null,[e("p",null,[a("You can also add more analysis nodes to perform parallel code analysis. To add new nodes, see "),t(s,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html"},{default:n(()=>[a("About node")]),_:1})])])]),j]),F,e("p",null,[a("Client analysis is local analysis. You need to have a client locally and configure the client configuration file "),R,a(", see "),t(s,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html"},{default:n(()=>[a("Start a local analysis")]),_:1}),a(" to configure your local client. After analysis, the report data will be uploaded.")]),q,e("p",null,[a("After the analysis, you can check a branch overview and "),t(s,{to:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%88%86%E6%9E%90%E7%BB%93%E6%9E%9C%E6%9F%A5%E7%9C%8B.html"},{default:n(()=>[a("Defects list")]),_:1}),a(" by entering "),I,a(" 等。")]),N])}const P=p(f,[["render",z],["__file","快速启动一次代码分析.html.vue"]]);export{P as default}; diff --git "a/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-4a457a00.js" "b/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-4a457a00.js" new file mode 100644 index 000000000..a8bde73bb --- /dev/null +++ "b/assets/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html-4a457a00.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-bbb8ba4e","path":"/en/guide/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8%E4%B8%80%E6%AC%A1%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90.html","title":"Quick start a code analysis","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Create teams and projects","slug":"create-teams-and-projects","link":"#create-teams-and-projects","children":[]},{"level":2,"title":"Register your repository","slug":"register-your-repository","link":"#register-your-repository","children":[]},{"level":2,"title":"Start code analysis","slug":"start-code-analysis","link":"#start-code-analysis","children":[{"level":3,"title":"Initialization","slug":"initialization","link":"#initialization","children":[]},{"level":3,"title":"Run a code analysis","slug":"run-a-code-analysis","link":"#run-a-code-analysis","children":[]}]},{"level":2,"title":"Analysis history","slug":"analysis-history","link":"#analysis-history","children":[]},{"level":2,"title":"Analysis overview","slug":"analysis-overview","link":"#analysis-overview","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/快速入门/快速启动一次代码分析.md"}');export{e as data}; diff --git "a/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-1e463c76.js" "b/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-1e463c76.js" new file mode 100644 index 000000000..de1427db3 --- /dev/null +++ "b/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-1e463c76.js" @@ -0,0 +1,3 @@ +import{_ as e,o as i,c as d,e as a}from"./app-2a91d8ab.js";const c={},l=a(`

    快速扫描模式

    使用场景

    • 对本地代码目录下的临时代码(未关联scm仓库或未提交到scm仓库的本地代码)进行扫描,对某个目录或某些文件进行快速扫描,产出本地扫描结果。

    • 该模式不与scm代码仓库关联,只对给定的目录或文件进行扫描,不依据提交版本号做增量分析,也不定位问题责任人。

    使用步骤

    1. 在页面上创建分析方案模板

    • 由于该模式不与scm代码仓库绑定,因此不能直接使用分析方案(分析方案上归属于某个代码仓库下的),需要使用分析方案模板的配置来扫描。

    • 目前快速扫描模式只支持代码检查,暂不支持代码度量,请勿开启代码度量配置项(无法展示结果)。

    • 配置好方案模板后,从页面URL中获取到分析方案模板ID,分析方案模板页面URL格式:http://{域名}/t/{org_sid}/p/{team_name}/template/{分析方案模板ID}template后面的数字即分析方案模板ID。

    2. 初始化扫描需要的工具

    • 进入到客户端client目录下,使用quickinit命令拉取指定分析方案模板所需要的分析工具:
    python3 codepuppy.py quickinit -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID
    +
    • 参数说明:
      • TOKEN: 必选,从TCA平台页面获取,前往[个人中心]-[个人令牌]-复制Token
      • SCHEME_TEMPLATE_ID: 必选,分析方案模板ID,从步骤1中获取
      • ORG_SID: 必选,团队编号,从TCA平台团队概览URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/profile

    3. 执行快速扫描

    • 进入到客户端client目录下,执行命令:
    python3 codepuppy.py quickscan -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID -s SOURCE_DIR --file FILE 
    +
    • 参数说明:

      • SOURCE_DIR: 必选,需要扫描的代码目录路径
      • FILE: 可选,指定文件扫描,格式为基于SOURCE_DIR的相对路径,多个文件用英文逗号(,)分隔。不指定文件,默认扫描整个代码目录。
      • 其他参数说明参考quickinit命令。
    • 扫描完成后,结果会默认输出到客户端client目录下的tca_quick_scan_report.json文件中。结果只保存在本地,不会上报到服务端展示。

    `,14),o=[l];function n(t,r){return i(),d("div",null,o)}const h=e(c,[["render",n],["__file","快速扫描模式.html.vue"]]);export{h as default}; diff --git "a/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-7dc85655.js" "b/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-7dc85655.js" new file mode 100644 index 000000000..b81b45ea4 --- /dev/null +++ "b/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-7dc85655.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-b58b961c","path":"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F.html","title":"快速扫描模式","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用场景","slug":"使用场景","link":"#使用场景","children":[]},{"level":2,"title":"使用步骤","slug":"使用步骤","link":"#使用步骤","children":[{"level":3,"title":"使用内置默认方案快速扫描","slug":"使用内置默认方案快速扫描","link":"#使用内置默认方案快速扫描","children":[]},{"level":3,"title":"2. 执行快速扫描","slug":"_2-执行快速扫描","link":"#_2-执行快速扫描","children":[]},{"level":3,"title":"使用自定义的分析方案快速扫描","slug":"使用自定义的分析方案快速扫描","link":"#使用自定义的分析方案快速扫描","children":[]},{"level":3,"title":"3. 执行快速扫描","slug":"_3-执行快速扫描","link":"#_3-执行快速扫描","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/客户端/快速扫描模式.md"}');export{l as data}; diff --git "a/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-9123e16a.js" "b/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-9123e16a.js" new file mode 100644 index 000000000..11a93adfd --- /dev/null +++ "b/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-9123e16a.js" @@ -0,0 +1,13 @@ +import{_ as e,o as i,c as d,e as c}from"./app-2a91d8ab.js";const l={},a=c(`

    快速扫描模式

    使用场景

    • 对本地代码目录下的临时代码(未关联scm仓库或未提交到scm仓库的本地代码)进行扫描,对某个目录或某些文件进行快速扫描,产出本地扫描结果。

    • 该模式不与scm代码仓库关联,只对给定的目录或文件进行扫描,不依据提交版本号做增量分析,也不定位问题责任人。

    使用步骤

    使用内置默认方案快速扫描

    提示

    客户端快扫模式已内置open_source_check(开源)、safety(基础安全)、sensitive(敏感信息)三种常用分析方案,快速启动内置方案:

    1. 初始化扫描需要的工具

    • 进入到客户端client目录下,运行codepuppy.py或codepuppy二进制,使用quickinit命令拉取指定分析方案模板所需要的分析工具:
    python3 codepuppy.py quickinit -l LABEL_NAME 
    +
    +# 如使用codepuppy二进制,可执行:./codepuppy quickinit -l LABEL_NAME
    +
    • 参数说明:
      • LABEL_NAME: 必选,内置分析方案标签名,从open_source_checksafetysensitive三者中选一。

    2. 执行快速扫描

    • 进入到客户端client目录下,执行命令:
    python3 codepuppy.py quickscan -l LABEL_NAME -s SOURCE_DIR --file FILE
    +
    +# 如使用codepuppy二进制,可执行:./codepuppy quickscan -l LABEL_NAME -s SOURCE_DIR --file FILE
    +
    • 参数说明:

      • LABEL_NAME: 必选,内置分析方案标签名,从open_source_checksafetysensitive三者中选一。
      • SOURCE_DIR: 必选,需要扫描的代码目录路径
      • FILE: 可选,指定文件扫描,格式为基于SOURCE_DIR的相对路径,多个文件用英文逗号(,)分隔。不指定文件,默认扫描整个代码目录。
      • 其他参数说明参考quickinit命令。
    • 扫描完成后,结果会默认输出到客户端client目录下的tca_quick_scan_report.json文件中。结果只保存在本地,不会上报到服务端展示。

    • 如需自行创建分析方案,参考以下步骤:

    使用自定义的分析方案快速扫描

    1. 在页面上创建分析方案模板

    • 由于该模式不与scm代码仓库绑定,因此不能直接使用分析方案(分析方案上归属于某个代码仓库下的),需要使用分析方案模板的配置来扫描。

    • 目前快速扫描模式只支持代码检查,暂不支持代码度量,请勿开启代码度量配置项(无法展示结果)。

    • 配置好方案模板后,从页面URL中获取到分析方案模板ID,分析方案模板页面URL格式:http://{域名}/t/{org_sid}/p/{team_name}/template/{分析方案模板ID}template后面的数字即分析方案模板ID。

    2. 初始化扫描需要的工具

    • 进入到客户端client目录下,使用quickinit命令拉取指定分析方案模板所需要的分析工具:
    python3 codepuppy.py quickinit -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID
    +
    +# 如使用codepuppy二进制,可执行:./codepuppy quickinit -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID
    +
    • 参数说明:
      • TOKEN: 必选,从TCA平台页面获取,前往[个人中心]-[个人令牌]-复制Token
      • SCHEME_TEMPLATE_ID: 必选,分析方案模板ID,从步骤1中获取
      • ORG_SID: 必选,团队编号,从TCA平台团队概览中获取“团队唯一标识”

    3. 执行快速扫描

    • 进入到客户端client目录下,执行命令:
    python3 codepuppy.py quickscan -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID -s SOURCE_DIR --file FILE 
    +
    +# 如使用codepuppy二进制,可执行:./codepuppy quickscan -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID -s SOURCE_DIR --file FILE
    +
    • 参数说明:

      • SOURCE_DIR: 必选,需要扫描的代码目录路径
      • FILE: 可选,指定文件扫描,格式为基于SOURCE_DIR的相对路径,多个文件用英文逗号(,)分隔。不指定文件,默认扫描整个代码目录。
      • 其他参数说明参考quickinit命令。
    • 扫描完成后,结果会默认输出到客户端client目录下的tca_quick_scan_report.json文件中。结果只保存在本地,不会上报到服务端展示。

    `,25),n=[a];function o(s,r){return i(),d("div",null,n)}const t=e(l,[["render",o],["__file","快速扫描模式.html.vue"]]);export{t as default}; diff --git "a/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-e7bbd3cb.js" "b/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-e7bbd3cb.js" new file mode 100644 index 000000000..6af0fee4f --- /dev/null +++ "b/assets/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html-e7bbd3cb.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2c3a512d","path":"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%BF%AB%E9%80%9F%E6%89%AB%E6%8F%8F%E6%A8%A1%E5%BC%8F.html","title":"快速扫描模式","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"使用场景","slug":"使用场景","link":"#使用场景","children":[]},{"level":2,"title":"使用步骤","slug":"使用步骤","link":"#使用步骤","children":[{"level":3,"title":"1. 在页面上创建分析方案模板","slug":"_1-在页面上创建分析方案模板","link":"#_1-在页面上创建分析方案模板","children":[]},{"level":3,"title":"2. 初始化扫描需要的工具","slug":"_2-初始化扫描需要的工具","link":"#_2-初始化扫描需要的工具","children":[]},{"level":3,"title":"3. 执行快速扫描","slug":"_3-执行快速扫描","link":"#_3-执行快速扫描","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/客户端/快速扫描模式.md"}');export{e as data}; diff --git "a/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-4e77afc1.js" "b/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-4e77afc1.js" new file mode 100644 index 000000000..d321c271d --- /dev/null +++ "b/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-4e77afc1.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-455fed71","path":"/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.html","title":"成员权限","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"团队成员","slug":"团队成员","link":"#团队成员","children":[]},{"level":2,"title":"项目成员","slug":"项目成员","link":"#项目成员","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/团队管理/成员权限.md"}');export{e as data}; diff --git "a/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-54a4da1a.js" "b/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-54a4da1a.js" new file mode 100644 index 000000000..48794d4ee --- /dev/null +++ "b/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-54a4da1a.js" @@ -0,0 +1 @@ +import{_ as r}from"./team_member-8942b2d5.js";import{_ as t,o as e,c as s,e as n}from"./app-2a91d8ab.js";const o={},a=n('

    成员权限

    团队成员

    成员权限

    团队成员分为团队管理员团队普通成员两类。

    团队管理员:可以邀请其他成员加入团队,具备团队内所有权限。

    团队普通成员:可以创建项目,可以访问自己有权限的项目。创建项目的人会自动成为这个项目的项目管理员。

    项目成员

    项目成员分为项目管理员项目普通成员

    项目管理员:具备项目内全部权限。

    项目普通成员:可以查看项目内的配置信息和分析结果等各项信息,并且可以启动分析,但是无其他操作权限。

    ',10),c=[a];function h(i,_){return e(),s("div",null,c)}const g=t(o,[["render",h],["__file","成员权限.html.vue"]]);export{g as default}; diff --git "a/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-7a01de0b.js" "b/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-7a01de0b.js" new file mode 100644 index 000000000..a3f130c43 --- /dev/null +++ "b/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-7a01de0b.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-53d9da54","path":"/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E6%88%90%E5%91%98%E6%9D%83%E9%99%90.html","title":"成员权限","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"团队成员","slug":"团队成员","link":"#团队成员","children":[]},{"level":2,"title":"项目成员","slug":"项目成员","link":"#项目成员","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/团队管理/成员权限.md"}');export{e as data}; diff --git "a/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-9077d3da.js" "b/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-9077d3da.js" new file mode 100644 index 000000000..48794d4ee --- /dev/null +++ "b/assets/\346\210\220\345\221\230\346\235\203\351\231\220.html-9077d3da.js" @@ -0,0 +1 @@ +import{_ as r}from"./team_member-8942b2d5.js";import{_ as t,o as e,c as s,e as n}from"./app-2a91d8ab.js";const o={},a=n('

    成员权限

    团队成员

    成员权限

    团队成员分为团队管理员团队普通成员两类。

    团队管理员:可以邀请其他成员加入团队,具备团队内所有权限。

    团队普通成员:可以创建项目,可以访问自己有权限的项目。创建项目的人会自动成为这个项目的项目管理员。

    项目成员

    项目成员分为项目管理员项目普通成员

    项目管理员:具备项目内全部权限。

    项目普通成员:可以查看项目内的配置信息和分析结果等各项信息,并且可以启动分析,但是无其他操作权限。

    ',10),c=[a];function h(i,_){return e(),s("div",null,c)}const g=t(o,[["render",h],["__file","成员权限.html.vue"]]);export{g as default}; diff --git "a/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-28645990.js" "b/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-28645990.js" new file mode 100644 index 000000000..96b43a45d --- /dev/null +++ "b/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-28645990.js" @@ -0,0 +1,8 @@ +import{_ as n}from"./start_scan_03-f1dea0e4.js";import{_ as r,r as l,o as c,c as o,a as e,b as t,d,e as i}from"./app-2a91d8ab.js";const s={},h=i('

    客户端本地分析

    使用场景

    • 希望在本地随时分析。

    • 接入持续集成系统实现自动化分析。

    前置步骤

    1. 客户端运行环境机器配置推荐

    操作系统推荐配置
    Linux8核16G内存,硬盘空间256G(可用空间不低于100G)
    Mac8核16G内存,硬盘空间256G(可用空间不低于100G)
    Windows8核16G内存,硬盘空间256G(可用空间不低于100G)

    以上为推荐配置,实际情况需要考虑扫描对象代码库的大小,按实际情况增加磁盘空间。

    2. 本地需具备客户端

    ',8),p={href:"https://github.com/Tencent/CodeAnalysis",target:"_blank",rel:"noopener noreferrer"},u={href:"https://github.com/Tencent/CodeAnalysis/releases",target:"_blank",rel:"noopener noreferrer"},g=i(`

    3. 安装Python环境和第三方库(仅客户端源码启动分析需要)

    • 预装Python3.7、pip,支持 python3pip3 命令
    • 安装依赖:pip3 install -r CodeAnalysis/client/requirements/app_reqs.pip

    4. 安装第三方工具(docker下启动分析可跳过)

    • 在命令行(windows环境下可以启动git bash)中执行以下命令:
    bash ./scripts/base/install_bin.sh
    +
    • 进入到client/requirements目录
    • 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    分析配置

    配置客户端 config.ini 文件

    • <Server IP地址> 替换成实际的TCA平台IP(可包含端口号)

    配置客户端 codedog.ini 文件

    codedog.ini获取方法:

    `,11),b=e("li",null,[e("p",null,[t("方法一: 打开TCA源码"),e("code",null,"CodeAnalysis/client/codedog.ini"),t(",填写配置信息")])],-1),_={href:"https://github.com/Tencent/CodeAnalysis/releases",target:"_blank",rel:"noopener noreferrer"},f=e("li",null,[e("p",null,"方法三: 在TCA平台平台上配置好对应信息后,下载配置文件到本地使用。"),e("p",null,[e("img",{src:n,alt:"下载配置文件"})])],-1),x=i(`

    codedog.ini中以下字段为必填项:

    字段名填写说明
    token从TCA平台页面获取,前往[个人中心]-[个人令牌]-复制Token
    org_sid(团队编号)从TCA平台项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile
    team_name(项目名称)同上
    source_dir本地代码目录路径

    其他字段按需填写。

    启动代码分析

    启动客户端分析有三种方式可选:客户端源码下启动分析客户端二进制启动分析docker下启动分析

    客户端源码下启动分析

    • 进入到客户端client目录下

    • 执行命令: 客户端源码:python3 codepuppy.py localscan

    客户端二进制启动分析

    • 进入到客户端client目录下

    • 执行命令: 客户端源码:./codepuppy localscan

    docker下启动分析

    1. 构建docker镜像

    在client目录下,执行以下命令:docker build -t tca-client .
    (需已安装Docker)

    2. 执行Docker容器

    注意

    注意:因为以下步骤会将代码目录挂载到容器中,需要先将codedog.ini里面的source_dir修改为/workspace/src,其他参数保持不变。

    执行Docker容器有以下两种方式:

    直接使用docker运行

    client目录下,执行以下命令:(注意:按照实际情况填写SOURCE_DIR环境变量值)

    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +

    使用docker内bash终端运行

    通过以下方式,进入容器内的bash终端后,通过命令行启动client代码:
    client目录下,执行以下命令:(注意:按照实际情况填写SOURCE_DIR环境变量值)

    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client bash
    +# 进入容器内终端,通过命令行执行扫描
    +python3 codepuppy.py localscan
    +
    `,21);function m(E,k){const a=l("ExternalLinkIcon");return c(),o("div",null,[h,e("p",null,[t("下载"),e("a",p,[t("开源版源码"),d(a)]),t("。 或从"),e("a",u,[t("开源版release"),d(a)]),t("下载客户端以运行客户端二进制;")]),g,e("ul",null,[b,e("li",null,[e("p",null,[t("方法二: 从"),e("a",_,[t("开源版release"),d(a)]),t("下载客户端包,解压后打开codedog.ini,填写配置信息。")])]),f]),x])}const A=r(s,[["render",m],["__file","本地分析.html.vue"]]);export{A as default}; diff --git "a/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-6a55018a.js" "b/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-6a55018a.js" new file mode 100644 index 000000000..69dd76dda --- /dev/null +++ "b/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-6a55018a.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-bb7105ba","path":"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html","title":"客户端本地分析","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"使用场景","slug":"使用场景","link":"#使用场景","children":[]},{"level":2,"title":"前置步骤","slug":"前置步骤","link":"#前置步骤","children":[]},{"level":2,"title":"分析配置","slug":"分析配置","link":"#分析配置","children":[{"level":3,"title":"配置客户端 config.ini 文件","slug":"配置客户端-config-ini-文件","link":"#配置客户端-config-ini-文件","children":[]},{"level":3,"title":"配置客户端 codedog.ini 文件","slug":"配置客户端-codedog-ini-文件","link":"#配置客户端-codedog-ini-文件","children":[]}]},{"level":2,"title":"启动代码分析","slug":"启动代码分析","link":"#启动代码分析","children":[{"level":3,"title":"客户端源码下启动分析","slug":"客户端源码下启动分析","link":"#客户端源码下启动分析","children":[]},{"level":3,"title":"客户端二进制启动分析","slug":"客户端二进制启动分析","link":"#客户端二进制启动分析","children":[]},{"level":3,"title":"docker下启动分析","slug":"docker下启动分析","link":"#docker下启动分析","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/客户端/本地分析.md"}');export{e as data}; diff --git "a/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-b5c4dff0.js" "b/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-b5c4dff0.js" new file mode 100644 index 000000000..aa074785e --- /dev/null +++ "b/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-b5c4dff0.js" @@ -0,0 +1,8 @@ +import{_ as n}from"./start_scan_03-f1dea0e4.js";import{_ as r,r as l,o as c,c as o,a as e,b as t,d,e as i}from"./app-2a91d8ab.js";const s={},h=i('

    客户端本地分析

    使用场景

    • 希望在本地随时分析。

    • 接入持续集成系统实现自动化分析。

    前置步骤

    1. 客户端运行环境机器配置推荐

    操作系统推荐配置
    Linux8核16G内存,硬盘空间256G(可用空间不低于100G)
    Mac8核16G内存,硬盘空间256G(可用空间不低于100G)
    Windows8核16G内存,硬盘空间256G(可用空间不低于100G)

    以上为推荐配置,实际情况需要考虑扫描对象代码库的大小,按实际情况增加磁盘空间。

    2. 本地需具备客户端

    ',8),p={href:"https://github.com/Tencent/CodeAnalysis",target:"_blank",rel:"noopener noreferrer"},u={href:"https://github.com/Tencent/CodeAnalysis/releases",target:"_blank",rel:"noopener noreferrer"},g=i(`

    3. 安装Python环境和第三方库(仅客户端源码启动分析需要)

    • 预装Python3.7、pip,支持 python3pip3 命令
    • 安装依赖:pip3 install -r CodeAnalysis/client/requirements/app_reqs.pip

    4. 安装第三方工具(docker下启动分析可跳过)

    • 在命令行(windows环境下可以启动git bash)中执行以下命令:
    bash ./scripts/base/install_bin.sh
    +
    • 进入到client/requirements目录
    • 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    分析配置

    配置客户端 config.ini 文件

    • <Server IP地址> 替换成实际的TCA平台IP(可包含端口号)

    配置客户端 codedog.ini 文件

    codedog.ini获取方法:

    `,11),b=e("li",null,[e("p",null,[t("方法一: 打开TCA源码"),e("code",null,"CodeAnalysis/client/codedog.ini"),t(",填写配置信息")])],-1),_={href:"https://github.com/Tencent/CodeAnalysis/releases",target:"_blank",rel:"noopener noreferrer"},f=e("li",null,[e("p",null,"方法三: 在TCA平台平台上配置好对应信息后,下载配置文件到本地使用。"),e("p",null,[e("img",{src:n,alt:"下载配置文件"})])],-1),x=i(`

    codedog.ini中以下字段为必填项:

    字段名填写说明
    token从TCA平台页面获取,前往[个人中心]-[个人令牌]-复制Token
    org_sid(团队编号)从TCA平台项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile
    team_name(项目名称)同上
    source_dir本地代码目录路径

    其他字段按需填写。

    启动代码分析

    启动客户端分析有三种方式可选:客户端源码下启动分析客户端二进制启动分析docker下启动分析

    客户端源码下启动分析

    • 进入到客户端client目录下

    • 执行命令: 客户端源码:python3 codepuppy.py localscan

    客户端二进制启动分析

    • 进入到客户端client目录下

    • 执行命令: 客户端源码:./codepuppy localscan

    docker下启动分析

    1. 构建docker镜像

    在client目录下,执行以下命令:docker build -t tca-client .
    (需已安装Docker)

    2. 执行Docker容器

    WARNING

    注意:因为以下步骤会将代码目录挂载到容器中,需要先将codedog.ini里面的source_dir修改为/workspace/src,其他参数保持不变。

    执行Docker容器有以下两种方式:

    直接使用docker运行

    client目录下,执行以下命令:(注意:按照实际情况填写SOURCE_DIR环境变量值)

    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +

    使用docker内bash终端运行

    通过以下方式,进入容器内的bash终端后,通过命令行启动client代码:
    client目录下,执行以下命令:(注意:按照实际情况填写SOURCE_DIR环境变量值)

    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client bash
    +# 进入容器内终端,通过命令行执行扫描
    +python3 codepuppy.py localscan
    +
    `,21);function m(E,k){const a=l("ExternalLinkIcon");return c(),o("div",null,[h,e("p",null,[t("下载"),e("a",p,[t("开源版源码"),d(a)]),t("。 或从"),e("a",u,[t("开源版release"),d(a)]),t("下载客户端以运行客户端二进制;")]),g,e("ul",null,[b,e("li",null,[e("p",null,[t("方法二: 从"),e("a",_,[t("开源版release"),d(a)]),t("下载客户端包,解压后打开codedog.ini,填写配置信息。")])]),f]),x])}const A=r(s,[["render",m],["__file","本地分析.html.vue"]]);export{A as default}; diff --git "a/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-b67e71be.js" "b/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-b67e71be.js" new file mode 100644 index 000000000..a4cb7e4c7 --- /dev/null +++ "b/assets/\346\234\254\345\234\260\345\210\206\346\236\220.html-b67e71be.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-aae78fb0","path":"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E6%9C%AC%E5%9C%B0%E5%88%86%E6%9E%90.html","title":"客户端本地分析","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用场景","slug":"使用场景","link":"#使用场景","children":[]},{"level":2,"title":"前置步骤","slug":"前置步骤","link":"#前置步骤","children":[]},{"level":2,"title":"分析配置","slug":"分析配置","link":"#分析配置","children":[{"level":3,"title":"配置客户端 config.ini 文件","slug":"配置客户端-config-ini-文件","link":"#配置客户端-config-ini-文件","children":[]},{"level":3,"title":"配置客户端 codedog.ini 文件","slug":"配置客户端-codedog-ini-文件","link":"#配置客户端-codedog-ini-文件","children":[]}]},{"level":2,"title":"启动代码分析","slug":"启动代码分析","link":"#启动代码分析","children":[{"level":3,"title":"客户端源码下启动分析","slug":"客户端源码下启动分析","link":"#客户端源码下启动分析","children":[]},{"level":3,"title":"客户端二进制启动分析","slug":"客户端二进制启动分析","link":"#客户端二进制启动分析","children":[]},{"level":3,"title":"docker下启动分析","slug":"docker下启动分析","link":"#docker下启动分析","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/客户端/本地分析.md"}');export{l as data}; diff --git "a/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-55bd82a5.js" "b/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-55bd82a5.js" new file mode 100644 index 000000000..0be1b6700 --- /dev/null +++ "b/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-55bd82a5.js" @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-d1640082","path":"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html","title":"添加规则配置","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/代码检查/添加规则配置.md"}');export{t as data}; diff --git "a/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-65f4adbd.js" "b/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-65f4adbd.js" new file mode 100644 index 000000000..5ffec3c6d --- /dev/null +++ "b/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-65f4adbd.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-459a75e4","path":"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E6%B7%BB%E5%8A%A0%E8%A7%84%E5%88%99%E9%85%8D%E7%BD%AE.html","title":"添加规则配置","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/代码检查/添加规则配置.md"}');export{e as data}; diff --git "a/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-7eb54a9d.js" "b/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-7eb54a9d.js" new file mode 100644 index 000000000..9462ec3b2 --- /dev/null +++ "b/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-7eb54a9d.js" @@ -0,0 +1 @@ +import{_ as t,a as s,b as r}from"./AddRule3-9d6ed3bf.js";import{_ as o,o as e,c as a,e as _}from"./app-2a91d8ab.js";const c={},n=_('

    添加规则配置

    规则配置是代码检查应用的规则集合,用于指定用哪些工具和规则进行代码分析扫描。目前,TCA 提供了覆盖代码规范安全扫描风格检查等方面的官方推荐规则包。

    官方推荐规则包是TCA长期以来在业务中实践的经验结果,将相关的有效性高的工具和规则打包在一起。业务可以根据需要选择官方推荐规则包。也可以在自定义规则包中添加希望的工具和规则。

    提示

    规则配置 = 自定义规则包 + 官方规则包

    自定义规则包中的规则配置会默认覆盖其他官方包中相同规则的配置

    添加规则配置

    可以单选或者批量多选规则 添加规则配置

    也可以根据搜索框进行多维度查询 添加规则配置

    ',7),i=[n];function p(l,m){return e(),a("div",null,i)}const h=o(c,[["render",p],["__file","添加规则配置.html.vue"]]);export{h as default}; diff --git "a/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-86efce15.js" "b/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-86efce15.js" new file mode 100644 index 000000000..d78f4a111 --- /dev/null +++ "b/assets/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html-86efce15.js" @@ -0,0 +1 @@ +import{_ as t,a as s,b as r}from"./AddRule3-9d6ed3bf.js";import{_ as o,o as e,c as a,e as _}from"./app-2a91d8ab.js";const c={},n=_('

    添加规则配置

    规则配置是代码检查应用的规则集合,用于指定用哪些工具和规则进行代码分析扫描。目前,TCA 提供了覆盖代码规范安全扫描风格检查等方面的官方推荐规则包。

    官方推荐规则包是TCA长期以来在业务中实践的经验结果,将相关的有效性高的工具和规则打包在一起。业务可以根据需要选择官方推荐规则包。也可以在自定义规则包中添加希望的工具和规则。

    TIP

    规则配置 = 自定义规则包 + 官方规则包

    自定义规则包中的规则配置会默认覆盖其他官方包中相同规则的配置

    添加规则配置

    可以单选或者批量多选规则 添加规则配置

    也可以根据搜索框进行多维度查询 添加规则配置

    ',7),i=[n];function p(l,m){return e(),a("div",null,i)}const h=o(c,[["render",p],["__file","添加规则配置.html.vue"]]);export{h as default}; diff --git "a/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-01a71e5a.js" "b/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-01a71e5a.js" new file mode 100644 index 000000000..7b58e4b96 --- /dev/null +++ "b/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-01a71e5a.js" @@ -0,0 +1 @@ +import{_ as t,a as r}from"./manage_user_02-e4d7abc6.js";import{_ as s,o,c as e,e as n}from"./app-2a91d8ab.js";const _={},a=n('

    用户管理

    • 查看编辑创建平台用户。

    • 可配置用户的登录密码用户级别超级管理员等。

    用户列表

    用户编辑

    ',4),c=[a];function i(l,p){return o(),e("div",null,c)}const m=s(_,[["render",i],["__file","用户管理.html.vue"]]);export{m as default}; diff --git "a/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-4b0db1f4.js" "b/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-4b0db1f4.js" new file mode 100644 index 000000000..e1a19bad2 --- /dev/null +++ "b/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-4b0db1f4.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b2cd5ac8","path":"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.html","title":"用户管理","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/后台管理/用户管理.md"}');export{e as data}; diff --git "a/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-faa0bff0.js" "b/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-faa0bff0.js" new file mode 100644 index 000000000..7b58e4b96 --- /dev/null +++ "b/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-faa0bff0.js" @@ -0,0 +1 @@ +import{_ as t,a as r}from"./manage_user_02-e4d7abc6.js";import{_ as s,o,c as e,e as n}from"./app-2a91d8ab.js";const _={},a=n('

    用户管理

    • 查看编辑创建平台用户。

    • 可配置用户的登录密码用户级别超级管理员等。

    用户列表

    用户编辑

    ',4),c=[a];function i(l,p){return o(),e("div",null,c)}const m=s(_,[["render",i],["__file","用户管理.html.vue"]]);export{m as default}; diff --git "a/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-fe658e34.js" "b/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-fe658e34.js" new file mode 100644 index 000000000..17ad8f5e3 --- /dev/null +++ "b/assets/\347\224\250\346\210\267\347\256\241\347\220\206.html-fe658e34.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-15e62d37","path":"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86.html","title":"用户管理","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/后台管理/用户管理.md"}');export{e as data}; diff --git "a/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-36bc583e.js" "b/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-36bc583e.js" new file mode 100644 index 000000000..3ce28a132 --- /dev/null +++ "b/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-36bc583e.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-54f72986","path":"/zh/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"代码扫描管理","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"查看项目扫描最新结果概览","slug":"查看项目扫描最新结果概览","link":"#查看项目扫描最新结果概览","children":[]},{"level":2,"title":"查看项目代码最新扫描结果概览","slug":"查看项目代码最新扫描结果概览","link":"#查看项目代码最新扫描结果概览","children":[]},{"level":2,"title":"查看项目代码扫描结果概览","slug":"查看项目代码扫描结果概览","link":"#查看项目代码扫描结果概览","children":[]},{"level":2,"title":"查看项目代码度量圈复杂度结果概览","slug":"查看项目代码度量圈复杂度结果概览","link":"#查看项目代码度量圈复杂度结果概览","children":[]},{"level":2,"title":"查看项目代码度量重复代码结果概览","slug":"查看项目代码度量重复代码结果概览","link":"#查看项目代码度量重复代码结果概览","children":[]},{"level":2,"title":"查看项目代码度量代码统计结果概览","slug":"查看项目代码度量代码统计结果概览","link":"#查看项目代码度量代码统计结果概览","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/api/结果概览模块接口.md"}');export{l as data}; diff --git "a/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-4ee7fd62.js" "b/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-4ee7fd62.js" new file mode 100644 index 000000000..d152d6c01 --- /dev/null +++ "b/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-4ee7fd62.js" @@ -0,0 +1,730 @@ +import{_ as n,o as i,c as e,e as u}from"./app-2a91d8ab.js";const d={},l=u(`

    代码扫描管理

    查看项目扫描最新结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/
    +

    返回结果

    {
    +    "lintscan": {
    +        "issue_open_num": 74,
    +        "issue_fix_num": 439,
    +        "issue_detail_num": 310,
    +        "scan": {
    +            "id": 1,
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "execute_time": "00:02:17.844712"
    +        },
    +        "current_scan": {
    +            "active_category_detail": {
    +                "convention": 70,
    +                "other": 4
    +            },
    +            "active_severity_detail": {
    +                "error": 69,
    +                "warning": 5
    +            },
    +            "issue_open_num": 74,
    +            "issue_fix_num": 439
    +        },
    +        "total": {
    +            "state_detail": {
    +                "active": 197,
    +                "resolved": 13,
    +                "closed": 23297
    +            },
    +            "category_detail": {
    +                "convention": {
    +                    "active": 184,
    +                    "resolved": 13,
    +                    "closed": 21143
    +                },
    +                "other": {
    +                    "active": 13,
    +                    "closed": 154
    +                },
    +                "correctness": {
    +                    "closed": 1997
    +                },
    +                "performance": {
    +                    "closed": 3
    +                }
    +            },
    +            "severity_detail": {
    +                "error": {
    +                    "active": 157,
    +                    "resolved": 11,
    +                    "closed": 20113
    +                },
    +                "warning": {
    +                    "active": 40,
    +                    "resolved": 2,
    +                    "closed": 2930
    +                },
    +                "info": {
    +                    "closed": 254
    +                }
    +            }
    +        },
    +        "status": 0,
    +        "text": "成功",
    +        "description": null,
    +        "scan_summary": {
    +            "convention": {
    +                "error": {
    +                    "rule_count": 7,
    +                    "active": 65
    +                },
    +                "warning": {
    +                    "rule_count": 2,
    +                    "active": 5
    +                }
    +            },
    +            "other": {
    +                "error": {
    +                    "rule_count": 1,
    +                    "active": 4
    +                }
    +            }
    +        },
    +        "total_summary": {
    +            "correctness": {
    +                "error": {
    +                    "rule_count": 16,
    +                    "closed": 1315
    +                },
    +                "warning": {
    +                    "rule_count": 10,
    +                    "closed": 629
    +                },
    +                "info": {
    +                    "rule_count": 1,
    +                    "closed": 53
    +                }
    +            },
    +            "performance": {
    +                "warning": {
    +                    "rule_count": 1,
    +                    "closed": 3
    +                }
    +            },
    +            "convention": {
    +                "error": {
    +                    "rule_count": 42,
    +                    "active": 149,
    +                    "resolved": 11,
    +                    "closed": 18778
    +                },
    +                "warning": {
    +                    "rule_count": 17,
    +                    "active": 35,
    +                    "resolved": 2,
    +                    "closed": 2298
    +                },
    +                "info": {
    +                    "rule_count": 1,
    +                    "closed": 67
    +                }
    +            },
    +            "other": {
    +                "error": {
    +                    "rule_count": 2,
    +                    "active": 8,
    +                    "closed": 20
    +                },
    +                "warning": {
    +                    "rule_count": 1,
    +                    "active": 5
    +                },
    +                "info": {
    +                    "rule_count": 3,
    +                    "closed": 134
    +                }
    +            }
    +        }
    +    },
    +    "cyclomaticcomplexityscan": {
    +        "id": 1,
    +        "scan_revision": "scan_revision",
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +        "default_summary": {
    +            "min_ccn": 20,
    +            "over_cc_func_count": 6,
    +            "under_cc_func_count": 796,
    +            "diff_over_cc_func_count": 0,
    +            "over_cc_func_average": 22.333333333333332,
    +            "cc_func_average": 2.5099750623441395,
    +            "over_cc_sum": 14,
    +            "cc_average_of_lines": 1.0422094841063054
    +        },
    +        "custom_summary": null,
    +        "created_time": "2021-03-11T20:48:59.976947+08:00",
    +        "creator": null,
    +        "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +        "modifier": null,
    +        "deleted_time": null,
    +        "deleter": null,
    +        "last_revision": "last_revision",
    +        "diff_cc_num": 0,
    +        "cc_open_num": 6,
    +        "cc_average_of_lines": 1.0422094841063054,
    +        "cc_fix_num": 0,
    +        "worse_cc_file_num": 0,
    +        "min_ccn": 20,
    +        "code_line_num": 13433,
    +        "scan": 1
    +    },
    +    "duplicatescan": {
    +        "id": 1,
    +        "scan_revision": "scan_revision",
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +        "default_summary": {
    +            "exhi_risk": {
    +                "range": [
    +                    0.2,
    +                    1
    +                ],
    +                "file_count": 1,
    +                "diff": {
    +                    "diff_file_count": 0
    +                }
    +            },
    +            "high_risk": {
    +                "range": [
    +                    0.11,
    +                    0.2
    +                ],
    +                "file_count": 3,
    +                "diff": {
    +                    "diff_file_count": 0
    +                }
    +            },
    +            "midd_risk": {
    +                "range": [
    +                    0.05,
    +                    0.11
    +                ],
    +                "file_count": 2,
    +                "diff": {
    +                    "diff_file_count": 0
    +                }
    +            },
    +            "low_risk": {
    +                "range": [
    +                    0,
    +                    0.05
    +                ],
    +                "file_count": 2,
    +                "diff": {
    +                    "diff_file_count": 0
    +                }
    +            }
    +        },
    +        "custom_summary": null,
    +        "last_revision": "last_revision",
    +        "duplicate_file_count": 8,
    +        "duplicate_block_count": 55,
    +        "duplicate_line_count": 1177,
    +        "diff_duplicate_block_count": 0,
    +        "diff_duplicate_line_count": 0,
    +        "close_issue_count": 0,
    +        "new_issue_count": 0,
    +        "reopen_issue_count": 5,
    +        "ignored_issue_count": 0,
    +        "duplicate_rate": 4.98,
    +        "unique_duplicate_line_count": 1083,
    +        "total_duplicate_line_count": 1083,
    +        "total_line_count": 21745,
    +        "scan": 1
    +    },
    +    "clocscan": {
    +        "id": 1,
    +        "scan_revision": "scan_revision",
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +        "last_revision": "last_revision",
    +        "code_line_num": 140490,
    +        "comment_line_num": 5410,
    +        "blank_line_num": 3408,
    +        "total_line_num": 149308,
    +        "add_code_line_num": 6673,
    +        "add_comment_line_num": 2309,
    +        "add_blank_line_num": 1289,
    +        "add_total_line_num": 10271,
    +        "mod_code_line_num": 965,
    +        "mod_comment_line_num": 297,
    +        "mod_blank_line_num": 0,
    +        "mod_total_line_num": 1262,
    +        "del_code_line_num": 35844,
    +        "del_comment_line_num": 2117,
    +        "del_blank_line_num": 1794,
    +        "del_total_line_num": 39755,
    +        "scan": 1
    +    }
    +}
    +

    查看项目代码最新扫描结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/latestscan/
    +

    参数列表

    参数类型描述
    scan_revisionstr指定查询的扫描版本号,如不指定则为当前项目最新的一次扫描

    返回结果

    {
    +    "data": {
    +        "id": 1,                            # 扫描编号
    +        "repo_id": 1,                       # 代码库编号
    +        "project_id": 1,                    # 项目编号
    +        "job_gid": 1,                       # 关联任务编号
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +        "current_revision": "current_revision",  # 扫描版本号
    +        "result_code": 0,                   # 扫描任务结果码,0表示正常
    +        "result_code_msg": "成功",
    +        "result_msg": null,
    +        "lintscan": {                         # 代码扫描结果信息
    +            "current_scan": {                 # 本次扫描信息
    +                "active_severity_detail": {   # 不同严重级别的活跃问题数,包含 fatal(1-致命), error(2-错误), warning(3-警告), info(4-提示)
    +                    "error": 69,              
    +                    "warning": 5              
    +                },
    +                "issue_open_num": 10,         # 本次扫描新发现问题数
    +                "issue_fix_num": 2            # 本次扫描关闭存量问题数
    +            },
    +            "total": {                        # 当前项目整体信息
    +                "state_detail": {             # 不同处理状态的问题数,包含 active(1-活跃)、resolved(2-已处理)、closed(3-已关闭)
    +                    "active": 197,            
    +                    "resolved": 13,
    +                    "closed": 23297
    +                },
    +                "severity_detail": {         # 不同严重级别下不同处理状态的问题量
    +                    "error": {
    +                        "active": 157,
    +                        "resolved": 11,
    +                        "closed": 20113
    +                    },
    +                    "warning": {
    +                        "active": 40,
    +                        "resolved": 2,
    +                        "closed": 2930
    +                    },
    +                    "info": {
    +                        "closed": 254
    +                    }
    +                }
    +            }
    +        },
    +        "duplicatescan": {                    # 重复代码扫描结果信息
    +            "id": 1,                          # 扫描任务编号
    +            "scan_revision": "scan_revision", # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +            "default_summary": {              # 默认概览
    +                "exhi_risk": {                # 极高风险
    +                    "range": [                # 重复率范围: 0.2-1
    +                        0.2,
    +                        1
    +                    ],
    +                    "file_count": 1,          # 文件数量
    +                    "diff": {                 # 增量数据
    +                        "diff_file_count": 0  # 增量文件数量
    +                    }
    +                },
    +                "high_risk": {                # 高风险
    +                    "range": [                # 重复率范围:0.11-0.2
    +                        0.11,
    +                        0.2
    +                    ],
    +                    "file_count": 3,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "midd_risk": {                # 中风险
    +                    "range": [                # 重复率范围:0.05-0.11
    +                        0.05,
    +                        0.11
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "low_risk": {                 # 低风险
    +                    "range": [                # 重复率范围:0-0.05
    +                        0,
    +                        0.05
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                }
    +            },
    +            "custom_summary": null,           # 自定义概览数据
    +            "last_revision": "2010ef28ff3a26424d4e8f32df022f90cd682eda",  # 上次扫描版本号
    +            "duplicate_file_count": 8,        # 重复文件数量
    +            "duplicate_block_count": 55,      # 重复代码块数量
    +            "duplicate_line_count": 1177,     # 重复代码行数
    +            "diff_duplicate_block_count": 0,  # 增量重复代码块数量
    +            "diff_duplicate_line_count": 0,   # 增量重复代码行数
    +            "close_issue_count": 0,           # 关闭问题数
    +            "new_issue_count": 0,             # 新增问题数
    +            "reopen_issue_count": 5,          # 重新打开问题数
    +            "ignored_issue_count": 0,         # 忽略问题数
    +            "duplicate_rate": 4.98,           # 重复率
    +            "unique_duplicate_line_count": 1083,  # 去重后的重复代码行数
    +            "total_duplicate_line_count": 1083,   # 项目总的去重后的重复代码行数
    +            "total_line_count": 21745,            # 项目总行书
    +            "scan": 1                         # 关联扫描任务编号
    +        },
    +        "cyclomaticcomplexityscan": {         # 圈复杂度扫描数据
    +            "id": 1,                          # 圈复杂度扫描编号
    +            "scan_revision": "scan_revision", # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "default_summary": {                      # 默认概览数据
    +                "min_ccn": 20,                        # 最小圈复杂度阈值
    +                "over_cc_func_count": 6,              # 超标函数数量
    +                "under_cc_func_count": 796,           # 未超标函数数量
    +                "diff_over_cc_func_count": 0,         # 增量超标函数数据
    +                "over_cc_func_average": 22.333333333333332,  # 平均超标圈复杂度
    +                "cc_func_average": 2.5099750623441395,  # 平均圈复杂度
    +                "over_cc_sum": 14,                      # 文件超标方法圈复杂度超过阈值的差值之和
    +                "cc_average_of_lines": 1.0422094841063054 # 千行代码平均圈复杂度
    +            },
    +            "custom_summary": null,                     # 自定义概览数据
    +            "created_time": "2021-03-11T20:48:59.976947+08:00",
    +            "creator": null,
    +            "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +            "modifier": null,
    +            "deleted_time": null,
    +            "deleter": null,
    +            "last_revision": "last_revision",           # 上一次扫描版本号
    +            "diff_cc_num": 0,                           # 增量超标函数数量
    +            "cc_open_num": 6,                           # 超标函数量
    +            "cc_average_of_lines": 1.0422094841063054,  # 千行代码平均圈复杂度
    +            "cc_fix_num": 0,                            # 修复数量
    +            "worse_cc_file_num": 0,                     # 圈复杂度恶化的文件数据
    +            "min_ccn": 20,                              # 最小圈复杂度阈值
    +            "code_line_num": 13433,                     # 代码行数
    +            "scan": 1
    +        },
    +        "clocscan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",           # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +            "last_revision": "last_revision",           # 上一次扫描版本号
    +            "code_line_num": 140490,                    # 代码行数
    +            "comment_line_num": 5410,                   # 注释行数
    +            "blank_line_num": 3408,                     # 空白行数
    +            "total_line_num": 149308,                   # 总行数
    +            "add_code_line_num": 6673,                  # 增加的代码行数
    +            "add_comment_line_num": 2309,               # 增加的注释行数
    +            "add_blank_line_num": 1289,                 # 增加的空白行数
    +            "add_total_line_num": 10271,                # 增加的总行数
    +            "mod_code_line_num": 965,                   # 修改的代码行数
    +            "mod_comment_line_num": 297,                # 修改的注释行数
    +            "mod_blank_line_num": 0,                    # 修改的空白行数
    +            "mod_total_line_num": 1262,                 # 修改的总行数
    +            "del_code_line_num": 35844,                 # 删除的代码行数
    +            "del_comment_line_num": 2117,               # 删除的注释行数
    +            "del_blank_line_num": 1794,                 # 删除的空白行数
    +            "del_total_line_num": 39755,                # 删除的总行数
    +            "scan": 1
    +        }
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码扫描结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/lintscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "issue_open_num": 10,             # 本次扫描新发现问题数
    +                "issue_fix_num": 2,               # 本次扫描关闭存量问题数
    +                "issue_detail_num": 310,          # 本次扫描上报原始问题数(问题展示会进行聚合)
    +                "scan": {                         # 扫描信息
    +                    "id": 1,                      # 扫描任务编号
    +                    "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描开始时间
    +                    "execute_time": "00:02:17.844712"                 # 扫描执行耗时
    +                },
    +                "current_scan": {                 # 本次扫描信息
    +                    "active_category_detail": {   # 活跃问题分类,包含 CORRECTNESS(1-功能)、SECURITY(2-安全)、PERFORMANCE(3-性能)、USABILITY(4-可用性)、ACCESSIBILITY(5-无障碍化)、I18N(6-国际化)、CONVENTION(7-代码风格)、OTHER(8-其他)
    +                        "convention": 70,         # 代码风格类型问题
    +                        "other": 4                # 其他类型问题
    +                    },
    +                    "active_severity_detail": {   # 不同严重级别的活跃问题数,包含 fatal(1-致命), error(2-错误), warning(3-警告), info(4-提示)
    +                        "error": 69,              
    +                        "warning": 5              
    +                    },
    +                    "issue_open_num": 10,         # 本次扫描新发现问题数
    +                    "issue_fix_num": 2            # 本次扫描关闭存量问题数
    +                },
    +                "total": {                        # 当前项目整体信息
    +                    "state_detail": {             # 不同处理状态的问题数,包含 active(1-活跃)、resolved(2-已处理)、closed(3-已关闭)
    +                        "active": 197,            
    +                        "resolved": 13,
    +                        "closed": 23297
    +                    },
    +                    "category_detail": {          # 不同分类下不同处理状态的问题量
    +                        "convention": {           
    +                            "active": 184,
    +                            "resolved": 13,
    +                            "closed": 21143
    +                        },
    +                        "other": {                
    +                            "active": 13,
    +                            "closed": 154
    +                        },
    +                        "correctness": {
    +                            "closed": 1997
    +                        },
    +                        "performance": {
    +                            "closed": 3
    +                        }
    +                    },
    +                    "severity_detail": {         # 不同严重级别下不同处理状态的问题量
    +                        "error": {
    +                            "active": 157,
    +                            "resolved": 11,
    +                            "closed": 20113
    +                        },
    +                        "warning": {
    +                            "active": 40,
    +                            "resolved": 2,
    +                            "closed": 2930
    +                        },
    +                        "info": {
    +                            "closed": 254
    +                        }
    +                    }
    +                },
    +                "status": 0,                     # 扫描状态,0表示成功
    +                "text": "成功",
    +                "description": null,
    +                "scan_summary": {                # 扫描概览
    +                    "convention": {              
    +                        "error": {               
    +                            "rule_count": 7,     # 规则数
    +                            "active": 65         # 活跃问题数
    +                        },
    +                        "warning": {
    +                            "rule_count": 2,
    +                            "active": 5
    +                        }
    +                    },
    +                    "other": {
    +                        "error": {
    +                            "rule_count": 1,
    +                            "active": 4
    +                        }
    +                    }
    +                },
    +                "total_summary": {
    +                    "correctness": {
    +                        "error": {
    +                            "rule_count": 16,
    +                            "closed": 1315
    +                        },
    +                        "warning": {
    +                            "rule_count": 10,
    +                            "closed": 629
    +                        },
    +                        "info": {
    +                            "rule_count": 1,
    +                            "closed": 53
    +                        }
    +                    },
    +                    "performance": {
    +                        "warning": {
    +                            "rule_count": 1,
    +                            "closed": 3
    +                        }
    +                    },
    +                    "convention": {
    +                        "error": {
    +                            "rule_count": 42,
    +                            "active": 149,
    +                            "resolved": 11,
    +                            "closed": 18778
    +                        },
    +                        "warning": {
    +                            "rule_count": 17,
    +                            "active": 35,
    +                            "resolved": 2,
    +                            "closed": 2298
    +                        },
    +                        "info": {
    +                            "rule_count": 1,
    +                            "closed": 67
    +                        }
    +                    },
    +                    "other": {
    +                        "error": {
    +                            "rule_count": 2,
    +                            "active": 8,
    +                            "closed": 20
    +                        },
    +                        "warning": {
    +                            "rule_count": 1,
    +                            "active": 5
    +                        },
    +                        "info": {
    +                            "rule_count": 3,
    +                            "closed": 134
    +                        }
    +                    }
    +                }
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量圈复杂度结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/cycscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "default_summary": {
    +                    "min_ccn": 20,
    +                    "over_cc_func_count": 6,
    +                    "under_cc_func_count": 796,
    +                    "diff_over_cc_func_count": 0,
    +                    "over_cc_func_average": 22.333333333333332,
    +                    "cc_func_average": 2.5099750623441395,
    +                    "over_cc_sum": 14,
    +                    "cc_average_of_lines": 1.0422094841063054
    +                },
    +                "custom_summary": null,
    +                "created_time": "2021-03-11T20:48:59.976947+08:00",
    +                "creator": null,
    +                "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "last_revision": "last_revision",
    +                "diff_cc_num": 0,
    +                "cc_open_num": 6,
    +                "cc_average_of_lines": 1.0422094841063054,
    +                "cc_fix_num": 0,
    +                "worse_cc_file_num": 0,
    +                "min_ccn": 20,
    +                "code_line_num": 13433,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量重复代码结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/dupscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "default_summary": {
    +                    "exhi_risk": {
    +                        "range": [
    +                            0.2,
    +                            1
    +                        ],
    +                        "file_count": 1,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "high_risk": {
    +                        "range": [
    +                            0.11,
    +                            0.2
    +                        ],
    +                        "file_count": 3,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "midd_risk": {
    +                        "range": [
    +                            0.05,
    +                            0.11
    +                        ],
    +                        "file_count": 2,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "low_risk": {
    +                        "range": [
    +                            0,
    +                            0.05
    +                        ],
    +                        "file_count": 2,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    }
    +                },
    +                "custom_summary": null,
    +                "last_revision": "last_revision",
    +                "duplicate_file_count": 8,
    +                "duplicate_block_count": 55,
    +                "duplicate_line_count": 1177,
    +                "diff_duplicate_block_count": 0,
    +                "diff_duplicate_line_count": 0,
    +                "close_issue_count": 0,
    +                "new_issue_count": 0,
    +                "reopen_issue_count": 5,
    +                "ignored_issue_count": 0,
    +                "duplicate_rate": 4.98,
    +                "unique_duplicate_line_count": 1083,
    +                "total_duplicate_line_count": 1083,
    +                "total_line_count": 21745,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量代码统计结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/clocscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "last_revision": "last_revision",
    +                "code_line_num": 140490,
    +                "comment_line_num": 5410,
    +                "blank_line_num": 3408,
    +                "total_line_num": 149308,
    +                "add_code_line_num": 6673,
    +                "add_comment_line_num": 2309,
    +                "add_blank_line_num": 1289,
    +                "add_total_line_num": 10271,
    +                "mod_code_line_num": 965,
    +                "mod_comment_line_num": 297,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 1262,
    +                "del_code_line_num": 35844,
    +                "del_comment_line_num": 2117,
    +                "del_blank_line_num": 1794,
    +                "del_total_line_num": 39755,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    `,35),s=[l];function t(o,v){return i(),e("div",null,s)}const c=n(d,[["render",t],["__file","结果概览模块接口.html.vue"]]);export{c as default}; diff --git "a/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-6e625e21.js" "b/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-6e625e21.js" new file mode 100644 index 000000000..4d31a97f9 --- /dev/null +++ "b/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-6e625e21.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-4b0e7010","path":"/en/api/%E7%BB%93%E6%9E%9C%E6%A6%82%E8%A7%88%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"代码扫描管理","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"查看项目扫描最新结果概览","slug":"查看项目扫描最新结果概览","link":"#查看项目扫描最新结果概览","children":[]},{"level":2,"title":"查看项目代码最新扫描结果概览","slug":"查看项目代码最新扫描结果概览","link":"#查看项目代码最新扫描结果概览","children":[]},{"level":2,"title":"查看项目代码扫描结果概览","slug":"查看项目代码扫描结果概览","link":"#查看项目代码扫描结果概览","children":[]},{"level":2,"title":"查看项目代码度量圈复杂度结果概览","slug":"查看项目代码度量圈复杂度结果概览","link":"#查看项目代码度量圈复杂度结果概览","children":[]},{"level":2,"title":"查看项目代码度量重复代码结果概览","slug":"查看项目代码度量重复代码结果概览","link":"#查看项目代码度量重复代码结果概览","children":[]},{"level":2,"title":"查看项目代码度量代码统计结果概览","slug":"查看项目代码度量代码统计结果概览","link":"#查看项目代码度量代码统计结果概览","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/api/结果概览模块接口.md"}');export{l as data}; diff --git "a/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-b8aa1708.js" "b/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-b8aa1708.js" new file mode 100644 index 000000000..61eda1a4a --- /dev/null +++ "b/assets/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html-b8aa1708.js" @@ -0,0 +1,735 @@ +import{_ as n,o as i,c as e,e as u}from"./app-2a91d8ab.js";const d={},l=u(`

    代码扫描管理

    查看项目扫描最新结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/
    +

    返回结果

    {
    +    "data": {
    +        "lintscan": {
    +            "issue_open_num": 74,
    +            "issue_fix_num": 439,
    +            "issue_detail_num": 310,
    +            "scan": {
    +                "id": 1,
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "execute_time": "00:02:17.844712"
    +            },
    +            "current_scan": {
    +                "active_category_detail": {
    +                    "convention": 70,
    +                    "other": 4
    +                },
    +                "active_severity_detail": {
    +                    "error": 69,
    +                    "warning": 5
    +                },
    +                "issue_open_num": 74,
    +                "issue_fix_num": 439
    +            },
    +            "total": {
    +                "state_detail": {
    +                    "active": 197,
    +                    "resolved": 13,
    +                    "closed": 23297
    +                },
    +                "category_detail": {
    +                    "convention": {
    +                        "active": 184,
    +                        "resolved": 13,
    +                        "closed": 21143
    +                    },
    +                    "other": {
    +                        "active": 13,
    +                        "closed": 154
    +                    },
    +                    "correctness": {
    +                        "closed": 1997
    +                    },
    +                    "performance": {
    +                        "closed": 3
    +                    }
    +                },
    +                "severity_detail": {
    +                    "error": {
    +                        "active": 157,
    +                        "resolved": 11,
    +                        "closed": 20113
    +                    },
    +                    "warning": {
    +                        "active": 40,
    +                        "resolved": 2,
    +                        "closed": 2930
    +                    },
    +                    "info": {
    +                        "closed": 254
    +                    }
    +                }
    +            },
    +            "status": 0,
    +            "text": "成功",
    +            "description": null,
    +            "scan_summary": {
    +                "convention": {
    +                    "error": {
    +                        "rule_count": 7,
    +                        "active": 65
    +                    },
    +                    "warning": {
    +                        "rule_count": 2,
    +                        "active": 5
    +                    }
    +                },
    +                "other": {
    +                    "error": {
    +                        "rule_count": 1,
    +                        "active": 4
    +                    }
    +                }
    +            },
    +            "total_summary": {
    +                "correctness": {
    +                    "error": {
    +                        "rule_count": 16,
    +                        "closed": 1315
    +                    },
    +                    "warning": {
    +                        "rule_count": 10,
    +                        "closed": 629
    +                    },
    +                    "info": {
    +                        "rule_count": 1,
    +                        "closed": 53
    +                    }
    +                },
    +                "performance": {
    +                    "warning": {
    +                        "rule_count": 1,
    +                        "closed": 3
    +                    }
    +                },
    +                "convention": {
    +                    "error": {
    +                        "rule_count": 42,
    +                        "active": 149,
    +                        "resolved": 11,
    +                        "closed": 18778
    +                    },
    +                    "warning": {
    +                        "rule_count": 17,
    +                        "active": 35,
    +                        "resolved": 2,
    +                        "closed": 2298
    +                    },
    +                    "info": {
    +                        "rule_count": 1,
    +                        "closed": 67
    +                    }
    +                },
    +                "other": {
    +                    "error": {
    +                        "rule_count": 2,
    +                        "active": 8,
    +                        "closed": 20
    +                    },
    +                    "warning": {
    +                        "rule_count": 1,
    +                        "active": 5
    +                    },
    +                    "info": {
    +                        "rule_count": 3,
    +                        "closed": 134
    +                    }
    +                }
    +            }
    +        },
    +        "cyclomaticcomplexityscan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "default_summary": {
    +                "min_ccn": 20,
    +                "over_cc_func_count": 6,
    +                "under_cc_func_count": 796,
    +                "diff_over_cc_func_count": 0,
    +                "over_cc_func_average": 22.333333333333332,
    +                "cc_func_average": 2.5099750623441395,
    +                "over_cc_sum": 14,
    +                "cc_average_of_lines": 1.0422094841063054
    +            },
    +            "custom_summary": null,
    +            "created_time": "2021-03-11T20:48:59.976947+08:00",
    +            "creator": null,
    +            "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +            "modifier": null,
    +            "deleted_time": null,
    +            "deleter": null,
    +            "last_revision": "last_revision",
    +            "diff_cc_num": 0,
    +            "cc_open_num": 6,
    +            "cc_average_of_lines": 1.0422094841063054,
    +            "cc_fix_num": 0,
    +            "worse_cc_file_num": 0,
    +            "min_ccn": 20,
    +            "code_line_num": 13433,
    +            "scan": 1
    +        },
    +        "duplicatescan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "default_summary": {
    +                "exhi_risk": {
    +                    "range": [
    +                        0.2,
    +                        1
    +                    ],
    +                    "file_count": 1,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "high_risk": {
    +                    "range": [
    +                        0.11,
    +                        0.2
    +                    ],
    +                    "file_count": 3,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "midd_risk": {
    +                    "range": [
    +                        0.05,
    +                        0.11
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "low_risk": {
    +                    "range": [
    +                        0,
    +                        0.05
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                }
    +            },
    +            "custom_summary": null,
    +            "last_revision": "last_revision",
    +            "duplicate_file_count": 8,
    +            "duplicate_block_count": 55,
    +            "duplicate_line_count": 1177,
    +            "diff_duplicate_block_count": 0,
    +            "diff_duplicate_line_count": 0,
    +            "close_issue_count": 0,
    +            "new_issue_count": 0,
    +            "reopen_issue_count": 5,
    +            "ignored_issue_count": 0,
    +            "duplicate_rate": 4.98,
    +            "unique_duplicate_line_count": 1083,
    +            "total_duplicate_line_count": 1083,
    +            "total_line_count": 21745,
    +            "scan": 1
    +        },
    +        "clocscan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "last_revision": "last_revision",
    +            "code_line_num": 140490,
    +            "comment_line_num": 5410,
    +            "blank_line_num": 3408,
    +            "total_line_num": 149308,
    +            "add_code_line_num": 6673,
    +            "add_comment_line_num": 2309,
    +            "add_blank_line_num": 1289,
    +            "add_total_line_num": 10271,
    +            "mod_code_line_num": 965,
    +            "mod_comment_line_num": 297,
    +            "mod_blank_line_num": 0,
    +            "mod_total_line_num": 1262,
    +            "del_code_line_num": 35844,
    +            "del_comment_line_num": 2117,
    +            "del_blank_line_num": 1794,
    +            "del_total_line_num": 39755,
    +            "scan": 1
    +        }
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码最新扫描结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/latestscan/
    +

    参数列表

    参数类型描述
    scan_revisionstr选填,指定查询的扫描版本号,如不指定则为当前项目最新的一次扫描

    返回结果

    {
    +    "data": {
    +        "id": 1,                            # 扫描编号
    +        "repo_id": 1,                       # 代码库编号
    +        "project_id": 1,                    # 项目编号
    +        "job_gid": 1,                       # 关联任务编号
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +        "current_revision": "current_revision",  # 扫描版本号
    +        "result_code": 0,                   # 扫描任务结果码,0表示正常
    +        "result_code_msg": "成功",
    +        "result_msg": null,
    +        "lintscan": {                         # 代码扫描结果信息
    +            "current_scan": {                 # 本次扫描信息
    +                "active_severity_detail": {   # 不同严重级别的活跃问题数,包含 fatal(1-致命), error(2-错误), warning(3-警告), info(4-提示)
    +                    "error": 69,              
    +                    "warning": 5              
    +                },
    +                "issue_open_num": 10,         # 本次扫描新发现问题数
    +                "issue_fix_num": 2            # 本次扫描关闭存量问题数
    +            },
    +            "total": {                        # 当前项目整体信息
    +                "state_detail": {             # 不同处理状态的问题数,包含 active(1-活跃)、resolved(2-已处理)、closed(3-已关闭)
    +                    "active": 197,            
    +                    "resolved": 13,
    +                    "closed": 23297
    +                },
    +                "severity_detail": {         # 不同严重级别下不同处理状态的问题量
    +                    "error": {
    +                        "active": 157,
    +                        "resolved": 11,
    +                        "closed": 20113
    +                    },
    +                    "warning": {
    +                        "active": 40,
    +                        "resolved": 2,
    +                        "closed": 2930
    +                    },
    +                    "info": {
    +                        "closed": 254
    +                    }
    +                }
    +            }
    +        },
    +        "duplicatescan": {                    # 重复代码扫描结果信息
    +            "id": 1,                          # 扫描任务编号
    +            "scan_revision": "scan_revision", # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +            "default_summary": {              # 默认概览
    +                "exhi_risk": {                # 极高风险
    +                    "range": [                # 重复率范围: 0.2-1
    +                        0.2,
    +                        1
    +                    ],
    +                    "file_count": 1,          # 文件数量
    +                    "diff": {                 # 增量数据
    +                        "diff_file_count": 0  # 增量文件数量
    +                    }
    +                },
    +                "high_risk": {                # 高风险
    +                    "range": [                # 重复率范围:0.11-0.2
    +                        0.11,
    +                        0.2
    +                    ],
    +                    "file_count": 3,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "midd_risk": {                # 中风险
    +                    "range": [                # 重复率范围:0.05-0.11
    +                        0.05,
    +                        0.11
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "low_risk": {                 # 低风险
    +                    "range": [                # 重复率范围:0-0.05
    +                        0,
    +                        0.05
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                }
    +            },
    +            "custom_summary": null,           # 自定义概览数据
    +            "last_revision": "2010ef28ff3a26424d4e8f32df022f90cd682eda",  # 上次扫描版本号
    +            "duplicate_file_count": 8,        # 重复文件数量
    +            "duplicate_block_count": 55,      # 重复代码块数量
    +            "duplicate_line_count": 1177,     # 重复代码行数
    +            "diff_duplicate_block_count": 0,  # 增量重复代码块数量
    +            "diff_duplicate_line_count": 0,   # 增量重复代码行数
    +            "close_issue_count": 0,           # 关闭问题数
    +            "new_issue_count": 0,             # 新增问题数
    +            "reopen_issue_count": 5,          # 重新打开问题数
    +            "ignored_issue_count": 0,         # 忽略问题数
    +            "duplicate_rate": 4.98,           # 重复率
    +            "unique_duplicate_line_count": 1083,  # 去重后的重复代码行数
    +            "total_duplicate_line_count": 1083,   # 项目总的去重后的重复代码行数
    +            "total_line_count": 21745,            # 项目总行书
    +            "scan": 1                         # 关联扫描任务编号
    +        },
    +        "cyclomaticcomplexityscan": {         # 圈复杂度扫描数据
    +            "id": 1,                          # 圈复杂度扫描编号
    +            "scan_revision": "scan_revision", # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "default_summary": {                      # 默认概览数据
    +                "min_ccn": 20,                        # 最小圈复杂度阈值
    +                "over_cc_func_count": 6,              # 超标函数数量
    +                "under_cc_func_count": 796,           # 未超标函数数量
    +                "diff_over_cc_func_count": 0,         # 增量超标函数数据
    +                "over_cc_func_average": 22.333333333333332,  # 平均超标圈复杂度
    +                "cc_func_average": 2.5099750623441395,  # 平均圈复杂度
    +                "over_cc_sum": 14,                      # 文件超标方法圈复杂度超过阈值的差值之和
    +                "cc_average_of_lines": 1.0422094841063054 # 千行代码平均圈复杂度
    +            },
    +            "custom_summary": null,                     # 自定义概览数据
    +            "created_time": "2021-03-11T20:48:59.976947+08:00",
    +            "creator": null,
    +            "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +            "modifier": null,
    +            "deleted_time": null,
    +            "deleter": null,
    +            "last_revision": "last_revision",           # 上一次扫描版本号
    +            "diff_cc_num": 0,                           # 增量超标函数数量
    +            "cc_open_num": 6,                           # 超标函数量
    +            "cc_average_of_lines": 1.0422094841063054,  # 千行代码平均圈复杂度
    +            "cc_fix_num": 0,                            # 修复数量
    +            "worse_cc_file_num": 0,                     # 圈复杂度恶化的文件数据
    +            "min_ccn": 20,                              # 最小圈复杂度阈值
    +            "code_line_num": 13433,                     # 代码行数
    +            "scan": 1
    +        },
    +        "clocscan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",           # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +            "last_revision": "last_revision",           # 上一次扫描版本号
    +            "code_line_num": 140490,                    # 代码行数
    +            "comment_line_num": 5410,                   # 注释行数
    +            "blank_line_num": 3408,                     # 空白行数
    +            "total_line_num": 149308,                   # 总行数
    +            "add_code_line_num": 6673,                  # 增加的代码行数
    +            "add_comment_line_num": 2309,               # 增加的注释行数
    +            "add_blank_line_num": 1289,                 # 增加的空白行数
    +            "add_total_line_num": 10271,                # 增加的总行数
    +            "mod_code_line_num": 965,                   # 修改的代码行数
    +            "mod_comment_line_num": 297,                # 修改的注释行数
    +            "mod_blank_line_num": 0,                    # 修改的空白行数
    +            "mod_total_line_num": 1262,                 # 修改的总行数
    +            "del_code_line_num": 35844,                 # 删除的代码行数
    +            "del_comment_line_num": 2117,               # 删除的注释行数
    +            "del_blank_line_num": 1794,                 # 删除的空白行数
    +            "del_total_line_num": 39755,                # 删除的总行数
    +            "scan": 1
    +        }
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码扫描结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/lintscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr选填,扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr选填,扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "issue_open_num": 10,             # 本次扫描新发现问题数
    +                "issue_fix_num": 2,               # 本次扫描关闭存量问题数
    +                "issue_detail_num": 310,          # 本次扫描上报原始问题数(问题展示会进行聚合)
    +                "scan": {                         # 扫描信息
    +                    "id": 1,                      # 扫描任务编号
    +                    "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描开始时间
    +                    "execute_time": "00:02:17.844712"                 # 扫描执行耗时
    +                },
    +                "current_scan": {                 # 本次扫描信息
    +                    "active_category_detail": {   # 活跃问题分类,包含 CORRECTNESS(1-功能)、SECURITY(2-安全)、PERFORMANCE(3-性能)、USABILITY(4-可用性)、ACCESSIBILITY(5-无障碍化)、I18N(6-国际化)、CONVENTION(7-代码风格)、OTHER(8-其他)
    +                        "convention": 70,         # 代码风格类型问题
    +                        "other": 4                # 其他类型问题
    +                    },
    +                    "active_severity_detail": {   # 不同严重级别的活跃问题数,包含 fatal(1-致命), error(2-错误), warning(3-警告), info(4-提示)
    +                        "error": 69,              
    +                        "warning": 5              
    +                    },
    +                    "issue_open_num": 10,         # 本次扫描新发现问题数
    +                    "issue_fix_num": 2            # 本次扫描关闭存量问题数
    +                },
    +                "total": {                        # 当前项目整体信息
    +                    "state_detail": {             # 不同处理状态的问题数,包含 active(1-活跃)、resolved(2-已处理)、closed(3-已关闭)
    +                        "active": 197,            
    +                        "resolved": 13,
    +                        "closed": 23297
    +                    },
    +                    "category_detail": {          # 不同分类下不同处理状态的问题量
    +                        "convention": {           
    +                            "active": 184,
    +                            "resolved": 13,
    +                            "closed": 21143
    +                        },
    +                        "other": {                
    +                            "active": 13,
    +                            "closed": 154
    +                        },
    +                        "correctness": {
    +                            "closed": 1997
    +                        },
    +                        "performance": {
    +                            "closed": 3
    +                        }
    +                    },
    +                    "severity_detail": {         # 不同严重级别下不同处理状态的问题量
    +                        "error": {
    +                            "active": 157,
    +                            "resolved": 11,
    +                            "closed": 20113
    +                        },
    +                        "warning": {
    +                            "active": 40,
    +                            "resolved": 2,
    +                            "closed": 2930
    +                        },
    +                        "info": {
    +                            "closed": 254
    +                        }
    +                    }
    +                },
    +                "status": 0,                     # 扫描状态,0表示成功
    +                "text": "成功",
    +                "description": null,
    +                "scan_summary": {                # 扫描概览
    +                    "convention": {              
    +                        "error": {               
    +                            "rule_count": 7,     # 规则数
    +                            "active": 65         # 活跃问题数
    +                        },
    +                        "warning": {
    +                            "rule_count": 2,
    +                            "active": 5
    +                        }
    +                    },
    +                    "other": {
    +                        "error": {
    +                            "rule_count": 1,
    +                            "active": 4
    +                        }
    +                    }
    +                },
    +                "total_summary": {
    +                    "correctness": {
    +                        "error": {
    +                            "rule_count": 16,
    +                            "closed": 1315
    +                        },
    +                        "warning": {
    +                            "rule_count": 10,
    +                            "closed": 629
    +                        },
    +                        "info": {
    +                            "rule_count": 1,
    +                            "closed": 53
    +                        }
    +                    },
    +                    "performance": {
    +                        "warning": {
    +                            "rule_count": 1,
    +                            "closed": 3
    +                        }
    +                    },
    +                    "convention": {
    +                        "error": {
    +                            "rule_count": 42,
    +                            "active": 149,
    +                            "resolved": 11,
    +                            "closed": 18778
    +                        },
    +                        "warning": {
    +                            "rule_count": 17,
    +                            "active": 35,
    +                            "resolved": 2,
    +                            "closed": 2298
    +                        },
    +                        "info": {
    +                            "rule_count": 1,
    +                            "closed": 67
    +                        }
    +                    },
    +                    "other": {
    +                        "error": {
    +                            "rule_count": 2,
    +                            "active": 8,
    +                            "closed": 20
    +                        },
    +                        "warning": {
    +                            "rule_count": 1,
    +                            "active": 5
    +                        },
    +                        "info": {
    +                            "rule_count": 3,
    +                            "closed": 134
    +                        }
    +                    }
    +                }
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量圈复杂度结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/cycscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr选填,扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr选填,扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "default_summary": {
    +                    "min_ccn": 20,
    +                    "over_cc_func_count": 6,
    +                    "under_cc_func_count": 796,
    +                    "diff_over_cc_func_count": 0,
    +                    "over_cc_func_average": 22.333333333333332,
    +                    "cc_func_average": 2.5099750623441395,
    +                    "over_cc_sum": 14,
    +                    "cc_average_of_lines": 1.0422094841063054
    +                },
    +                "custom_summary": null,
    +                "created_time": "2021-03-11T20:48:59.976947+08:00",
    +                "creator": null,
    +                "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "last_revision": "last_revision",
    +                "diff_cc_num": 0,
    +                "cc_open_num": 6,
    +                "cc_average_of_lines": 1.0422094841063054,
    +                "cc_fix_num": 0,
    +                "worse_cc_file_num": 0,
    +                "min_ccn": 20,
    +                "code_line_num": 13433,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量重复代码结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/dupscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr选填,扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr选填,扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "default_summary": {
    +                    "exhi_risk": {
    +                        "range": [
    +                            0.2,
    +                            1
    +                        ],
    +                        "file_count": 1,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "high_risk": {
    +                        "range": [
    +                            0.11,
    +                            0.2
    +                        ],
    +                        "file_count": 3,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "midd_risk": {
    +                        "range": [
    +                            0.05,
    +                            0.11
    +                        ],
    +                        "file_count": 2,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "low_risk": {
    +                        "range": [
    +                            0,
    +                            0.05
    +                        ],
    +                        "file_count": 2,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    }
    +                },
    +                "custom_summary": null,
    +                "last_revision": "last_revision",
    +                "duplicate_file_count": 8,
    +                "duplicate_block_count": 55,
    +                "duplicate_line_count": 1177,
    +                "diff_duplicate_block_count": 0,
    +                "diff_duplicate_line_count": 0,
    +                "close_issue_count": 0,
    +                "new_issue_count": 0,
    +                "reopen_issue_count": 5,
    +                "ignored_issue_count": 0,
    +                "duplicate_rate": 4.98,
    +                "unique_duplicate_line_count": 1083,
    +                "total_duplicate_line_count": 1083,
    +                "total_line_count": 21745,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量代码统计结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/clocscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr选填,扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr选填,扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "last_revision": "last_revision",
    +                "code_line_num": 140490,
    +                "comment_line_num": 5410,
    +                "blank_line_num": 3408,
    +                "total_line_num": 149308,
    +                "add_code_line_num": 6673,
    +                "add_comment_line_num": 2309,
    +                "add_blank_line_num": 1289,
    +                "add_total_line_num": 10271,
    +                "mod_code_line_num": 965,
    +                "mod_comment_line_num": 297,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 1262,
    +                "del_code_line_num": 35844,
    +                "del_comment_line_num": 2117,
    +                "del_blank_line_num": 1794,
    +                "del_total_line_num": 39755,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    `,35),s=[l];function t(o,v){return i(),e("div",null,s)}const c=n(d,[["render",t],["__file","结果概览模块接口.html.vue"]]);export{c as default}; diff --git "a/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-02d18eb1.js" "b/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-02d18eb1.js" new file mode 100644 index 000000000..03cbfa201 --- /dev/null +++ "b/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-02d18eb1.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-72a0db1d","path":"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7.html","title":"自定义工具","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"自定义工具步骤说明","slug":"自定义工具步骤说明","link":"#自定义工具步骤说明","children":[{"level":3,"title":"第一步,编写代码,实现分析工具逻辑","slug":"第一步-编写代码-实现分析工具逻辑","link":"#第一步-编写代码-实现分析工具逻辑","children":[]},{"level":3,"title":"第二步,提交工具到 git 代码库","slug":"第二步-提交工具到-git-代码库","link":"#第二步-提交工具到-git-代码库","children":[]},{"level":3,"title":"第三步,在工具管理页面中创建工具","slug":"第三步-在工具管理页面中创建工具","link":"#第三步-在工具管理页面中创建工具","children":[]},{"level":3,"title":"第四步,为工具添加规则","slug":"第四步-为工具添加规则","link":"#第四步-为工具添加规则","children":[]},{"level":3,"title":"第五步,将工具配置到执行节点","slug":"第五步-将工具配置到执行节点","link":"#第五步-将工具配置到执行节点","children":[]},{"level":3,"title":"第六步,完成上述操作,在项目中使用工具规则","slug":"第六步-完成上述操作-在项目中使用工具规则","link":"#第六步-完成上述操作-在项目中使用工具规则","children":[]}]},{"level":2,"title":"自定义工具权限说明","slug":"自定义工具权限说明","link":"#自定义工具权限说明","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/工具管理/自定义工具.md"}');export{l as data}; diff --git "a/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-5b755770.js" "b/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-5b755770.js" new file mode 100644 index 000000000..92f443201 --- /dev/null +++ "b/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-5b755770.js" @@ -0,0 +1,35 @@ +import{_ as s,a as t,b as r,c as d,d as a,e as u}from"./customtool_06-8ec07c7b.js";import{_ as c,r as p,o as m,c as h,a as e,b as i,d as o,e as n}from"./app-2a91d8ab.js";const v={},g=n('

    自定义工具

    腾讯云代码分析平台支持用户自助添加代码分析工具。

    适用场景:自定义规则无法满足团队业务复杂需求,需要更多的代码逻辑来匹配目标代码的情况。通常需要团队业务方自行实现对应代码分析工具。

    只需要几步操作:

    1. 编写代码,实现扫描工具逻辑
    2. 提交工具到 git 代码库
    3. 在页面创建新工具
    4. 为工具添加规则
    5. 将工具配置到执行节点
    6. 在项目分析方案中添加规则

    扩展集成工具免责声明

    被扩展集成进腾讯云代码分析系统的任何非官方工具,该类工具对于腾讯云代码分析系统等于黑盒,腾讯云代码分析系统不对该类工具负责,由该类工具方承担所有责任(包括但不限于分发被分析代码,产生代码以及相关信息泄漏)。

    自定义工具步骤说明

    第一步,编写代码,实现分析工具逻辑

    ',8),_={href:"https://github.com/TCATools/demo_tool",target:"_blank",rel:"noopener noreferrer"},b=e("p",null,[e("strong",null,"必要:")],-1),q=n("
  • 运行方式:支持命令行执行,比如 python run.py 或 run.exe,执行命令的工作目录为工具代码的根目录。

  • 运行环境说明

    • 建议将工具打包编译成可执行程序,拉取下来直接可以执行。
    • 如果工具需要在特定的环境中运行,比如python、java环境,平台提供了丰富的工具依赖包,可以在工具管理-工具依赖中查看,创建工具时可供选择,执行时会自动配置好依赖环境。
    • 如果现有的工具依赖包未支持所需依赖,也可以创建新的工具依赖使用。
  • ",2),x=e("p",null,[e("strong",null,"平台已提供的环境变量")],-1),f={href:"https://github.com/TCATools/demo_tool",target:"_blank",rel:"noopener noreferrer"},E=n(`
    SOURCE_DIR:要扫描的代码目录路径
    +DIFF_FILES: 值为一个json文件路径,文件内容为增量扫描的文件列表(增量扫描时可用)
    +SCAN_FILES: 值为一个json文件路径,文件内容为需要扫描的文件列表(增量或全量扫描均可用)
    +TASK_REQUEST: 值为一个json文件路径,文件内容为当前扫描任务参数
    +RESULT_DIR: 结果result.json输出的结果目录路径
    +
    `,1),j=n(`
  • 工具命令声明

    在工具仓库根目录下,添加一个tool.json文件,声明工具的检查和扫描命令,比如:

    {
    +  "check_cmd": "python src/main.py check",
    +  "run_cmd": "python src/main.py scan"
    +}
    +

    参数说明:

    • check_cmd
      • 功能:判断当前执行环境是否满足工具要求(如果不需要检查,也可以没有这个命令)。 比如某些工具只能在linux下执行,需要判断当前是否为linux环境。
      • 输出:将判断结果输出到check_result.json文件中,文件内容为{"usable": true}{"usable": false}
    • run_cmd
      • 功能:扫描代码,执行自定义检查器逻辑(该命令必须存在)。
      • 输出:按照指定格式,输出结果到结果目录下的result.json文件中。
  • 工具输出格式要求

    • 将扫描结果输出到RESULT_DIR环境变量指定的目录下的result.json文件中(Python 示例代码)
    import os
    +import json
    +result_dir = os.getenv("RESULT_DIR", os.getcwd())
    +result_path = os.path.join(result_dir, "result.json")
    +with open(result_path, "w") as fp:
    +    json.dump(result, fp, indent=2)
    +
    • result.json 文件格式如下:
    [
    +    {
    +        "path": "文件绝对路径",
    +        "line": "行号,int类型",
    +        "column": "列号, int类型,如果工具没有输出列号信息,可以用0代替",
    +        "msg": "提示信息",
    +        "rule": "规则名称,可以根据需要输出不同的规则名",
    +        "refs": [
    +            {
    +                "line": "回溯行号",
    +                "msg": "提示信息",
    +                "tag": "用一个词简要标记该行信息,比如uninit_member,member_decl等,如果没有也可以都写成一样的",
    +                "path": "回溯行所在文件绝对路径"
    +            },
    +            ...
    +        ]
    +    },
    +    ...
    +]
    +

    refs 字段说明:

    非必需项,可无。该字段记录问题回溯路径信息。比如当前行的代码问题,是经过上下文的三行代码执行路径而导致的,可以将这三行的位置及提示信息,按顺序添加到 refs 数组中。

  • `,2),T=n('

    第二步,提交工具到 git 代码库

    • 创建代码库,将工具源代码或编译打包后的可执行文件,提交到代码仓库中(建议提交到master分支,TCA默认拉取的是master分支)。

    • 建议代码库中加入 README.md 文件,说明工具功能和维护人。

    • 后续需要修改工具实现逻辑,可以直接更新代码库,TCA 平台在执行该工具时,会自动拉取最新工具代码版本。

    第三步,在工具管理页面中创建工具

    • 进入工具管理页面,点击创建工具

      enter image description here

    • 填写工具信息

      enter image description here

      部分参数说明:

      • 工具仓库地址,即前述步骤中提交的工具 git 代码库地址,默认拉取的是master分支,如果是其他分支,需要在仓库地址后加上#分支名,比如:https://github.com/xxx/xxx.git#main

      • 工具认证,授权拉取工具仓库的权限

      • 执行命令,该命令会在工具根目录下执行

      • 环境变量,工具执行所需的环境变量

      • License,如果是开源工具,填写工具遵循的开源协议,或者填写自研共建

      • 是否为编译型工具,表示在使用该工具对用户代码进行分析时,是否要求代码需要编译或可执行编译

      • 注意:针对特殊扫描场景的工具(比如检查代码库下是否包含某些第三方依赖目录,结果不涉及单个代码文件的),无法对结果进行代码文件处理,可以通过设置以下环境变量,跳过一些通用的结果处理步骤,避免问题结果被过滤掉:

        • BLAME_TYPE=NO_BLAME,跳过对代码行/代码文件进行文件责任人定位(结果非单个文件/代码行时使用)
        • FILTER_TYPE=NO_VERSION_FILTER,跳过检查问题路径(path字段)是否为已提交到代码库中的文件(结果非单个文件/代码行时使用)
        • IGNORE_TYPE=NO_ISSUE_IGNORE,跳过注释忽略处理(结果非单个文件/代码行时使用)
    • 添加工具依赖

      enter image description here

      添加完成后,会展示已添加的依赖方案:

      enter image description here

    工具依赖说明:

    • 比如当前的demo工具,只需要依赖python3运行,而且支持在linux x86_64、linux arm64、mac和windows下执行,那么只需要配置一个依赖方案(如上图),并配置为默认方案。在不同的操作系统中,会自动加载对应操作系统的python环境。
    • 如果需要根据扫描项目设置的环境变量,加载不同的依赖配置,则可以配置不同的判断条件,使用多个依赖方案。

    第四步,为工具添加规则

    • 完成工具创建后,进入规则列表,为工具添加规则

      enter image description here

    • 填写规则信息

      部分参数说明:

      • 规则简介:简要描述规则发现的是什么问题,扫描结果中会作为问题标题展示

      • 详细描述:可详细描述规则,以及规则的解决方式,建议附上解决案例 demo

      • 解决方法:按照实际情况,说明该代码问题的解决方法,建议附上解决案例 demo

      • 规则参数:如果不需要通过规则参数传递信息,可留空

    第五步,将工具配置到执行节点

    提示

    需要联系平台管理员协助操作,在管理入口-节点管理中进入需要配置的机器节点的工具进程配置中,找到对应工具,勾选工具进程。

    完成节点配置工具进程后,才能在项目中采用该工具进行分析。

    enter image description here

    第六步,完成上述操作,在项目中使用工具规则

    • 进入到项目中,在分析方案-代码检查进行规则配置。

    • 点击添加规则,找到对应工具规则进行添加。

    • 添加完成后,启动分析,为了将规则应用到所有代码文件,建议启动一次全量分析(增量分析只会分析自上次扫描后变更的文件)。

    自定义工具权限说明

    • 默认自定义工具仅团队管理员可操作,团队内所有成员可使用。

      • 团队管理员才能创建工具,添加工具规则等,具备该工具全部权限

      • 团队内所有成员可使用该工具规则,如在规则配置中添加此工具规则,团队普通成员仅只读权限

    • 工具希望全平台使用?

      由于全平台使用的工具影响范围较大,建议团队先在团队内对工具进行充分测试,保障团队内工具的高有效性,如需全平台使用,需联系平台管理员进行申请

      平台管理员需对此工具进行审核,在确保工具的高有效性下可将此工具权限调整为全平台可使用

    ',15);function I(R,y){const l=p("ExternalLinkIcon");return m(),h("div",null,[g,e("p",null,[i("根据需要匹配的目标代码场景,编写对应的工具逻辑。 可以参考 Python 实现的 "),e("a",_,[i("Demo 项目"),o(l)]),i("。")]),b,e("ul",null,[q,e("li",null,[x,e("ul",null,[e("li",null,[i("获取及使用方式请参考 "),e("a",f,[i("Demo 项目"),o(l)]),i("。")])]),E]),j]),T])}const N=c(v,[["render",I],["__file","自定义工具.html.vue"]]);export{N as default}; diff --git "a/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-7f234a0d.js" "b/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-7f234a0d.js" new file mode 100644 index 000000000..7b53f0c2d --- /dev/null +++ "b/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-7f234a0d.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-28be823c","path":"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B7%A5%E5%85%B7.html","title":"自定义工具","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"自定义工具步骤说明","slug":"自定义工具步骤说明","link":"#自定义工具步骤说明","children":[{"level":3,"title":"第一步,编写代码,实现分析工具逻辑","slug":"第一步-编写代码-实现分析工具逻辑","link":"#第一步-编写代码-实现分析工具逻辑","children":[]},{"level":3,"title":"第二步,提交工具到 git 代码库","slug":"第二步-提交工具到-git-代码库","link":"#第二步-提交工具到-git-代码库","children":[]},{"level":3,"title":"第三步,在工具管理页面中创建工具","slug":"第三步-在工具管理页面中创建工具","link":"#第三步-在工具管理页面中创建工具","children":[]},{"level":3,"title":"第四步,为工具添加规则","slug":"第四步-为工具添加规则","link":"#第四步-为工具添加规则","children":[]},{"level":3,"title":"第五步,将工具配置到执行节点","slug":"第五步-将工具配置到执行节点","link":"#第五步-将工具配置到执行节点","children":[]},{"level":3,"title":"第六步,完成上述操作,在项目中使用工具规则","slug":"第六步-完成上述操作-在项目中使用工具规则","link":"#第六步-完成上述操作-在项目中使用工具规则","children":[]}]},{"level":2,"title":"自定义工具权限说明","slug":"自定义工具权限说明","link":"#自定义工具权限说明","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/工具管理/自定义工具.md"}');export{l as data}; diff --git "a/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-bc29708f.js" "b/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-bc29708f.js" new file mode 100644 index 000000000..2dfc8933b --- /dev/null +++ "b/assets/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html-bc29708f.js" @@ -0,0 +1,35 @@ +import{_ as s,a as t,b as r,c as d,d as a,e as u}from"./customtool_06-8ec07c7b.js";import{_ as c,r as p,o as m,c as h,a as e,b as i,d as o,e as n}from"./app-2a91d8ab.js";const v={},g=n('

    自定义工具

    腾讯云代码分析平台支持用户自助添加代码分析工具。

    适用场景:自定义规则无法满足团队业务复杂需求,需要更多的代码逻辑来匹配目标代码的情况。通常需要团队业务方自行实现对应代码分析工具。

    只需要几步操作:

    1. 编写代码,实现扫描工具逻辑
    2. 提交工具到 git 代码库
    3. 在页面创建新工具
    4. 为工具添加规则
    5. 将工具配置到执行节点
    6. 在项目分析方案中添加规则

    扩展集成工具免责声明

    被扩展集成进腾讯云代码分析系统的任何非官方工具,该类工具对于腾讯云代码分析系统等于黑盒,腾讯云代码分析系统不对该类工具负责,由该类工具方承担所有责任(包括但不限于分发被分析代码,产生代码以及相关信息泄漏)。

    自定义工具步骤说明

    第一步,编写代码,实现分析工具逻辑

    ',8),_={href:"https://github.com/TCATools/demo_tool",target:"_blank",rel:"noopener noreferrer"},b=e("p",null,[e("strong",null,"必要:")],-1),q=n("
  • 运行方式:支持命令行执行,比如 python run.py 或 run.exe,执行命令的工作目录为工具代码的根目录。

  • 运行环境说明

    • 建议将工具打包编译成可执行程序,拉取下来直接可以执行。
    • 如果工具需要在特定的环境中运行,比如python、java环境,平台提供了丰富的工具依赖包,可以在工具管理-工具依赖中查看,创建工具时可供选择,执行时会自动配置好依赖环境。
    • 如果现有的工具依赖包未支持所需依赖,也可以创建新的工具依赖使用。
  • ",2),x=e("p",null,[e("strong",null,"平台已提供的环境变量")],-1),f={href:"https://github.com/TCATools/demo_tool",target:"_blank",rel:"noopener noreferrer"},E=n(`
    SOURCE_DIR:要扫描的代码目录路径
    +DIFF_FILES: 值为一个json文件路径,文件内容为增量扫描的文件列表(增量扫描时可用)
    +SCAN_FILES: 值为一个json文件路径,文件内容为需要扫描的文件列表(增量或全量扫描均可用)
    +TASK_REQUEST: 值为一个json文件路径,文件内容为当前扫描任务参数
    +RESULT_DIR: 结果result.json输出的结果目录路径
    +
    `,1),j=n(`
  • 工具命令声明

    在工具仓库根目录下,添加一个tool.json文件,声明工具的检查和扫描命令,比如:

    {
    +  "check_cmd": "python src/main.py check",
    +  "run_cmd": "python src/main.py scan"
    +}
    +

    参数说明:

    • check_cmd
      • 功能:判断当前执行环境是否满足工具要求(如果不需要检查,也可以没有这个命令)。 比如某些工具只能在linux下执行,需要判断当前是否为linux环境。
      • 输出:将判断结果输出到check_result.json文件中,文件内容为{"usable": true}{"usable": false}
    • run_cmd
      • 功能:扫描代码,执行自定义检查器逻辑(该命令必须存在)。
      • 输出:按照指定格式,输出结果到结果目录下的result.json文件中。
  • 工具输出格式要求

    • 将扫描结果输出到RESULT_DIR环境变量指定的目录下的result.json文件中(Python 示例代码)
    import os
    +import json
    +result_dir = os.getenv("RESULT_DIR", os.getcwd())
    +result_path = os.path.join(result_dir, "result.json")
    +with open(result_path, "w") as fp:
    +    json.dump(result, fp, indent=2)
    +
    • result.json 文件格式如下:
    [
    +    {
    +        "path": "文件绝对路径",
    +        "line": "行号,int类型",
    +        "column": "列号, int类型,如果工具没有输出列号信息,可以用0代替",
    +        "msg": "提示信息",
    +        "rule": "规则名称,可以根据需要输出不同的规则名",
    +        "refs": [
    +            {
    +                "line": "回溯行号",
    +                "msg": "提示信息",
    +                "tag": "用一个词简要标记该行信息,比如uninit_member,member_decl等,如果没有也可以都写成一样的",
    +                "path": "回溯行所在文件绝对路径"
    +            },
    +            ...
    +        ]
    +    },
    +    ...
    +]
    +

    refs 字段说明:

    非必需项,可无。该字段记录问题回溯路径信息。比如当前行的代码问题,是经过上下文的三行代码执行路径而导致的,可以将这三行的位置及提示信息,按顺序添加到 refs 数组中。

  • `,2),T=n('

    第二步,提交工具到 git 代码库

    • 创建代码库,将工具源代码或编译打包后的可执行文件,提交到代码仓库中(建议提交到master分支,TCA默认拉取的是master分支)。

    • 建议代码库中加入 README.md 文件,说明工具功能和维护人。

    • 后续需要修改工具实现逻辑,可以直接更新代码库,TCA 平台在执行该工具时,会自动拉取最新工具代码版本。

    第三步,在工具管理页面中创建工具

    • 进入工具管理页面,点击创建工具

      enter image description here

    • 填写工具信息

      enter image description here

      部分参数说明:

      • 工具仓库地址,即前述步骤中提交的工具 git 代码库地址,默认拉取的是master分支,如果是其他分支,需要在仓库地址后加上#分支名,比如:https://github.com/xxx/xxx.git#main

      • 工具认证,授权拉取工具仓库的权限

      • 执行命令,该命令会在工具根目录下执行

      • 环境变量,工具执行所需的环境变量

      • License,如果是开源工具,填写工具遵循的开源协议,或者填写自研共建

      • 是否为编译型工具,表示在使用该工具对用户代码进行分析时,是否要求代码需要编译或可执行编译

      • 注意:针对特殊扫描场景的工具(比如检查代码库下是否包含某些第三方依赖目录,结果不涉及单个代码文件的),无法对结果进行代码文件处理,可以通过设置以下环境变量,跳过一些通用的结果处理步骤,避免问题结果被过滤掉:

        • BLAME_TYPE=NO_BLAME,跳过对代码行/代码文件进行文件责任人定位(结果非单个文件/代码行时使用)
        • FILTER_TYPE=NO_VERSION_FILTER,跳过检查问题路径(path字段)是否为已提交到代码库中的文件(结果非单个文件/代码行时使用)
        • IGNORE_TYPE=NO_ISSUE_IGNORE,跳过注释忽略处理(结果非单个文件/代码行时使用)
    • 添加工具依赖

      enter image description here

      添加完成后,会展示已添加的依赖方案:

      enter image description here

    工具依赖说明:

    • 比如当前的demo工具,只需要依赖python3运行,而且支持在linux x86_64、linux arm64、mac和windows下执行,那么只需要配置一个依赖方案(如上图),并配置为默认方案。在不同的操作系统中,会自动加载对应操作系统的python环境。
    • 如果需要根据扫描项目设置的环境变量,加载不同的依赖配置,则可以配置不同的判断条件,使用多个依赖方案。

    第四步,为工具添加规则

    • 完成工具创建后,进入规则列表,为工具添加规则

      enter image description here

    • 填写规则信息

      部分参数说明:

      • 规则简介:简要描述规则发现的是什么问题,扫描结果中会作为问题标题展示

      • 详细描述:可详细描述规则,以及规则的解决方式,建议附上解决案例 demo

      • 解决方法:按照实际情况,说明该代码问题的解决方法,建议附上解决案例 demo

      • 规则参数:如果不需要通过规则参数传递信息,可留空

    第五步,将工具配置到执行节点

    TIP

    需要联系平台管理员协助操作,在管理入口-节点管理中进入需要配置的机器节点的工具进程配置中,找到对应工具,勾选工具进程。

    完成节点配置工具进程后,才能在项目中采用该工具进行分析。

    enter image description here

    第六步,完成上述操作,在项目中使用工具规则

    • 进入到项目中,在分析方案-代码检查进行规则配置。

    • 点击添加规则,找到对应工具规则进行添加。

    • 添加完成后,启动分析,为了将规则应用到所有代码文件,建议启动一次全量分析(增量分析只会分析自上次扫描后变更的文件)。

    自定义工具权限说明

    • 默认自定义工具仅团队管理员可操作,团队内所有成员可使用。

      • 团队管理员才能创建工具,添加工具规则等,具备该工具全部权限

      • 团队内所有成员可使用该工具规则,如在规则配置中添加此工具规则,团队普通成员仅只读权限

    • 工具希望全平台使用?

      由于全平台使用的工具影响范围较大,建议团队先在团队内对工具进行充分测试,保障团队内工具的高有效性,如需全平台使用,需联系平台管理员进行申请

      平台管理员需对此工具进行审核,在确保工具的高有效性下可将此工具权限调整为全平台可使用

    ',15);function I(R,y){const l=p("ExternalLinkIcon");return m(),h("div",null,[g,e("p",null,[i("根据需要匹配的目标代码场景,编写对应的工具逻辑。 可以参考 Python 实现的 "),e("a",_,[i("Demo 项目"),o(l)]),i("。")]),b,e("ul",null,[q,e("li",null,[x,e("ul",null,[e("li",null,[i("获取及使用方式请参考 "),e("a",f,[i("Demo 项目"),o(l)]),i("。")])]),E]),j]),T])}const N=c(v,[["render",I],["__file","自定义工具.html.vue"]]);export{N as default}; diff --git "a/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-4ffb8d2c.js" "b/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-4ffb8d2c.js" new file mode 100644 index 000000000..5e19845a3 --- /dev/null +++ "b/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-4ffb8d2c.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-403820f8","path":"/zh/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.html","title":"自定义规则","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"自定义规则权限说明","slug":"自定义规则权限说明","link":"#自定义规则权限说明","children":[]},{"level":2,"title":"平台提供的正则工具 TCA-Armory-R 说明","slug":"平台提供的正则工具-tca-armory-r-说明","link":"#平台提供的正则工具-tca-armory-r-说明","children":[]},{"level":2,"title":"平台提供的正则工具 RegexScan 说明","slug":"平台提供的正则工具-regexscan-说明","link":"#平台提供的正则工具-regexscan-说明","children":[{"level":3,"title":"自定义规则步骤","slug":"自定义规则步骤","link":"#自定义规则步骤","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/工具管理/自定义规则.md"}');export{e as data}; diff --git "a/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-603972e0.js" "b/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-603972e0.js" new file mode 100644 index 000000000..12ea74262 --- /dev/null +++ "b/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-603972e0.js" @@ -0,0 +1 @@ +import{_ as i,r as t,o as c,c as a,a as e,b as n,d as l,w as s,e as d}from"./app-2a91d8ab.js";const u={},p=e("h1",{id:"自定义规则",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#自定义规则","aria-hidden":"true"},"#"),n(" 自定义规则")],-1),_=e("p",null,"自定义规则即由业务团队根据自身需求,由业务团队自行设计提供的规则。",-1),h=e("h2",{id:"自定义规则权限说明",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#自定义规则权限说明","aria-hidden":"true"},"#"),n(" 自定义规则权限说明")],-1),g=e("p",null,[n("工具需开放"),e("strong",null,"支持自定义规则"),n("权限,才可添加自定义规则。")],-1),x=e("code",null,"RegexFileScan",-1),m=e("code",null,"RegexScan",-1),A=e("li",null,[e("p",null,[n("开放"),e("strong",null,"支持自定义规则"),n("权限,需平台管理员在"),e("strong",null,"管理入口"),n("-"),e("strong",null,"工具管理"),n("中找到对应工具,并将其权限状态调整为"),e("strong",null,"支持自定义规则"),n("。")])],-1),f=e("li",null,[e("p",null,"自定义规则仅支持团队管理员添加,且默认仅团队内可见。"),e("ul",null,[e("li",null,"满足不同团队自定义规则可能存在的差异和隐私性。")])],-1),E=e("li",null,[e("p",null,"如需将自定义规则加入工具默认规则,需联系工具提供方团队管理员添加。")],-1),R=e("h2",{id:"平台提供的正则工具-tca-armory-r-说明",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#平台提供的正则工具-tca-armory-r-说明","aria-hidden":"true"},"#"),n(" 平台提供的正则工具 TCA-Armory-R 说明")],-1),B=e("h2",{id:"平台提供的正则工具-regexscan-说明",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#平台提供的正则工具-regexscan-说明","aria-hidden":"true"},"#"),n(" 平台提供的正则工具 RegexScan 说明")],-1),b=e("p",null,[e("code",null,"正则工具 RegexScan"),n(" 即为开放了自定义规则功能的工具,可进入工具管理页面,搜索工具名称"),e("code",null,"RegexScan"),n(",查看该工具已存在的规则以及根据团队业务需求,添加自定义规则。")],-1),k=e("p",null,"适用场景:通过正则表达式,能够匹配到目标代码的情况。",-1),y=e("h3",{id:"自定义规则步骤",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#自定义规则步骤","aria-hidden":"true"},"#"),n(" 自定义规则步骤")],-1),C=e("p",null,[e("strong",null,"根据团队业务需求设计正则表达式")],-1),T={class:"custom-container tip"},S=e("p",{class:"custom-container-title"},"提示",-1),v={href:"http://tool.oschina.net/regex",target:"_blank",rel:"noopener noreferrer"},F=e("p",null,"规则示例:",-1),L=e("ul",null,[e("li",null,[e("p",null,"规则分析场景"),e("p",null,"分析代码中的 usleep() 方法调用,如果参数小于 100 ,容易造成 CPU 使用率过高,造成性能浪费,判断为缺陷。")]),e("li",null,[e("p",null,"正则表达式"),e("p",null,[n("匹配 usleep() 字符串,括号中的内容为 1 位或 2 位整数,那么正则表达式可以写成 "),e("code",null,"\\busleep\\s*\\(\\s*\\d{1,2}\\s*\\)"),n(",这里考虑了字符串中存在空格的情况。")])])],-1),N=d("
  • 进入正则工具添加自定义规则

    进入工具管理页面,找到正则工具RegexScan,并点击进入自定义规则列表页,点击添加规则按钮。

  • 填写规则信息

    规则参数填写说明(必要):

    参数格式类似 ini 的格式, 也就是 key = value 的格式

    • 【必要】 regex 参数,用于指定分析的正则表达式, 例如: regex = \\busleep\\s*\\(\\s*\\d{1,2}\\s*\\)

    • 【必要】 msg 参数,用于展现 issue 说明, 例如: msg = 函数方法%s 已经废弃,请使用 xxx 方法

      msg 中的“%s”使用 regex 中的 group(用“()"括起来的部分)一一匹配。

      如果 regex 没有定义 group,则 msg 最多有一个%s, 并由整个 regex 匹配的字符串替代

      如果 msg 里没有包含“%s”,则直接显示 msg

      如果 msg 没有提供,则默认为“发现不规范代码:%s”(不建议使用默认格式,太笼统)

    • 【可选填】 ignore_comment 参数,用于指定是否忽略注释代码,可选值:True、true、False、false 。例如 ignore_comment=True, 默认是 False

    • 【可选填】 include 参数,用于将指定分析文件匹配范围,使用 unix 的文件匹配格式,多项使用英文分号;隔开。例如 include = path/to/dir;path/to/\\*.cpp

    • 【可选填】 exclude 参数,用于指定不分析的文件。格式参考 include 参数。

  • 将自定义规则添加到项目分析方案中

    添加完成,可在分析方案-代码检查-规则配置中添加该自定义规则

  • ",3);function V(w,z){const o=t("RouterLink"),r=t("ExternalLinkIcon");return c(),a("div",null,[p,_,h,e("ul",null,[e("li",null,[g,e("ul",null,[e("li",null,[e("p",null,[n("当前平台提供的工具中,仅"),l(o,{to:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html"},{default:s(()=>[n("TCA-Armory-R")]),_:1}),n("、"),x,n("、"),m,n("三款工具支持使用用户自定义规则。")])]),A])]),f,E]),R,e("p",null,[n("详见"),l(o,{to:"/zh/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html"},{default:s(()=>[n("TCA-Armory-R使用手册")]),_:1}),n("。")]),B,b,k,y,e("ol",null,[e("li",null,[C,e("div",T,[S,e("p",null,[n("建议先测试好正则表达式是否正确,正则表达式测试网站推荐:"),e("a",v,[n("http://tool.oschina.net/regex"),l(r)])]),F,L])]),N])])}const q=i(u,[["render",V],["__file","自定义规则.html.vue"]]);export{q as default}; diff --git "a/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-85879bde.js" "b/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-85879bde.js" new file mode 100644 index 000000000..26f433991 --- /dev/null +++ "b/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-85879bde.js" @@ -0,0 +1 @@ +import{_ as i,r as t,o as c,c as a,a as e,b as n,d as l,w as s,e as d}from"./app-2a91d8ab.js";const u={},p=e("h1",{id:"自定义规则",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#自定义规则","aria-hidden":"true"},"#"),n(" 自定义规则")],-1),_=e("p",null,"自定义规则即由业务团队根据自身需求,由业务团队自行设计提供的规则。",-1),h=e("h2",{id:"自定义规则权限说明",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#自定义规则权限说明","aria-hidden":"true"},"#"),n(" 自定义规则权限说明")],-1),g=e("p",null,[n("工具需开放"),e("strong",null,"支持自定义规则"),n("权限,才可添加自定义规则。")],-1),x=e("code",null,"RegexFileScan",-1),m=e("code",null,"RegexScan",-1),A=e("li",null,[e("p",null,[n("开放"),e("strong",null,"支持自定义规则"),n("权限,需平台管理员在"),e("strong",null,"管理入口"),n("-"),e("strong",null,"工具管理"),n("中找到对应工具,并将其权限状态调整为"),e("strong",null,"支持自定义规则"),n("。")])],-1),f=e("li",null,[e("p",null,"自定义规则仅支持团队管理员添加,且默认仅团队内可见。"),e("ul",null,[e("li",null,"满足不同团队自定义规则可能存在的差异和隐私性。")])],-1),E=e("li",null,[e("p",null,"如需将自定义规则加入工具默认规则,需联系工具提供方团队管理员添加。")],-1),R=e("h2",{id:"平台提供的正则工具-tca-armory-r-说明",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#平台提供的正则工具-tca-armory-r-说明","aria-hidden":"true"},"#"),n(" 平台提供的正则工具 TCA-Armory-R 说明")],-1),B=e("h2",{id:"平台提供的正则工具-regexscan-说明",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#平台提供的正则工具-regexscan-说明","aria-hidden":"true"},"#"),n(" 平台提供的正则工具 RegexScan 说明")],-1),b=e("p",null,[e("code",null,"正则工具 RegexScan"),n(" 即为开放了自定义规则功能的工具,可进入工具管理页面,搜索工具名称"),e("code",null,"RegexScan"),n(",查看该工具已存在的规则以及根据团队业务需求,添加自定义规则。")],-1),T=e("p",null,"适用场景:通过正则表达式,能够匹配到目标代码的情况。",-1),k=e("h3",{id:"自定义规则步骤",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#自定义规则步骤","aria-hidden":"true"},"#"),n(" 自定义规则步骤")],-1),y=e("p",null,[e("strong",null,"根据团队业务需求设计正则表达式")],-1),C={class:"custom-container tip"},S=e("p",{class:"custom-container-title"},"TIP",-1),v={href:"http://tool.oschina.net/regex",target:"_blank",rel:"noopener noreferrer"},F=e("p",null,"规则示例:",-1),L=e("ul",null,[e("li",null,[e("p",null,"规则分析场景"),e("p",null,"分析代码中的 usleep() 方法调用,如果参数小于 100 ,容易造成 CPU 使用率过高,造成性能浪费,判断为缺陷。")]),e("li",null,[e("p",null,"正则表达式"),e("p",null,[n("匹配 usleep() 字符串,括号中的内容为 1 位或 2 位整数,那么正则表达式可以写成 "),e("code",null,"\\busleep\\s*\\(\\s*\\d{1,2}\\s*\\)"),n(",这里考虑了字符串中存在空格的情况。")])])],-1),N=d("
  • 进入正则工具添加自定义规则

    进入工具管理页面,找到正则工具RegexScan,并点击进入自定义规则列表页,点击添加规则按钮。

  • 填写规则信息

    规则参数填写说明(必要):

    参数格式类似 ini 的格式, 也就是 key = value 的格式

    • 【必要】 regex 参数,用于指定分析的正则表达式, 例如: regex = \\busleep\\s*\\(\\s*\\d{1,2}\\s*\\)

    • 【必要】 msg 参数,用于展现 issue 说明, 例如: msg = 函数方法%s 已经废弃,请使用 xxx 方法

      msg 中的“%s”使用 regex 中的 group(用“()"括起来的部分)一一匹配。

      如果 regex 没有定义 group,则 msg 最多有一个%s, 并由整个 regex 匹配的字符串替代

      如果 msg 里没有包含“%s”,则直接显示 msg

      如果 msg 没有提供,则默认为“发现不规范代码:%s”(不建议使用默认格式,太笼统)

    • 【可选填】 ignore_comment 参数,用于指定是否忽略注释代码,可选值:True、true、False、false 。例如 ignore_comment=True, 默认是 False

    • 【可选填】 include 参数,用于将指定分析文件匹配范围,使用 unix 的文件匹配格式,多项使用英文分号;隔开。例如 include = path/to/dir;path/to/\\*.cpp

    • 【可选填】 exclude 参数,用于指定不分析的文件。格式参考 include 参数。

  • 将自定义规则添加到项目分析方案中

    添加完成,可在分析方案-代码检查-规则配置中添加该自定义规则

  • ",3);function V(I,w){const o=t("RouterLink"),r=t("ExternalLinkIcon");return c(),a("div",null,[p,_,h,e("ul",null,[e("li",null,[g,e("ul",null,[e("li",null,[e("p",null,[n("当前平台提供的工具中,仅"),l(o,{to:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html"},{default:s(()=>[n("TCA-Armory-R")]),_:1}),n("、"),x,n("、"),m,n("三款工具支持使用用户自定义规则。")])]),A])]),f,E]),R,e("p",null,[n("详见"),l(o,{to:"/en/guide/%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5/%E5%B7%A5%E5%85%B7/TCA-Armory-R.html"},{default:s(()=>[n("TCA-Armory-R使用手册")]),_:1}),n("。")]),B,b,T,k,e("ol",null,[e("li",null,[y,e("div",C,[S,e("p",null,[n("建议先测试好正则表达式是否正确,正则表达式测试网站推荐:"),e("a",v,[n("http://tool.oschina.net/regex"),l(r)])]),F,L])]),N])])}const q=i(u,[["render",V],["__file","自定义规则.html.vue"]]);export{q as default}; diff --git "a/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-9dbeac77.js" "b/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-9dbeac77.js" new file mode 100644 index 000000000..688860a96 --- /dev/null +++ "b/assets/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html-9dbeac77.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-66e40bbf","path":"/en/guide/%E5%B7%A5%E5%85%B7%E7%AE%A1%E7%90%86/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99.html","title":"自定义规则","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"自定义规则权限说明","slug":"自定义规则权限说明","link":"#自定义规则权限说明","children":[]},{"level":2,"title":"平台提供的正则工具 TCA-Armory-R 说明","slug":"平台提供的正则工具-tca-armory-r-说明","link":"#平台提供的正则工具-tca-armory-r-说明","children":[]},{"level":2,"title":"平台提供的正则工具 RegexScan 说明","slug":"平台提供的正则工具-regexscan-说明","link":"#平台提供的正则工具-regexscan-说明","children":[{"level":3,"title":"自定义规则步骤","slug":"自定义规则步骤","link":"#自定义规则步骤","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/工具管理/自定义规则.md"}');export{e as data}; diff --git "a/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-2af93833.js" "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-2af93833.js" new file mode 100644 index 000000000..959bad9c3 --- /dev/null +++ "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-2af93833.js" @@ -0,0 +1 @@ +import{_ as r,a as i,b as n,c as a,d as e}from"./org_tag_scheme-0392461b.js";import{_ as l,r as c,o as p,c as d,a as g,b as t,d as h,w as _,e as o}from"./app-2a91d8ab.js";const u={},m=o('

    团队节点与标签

    WARNING

    团队节点及标签说明

    • 团队节点是团队注册并管理的私有节点。

    • 团队标签用于关联团队内的节点机器与分析项目。

    • 团队可以利用团队标签注册并使用团队节点

    • 在项目的分析方案中配置运行环境为团队标签后,才可将该项目的分析任务下发到对应的团队节点。

    • 团队节点仅支持运行当前团队中的分析任务,节点可执行的任务范围取决于该节点的负责人权限:

      • 如果节点负责人为团队管理员,该节点可以执行当前团队所有项目的分析任务
      • 如果节点负责人为项目管理员,该节点只能运行指定项目下的分析任务
      • 如果节点负责人为部分代码库的管理员,该节点只能运行对应代码库的分析任务

    适用场景

    1. 团队因资源可靠性或项目敏感性,需使用私有机器资源

    2. 团队项目分析依赖特定机器环境(比如CPU架构、操作系统等)

    以上场景,团队可接入专机资源作为团队节点,仅分析自己业务的代码库,以保证执行效率保护源码安全支持项目环境依赖等。

    团队节点注册

    ',6),E=o('

    团队节点管理

    完成团队节点注册后,可以在当前团队节点管理下看到对应的节点信息,同时需要进行节点配置

    WARNING

    • 团队节点首次注册时,需要手动在平台上配置所属标签节点可用性工具进程等。
    • 将节点的节点可用性调整为活跃后,节点终端客户端运行日志会输出心跳上报成功的日志
    • 首次注册团队节点,节点状态默认为不可用,需调整节点状态为“活跃”: 注册团队节点

    • 配置节点关联的工具进程:

      配置工具进程

    TIP

    1. 团队节点使用的所属标签均为当前团队内创建的标签,可参见团队标签管理
    2. 团队标签可以参考CodeDog标签为不同的系统类型(Linux、MacOS、Windows)建立标签,比如专属标签-Linux专属标签-Mac

    使用团队标签

    您可以创建一个团队标签,并配置到您的团队节点和您的分析方案中

    • 创建团队标签。

      创建团队标签

    • 配置团队节点所属标签。

      节点配置团队标签

    • 配置分析方案运行环境。

      方案配置团队标签

    ',8);function f(A,x){const s=c("RouterLink");return p(),d("div",null,[m,g("p",null,[t("参考"),h(s,{to:"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html"},{default:_(()=>[t("客户端常驻节点分析")]),_:1}),t("进行环境配置和启动节点。")]),E])}const N=l(u,[["render",f],["__file","节点管理.html.vue"]]);export{N as default}; diff --git "a/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-3a0c1401.js" "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-3a0c1401.js" new file mode 100644 index 000000000..7f16bc0e1 --- /dev/null +++ "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-3a0c1401.js" @@ -0,0 +1 @@ +import{_ as t,a as s,b as r,c as o}from"./manage_node_04-ba2c36cb.js";import{_ as n,o as i,c as _,e as a}from"./app-2a91d8ab.js";const e={},c=a('

    节点管理

    • 可查看常驻节点状态,包含公共节点团队节点

    • 查看编辑删除常驻节点。

    • 可配置节点工具进程

    • 可配置节点标签

    节点管理节点管理节点管理节点管理

    ',3),l=[c];function g(p,m){return i(),_("div",null,l)}const f=n(e,[["render",g],["__file","节点管理.html.vue"]]);export{f as default}; diff --git "a/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-3ac337bb.js" "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-3ac337bb.js" new file mode 100644 index 000000000..eac0c39b5 --- /dev/null +++ "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-3ac337bb.js" @@ -0,0 +1 @@ +import{_ as r,a as i,b as n,c as a,d as e}from"./org_tag_scheme-0392461b.js";import{_ as l,r as c,o as p,c as d,a as g,b as t,d as h,w as _,e as o}from"./app-2a91d8ab.js";const u={},m=o('

    团队节点与标签

    注意

    团队节点及标签说明

    • 团队节点是团队注册并管理的私有节点。

    • 团队标签用于关联团队内的节点机器与分析项目。

    • 团队可以利用团队标签注册并使用团队节点

    • 在项目的分析方案中配置运行环境为团队标签后,才可将该项目的分析任务下发到对应的团队节点。

    • 团队节点仅支持运行当前团队中的分析任务,节点可执行的任务范围取决于该节点的负责人权限:

      • 如果节点负责人为团队管理员,该节点可以执行当前团队所有项目的分析任务
      • 如果节点负责人为项目管理员,该节点只能运行指定项目下的分析任务
      • 如果节点负责人为部分代码库的管理员,该节点只能运行对应代码库的分析任务

    适用场景

    1. 团队因资源可靠性或项目敏感性,需使用私有机器资源

    2. 团队项目分析依赖特定机器环境(比如CPU架构、操作系统等)

    以上场景,团队可接入专机资源作为团队节点,仅分析自己业务的代码库,以保证执行效率保护源码安全支持项目环境依赖等。

    团队节点注册

    ',6),E=o('

    团队节点管理

    完成团队节点注册后,可以在当前团队节点管理下看到对应的节点信息,同时需要进行节点配置

    注意

    • 团队节点首次注册时,需要手动在平台上配置所属标签节点可用性工具进程等。
    • 将节点的节点可用性调整为活跃后,节点终端客户端运行日志会输出心跳上报成功的日志
    • 首次注册团队节点,节点状态默认为不可用,需调整节点状态为“活跃”: 注册团队节点

    • 配置节点关联的工具进程:

      配置工具进程

    提示

    1. 团队节点使用的所属标签均为当前团队内创建的标签,可参见团队标签管理
    2. 团队标签可以参考CodeDog标签为不同的系统类型(Linux、MacOS、Windows)建立标签,比如专属标签-Linux专属标签-Mac

    使用团队标签

    您可以创建一个团队标签,并配置到您的团队节点和您的分析方案中

    • 创建团队标签。

      创建团队标签

    • 配置团队节点所属标签。

      节点配置团队标签

    • 配置分析方案运行环境。

      方案配置团队标签

    ',8);function f(x,B){const s=c("RouterLink");return p(),d("div",null,[m,g("p",null,[t("参考"),h(s,{to:"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E5%B8%B8%E9%A9%BB%E8%8A%82%E7%82%B9%E5%88%86%E6%9E%90.html"},{default:_(()=>[t("客户端常驻节点分析")]),_:1}),t("进行环境配置和启动节点。")]),E])}const b=l(u,[["render",f],["__file","节点管理.html.vue"]]);export{b as default}; diff --git "a/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-8b6ba95b.js" "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-8b6ba95b.js" new file mode 100644 index 000000000..3a5003ba3 --- /dev/null +++ "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-8b6ba95b.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-bfa89738","path":"/zh/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html","title":"团队节点与标签","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"适用场景","slug":"适用场景","link":"#适用场景","children":[]},{"level":2,"title":"团队节点注册","slug":"团队节点注册","link":"#团队节点注册","children":[]},{"level":2,"title":"团队节点管理","slug":"团队节点管理","link":"#团队节点管理","children":[]},{"level":2,"title":"使用团队标签","slug":"使用团队标签","link":"#使用团队标签","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/团队管理/节点管理.md"}');export{e as data}; diff --git "a/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-b436d9b1.js" "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-b436d9b1.js" new file mode 100644 index 000000000..7f16bc0e1 --- /dev/null +++ "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-b436d9b1.js" @@ -0,0 +1 @@ +import{_ as t,a as s,b as r,c as o}from"./manage_node_04-ba2c36cb.js";import{_ as n,o as i,c as _,e as a}from"./app-2a91d8ab.js";const e={},c=a('

    节点管理

    • 可查看常驻节点状态,包含公共节点团队节点

    • 查看编辑删除常驻节点。

    • 可配置节点工具进程

    • 可配置节点标签

    节点管理节点管理节点管理节点管理

    ',3),l=[c];function g(p,m){return i(),_("div",null,l)}const f=n(e,[["render",g],["__file","节点管理.html.vue"]]);export{f as default}; diff --git "a/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-d35d61ad.js" "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-d35d61ad.js" new file mode 100644 index 000000000..9f07c0bf3 --- /dev/null +++ "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-d35d61ad.js" @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-3a124584","path":"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html","title":"节点管理","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/后台管理/节点管理.md"}');export{t as data}; diff --git "a/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-de9ab0a5.js" "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-de9ab0a5.js" new file mode 100644 index 000000000..8bb62cb1d --- /dev/null +++ "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-de9ab0a5.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-30ded9c9","path":"/en/guide/%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html","title":"团队节点与标签","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"适用场景","slug":"适用场景","link":"#适用场景","children":[]},{"level":2,"title":"团队节点注册","slug":"团队节点注册","link":"#团队节点注册","children":[]},{"level":2,"title":"团队节点管理","slug":"团队节点管理","link":"#团队节点管理","children":[]},{"level":2,"title":"使用团队标签","slug":"使用团队标签","link":"#使用团队标签","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/团队管理/节点管理.md"}');export{e as data}; diff --git "a/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-e16a83ba.js" "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-e16a83ba.js" new file mode 100644 index 000000000..549320138 --- /dev/null +++ "b/assets/\350\212\202\347\202\271\347\256\241\347\220\206.html-e16a83ba.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6a752a2e","path":"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E8%8A%82%E7%82%B9%E7%AE%A1%E7%90%86.html","title":"节点管理","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/后台管理/节点管理.md"}');export{e as data}; diff --git "a/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-69241b23.js" "b/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-69241b23.js" new file mode 100644 index 000000000..bcb733873 --- /dev/null +++ "b/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-69241b23.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-20ae30e2","path":"/zh/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE.html","title":"过滤配置","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"路径过滤","slug":"路径过滤","link":"#路径过滤","children":[]},{"level":2,"title":"问题过滤","slug":"问题过滤","link":"#问题过滤","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/分析方案/过滤配置.md"}');export{e as data}; diff --git "a/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-98359f35.js" "b/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-98359f35.js" new file mode 100644 index 000000000..02831e2cf --- /dev/null +++ "b/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-98359f35.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-9d3d5372","path":"/en/guide/%E5%88%86%E6%9E%90%E6%96%B9%E6%A1%88/%E8%BF%87%E6%BB%A4%E9%85%8D%E7%BD%AE.html","title":"过滤配置","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"路径过滤","slug":"路径过滤","link":"#路径过滤","children":[]},{"level":2,"title":"问题过滤","slug":"问题过滤","link":"#问题过滤","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/分析方案/过滤配置.md"}');export{e as data}; diff --git "a/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-b496bc8d.js" "b/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-b496bc8d.js" new file mode 100644 index 000000000..18a1442af --- /dev/null +++ "b/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-b496bc8d.js" @@ -0,0 +1,33 @@ +import{_ as e,o as s,c as i,e as n}from"./app-2a91d8ab.js";const d={},l=n(`

    过滤配置

    路径过滤

    用于设定代码分析的范围,设定后,已经开启的代码检查、代码度量各项功能都会在指定的代码范围内生效。

    目前支持正则表达式通配符两种类型:

    • 正则表达式

      请填写相对路径(基于代码库根目录),要求匹配到文件
      +使用正则表达式格式,示例如下:
      +    代码根目录
      +    |-src
      +      |- test
      +          |- main_test.py
      +          |- input_test.py
      +      |- main.py
      +    |-test
      +      |- param_test.py
      +    匹配src/test目录:src/test/.*
      +    匹配根目录下的test目录:test/.*
      +    匹配所有_test.py后缀的文件:.*_test\\\\.py
      +修改后,下次分析生效,需要启动一次全量分析处理历史存量问题。
      +
      Include 表示只分析,如只分析 src/ 目录:src/.*
      +Exclude 表示只屏蔽,如要屏蔽 src/lib/ 目录:src/lib/.*
      +
    • 通配符

      请填写相对路径(基于代码库根目录),要求匹配到文件
      +使用Unix通配符格式,示例如下
      +    代码根目录
      +    |-src
      +      |- test
      +          |- main_test.py
      +          |- input_test.py
      +      |- main.py
      +    |-test
      +      |- param_test.py
      +    匹配src/test目录:src/test/*
      +    匹配根目录下的test目录:test/*
      +    匹配所有_test.py后缀的文件:*_test.py
      +修改后,下次分析生效,需要启动一次全量分析处理历史存量问题。
      +
      Include 表示只分析,如只分析 src/ 目录:src/*
      +Exclude 表示只屏蔽,如要屏蔽 src/lib/ 目录:src/lib/*
      +

    如果几个分析方案希望共享相同的路径过滤方案,可以通过导入导出路径配置的方式进行处理。

    TIP

    配置更改后,下次启动分析生效

    问题过滤

    • 全局 Issue 忽略状态同步

      仅对代码检查生效。开启后,在 Issue 页面进行全局忽略操作时,其他利用该方案分析的分析项目在发现相同 Issue 时,会同步忽略该 Issue。否则不受全局 Issue 忽略状态同步影响。

    `,9),t=[l];function a(r,c){return s(),i("div",null,t)}const u=e(d,[["render",a],["__file","过滤配置.html.vue"]]);export{u as default}; diff --git "a/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-d0b32b09.js" "b/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-d0b32b09.js" new file mode 100644 index 000000000..7c2bb685b --- /dev/null +++ "b/assets/\350\277\207\346\273\244\351\205\215\347\275\256.html-d0b32b09.js" @@ -0,0 +1,33 @@ +import{_ as e,o as s,c as i,e as n}from"./app-2a91d8ab.js";const d={},l=n(`

    过滤配置

    路径过滤

    用于设定代码分析的范围,设定后,已经开启的代码检查、代码度量各项功能都会在指定的代码范围内生效。

    目前支持正则表达式通配符两种类型:

    • 正则表达式

      请填写相对路径(基于代码库根目录),要求匹配到文件
      +使用正则表达式格式,示例如下:
      +    代码根目录
      +    |-src
      +      |- test
      +          |- main_test.py
      +          |- input_test.py
      +      |- main.py
      +    |-test
      +      |- param_test.py
      +    匹配src/test目录:src/test/.*
      +    匹配根目录下的test目录:test/.*
      +    匹配所有_test.py后缀的文件:.*_test\\\\.py
      +修改后,下次分析生效,需要启动一次全量分析处理历史存量问题。
      +
      Include 表示只分析,如只分析 src/ 目录:src/.*
      +Exclude 表示只屏蔽,如要屏蔽 src/lib/ 目录:src/lib/.*
      +
    • 通配符

      请填写相对路径(基于代码库根目录),要求匹配到文件
      +使用Unix通配符格式,示例如下
      +    代码根目录
      +    |-src
      +      |- test
      +          |- main_test.py
      +          |- input_test.py
      +      |- main.py
      +    |-test
      +      |- param_test.py
      +    匹配src/test目录:src/test/*
      +    匹配根目录下的test目录:test/*
      +    匹配所有_test.py后缀的文件:*_test.py
      +修改后,下次分析生效,需要启动一次全量分析处理历史存量问题。
      +
      Include 表示只分析,如只分析 src/ 目录:src/*
      +Exclude 表示只屏蔽,如要屏蔽 src/lib/ 目录:src/lib/*
      +

    如果几个分析方案希望共享相同的路径过滤方案,可以通过导入导出路径配置的方式进行处理。

    提示

    配置更改后,下次启动分析生效

    问题过滤

    • 全局 Issue 忽略状态同步

      仅对代码检查生效。开启后,在 Issue 页面进行全局忽略操作时,其他利用该方案分析的分析项目在发现相同 Issue 时,会同步忽略该 Issue。否则不受全局 Issue 忽略状态同步影响。

    `,9),t=[l];function a(r,c){return s(),i("div",null,t)}const u=e(d,[["render",a],["__file","过滤配置.html.vue"]]);export{u as default}; diff --git "a/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-43356197.js" "b/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-43356197.js" new file mode 100644 index 000000000..50d0085ce --- /dev/null +++ "b/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-43356197.js" @@ -0,0 +1,7 @@ +import{_ as o,r as c,o as a,c as l,a as e,b as i,d as r,e as t}from"./app-2a91d8ab.js";const n={},s=t('

    TCA Client

    一、基础配置

    1. 机器配置推荐

    操作系统推荐配置
    Linux8核16G内存,硬盘空间256G(可用空间不低于100G)
    Mac8核16G内存,硬盘空间256G(可用空间不低于100G)
    Windows8核16G内存,硬盘空间256G(可用空间不低于100G)

    以上为推荐配置,实际情况需要考虑扫描对象代码库的大小,按实际情况增加磁盘空间。

    2. 配置client/config.ini文件

    -(1)将<Server IP地址>替换成实际的serve ip(可包含端口号)。

    3. 配置client/codedog.ini文件(分布式节点模式无需配置)

    填写以下必填项:token,org_sid,team_name,source_dir

    字段名填写说明
    token从tca页面获取,前往[个人中心]-[个人令牌]-复制Token
    org_sid(团队编号)从tca项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile
    team_name(项目名称)同上
    source_dir本地代码目录路径

    其他可选项按需填写。

    二、使用docker环境快速体验

    提示

    适用于快速上手体验。使用docker运行,可以免去客户端环境依赖的安装,避免环境兼容性问题。

    但是由于环境受限于docker,会无法复用本地的编译环境,部分需要编译的工具无法使用。

    1. 下载和安装Docker

    ',14),h={href:"https://docs.docker.com/get-started/",target:"_blank",rel:"noopener noreferrer"},p=t(`

    2. 构建docker镜像

    client目录下,执行以下命令:docker build -t tca-client .

    3. 执行docker容器,扫描代码,可选以下两种方式

    (1)直接使用docker运行

    • 在client目录下,执行以下命令:
    • (注意:按照实际情况填写SOURCE_DIR环境变量值)
    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +

    (2)使用docker内bash终端运行

    • 通过以下方式,进入容器内的bash终端后,通过命令行启动client代码:
    • 在client目录下,执行以下命令:
    • (注意:按照实际情况填写SOURCE_DIR环境变量值)
    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client bash
    +# 进入容器内终端,通过命令行执行扫描
    +python3 codepuppy.py localscan
    +

    三、使用本地机器环境运行

    提示

    适用于深度体验,可以复用本地编译环境,使用编译型代码分析工具。

    可能会有系统环境兼容问题。

    1. 安装Python环境和第三方库

    • (1) 预装Python3.7、pip,支持 python3pip3 命令
    • (2) 安装依赖:pip3 install -r client/requirements/app_reqs.pip

    2. 安装第三方工具

    • (1) 进入到client/requirements目录
    • (2) 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    3. 启动代码分析

    • (1) 进入到client目录下
    • (2) 执行命令:python3 codepuppy.py localscan

    四、使用分布式节点模式执行客户端

    提示

    • CA客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。
    • 和本地执行任务一样,需要先安装环境和必要的工具,并配置好服务端地址。

    1. 安装Python环境和第三方库

    • (1) 预装Python3.7、pip,支持 python3pip3 命令
    • (2) 安装依赖:pip3 install -r client/requirements/app_reqs.pip

    2. 安装第三方工具

    • 进入到client/requirements目录
    • 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    3. 启动代码分析节点

    • (1)从tca页面个人中心-个人令牌-复制Token
    • (2)进入到client目录下,执行命令:python3 codepuppy.py -l codepuppy.log start -t <token>
    • (3)启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    4. 配置节点

    • 从tca页面管理入口-节点管理,可以看到当前在线的节点,可以修改节点名称、标签、负责人等信息。
    • 可以进入工具进程配置页面,对节点支持的工具进程进行管理(默认会全部勾选),未勾选的工具进程,将不会在该节点上执行。
    • 节点所属标签会与分析方案中的运行环境标签进行匹配,只有相同标签的任务才会下发到该机器节点上。

    五、其他配置与用法

    1. 配置使用本地工具

    注意

    如果由于网络原因,执行时无法从github自动拉取工具,或拉取比较慢,可以参考基础配置腾讯工蜂工具地址,或使用以下方式预先下载好工具,配置使用本地工具目录。

    • (1)下载工具配置库 https://github.com/TCATools/puppy-tools-config.git ,存放到 tools目录下(如果未生成,可先创建该目录)。
    • (2)根据当前机器操作系统,查看puppy-tools-config目录下的linux_tools.inimac_tools.iniwindows_tools.ini文件,将[tool_url]中声明的所有工具下载到 tools目录下。
    • (3)填写client/config.ini中的配置:USE_LOCAL_TOOL=True,即可使用下载好的本地工具,不自动拉取和更新工具。

    2. 使用自建git server存放工具

    注意

    如果自己搭建了一套git server,可以将工具配置库 https://github.com/TCATools/puppy-tools-config.git 以及里面声明的工具仓库,存放到自建git serevr上。

    • (1)将工具配置库 https://github.com/TCATools/puppy-tools-config.git 上传到自建git仓库。
    • (2)按所需的操作系统,将puppy-tools-config仓库下的linux_tools.inimac_tools.iniwindows_tools.ini文件中[tool_url]声明的所有工具库,上传到自建git仓库。
    • (3)修改linux_tools.inimac_tools.iniwindows_tools.ini文件中[base_value]中的git_url为自建git server地址。
    • (4)修改client/config.ini中的TOOL_CONFIG_URL为自建git server的puppy-tools-config仓库地址。
    • (5)填写client/config.ini中的[TOOL_LOAD_ACCOUNT]配置,输入有拉取权限的用户名密码,即可使用自建git server拉取工具。

    3. git lfs带宽和存储配额不够问题

    • 如果git拉取工具时,出现git lfs拉取失败,可能是lfs带宽和存储配额不够,可以打开对应的工具github页面,通过Download ZIP的方式下载工具压缩包,再解压到tools目录下。
    `,36);function u(_,g){const d=c("ExternalLinkIcon");return a(),l("div",null,[s,e("p",null,[i("参考Docker官方文档:"),e("a",h,[i("Docker下载和安装"),r(d)])]),p])}const f=o(n,[["render",u],["__file","配置说明.html.vue"]]);export{f as default}; diff --git "a/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-90986766.js" "b/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-90986766.js" new file mode 100644 index 000000000..5ae73d90a --- /dev/null +++ "b/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-90986766.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-6c548cb1","path":"/zh/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.html","title":"TCA Client","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"一、基础配置","slug":"一、基础配置","link":"#一、基础配置","children":[{"level":3,"title":"1. 机器配置推荐","slug":"_1-机器配置推荐","link":"#_1-机器配置推荐","children":[]},{"level":3,"title":"2. 配置client/config.ini文件","slug":"_2-配置client-config-ini文件","link":"#_2-配置client-config-ini文件","children":[]},{"level":3,"title":"3. 配置client/codedog.ini文件(分布式节点模式无需配置)","slug":"_3-配置client-codedog-ini文件-分布式节点模式无需配置","link":"#_3-配置client-codedog-ini文件-分布式节点模式无需配置","children":[]}]},{"level":2,"title":"二、使用docker环境快速体验","slug":"二、使用docker环境快速体验","link":"#二、使用docker环境快速体验","children":[{"level":3,"title":"1. 下载和安装Docker","slug":"_1-下载和安装docker","link":"#_1-下载和安装docker","children":[]},{"level":3,"title":"2. 构建docker镜像","slug":"_2-构建docker镜像","link":"#_2-构建docker镜像","children":[]},{"level":3,"title":"3. 执行docker容器,扫描代码,可选以下两种方式","slug":"_3-执行docker容器-扫描代码-可选以下两种方式","link":"#_3-执行docker容器-扫描代码-可选以下两种方式","children":[]}]},{"level":2,"title":"三、使用本地机器环境运行","slug":"三、使用本地机器环境运行","link":"#三、使用本地机器环境运行","children":[{"level":3,"title":"1. 安装Python环境和第三方库","slug":"_1-安装python环境和第三方库","link":"#_1-安装python环境和第三方库","children":[]},{"level":3,"title":"2. 安装第三方工具","slug":"_2-安装第三方工具","link":"#_2-安装第三方工具","children":[]},{"level":3,"title":"3. 启动代码分析","slug":"_3-启动代码分析","link":"#_3-启动代码分析","children":[]}]},{"level":2,"title":"四、使用分布式节点模式执行客户端","slug":"四、使用分布式节点模式执行客户端","link":"#四、使用分布式节点模式执行客户端","children":[{"level":3,"title":"1. 安装Python环境和第三方库","slug":"_1-安装python环境和第三方库-1","link":"#_1-安装python环境和第三方库-1","children":[]},{"level":3,"title":"2. 安装第三方工具","slug":"_2-安装第三方工具-1","link":"#_2-安装第三方工具-1","children":[]},{"level":3,"title":"3. 启动代码分析节点","slug":"_3-启动代码分析节点","link":"#_3-启动代码分析节点","children":[]},{"level":3,"title":"4. 配置节点","slug":"_4-配置节点","link":"#_4-配置节点","children":[]}]},{"level":2,"title":"五、其他配置与用法","slug":"五、其他配置与用法","link":"#五、其他配置与用法","children":[{"level":3,"title":"1. 配置使用本地工具","slug":"_1-配置使用本地工具","link":"#_1-配置使用本地工具","children":[]},{"level":3,"title":"2. 使用自建git server存放工具","slug":"_2-使用自建git-server存放工具","link":"#_2-使用自建git-server存放工具","children":[]},{"level":3,"title":"3. git lfs带宽和存储配额不够问题","slug":"_3-git-lfs带宽和存储配额不够问题","link":"#_3-git-lfs带宽和存储配额不够问题","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/客户端/配置说明.md"}');export{l as data}; diff --git "a/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-d33cfc48.js" "b/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-d33cfc48.js" new file mode 100644 index 000000000..22dfe9263 --- /dev/null +++ "b/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-d33cfc48.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-640fd1ac","path":"/en/guide/%E5%AE%A2%E6%88%B7%E7%AB%AF/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.html","title":"TCA Client","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"一、基础配置","slug":"一、基础配置","link":"#一、基础配置","children":[{"level":3,"title":"1. 机器配置推荐","slug":"_1-机器配置推荐","link":"#_1-机器配置推荐","children":[]},{"level":3,"title":"2. 配置client/config.ini文件","slug":"_2-配置client-config-ini文件","link":"#_2-配置client-config-ini文件","children":[]},{"level":3,"title":"3. 配置client/codedog.ini文件(分布式节点模式无需配置)","slug":"_3-配置client-codedog-ini文件-分布式节点模式无需配置","link":"#_3-配置client-codedog-ini文件-分布式节点模式无需配置","children":[]}]},{"level":2,"title":"二、使用docker环境快速体验","slug":"二、使用docker环境快速体验","link":"#二、使用docker环境快速体验","children":[{"level":3,"title":"1. 下载和安装Docker","slug":"_1-下载和安装docker","link":"#_1-下载和安装docker","children":[]},{"level":3,"title":"2. 构建docker镜像","slug":"_2-构建docker镜像","link":"#_2-构建docker镜像","children":[]},{"level":3,"title":"3. 执行docker容器,扫描代码,可选以下两种方式","slug":"_3-执行docker容器-扫描代码-可选以下两种方式","link":"#_3-执行docker容器-扫描代码-可选以下两种方式","children":[]}]},{"level":2,"title":"三、使用本地机器环境运行","slug":"三、使用本地机器环境运行","link":"#三、使用本地机器环境运行","children":[{"level":3,"title":"1. 安装Python环境和第三方库","slug":"_1-安装python环境和第三方库","link":"#_1-安装python环境和第三方库","children":[]},{"level":3,"title":"2. 安装第三方工具","slug":"_2-安装第三方工具","link":"#_2-安装第三方工具","children":[]},{"level":3,"title":"3. 启动代码分析","slug":"_3-启动代码分析","link":"#_3-启动代码分析","children":[]}]},{"level":2,"title":"四、使用分布式节点模式执行客户端","slug":"四、使用分布式节点模式执行客户端","link":"#四、使用分布式节点模式执行客户端","children":[{"level":3,"title":"1. 安装Python环境和第三方库","slug":"_1-安装python环境和第三方库-1","link":"#_1-安装python环境和第三方库-1","children":[]},{"level":3,"title":"2. 安装第三方工具","slug":"_2-安装第三方工具-1","link":"#_2-安装第三方工具-1","children":[]},{"level":3,"title":"3. 启动代码分析节点","slug":"_3-启动代码分析节点","link":"#_3-启动代码分析节点","children":[]},{"level":3,"title":"4. 配置节点","slug":"_4-配置节点","link":"#_4-配置节点","children":[]}]},{"level":2,"title":"五、其他配置与用法","slug":"五、其他配置与用法","link":"#五、其他配置与用法","children":[{"level":3,"title":"1. 配置使用本地工具","slug":"_1-配置使用本地工具","link":"#_1-配置使用本地工具","children":[]},{"level":3,"title":"2. 使用自建git server存放工具","slug":"_2-使用自建git-server存放工具","link":"#_2-使用自建git-server存放工具","children":[]},{"level":3,"title":"3. git lfs带宽和存储配额不够问题","slug":"_3-git-lfs带宽和存储配额不够问题","link":"#_3-git-lfs带宽和存储配额不够问题","children":[]}]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/客户端/配置说明.md"}');export{l as data}; diff --git "a/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-ddefec01.js" "b/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-ddefec01.js" new file mode 100644 index 000000000..6180d3cd6 --- /dev/null +++ "b/assets/\351\205\215\347\275\256\350\257\264\346\230\216.html-ddefec01.js" @@ -0,0 +1,7 @@ +import{_ as o,r as c,o as a,c as l,a as e,b as i,d as r,e as t}from"./app-2a91d8ab.js";const n={},s=t('

    TCA Client

    一、基础配置

    1. 机器配置推荐

    操作系统推荐配置
    Linux8核16G内存,硬盘空间256G(可用空间不低于100G)
    Mac8核16G内存,硬盘空间256G(可用空间不低于100G)
    Windows8核16G内存,硬盘空间256G(可用空间不低于100G)

    以上为推荐配置,实际情况需要考虑扫描对象代码库的大小,按实际情况增加磁盘空间。

    2. 配置client/config.ini文件

    -(1)将<Server IP地址>替换成实际的serve ip(可包含端口号)。

    3. 配置client/codedog.ini文件(分布式节点模式无需配置)

    填写以下必填项:token,org_sid,team_name,source_dir

    字段名填写说明
    token从tca页面获取,前往[个人中心]-[个人令牌]-复制Token
    org_sid(团队编号)从tca项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile
    team_name(项目名称)同上
    source_dir本地代码目录路径

    其他可选项按需填写。

    二、使用docker环境快速体验

    TIP

    适用于快速上手体验。使用docker运行,可以免去客户端环境依赖的安装,避免环境兼容性问题。

    但是由于环境受限于docker,会无法复用本地的编译环境,部分需要编译的工具无法使用。

    1. 下载和安装Docker

    ',14),h={href:"https://docs.docker.com/get-started/",target:"_blank",rel:"noopener noreferrer"},p=t(`

    2. 构建docker镜像

    client目录下,执行以下命令:docker build -t tca-client .

    3. 执行docker容器,扫描代码,可选以下两种方式

    (1)直接使用docker运行

    • 在client目录下,执行以下命令:
    • (注意:按照实际情况填写SOURCE_DIR环境变量值)
    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +

    (2)使用docker内bash终端运行

    • 通过以下方式,进入容器内的bash终端后,通过命令行启动client代码:
    • 在client目录下,执行以下命令:
    • (注意:按照实际情况填写SOURCE_DIR环境变量值)
    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client bash
    +# 进入容器内终端,通过命令行执行扫描
    +python3 codepuppy.py localscan
    +

    三、使用本地机器环境运行

    TIP

    适用于深度体验,可以复用本地编译环境,使用编译型代码分析工具。

    可能会有系统环境兼容问题。

    1. 安装Python环境和第三方库

    • (1) 预装Python3.7、pip,支持 python3pip3 命令
    • (2) 安装依赖:pip3 install -r client/requirements/app_reqs.pip

    2. 安装第三方工具

    • (1) 进入到client/requirements目录
    • (2) 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    3. 启动代码分析

    • (1) 进入到client目录下
    • (2) 执行命令:python3 codepuppy.py localscan

    四、使用分布式节点模式执行客户端

    TIP

    • CA客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。
    • 和本地执行任务一样,需要先安装环境和必要的工具,并配置好服务端地址。

    1. 安装Python环境和第三方库

    • (1) 预装Python3.7、pip,支持 python3pip3 命令
    • (2) 安装依赖:pip3 install -r client/requirements/app_reqs.pip

    2. 安装第三方工具

    • 进入到client/requirements目录
    • 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    3. 启动代码分析节点

    • (1)从tca页面个人中心-个人令牌-复制Token
    • (2)进入到client目录下,执行命令:python3 codepuppy.py -l codepuppy.log start -t <token>
    • (3)启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    4. 配置节点

    • 从tca页面管理入口-节点管理,可以看到当前在线的节点,可以修改节点名称、标签、负责人等信息。
    • 可以进入工具进程配置页面,对节点支持的工具进程进行管理(默认会全部勾选),未勾选的工具进程,将不会在该节点上执行。
    • 节点所属标签会与分析方案中的运行环境标签进行匹配,只有相同标签的任务才会下发到该机器节点上。

    五、其他配置与用法

    1. 配置使用本地工具

    WARNING

    如果由于网络原因,执行时无法从github自动拉取工具,或拉取比较慢,可以参考基础配置腾讯工蜂工具地址,或使用以下方式预先下载好工具,配置使用本地工具目录。

    • (1)下载工具配置库 https://github.com/TCATools/puppy-tools-config.git ,存放到 tools目录下(如果未生成,可先创建该目录)。
    • (2)根据当前机器操作系统,查看puppy-tools-config目录下的linux_tools.inimac_tools.iniwindows_tools.ini文件,将[tool_url]中声明的所有工具下载到 tools目录下。
    • (3)填写client/config.ini中的配置:USE_LOCAL_TOOL=True,即可使用下载好的本地工具,不自动拉取和更新工具。

    2. 使用自建git server存放工具

    WARNING

    如果自己搭建了一套git server,可以将工具配置库 https://github.com/TCATools/puppy-tools-config.git 以及里面声明的工具仓库,存放到自建git serevr上。

    • (1)将工具配置库 https://github.com/TCATools/puppy-tools-config.git 上传到自建git仓库。
    • (2)按所需的操作系统,将puppy-tools-config仓库下的linux_tools.inimac_tools.iniwindows_tools.ini文件中[tool_url]声明的所有工具库,上传到自建git仓库。
    • (3)修改linux_tools.inimac_tools.iniwindows_tools.ini文件中[base_value]中的git_url为自建git server地址。
    • (4)修改client/config.ini中的TOOL_CONFIG_URL为自建git server的puppy-tools-config仓库地址。
    • (5)填写client/config.ini中的[TOOL_LOAD_ACCOUNT]配置,输入有拉取权限的用户名密码,即可使用自建git server拉取工具。

    3. git lfs带宽和存储配额不够问题

    • 如果git拉取工具时,出现git lfs拉取失败,可能是lfs带宽和存储配额不够,可以打开对应的工具github页面,通过Download ZIP的方式下载工具压缩包,再解压到tools目录下。
    `,36);function u(_,g){const d=c("ExternalLinkIcon");return a(),l("div",null,[s,e("p",null,[i("参考Docker官方文档:"),e("a",h,[i("Docker下载和安装"),r(d)])]),p])}const f=o(n,[["render",u],["__file","配置说明.html.vue"]]);export{f as default}; diff --git "a/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-47aad379.js" "b/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-47aad379.js" new file mode 100644 index 000000000..598e13e86 --- /dev/null +++ "b/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-47aad379.js" @@ -0,0 +1,116 @@ +import{_ as d,a as l}from"./ProcessConfiguration2-c60284cc.js";import{_ as s,r as a,o,c as r,a as e,b as i,d as u,e as n}from"./app-2a91d8ab.js";const c={},v=n(`

    源码集成代码分析工具

    初识TCA任务执行机制

    1. TCA server在接收到开启分析的请求后根据所选规则生成对应的task_request,每个task_request对应一个工具的任务
    2. TCA server将task_request分发到能够执行该工具的机器
    3. TCA client在收到task_request后提取出本次任务的工具名也就是其中的task_name字段,字段对应于工具的name字段
    4. TCA client按照task_name在client中的tool目录查找对应python启动脚本
    5. 执行python启动脚本中的内容

    添加分析工具(以 tca_ql_php 为例)

    根据上述的任务机制添加工具需要做到以下几点

    1. 让server知道存在tca_ql_php工具及其所含的规则
    2. 让server知道哪些客户端可以执行tca_ql_php工具
    3. client下载/找到工具所在目录及需要的环境
    4. 让client知道tca_ql_php对应的启动脚本是什么

    如何让Server知道存在相应工具

    1. 找到server/projects/main/apps/scan_conf/management/commands/open_source目录

    2. 创建工具json文件,json文件名尽量对应工具名称方便查看

    3. json文件内容为(以 tca_ql_php 为例)

    [
    +    {
    +        "name": "tca_ql_php",
    +        "display_name": "Hades_PHP(展示名称用于前端展示使用)",
    +        "description": "工具描述",
    +        "license": "工具license",
    +        "libscheme_set": [], # 暂时不需要
    +        "task_processes": [
    +            "analyze",
    +            "datahandle",
    +            "compile"
    +        ],  # 工具进程,包含compile编译, analyze分析, datahandle数据处理
    +        "scan_app": "codelint",  # 代码分析统一为codelint
    +        "scm_url": "", # 暂时为空
    +        "run_cmd": "",
    +        "envs": null, # 是否需要特殊环境,这里无需填写
    +        "build_flag": false, # 是否需要编译命令才能运行
    +        "checkrule_set": [  # 工具包含的规则
    +            {
    +                "real_name": "deser",  # 规则名
    +                "display_name": "反序列化漏洞",  # 规则前端展示,考虑各工具规则名可能晦涩难懂,设置展示名称方便查找
    +                "severity": "error",  # 规则等级 从上到下分为 fatal, error, warning, info 四个等级
    +                "category": "security",  # 规则类别。correctness 功能 security安全 performance性能 usability可用性 accessibility无障碍化 i18n国际化 convention代码风格 other其他
    +                "rule_title": "反序列化漏洞",  # 一句话概括规则简介
    +                "rule_params": null,  # 规则参数
    +                "languages": [  # 支持语言
    +                    "php"
    +                ],
    +                "solution": "",  # 建议的解决方法
    +                "owner": "",
    +                "labels": [],
    +                "description": "",  # 规则详细介绍
    +            }
    +        ]
    +    }
    +]
    +
    1. server/projects/main/目录执行python manage.py loadcheckers --dir open_source tca_ql_php 加载工具进入数据库

    让server知道哪些客户端可以执行tca_ql_php工具

    1. 进入节点管理页面

    节点管理

    1. 选择其中一台机器 工具进程配置,勾选其工具进程

    工具进程

    client下载/找到工具所在目录及需要的环境

    ',16),m={href:"https://github.com/TCATools/puppy-tools-config.git",target:"_blank",rel:"noopener noreferrer"},p=e("li",null,"修改其中的 ini 配置文件,每个操作系统对应一个ini",-1),q=e("li",null,"以 tca_ql_php 为例需要做以下修改",-1),b=n(`
    ; env_path 主要填写存放工具文件所在的相对目录,一般都存放/拉取在tools下,会在工具执行前加载到环境变量中提供使用
    +[env_path]
    +ZEUS_HOME   : Zeus
    +HADES_HOME  : Hades
    +
    +; toolz_url
    +[tool_url] 主要填写工具的git仓库,这里因为 tca_ql_php 直接使用tools下的目录所以不用再进行额外拉取也无需再写
    +CPPCHECK    : \${base_value:git_url}/linux-cppcheck-1.78
    +
    +; 各工具配置 以 tca_ql_php 为例
    +; env_path 填写上面需要加载的环境变量
    +; env_value 通用环境变量,一般无需填写如果有需求需要现在 [env_value] 中定义好再填写
    +; path 工具所在目录填写上面的定义
    +; tool_url 工具git仓库,使用本地相对目录故为空
    +[tca_ql_php]
    +env_path  : ZEUS_HOME;HADES_HOME
    +env_value :
    +path      : \${env_path:ZEUS_HOME};\${env_path:HADES_HOME}
    +tool_url  : 
    +
    +

    让client知道tca_ql_php对应的启动脚本是什么

    1. 以上述步骤在client/tool目录添加脚本tca_ql_php.py作为启动脚本 注:启动脚本必须与工具名称相同

    2. 编写脚本

    脚本编写规范

    tca_ql_php为例

    
    +from task.codelintmodel import CodeLintModel
    +from util.logutil import LogPrinter
    +from util.subprocc import SubProcController
    +
    +logger = LogPrinter()
    +
    +
    +class TcaQlPHP(CodeLintModel):
    +    # 代码分析工具集成基类CodeLintModel
    +    def __init__(self, params):
    +        logger.info("找到工具了Q_Q")
    +        super().__init__(params)
    +
    +    def compile(self, params):
    +        logger.info("开始编译了Q_Q")
    +        build_cmd = params.get('build_cmd', None)  # 从params中获取编译命令, params内容可以在最后附录查看
    +        lang = "php"
    +        do_some_things()
    +
    +    def analyze(self, params):
    +        logger.info("开始分析了Q_Q")
    +        lang = "php"
    +        HADES_HOME = envs.get("HADES_HOME", None)
    +        output_json = "result.json"
    +        sp = SubProcController(
    +            command=["Hades", "analyze", "test.php", "-o", output_json],
    +            cwd=HADES_HOME,
    +            stdout_line_callback=subprocc_log,
    +            stderr_line_callback=subprocc_log,
    +        )
    +        sp.wait()  # 执行工具分析命令
    +        issues = []
    +        # 工具结果输出到output_json,具体工具可能有所不同
    +        if os.path.exists(output_json):
    +            with open(output_json, "r") as result_reader:
    +                result = json.load(result_reader)
    +                issues.extend(result)
    +        return issues
    +
    +tool = TcaQlPHP  # 必须,必须包含tool变量并且为该工具的类
    +
    1. 脚本必须包含analyze方法,如果有配置编译进程也需要相应的compile方法来做编译相关工作,datahandle函数不用自定义基类方法已经够用了。方法执行顺序为 compile -> analyze -> datahandle
    2. params参数为task_request中的task_params字段,具体字段将在最后附录进行说明
    3. anlyze方法必须有返回值,返回值为issue列表,issue格式为
    {
    +    "path": "文件相对路径",
    +    "line": "行号,int类型",
    +    "column": "列号, int类型,如果工具没有输出列号信息,可以用0代替",
    +    "msg": "提示信息",
    +    "rule": "规则名称,可以根据需要输出不同的规则名",
    +    "refs": [
    +        {
    +            "line": "回溯行号", 
    +            "msg": "提示信息", 
    +            "tag": "用一个词简要标记该行信息,比如uninit_member,member_decl等,如果没有也可以都写成一样的", 
    +            "path": "回溯行所在文件绝对路径"
    +        },
    +        ...
    +    ]
    +}
    +说明:
    +    refs:可选,记录问题回溯路径信息。比如当前文件的回溯路径其他的3行代码,可以将这三行的路径及提示信息,按顺序添加到refs数组中。
    +

    PR

    如果有意公开您添加的工具欢迎发起PR

    注:别忘了puppy-tool-config 也需要PR

    附录

    params 表格

    字段说明类型
    scan_languages语言字符串列表如 ["python", "php"]
    pre_cmd编译前置命令字符串
    build_cmd编译命令字符串
    envs额外环境变量字符串
    scm_last_revision上次成功分析的代码版本,增量使用字符串
    incr_scan是否为增量分析bool
    rules规则名称列表,只有规则名字符串列表
    rule_list详细的规则列表包含规则名和规则参数等字典列表
    checktool工具详细信息,执行一般用不到字典
    path_filters过滤路径字典
    scm_url代码库url字符串
    source_dir代码库本地目录字符串
    work_dir本次任务的work_dir目录字符串
    project_id分析项目idint
    repo_id仓库idint
    task_id任务idint
    job_id本次分析的idint
    `,14);function _(h,g){const t=a("ExternalLinkIcon");return o(),r("div",null,[v,e("ol",null,[e("li",null,[i("找到puppy-tool-config若没有额外配置则为默认代码库"),e("a",m,[i("https://github.com/TCATools/puppy-tools-config.git"),u(t)])]),p,q]),b])}const y=s(c,[["render",_],["__file","集成代码分析工具.html.vue"]]);export{y as default}; diff --git "a/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-5b16521a.js" "b/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-5b16521a.js" new file mode 100644 index 000000000..98d4a2ed1 --- /dev/null +++ "b/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-5b16521a.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-331b689a","path":"/zh/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7.html","title":"源码集成代码分析工具","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"初识TCA任务执行机制","slug":"初识tca任务执行机制","link":"#初识tca任务执行机制","children":[]},{"level":2,"title":"添加分析工具(以 tca_ql_php 为例)","slug":"添加分析工具-以-tca-ql-php-为例","link":"#添加分析工具-以-tca-ql-php-为例","children":[{"level":3,"title":"如何让Server知道存在相应工具","slug":"如何让server知道存在相应工具","link":"#如何让server知道存在相应工具","children":[]}]},{"level":2,"title":"让server知道哪些客户端可以执行tca_ql_php工具","slug":"让server知道哪些客户端可以执行tca-ql-php工具","link":"#让server知道哪些客户端可以执行tca-ql-php工具","children":[]},{"level":2,"title":"client下载/找到工具所在目录及需要的环境","slug":"client下载-找到工具所在目录及需要的环境","link":"#client下载-找到工具所在目录及需要的环境","children":[]},{"level":2,"title":"让client知道tca_ql_php对应的启动脚本是什么","slug":"让client知道tca-ql-php对应的启动脚本是什么","link":"#让client知道tca-ql-php对应的启动脚本是什么","children":[{"level":3,"title":"脚本编写规范","slug":"脚本编写规范","link":"#脚本编写规范","children":[]}]},{"level":2,"title":"params 表格","slug":"params-表格","link":"#params-表格","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/advanced/集成代码分析工具.md"}');export{l as data}; diff --git "a/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-7b03efe0.js" "b/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-7b03efe0.js" new file mode 100644 index 000000000..598e13e86 --- /dev/null +++ "b/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-7b03efe0.js" @@ -0,0 +1,116 @@ +import{_ as d,a as l}from"./ProcessConfiguration2-c60284cc.js";import{_ as s,r as a,o,c as r,a as e,b as i,d as u,e as n}from"./app-2a91d8ab.js";const c={},v=n(`

    源码集成代码分析工具

    初识TCA任务执行机制

    1. TCA server在接收到开启分析的请求后根据所选规则生成对应的task_request,每个task_request对应一个工具的任务
    2. TCA server将task_request分发到能够执行该工具的机器
    3. TCA client在收到task_request后提取出本次任务的工具名也就是其中的task_name字段,字段对应于工具的name字段
    4. TCA client按照task_name在client中的tool目录查找对应python启动脚本
    5. 执行python启动脚本中的内容

    添加分析工具(以 tca_ql_php 为例)

    根据上述的任务机制添加工具需要做到以下几点

    1. 让server知道存在tca_ql_php工具及其所含的规则
    2. 让server知道哪些客户端可以执行tca_ql_php工具
    3. client下载/找到工具所在目录及需要的环境
    4. 让client知道tca_ql_php对应的启动脚本是什么

    如何让Server知道存在相应工具

    1. 找到server/projects/main/apps/scan_conf/management/commands/open_source目录

    2. 创建工具json文件,json文件名尽量对应工具名称方便查看

    3. json文件内容为(以 tca_ql_php 为例)

    [
    +    {
    +        "name": "tca_ql_php",
    +        "display_name": "Hades_PHP(展示名称用于前端展示使用)",
    +        "description": "工具描述",
    +        "license": "工具license",
    +        "libscheme_set": [], # 暂时不需要
    +        "task_processes": [
    +            "analyze",
    +            "datahandle",
    +            "compile"
    +        ],  # 工具进程,包含compile编译, analyze分析, datahandle数据处理
    +        "scan_app": "codelint",  # 代码分析统一为codelint
    +        "scm_url": "", # 暂时为空
    +        "run_cmd": "",
    +        "envs": null, # 是否需要特殊环境,这里无需填写
    +        "build_flag": false, # 是否需要编译命令才能运行
    +        "checkrule_set": [  # 工具包含的规则
    +            {
    +                "real_name": "deser",  # 规则名
    +                "display_name": "反序列化漏洞",  # 规则前端展示,考虑各工具规则名可能晦涩难懂,设置展示名称方便查找
    +                "severity": "error",  # 规则等级 从上到下分为 fatal, error, warning, info 四个等级
    +                "category": "security",  # 规则类别。correctness 功能 security安全 performance性能 usability可用性 accessibility无障碍化 i18n国际化 convention代码风格 other其他
    +                "rule_title": "反序列化漏洞",  # 一句话概括规则简介
    +                "rule_params": null,  # 规则参数
    +                "languages": [  # 支持语言
    +                    "php"
    +                ],
    +                "solution": "",  # 建议的解决方法
    +                "owner": "",
    +                "labels": [],
    +                "description": "",  # 规则详细介绍
    +            }
    +        ]
    +    }
    +]
    +
    1. server/projects/main/目录执行python manage.py loadcheckers --dir open_source tca_ql_php 加载工具进入数据库

    让server知道哪些客户端可以执行tca_ql_php工具

    1. 进入节点管理页面

    节点管理

    1. 选择其中一台机器 工具进程配置,勾选其工具进程

    工具进程

    client下载/找到工具所在目录及需要的环境

    ',16),m={href:"https://github.com/TCATools/puppy-tools-config.git",target:"_blank",rel:"noopener noreferrer"},p=e("li",null,"修改其中的 ini 配置文件,每个操作系统对应一个ini",-1),q=e("li",null,"以 tca_ql_php 为例需要做以下修改",-1),b=n(`
    ; env_path 主要填写存放工具文件所在的相对目录,一般都存放/拉取在tools下,会在工具执行前加载到环境变量中提供使用
    +[env_path]
    +ZEUS_HOME   : Zeus
    +HADES_HOME  : Hades
    +
    +; toolz_url
    +[tool_url] 主要填写工具的git仓库,这里因为 tca_ql_php 直接使用tools下的目录所以不用再进行额外拉取也无需再写
    +CPPCHECK    : \${base_value:git_url}/linux-cppcheck-1.78
    +
    +; 各工具配置 以 tca_ql_php 为例
    +; env_path 填写上面需要加载的环境变量
    +; env_value 通用环境变量,一般无需填写如果有需求需要现在 [env_value] 中定义好再填写
    +; path 工具所在目录填写上面的定义
    +; tool_url 工具git仓库,使用本地相对目录故为空
    +[tca_ql_php]
    +env_path  : ZEUS_HOME;HADES_HOME
    +env_value :
    +path      : \${env_path:ZEUS_HOME};\${env_path:HADES_HOME}
    +tool_url  : 
    +
    +

    让client知道tca_ql_php对应的启动脚本是什么

    1. 以上述步骤在client/tool目录添加脚本tca_ql_php.py作为启动脚本 注:启动脚本必须与工具名称相同

    2. 编写脚本

    脚本编写规范

    tca_ql_php为例

    
    +from task.codelintmodel import CodeLintModel
    +from util.logutil import LogPrinter
    +from util.subprocc import SubProcController
    +
    +logger = LogPrinter()
    +
    +
    +class TcaQlPHP(CodeLintModel):
    +    # 代码分析工具集成基类CodeLintModel
    +    def __init__(self, params):
    +        logger.info("找到工具了Q_Q")
    +        super().__init__(params)
    +
    +    def compile(self, params):
    +        logger.info("开始编译了Q_Q")
    +        build_cmd = params.get('build_cmd', None)  # 从params中获取编译命令, params内容可以在最后附录查看
    +        lang = "php"
    +        do_some_things()
    +
    +    def analyze(self, params):
    +        logger.info("开始分析了Q_Q")
    +        lang = "php"
    +        HADES_HOME = envs.get("HADES_HOME", None)
    +        output_json = "result.json"
    +        sp = SubProcController(
    +            command=["Hades", "analyze", "test.php", "-o", output_json],
    +            cwd=HADES_HOME,
    +            stdout_line_callback=subprocc_log,
    +            stderr_line_callback=subprocc_log,
    +        )
    +        sp.wait()  # 执行工具分析命令
    +        issues = []
    +        # 工具结果输出到output_json,具体工具可能有所不同
    +        if os.path.exists(output_json):
    +            with open(output_json, "r") as result_reader:
    +                result = json.load(result_reader)
    +                issues.extend(result)
    +        return issues
    +
    +tool = TcaQlPHP  # 必须,必须包含tool变量并且为该工具的类
    +
    1. 脚本必须包含analyze方法,如果有配置编译进程也需要相应的compile方法来做编译相关工作,datahandle函数不用自定义基类方法已经够用了。方法执行顺序为 compile -> analyze -> datahandle
    2. params参数为task_request中的task_params字段,具体字段将在最后附录进行说明
    3. anlyze方法必须有返回值,返回值为issue列表,issue格式为
    {
    +    "path": "文件相对路径",
    +    "line": "行号,int类型",
    +    "column": "列号, int类型,如果工具没有输出列号信息,可以用0代替",
    +    "msg": "提示信息",
    +    "rule": "规则名称,可以根据需要输出不同的规则名",
    +    "refs": [
    +        {
    +            "line": "回溯行号", 
    +            "msg": "提示信息", 
    +            "tag": "用一个词简要标记该行信息,比如uninit_member,member_decl等,如果没有也可以都写成一样的", 
    +            "path": "回溯行所在文件绝对路径"
    +        },
    +        ...
    +    ]
    +}
    +说明:
    +    refs:可选,记录问题回溯路径信息。比如当前文件的回溯路径其他的3行代码,可以将这三行的路径及提示信息,按顺序添加到refs数组中。
    +

    PR

    如果有意公开您添加的工具欢迎发起PR

    注:别忘了puppy-tool-config 也需要PR

    附录

    params 表格

    字段说明类型
    scan_languages语言字符串列表如 ["python", "php"]
    pre_cmd编译前置命令字符串
    build_cmd编译命令字符串
    envs额外环境变量字符串
    scm_last_revision上次成功分析的代码版本,增量使用字符串
    incr_scan是否为增量分析bool
    rules规则名称列表,只有规则名字符串列表
    rule_list详细的规则列表包含规则名和规则参数等字典列表
    checktool工具详细信息,执行一般用不到字典
    path_filters过滤路径字典
    scm_url代码库url字符串
    source_dir代码库本地目录字符串
    work_dir本次任务的work_dir目录字符串
    project_id分析项目idint
    repo_id仓库idint
    task_id任务idint
    job_id本次分析的idint
    `,14);function _(h,g){const t=a("ExternalLinkIcon");return o(),r("div",null,[v,e("ol",null,[e("li",null,[i("找到puppy-tool-config若没有额外配置则为默认代码库"),e("a",m,[i("https://github.com/TCATools/puppy-tools-config.git"),u(t)])]),p,q]),b])}const y=s(c,[["render",_],["__file","集成代码分析工具.html.vue"]]);export{y as default}; diff --git "a/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-ca82af0a.js" "b/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-ca82af0a.js" new file mode 100644 index 000000000..4ccb50d6d --- /dev/null +++ "b/assets/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html-ca82af0a.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-16f1abd8","path":"/en/advanced/%E9%9B%86%E6%88%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7.html","title":"源码集成代码分析工具","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"初识TCA任务执行机制","slug":"初识tca任务执行机制","link":"#初识tca任务执行机制","children":[]},{"level":2,"title":"添加分析工具(以 tca_ql_php 为例)","slug":"添加分析工具-以-tca-ql-php-为例","link":"#添加分析工具-以-tca-ql-php-为例","children":[{"level":3,"title":"如何让Server知道存在相应工具","slug":"如何让server知道存在相应工具","link":"#如何让server知道存在相应工具","children":[]}]},{"level":2,"title":"让server知道哪些客户端可以执行tca_ql_php工具","slug":"让server知道哪些客户端可以执行tca-ql-php工具","link":"#让server知道哪些客户端可以执行tca-ql-php工具","children":[]},{"level":2,"title":"client下载/找到工具所在目录及需要的环境","slug":"client下载-找到工具所在目录及需要的环境","link":"#client下载-找到工具所在目录及需要的环境","children":[]},{"level":2,"title":"让client知道tca_ql_php对应的启动脚本是什么","slug":"让client知道tca-ql-php对应的启动脚本是什么","link":"#让client知道tca-ql-php对应的启动脚本是什么","children":[{"level":3,"title":"脚本编写规范","slug":"脚本编写规范","link":"#脚本编写规范","children":[]}]},{"level":2,"title":"params 表格","slug":"params-表格","link":"#params-表格","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/advanced/集成代码分析工具.md"}');export{l as data}; diff --git "a/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-36cd817e.js" "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-36cd817e.js" new file mode 100644 index 000000000..d6e4cd098 --- /dev/null +++ "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-36cd817e.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b2bcdc3c","path":"/en/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86.html","title":"项目管理","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/guide/后台管理/项目管理.md"}');export{e as data}; diff --git "a/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-54c86c5b.js" "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-54c86c5b.js" new file mode 100644 index 000000000..01f3dff31 --- /dev/null +++ "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-54c86c5b.js" @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-15ee6c7d","path":"/zh/guide/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86.html","title":"项目管理","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/guide/后台管理/项目管理.md"}');export{e as data}; diff --git "a/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-7f3dd5ba.js" "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-7f3dd5ba.js" new file mode 100644 index 000000000..5cd417b33 --- /dev/null +++ "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-7f3dd5ba.js" @@ -0,0 +1 @@ +import{_ as l}from"./manage_team_01-ead0dac9.js";import{_ as n,o,c as s,a as e,b as t}from"./app-2a91d8ab.js";const _={},r=e("h1",{id:"项目管理",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#项目管理","aria-hidden":"true"},"#"),t(" 项目管理")],-1),a=e("ul",null,[e("li",null,[e("p",null,"可查看平台创建的项目列表,并提供了提供相应筛选")]),e("li",null,[e("p",null,[t("可"),e("strong",null,"禁用"),t("、"),e("strong",null,"恢复"),t("项目")])])],-1),c=e("p",null,[e("img",{src:l,alt:"项目列表"})],-1),i=[r,a,c];function d(u,h){return o(),s("div",null,i)}const p=n(_,[["render",d],["__file","项目管理.html.vue"]]);export{p as default}; diff --git "a/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-e07a0f63.js" "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-e07a0f63.js" new file mode 100644 index 000000000..5cd417b33 --- /dev/null +++ "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206.html-e07a0f63.js" @@ -0,0 +1 @@ +import{_ as l}from"./manage_team_01-ead0dac9.js";import{_ as n,o,c as s,a as e,b as t}from"./app-2a91d8ab.js";const _={},r=e("h1",{id:"项目管理",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#项目管理","aria-hidden":"true"},"#"),t(" 项目管理")],-1),a=e("ul",null,[e("li",null,[e("p",null,"可查看平台创建的项目列表,并提供了提供相应筛选")]),e("li",null,[e("p",null,[t("可"),e("strong",null,"禁用"),t("、"),e("strong",null,"恢复"),t("项目")])])],-1),c=e("p",null,[e("img",{src:l,alt:"项目列表"})],-1),i=[r,a,c];function d(u,h){return o(),s("div",null,i)}const p=n(_,[["render",d],["__file","项目管理.html.vue"]]);export{p as default}; diff --git "a/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-3a996ff5.js" "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-3a996ff5.js" new file mode 100644 index 000000000..82fd2e1e4 --- /dev/null +++ "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-3a996ff5.js" @@ -0,0 +1,539 @@ +import{_ as e,o as t,c as i,e as n}from"./app-2a91d8ab.js";const d={},u=n(`

    项目管理模块

    查看指定代码库的指定分析项目列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/
    +

    参数列表

    参数类型描述
    scm_url_or_namestr代码库地址或者名称,支持模糊匹配
    scm_urlstr代码库仓库匹配
    scopestr过滤范围(my/subscribed/related_me),my表示我创建的,subscribed表示我关注的,related_me表示我有权限的

    返回结果

    {
    +    "count": 1,
    +    "next": null,
    +    "previous": null,
    +    "results": [
    +        {
    +            "id": 1,
    +            "name": "test_repo.git",
    +            "scm_url": "http://git.com/xxx/test_repo",
    +            "scm_type": "git",
    +            "branch_count": 1,
    +            "scheme_count": 1,
    +            "job_count": 1,
    +            "created_time": "2021-03-15 02:26:31.423674+00:00",
    +            "recent_active": {
    +                "id": 1,
    +                "branch_name": "master",
    +                "active_time": "2021-03-15T03:14:56.760427Z",
    +                "total_line_num": null,
    +                "code_line_num": null
    +            },
    +            "created_from": "codedog_web",
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "symbol": null
    +        }
    +    ]
    +}
    +

    查看指定代码库详情

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/
    +

    返回结果

    {
    +    "data":{
    +        "id": 1,
    +        "name": "test_repo.git",
    +        "scm_url": "http://git.com/xxx/test_repo",
    +        "scm_type": "git",
    +        "branch_count": 1,
    +        "scheme_count": 1,
    +        "job_count": 1,
    +        "created_time": "2021-03-15 02:26:31.423674+00:00",
    +        "recent_active": {
    +            "id": 1,
    +            "branch_name": "master",
    +            "active_time": "2021-03-15T03:14:56.760427Z",
    +            "total_line_num": null,
    +            "code_line_num": null
    +        },
    +        "created_from": "codedog_web",
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "symbol": null
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的不同分支的列表接口

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/branches/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "branch": "master",
    +                "schemes": [
    +                    {
    +                        "project_id": 1,
    +                        "scan_scheme_id": 1,
    +                        "scan_scheme_name": "默认"
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的分析项目列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    参数列表

    参数类型描述
    branchstr分支名称
    scan_schemeint扫描方案名称
    scan_scheme__statusint扫描方案状态,1为活跃,2为废弃
    branch_or_schemestr分支名称/扫描方案名称
    statusint项目状态筛选,1表示活跃,2表示失活,3表示关闭

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "creator": {
    +                    "username": "username",
    +                    "nickname": "nickname",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "org": 1
    +                },
    +                "created_time": "2021-01-28 02:27:26.256015+00:00",
    +                "modifier": null,
    +                "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +                "deleter": null,
    +                "deleted_time": null,
    +                "scan_scheme": {
    +                    "id": 1,
    +                    "creator": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    },
    +                    "created_time": "2021-01-28 02:27:26.209661+00:00",
    +                    "modifier": null,
    +                    "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +                    "deleter": null,
    +                    "deleted_time": null,
    +                    "languages": [
    +                        "python"
    +                    ],
    +                    "tag": "TCA_Linux",
    +                    "refer_scheme_info": null,
    +                    "name": "默认",
    +                    "description": null,
    +                    "default_flag": true,
    +                    "created_from": "web",
    +                    "job_runtime_limit": 600,
    +                    "ignore_merged_issue": false,
    +                    "ignore_branch_issue": null,
    +                    "ignore_submodule_clone": false,
    +                    "ignore_submodule_issue": true,
    +                    "issue_global_ignore": false,
    +                    "daily_save": false,
    +                    "lfs_flag": null,
    +                    "webhook_flag": false,
    +                    "issue_revision_merge_flag": false,
    +                    "status": 1,
    +                    "scheme_key": null,
    +                    "repo": 1
    +                },
    +                "branch": "master",
    +                "status": 1,
    +                "created_from": "codedog_web",
    +                "repo": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    创建指定代码库的指定分析项目

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    参数列表

    参数类型描述
    scan_scheme_idint当前代码库的扫描方案编号
    global_scheme_idint扫描方案模板编号
    custom_scheme_namestr自定义方案名称
    branchstr分支
    created_fromstr创建渠道,用于区分不同运行场景

    返回结果

    {
    +    "data": {
    +        "id":1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.256015+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "repo": {
    +            "id": 1,
    +            "name": "test_demo.git",
    +            "scm_url": "http://github.com/xxxx/test_demo.git",
    +            "scm_type": "git",
    +            "scm_auth": {
    +                "id": 1,
    +                "scm_account": null,
    +                "scm_oauth": null,
    +                "scm_ssh": {
    +                    "id": 1,
    +                    "name": "1",
    +                    "scm_platform": 1,
    +                    "scm_platform_desc": null,
    +                    "user": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    }
    +                },
    +                "auth_type": "ssh_token",
    +                "created_time": "2021-01-28T10:26:31.453389+08:00",
    +                "modified_time": "2021-01-28T10:26:31.453417+08:00"
    +            },
    +            "symbol": null
    +        },
    +        "scan_scheme": {
    +            "id": 1,
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "created_time": "2021-01-28 02:27:26.209661+00:00",
    +            "modifier": null,
    +            "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +            "deleter": null,
    +            "deleted_time": null,
    +            "languages": [
    +                "python"
    +            ],
    +            "tag": "TCA_Linux",
    +            "refer_scheme_info": null,
    +            "name": "默认",
    +            "description": null,
    +            "default_flag": true,
    +            "created_from": "web",
    +            "job_runtime_limit": 600,
    +            "ignore_merged_issue": false,
    +            "ignore_branch_issue": null,
    +            "ignore_submodule_clone": false,
    +            "ignore_submodule_issue": true,
    +            "issue_global_ignore": false,
    +            "daily_save": false,
    +            "lfs_flag": null,
    +            "webhook_flag": false,
    +            "issue_revision_merge_flag": false,
    +            "status": 1,
    +            "scheme_key": null,
    +            "repo": 1
    +        },
    +        "branch": "master",
    +        "status": 1,
    +        "created_from": "tca_web"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的指定分析项目

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/<project_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id":1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.256015+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "repo": {
    +            "id": 1,
    +            "name": "test_demo.git",
    +            "scm_url": "http://github.com/xxxx/test_demo.git",
    +            "scm_type": "git",
    +            "scm_auth": {
    +                "id": 1,
    +                "scm_account": null,
    +                "scm_oauth": null,
    +                "scm_ssh": {
    +                    "id": 1,
    +                    "name": "1",
    +                    "scm_platform": 1,
    +                    "scm_platform_desc": null,
    +                    "user": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    }
    +                },
    +                "auth_type": "ssh_token",
    +                "created_time": "2021-01-28T10:26:31.453389+08:00",
    +                "modified_time": "2021-01-28T10:26:31.453417+08:00"
    +            },
    +            "symbol": null
    +        },
    +        "scan_scheme": {
    +            "id": 1,
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "created_time": "2021-01-28 02:27:26.209661+00:00",
    +            "modifier": null,
    +            "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +            "deleter": null,
    +            "deleted_time": null,
    +            "languages": [
    +                "python"
    +            ],
    +            "tag": "TCA_Linux",
    +            "refer_scheme_info": null,
    +            "name": "默认",
    +            "description": null,
    +            "default_flag": true,
    +            "created_from": "web",
    +            "job_runtime_limit": 600,
    +            "ignore_merged_issue": false,
    +            "ignore_branch_issue": null,
    +            "ignore_submodule_clone": false,
    +            "ignore_submodule_issue": true,
    +            "issue_global_ignore": false,
    +            "daily_save": false,
    +            "lfs_flag": null,
    +            "webhook_flag": false,
    +            "issue_revision_merge_flag": false,
    +            "status": 1,
    +            "scheme_key": null,
    +            "repo": 1
    +        },
    +        "branch": "master",
    +        "status": 1,
    +        "created_from": "tca_web"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的扫描方案列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/
    +

    参数列表

    参数类型描述
    namestr扫描方案名称
    statusint扫描方案状态,1为活跃,2为废弃

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "creator": {
    +                    "username": "username",
    +                    "nickname": "nickname",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "org": 1
    +                },
    +                "created_time": "2021-01-28 02:27:26.209661+00:00",
    +                "modifier": null,
    +                "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +                "deleter": null,
    +                "deleted_time": null,
    +                "languages": [
    +                    "python"
    +                ],
    +                "tag": "TCA_Linux",
    +                "refer_scheme": null,
    +                "name": "默认",
    +                "description": null,
    +                "default_flag": true,
    +                "created_from": "web",
    +                "job_runtime_limit": 600,
    +                "ignore_merged_issue": false,
    +                "ignore_branch_issue": null,
    +                "ignore_submodule_clone": false,
    +                "ignore_submodule_issue": true,
    +                "issue_global_ignore": false,
    +                "daily_save": false,
    +                "lfs_flag": null,
    +                "issue_revision_merge_flag": false,
    +                "status": 1,
    +                "repo": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    使用指定扫描方案模板创建指定代码库的扫描方案

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/copyscheme/
    +

    参数列表

    参数类型描述
    namestr扫描方案名称
    ref_schemeint参照扫描方案编号

    返回结果

    {
    +    "data": {
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    查看指定代码库的指定扫描方案

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/basicconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.209661+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "languages": [
    +            "python"
    +        ],
    +        "tag": "TCA_Linux",
    +        "refer_scheme": null,
    +        "name": "默认",
    +        "description": null,
    +        "default_flag": true,
    +        "created_from": "web",
    +        "job_runtime_limit": 600,
    +        "ignore_merged_issue": false,
    +        "ignore_branch_issue": null,
    +        "ignore_submodule_clone": false,
    +        "ignore_submodule_issue": true,
    +        "issue_global_ignore": false,
    +        "daily_save": false,
    +        "lfs_flag": null,
    +        "issue_revision_merge_flag": false,
    +        "status": 1,
    +        "repo": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/basicconf/
    +

    参数列表

    参数类型描述
    languageslist代码语言
    tagstr执行标签,目前只支持 CodeDog_Linux
    namestr方案名称
    descriptionstr方案描述
    default_flagbool默认方案标志,一个代码库只能有一个默认方案
    job_runtime_limitint任务执行超时时间,默认为600分钟
    ignore_merged_issuebool忽略合入的问题
    ignore_branch_issuestr过滤参考分支引入的问题
    ignore_submodule_clonebool不拉取子模块扫描,True表示不拉取,False表示拉取
    ignore_submodule_issuebool忽略子模块引入的问题,True表示忽略,False表示不忽略
    issue_global_ignorebool问题全局忽略
    daily_savebool每次扫描原始数据存储,默认存储7天
    lfs_flagbool拉取lfs模块开关
    issue_revision_merge_flagbool"是否开启Issue按引入版本号聚合开关
    statusint方案状态,1表示活跃,2表示废弃

    返回结果

    查看指定代码库的指定扫描方案的返回结果一致

    查看指定代码库的扫描方案的代码扫描配置

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/lintconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "enabled": true,
    +        "checkprofile": {
    +            "id": 1,
    +            "profile_type": 1,
    +            "custom_checkpackage": 1,
    +            "checkpackages": [
    +                1
    +            ]
    +        },
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的代码扫描配置

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/lintconf/
    +

    参数列表

    参数类型描述
    enabledbool是否开启代码扫描

    返回结果

    指定代码库的指定方案的代码扫描配置的返回结果一致

    查看指定代码库的扫描方案的代码度量配置

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "cc_scan_enabled": false,
    +        "min_ccn": 20,
    +        "dup_scan_enabled": false,
    +        "dup_block_length_min": 120,
    +        "dup_block_length_max": null,
    +        "dup_min_dup_times": 2,
    +        "dup_max_dup_times": null,
    +        "dup_min_midd_rate": 5,
    +        "dup_min_high_rate": 11,
    +        "dup_min_exhi_rate": 20,
    +        "dup_issue_limit": 1000,
    +        "cloc_scan_enabled": false,
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的代码度量配置

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    参数列表

    参数类型描述
    cc_scan_enabledbool圈复杂度扫描开关
    min_ccnint最小圈复杂度
    dup_scan_enabledbool重复代码扫描开关
    dup_block_length_minint重复块最小长度
    dup_block_length_maxint重复块最大长度
    dup_max_dup_timesint最大重复次数
    dup_min_midd_rateint中风险最小重复率
    dup_min_high_rateint高风险最小重复率
    dup_min_exhi_rateint极高风险风险最小重复率
    dup_issue_limitint上报重复代码块数上限
    cloc_scan_enabledboolean代码统计扫描开关

    返回结果

    指定代码库的指定方案的代码度量配置的返回结果一致

    查看指定代码库的扫描方案的过滤路径列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "dir_path": "test/*",
    +                "path_type": 1,
    +                "scan_type": 1,
    +                "scan_scheme": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    创建指定代码库的指定方案的过滤路径列表

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/
    +

    参数列表

    参数类型描述
    dir_pathstr指定过滤路径
    path_typeint路径格式,1表示通配符,2表示正则表达式,默认为通配符
    scan_typeint扫描类型,1表示包含,2表示排除

    返回结果

    {
    +    "data": {
    +        "id": 13,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 36
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    查看指定代码库的扫描方案的指定过滤路径

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的指定过滤路径

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    参数列表

    参数类型描述
    dir_pathstr指定过滤路径
    path_typeint路径格式,1表示通配符,2表示正则表达式,默认为通配符
    scan_typeint扫描类型,1表示包含,2表示排除

    返回结果

    {
    +    "data": {
    +        "id": 13,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 36
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    删除指定代码库的指定方案的指定过滤路径

    DELETE /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    返回结果

    `,97),s=[u];function a(l,o){return t(),i("div",null,s)}const v=e(d,[["render",a],["__file","项目管理模块接口.html.vue"]]);export{v as default}; diff --git "a/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-3cef7840.js" "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-3cef7840.js" new file mode 100644 index 000000000..503944193 --- /dev/null +++ "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-3cef7840.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-bb3cf496","path":"/en/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"项目管理模块","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"查看指定代码库的指定分析项目列表","slug":"查看指定代码库的指定分析项目列表","link":"#查看指定代码库的指定分析项目列表","children":[]},{"level":2,"title":"查看指定代码库详情","slug":"查看指定代码库详情","link":"#查看指定代码库详情","children":[]},{"level":2,"title":"查看指定代码库的不同分支的列表接口","slug":"查看指定代码库的不同分支的列表接口","link":"#查看指定代码库的不同分支的列表接口","children":[]},{"level":2,"title":"查看指定代码库的分析项目列表","slug":"查看指定代码库的分析项目列表","link":"#查看指定代码库的分析项目列表","children":[]},{"level":2,"title":"创建指定代码库的指定分析项目","slug":"创建指定代码库的指定分析项目","link":"#创建指定代码库的指定分析项目","children":[]},{"level":2,"title":"查看指定代码库的指定分析项目","slug":"查看指定代码库的指定分析项目","link":"#查看指定代码库的指定分析项目","children":[]},{"level":2,"title":"查看指定代码库的扫描方案列表","slug":"查看指定代码库的扫描方案列表","link":"#查看指定代码库的扫描方案列表","children":[]},{"level":2,"title":"使用指定扫描方案模板创建指定代码库的扫描方案","slug":"使用指定扫描方案模板创建指定代码库的扫描方案","link":"#使用指定扫描方案模板创建指定代码库的扫描方案","children":[]},{"level":2,"title":"查看指定代码库的指定扫描方案","slug":"查看指定代码库的指定扫描方案","link":"#查看指定代码库的指定扫描方案","children":[]},{"level":2,"title":"更新指定代码库的指定方案","slug":"更新指定代码库的指定方案","link":"#更新指定代码库的指定方案","children":[]},{"level":2,"title":"查看指定代码库的扫描方案的代码扫描配置","slug":"查看指定代码库的扫描方案的代码扫描配置","link":"#查看指定代码库的扫描方案的代码扫描配置","children":[]},{"level":2,"title":"更新指定代码库的指定方案的代码扫描配置","slug":"更新指定代码库的指定方案的代码扫描配置","link":"#更新指定代码库的指定方案的代码扫描配置","children":[]},{"level":2,"title":"查看指定代码库的扫描方案的代码度量配置","slug":"查看指定代码库的扫描方案的代码度量配置","link":"#查看指定代码库的扫描方案的代码度量配置","children":[]},{"level":2,"title":"更新指定代码库的指定方案的代码度量配置","slug":"更新指定代码库的指定方案的代码度量配置","link":"#更新指定代码库的指定方案的代码度量配置","children":[]},{"level":2,"title":"查看指定代码库的扫描方案的过滤路径列表","slug":"查看指定代码库的扫描方案的过滤路径列表","link":"#查看指定代码库的扫描方案的过滤路径列表","children":[]},{"level":2,"title":"创建指定代码库的指定方案的过滤路径列表","slug":"创建指定代码库的指定方案的过滤路径列表","link":"#创建指定代码库的指定方案的过滤路径列表","children":[]},{"level":2,"title":"查看指定代码库的扫描方案的指定过滤路径","slug":"查看指定代码库的扫描方案的指定过滤路径","link":"#查看指定代码库的扫描方案的指定过滤路径","children":[]},{"level":2,"title":"更新指定代码库的指定方案的指定过滤路径","slug":"更新指定代码库的指定方案的指定过滤路径","link":"#更新指定代码库的指定方案的指定过滤路径","children":[]},{"level":2,"title":"删除指定代码库的指定方案的指定过滤路径","slug":"删除指定代码库的指定方案的指定过滤路径","link":"#删除指定代码库的指定方案的指定过滤路径","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"en/api/项目管理模块接口.md"}');export{l as data}; diff --git "a/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-73b341fb.js" "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-73b341fb.js" new file mode 100644 index 000000000..edeec9f93 --- /dev/null +++ "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-73b341fb.js" @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-c525ae0c","path":"/zh/api/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%8F%A3.html","title":"项目管理模块","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"查看指定代码库的指定分析项目列表","slug":"查看指定代码库的指定分析项目列表","link":"#查看指定代码库的指定分析项目列表","children":[]},{"level":2,"title":"查看已创建的授权信息","slug":"查看已创建的授权信息","link":"#查看已创建的授权信息","children":[]},{"level":2,"title":"登记代码库","slug":"登记代码库","link":"#登记代码库","children":[]},{"level":2,"title":"查看指定代码库详情","slug":"查看指定代码库详情","link":"#查看指定代码库详情","children":[]},{"level":2,"title":"查看指定代码库的不同分支的列表接口","slug":"查看指定代码库的不同分支的列表接口","link":"#查看指定代码库的不同分支的列表接口","children":[]},{"level":2,"title":"查看指定代码库的分析项目列表","slug":"查看指定代码库的分析项目列表","link":"#查看指定代码库的分析项目列表","children":[]},{"level":2,"title":"创建指定代码库的指定分析项目","slug":"创建指定代码库的指定分析项目","link":"#创建指定代码库的指定分析项目","children":[]},{"level":2,"title":"查看指定代码库的指定分析项目","slug":"查看指定代码库的指定分析项目","link":"#查看指定代码库的指定分析项目","children":[]},{"level":2,"title":"查看指定代码库的扫描方案列表","slug":"查看指定代码库的扫描方案列表","link":"#查看指定代码库的扫描方案列表","children":[]},{"level":2,"title":"查看指定代码库的指定扫描方案","slug":"查看指定代码库的指定扫描方案","link":"#查看指定代码库的指定扫描方案","children":[]},{"level":2,"title":"更新指定代码库的指定方案","slug":"更新指定代码库的指定方案","link":"#更新指定代码库的指定方案","children":[]},{"level":2,"title":"查看指定代码库的扫描方案的代码扫描配置","slug":"查看指定代码库的扫描方案的代码扫描配置","link":"#查看指定代码库的扫描方案的代码扫描配置","children":[]},{"level":2,"title":"更新指定代码库的指定方案的代码扫描配置","slug":"更新指定代码库的指定方案的代码扫描配置","link":"#更新指定代码库的指定方案的代码扫描配置","children":[]},{"level":2,"title":"查看指定代码库的扫描方案的代码度量配置","slug":"查看指定代码库的扫描方案的代码度量配置","link":"#查看指定代码库的扫描方案的代码度量配置","children":[]},{"level":2,"title":"更新指定代码库的指定方案的代码度量配置","slug":"更新指定代码库的指定方案的代码度量配置","link":"#更新指定代码库的指定方案的代码度量配置","children":[]},{"level":2,"title":"查看指定代码库的扫描方案的过滤路径列表","slug":"查看指定代码库的扫描方案的过滤路径列表","link":"#查看指定代码库的扫描方案的过滤路径列表","children":[]},{"level":2,"title":"创建指定代码库的指定方案的过滤路径列表","slug":"创建指定代码库的指定方案的过滤路径列表","link":"#创建指定代码库的指定方案的过滤路径列表","children":[]},{"level":2,"title":"查看指定代码库的扫描方案的指定过滤路径","slug":"查看指定代码库的扫描方案的指定过滤路径","link":"#查看指定代码库的扫描方案的指定过滤路径","children":[]},{"level":2,"title":"更新指定代码库的指定方案的指定过滤路径","slug":"更新指定代码库的指定方案的指定过滤路径","link":"#更新指定代码库的指定方案的指定过滤路径","children":[]},{"level":2,"title":"删除指定代码库的指定方案的指定过滤路径","slug":"删除指定代码库的指定方案的指定过滤路径","link":"#删除指定代码库的指定方案的指定过滤路径","children":[]}],"git":{"updatedTime":1725872649000,"contributors":[{"name":"Jero","email":"lingh0927@hotmail.com","commits":1}]},"filePathRelative":"zh/api/项目管理模块接口.md"}');export{l as data}; diff --git "a/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-eba8e5dc.js" "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-eba8e5dc.js" new file mode 100644 index 000000000..d832098cc --- /dev/null +++ "b/assets/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html-eba8e5dc.js" @@ -0,0 +1,628 @@ +import{_ as e,o as t,c as i,e as n}from"./app-2a91d8ab.js";const d={},u=n(`

    项目管理模块

    查看指定代码库的指定分析项目列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/
    +

    参数列表

    参数类型描述
    scm_url_or_namestr选填,代码库地址或者名称,支持模糊匹配
    scm_urlstr选填,代码库仓库匹配
    scopestr选填,过滤范围(my/subscribed/related_me),my表示我创建的,subscribed表示我关注的,related_me表示我有权限的

    返回结果

    {
    +    "count": 1,
    +    "next": null,
    +    "previous": null,
    +    "results": [
    +        {
    +            "id": 1,
    +            "name": "test_repo.git",
    +            "scm_url": "http://git.com/xxx/test_repo",
    +            "scm_type": "git",
    +            "branch_count": 1,
    +            "scheme_count": 1,
    +            "job_count": 1,
    +            "created_time": "2021-03-15 02:26:31.423674+00:00",
    +            "recent_active": {
    +                "id": 1,
    +                "branch_name": "master",
    +                "active_time": "2021-03-15T03:14:56.760427Z",
    +                "total_line_num": null,
    +                "code_line_num": null
    +            },
    +            "created_from": "codedog_web",
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "symbol": null
    +        }
    +    ]
    +}
    +

    查看已创建的授权信息

    GET /server/main/api/authen/scmallaccounts/
    +

    返回结果

    {
    +    "data": {
    +        "ssh": [
    +            {
    +                "id": 1,
    +                "user": {
    +                    "username": "CodeDog",
    +                    "nickname": "CodeDog",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "latest_login_time": "2022-10-22T15:30:30+08:00",
    +                    "org": null
    +                },
    +                "auth_origin": "CodeDog",
    +                "indentity": "xxx",
    +                "display_scm_platform": "tgit",
    +                "name": "gerrit",
    +                "scm_platform": 1,
    +                "scm_platform_desc": null
    +            }
    +        ],
    +        "account": [
    +            {
    +                "id": 1,
    +                "user": {
    +                    "username": "CodeDog",
    +                    "nickname": "CodeDog",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "latest_login_time": "2022-10-22T15:30:30+08:00",
    +                    "org": null
    +                },
    +                "auth_origin": "CodeDog",
    +                "display_scm_platform": "tgit",
    +                "scm_username": "CodeDog",
    +                "scm_platform": 1,
    +                "scm_platform_desc": null
    +            }
    +        ],
    +        "oauth": [
    +            {
    +                "id": 1,
    +                "user": {
    +                    "username": "CodeDog",
    +                    "nickname": "CodeDog",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "latest_login_time": "2022-10-22T15:30:30+08:00",
    +                    "org": null
    +                },
    +                "auth_origin": "CodeDog",
    +                "scm_platform_name": "tgit"
    +            }
    +        ],
    +    }
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    登记代码库

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/
    +

    参数列表

    参数类型描述
    scm_urlstr必填,代码库地址
    scm_typestr必填,git或svn
    ssh_urlstr选填,代码库SSH地址
    namestr选填, 代码库名称
    scm_authdict选填,代码库授权

    例子:

    {
    +    "scm_url": "https://github.com/Tencent/CodeAnalysis",
    +    "scm_type": "git",
    +    "name": "CodeAnalysis",
    +    "scm_auth": {
    +        # 通过 查看已创建的授权信息 接口获取到对应的凭证id,scm_account、scm_oauth、scm_ssh 只需填一个
    +        "scm_account": account_id,
    +        "scm_ssh": ssh_id,
    +        "scm_oauth": oauth_id
    +    }
    +}
    +

    返回结果

    {
    +    "data":{
    +        "id": 1,
    +        "name": "CodeAnalysis",
    +        "scm_url": "http://github.com/Tencent/CodeAnalysis",
    +        "scm_type": "git",
    +        "branch_count": 0,
    +        "scheme_count": 0,
    +        "job_count": 0,
    +        "created_time": "2022-10-22T16:30:30+08:00",
    +        "recent_active": {
    +        },
    +        "created_from": "codedog_web",
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "symbol": null
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库详情

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/
    +

    返回结果

    {
    +    "data":{
    +        "id": 1,
    +        "name": "test_repo.git",
    +        "scm_url": "http://git.com/xxx/test_repo",
    +        "scm_type": "git",
    +        "branch_count": 1,
    +        "scheme_count": 1,
    +        "job_count": 1,
    +        "created_time": "2021-03-15 02:26:31.423674+00:00",
    +        "recent_active": {
    +            "id": 1,
    +            "branch_name": "master",
    +            "active_time": "2021-03-15T03:14:56.760427Z",
    +            "total_line_num": null,
    +            "code_line_num": null
    +        },
    +        "created_from": "codedog_web",
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "symbol": null
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的不同分支的列表接口

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/branches/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "branch": "master",
    +                "schemes": [
    +                    {
    +                        "project_id": 1,
    +                        "scan_scheme_id": 1,
    +                        "scan_scheme_name": "默认"
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的分析项目列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    参数列表

    参数类型描述
    branchstr选填,分支名称
    scan_schemeint选填,扫描方案名称
    scan_scheme__statusint选填,扫描方案状态,1为活跃,2为废弃
    branch_or_schemestr选填,分支名称/扫描方案名称
    statusint选填,项目状态筛选,1表示活跃,2表示失活,3表示关闭

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "creator": {
    +                    "username": "username",
    +                    "nickname": "nickname",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "org": 1
    +                },
    +                "created_time": "2021-01-28 02:27:26.256015+00:00",
    +                "modifier": null,
    +                "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +                "deleter": null,
    +                "deleted_time": null,
    +                "scan_scheme": {
    +                    "id": 1,
    +                    "creator": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    },
    +                    "created_time": "2021-01-28 02:27:26.209661+00:00",
    +                    "modifier": null,
    +                    "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +                    "deleter": null,
    +                    "deleted_time": null,
    +                    "languages": [
    +                        "python"
    +                    ],
    +                    "tag": "TCA_Linux",
    +                    "refer_scheme_info": null,
    +                    "name": "默认",
    +                    "description": null,
    +                    "default_flag": true,
    +                    "created_from": "web",
    +                    "job_runtime_limit": 600,
    +                    "ignore_merged_issue": false,
    +                    "ignore_branch_issue": null,
    +                    "ignore_submodule_clone": false,
    +                    "ignore_submodule_issue": true,
    +                    "issue_global_ignore": false,
    +                    "daily_save": false,
    +                    "lfs_flag": null,
    +                    "webhook_flag": false,
    +                    "issue_revision_merge_flag": false,
    +                    "status": 1,
    +                    "scheme_key": null,
    +                    "repo": 1
    +                },
    +                "branch": "master",
    +                "status": 1,
    +                "created_from": "codedog_web",
    +                "repo": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    创建指定代码库的指定分析项目

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    参数列表

    参数类型描述
    scan_scheme_idint和global_scheme_id二选一进行填写,当前代码库的扫描方案编号
    global_scheme_idint和scan_scheme_id二选一进行填写,扫描方案模板编号
    custom_scheme_namestr选填,自定义方案名称
    branchstr必填,分支
    created_fromstr选填,创建渠道,用于区分不同运行场景

    返回结果

    {
    +    "data": {
    +        "id":1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.256015+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "repo": {
    +            "id": 1,
    +            "name": "test_demo.git",
    +            "scm_url": "http://github.com/xxxx/test_demo.git",
    +            "scm_type": "git",
    +            "scm_auth": {
    +                "id": 1,
    +                "scm_account": null,
    +                "scm_oauth": null,
    +                "scm_ssh": {
    +                    "id": 1,
    +                    "name": "1",
    +                    "scm_platform": 1,
    +                    "scm_platform_desc": null,
    +                    "user": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    }
    +                },
    +                "auth_type": "ssh_token",
    +                "created_time": "2021-01-28T10:26:31.453389+08:00",
    +                "modified_time": "2021-01-28T10:26:31.453417+08:00"
    +            },
    +            "symbol": null
    +        },
    +        "scan_scheme": {
    +            "id": 1,
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "created_time": "2021-01-28 02:27:26.209661+00:00",
    +            "modifier": null,
    +            "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +            "deleter": null,
    +            "deleted_time": null,
    +            "languages": [
    +                "python"
    +            ],
    +            "tag": "TCA_Linux",
    +            "refer_scheme_info": null,
    +            "name": "默认",
    +            "description": null,
    +            "default_flag": true,
    +            "created_from": "web",
    +            "job_runtime_limit": 600,
    +            "ignore_merged_issue": false,
    +            "ignore_branch_issue": null,
    +            "ignore_submodule_clone": false,
    +            "ignore_submodule_issue": true,
    +            "issue_global_ignore": false,
    +            "daily_save": false,
    +            "lfs_flag": null,
    +            "webhook_flag": false,
    +            "issue_revision_merge_flag": false,
    +            "status": 1,
    +            "scheme_key": null,
    +            "repo": 1
    +        },
    +        "branch": "master",
    +        "status": 1,
    +        "created_from": "tca_web"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的指定分析项目

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id":1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.256015+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "repo": {
    +            "id": 1,
    +            "name": "test_demo.git",
    +            "scm_url": "http://github.com/xxxx/test_demo.git",
    +            "scm_type": "git",
    +            "scm_auth": {
    +                "id": 1,
    +                "scm_account": null,
    +                "scm_oauth": null,
    +                "scm_ssh": {
    +                    "id": 1,
    +                    "name": "1",
    +                    "scm_platform": 1,
    +                    "scm_platform_desc": null,
    +                    "user": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    }
    +                },
    +                "auth_type": "ssh_token",
    +                "created_time": "2021-01-28T10:26:31.453389+08:00",
    +                "modified_time": "2021-01-28T10:26:31.453417+08:00"
    +            },
    +            "symbol": null
    +        },
    +        "scan_scheme": {
    +            "id": 1,
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "created_time": "2021-01-28 02:27:26.209661+00:00",
    +            "modifier": null,
    +            "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +            "deleter": null,
    +            "deleted_time": null,
    +            "languages": [
    +                "python"
    +            ],
    +            "tag": "TCA_Linux",
    +            "refer_scheme_info": null,
    +            "name": "默认",
    +            "description": null,
    +            "default_flag": true,
    +            "created_from": "web",
    +            "job_runtime_limit": 600,
    +            "ignore_merged_issue": false,
    +            "ignore_branch_issue": null,
    +            "ignore_submodule_clone": false,
    +            "ignore_submodule_issue": true,
    +            "issue_global_ignore": false,
    +            "daily_save": false,
    +            "lfs_flag": null,
    +            "webhook_flag": false,
    +            "issue_revision_merge_flag": false,
    +            "status": 1,
    +            "scheme_key": null,
    +            "repo": 1
    +        },
    +        "branch": "master",
    +        "status": 1,
    +        "created_from": "tca_web"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的扫描方案列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/
    +

    参数列表

    参数类型描述
    namestr选填,扫描方案名称
    statusint选填,扫描方案状态,1为活跃,2为废弃

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "creator": {
    +                    "username": "username",
    +                    "nickname": "nickname",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "org": 1
    +                },
    +                "created_time": "2021-01-28 02:27:26.209661+00:00",
    +                "modifier": null,
    +                "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +                "deleter": null,
    +                "deleted_time": null,
    +                "languages": [
    +                    "python"
    +                ],
    +                "tag": "TCA_Linux",
    +                "refer_scheme": null,
    +                "name": "默认",
    +                "description": null,
    +                "default_flag": true,
    +                "created_from": "web",
    +                "job_runtime_limit": 600,
    +                "ignore_merged_issue": false,
    +                "ignore_branch_issue": null,
    +                "ignore_submodule_clone": false,
    +                "ignore_submodule_issue": true,
    +                "issue_global_ignore": false,
    +                "daily_save": false,
    +                "lfs_flag": null,
    +                "issue_revision_merge_flag": false,
    +                "status": 1,
    +                "repo": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的指定扫描方案

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/basicconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.209661+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "languages": [
    +            "python"
    +        ],
    +        "tag": "TCA_Linux",
    +        "refer_scheme": null,
    +        "name": "默认",
    +        "description": null,
    +        "default_flag": true,
    +        "created_from": "web",
    +        "job_runtime_limit": 600,
    +        "ignore_merged_issue": false,
    +        "ignore_branch_issue": null,
    +        "ignore_submodule_clone": false,
    +        "ignore_submodule_issue": true,
    +        "issue_global_ignore": false,
    +        "daily_save": false,
    +        "lfs_flag": null,
    +        "issue_revision_merge_flag": false,
    +        "status": 1,
    +        "repo": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/basicconf/
    +

    参数列表

    参数类型描述
    languageslist选填,代码语言
    tagstr选填,执行标签,目前只支持 CodeDog_Linux
    namestr必填,方案名称
    descriptionstr选填,方案描述
    default_flagbool选填,默认方案标志,一个代码库只能有一个默认方案
    job_runtime_limitint选填,任务执行超时时间,默认为600分钟
    ignore_merged_issuebool选填,忽略合入的问题
    ignore_branch_issuestr选填,过滤参考分支引入的问题
    ignore_submodule_clonebool选填,不拉取子模块扫描,True表示不拉取,False表示拉取
    ignore_submodule_issuebool选填,忽略子模块引入的问题,True表示忽略,False表示不忽略
    issue_global_ignorebool选填,问题全局忽略
    daily_savebool选填,每次扫描原始数据存储,默认存储7天
    lfs_flagbool选填,拉取lfs模块开关
    issue_revision_merge_flagbool选填,"是否开启Issue按引入版本号聚合开关
    statusint选填,方案状态,1表示活跃,2表示废弃

    返回结果

    查看指定代码库的指定扫描方案的返回结果一致

    查看指定代码库的扫描方案的代码扫描配置

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/lintconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "enabled": true,
    +        "checkprofile": {
    +            "id": 1,
    +            "profile_type": 1,
    +            "custom_checkpackage": 1,
    +            "checkpackages": [
    +                1
    +            ]
    +        },
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的代码扫描配置

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/lintconf/
    +

    参数列表

    参数类型描述
    enabledbool必填,是否开启代码扫描

    返回结果

    指定代码库的指定方案的代码扫描配置的返回结果一致

    查看指定代码库的扫描方案的代码度量配置

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "cc_scan_enabled": false,
    +        "min_ccn": 20,
    +        "dup_scan_enabled": false,
    +        "dup_block_length_min": 120,
    +        "dup_block_length_max": null,
    +        "dup_min_dup_times": 2,
    +        "dup_max_dup_times": null,
    +        "dup_min_midd_rate": 5,
    +        "dup_min_high_rate": 11,
    +        "dup_min_exhi_rate": 20,
    +        "dup_issue_limit": 1000,
    +        "cloc_scan_enabled": false,
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的代码度量配置

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    参数列表

    参数类型描述
    cc_scan_enabledbool选填,圈复杂度扫描开关
    min_ccnint选填,最小圈复杂度
    dup_scan_enabledbool选填,重复代码扫描开关
    dup_block_length_minint选填,重复块最小长度
    dup_block_length_maxint选填,重复块最大长度
    dup_max_dup_timesint选填,最大重复次数
    dup_min_midd_rateint选填,中风险最小重复率
    dup_min_high_rateint选填,高风险最小重复率
    dup_min_exhi_rateint选填,极高风险风险最小重复率
    dup_issue_limitint选填,上报重复代码块数上限
    cloc_scan_enabledboolean选填,代码统计扫描开关

    返回结果

    指定代码库的指定方案的代码度量配置的返回结果一致

    查看指定代码库的扫描方案的过滤路径列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "dir_path": "test/*",
    +                "path_type": 1,
    +                "scan_type": 1,
    +                "scan_scheme": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    创建指定代码库的指定方案的过滤路径列表

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/
    +

    参数列表

    参数类型描述
    dir_pathstr必填,指定过滤路径
    path_typeint选填,路径格式,1表示通配符,2表示正则表达式,默认为通配符
    scan_typeint选填,扫描类型,1表示包含,2表示排除

    返回结果

    {
    +    "data": {
    +        "id": 13,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 36
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    查看指定代码库的扫描方案的指定过滤路径

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的指定过滤路径

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    参数列表

    参数类型描述
    dir_pathstr必填,指定过滤路径
    path_typeint选填,路径格式,1表示通配符,2表示正则表达式,默认为通配符
    scan_typeint选填,扫描类型,1表示包含,2表示排除

    返回结果

    {
    +    "data": {
    +        "id": 13,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 36
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    删除指定代码库的指定方案的指定过滤路径

    DELETE /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    返回结果

    `,103),s=[u];function a(l,o){return t(),i("div",null,s)}const v=e(d,[["render",a],["__file","项目管理模块接口.html.vue"]]);export{v as default}; diff --git a/en/advanced/install_mysql_on_centos.html b/en/advanced/install_mysql_on_centos.html new file mode 100644 index 000000000..ad655d145 --- /dev/null +++ b/en/advanced/install_mysql_on_centos.html @@ -0,0 +1,61 @@ + + + + + + + + + 在 CentOS 安装 MySQL | Tencent Cloud Code Analysis + + + + +

    在 CentOS 安装 MySQL

    注意

    本文档仅供参考,不适用于正式环境部署,正式环境建议使用专业的MySQL服务(比如腾讯云的MySQL产品open in new window

    环境

    CentOS 7.3 版本

    安装 mysql yum源

    wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
    +yum localinstall mysql57-community-release-el7-11.noarch.rpm
    +

    安装成功后,查看MySQL版本:

    yum repolist all | grep mysql
    +

    输出结果:

    mysql-cluster-7.5-community/x86_64   MySQL Cluster 7.5 Community    禁用
    +mysql-cluster-7.5-community-source   MySQL Cluster 7.5 Community -  禁用
    +mysql-cluster-7.6-community/x86_64   MySQL Cluster 7.6 Community    禁用
    +mysql-cluster-7.6-community-source   MySQL Cluster 7.6 Community -  禁用
    +!mysql-connectors-community/x86_64   MySQL Connectors Community     启用:    221
    +mysql-connectors-community-source    MySQL Connectors Community - S 禁用
    +!mysql-tools-community/x86_64        MySQL Tools Community          启用:    135
    +mysql-tools-community-source         MySQL Tools Community - Source 禁用
    +mysql-tools-preview/x86_64           MySQL Tools Preview            禁用
    +mysql-tools-preview-source           MySQL Tools Preview - Source   禁用
    +mysql55-community/x86_64             MySQL 5.5 Community Server     禁用
    +mysql55-community-source             MySQL 5.5 Community Server - S 禁用
    +mysql56-community/x86_64             MySQL 5.6 Community Server     禁用
    +mysql56-community-source             MySQL 5.6 Community Server - S 禁用
    +!mysql57-community/x86_64            MySQL 5.7 Community Server     启用:    544
    +mysql57-community-source             MySQL 5.7 Community Server - S 禁用
    +mysql80-community/x86_64             MySQL 8.0 Community Server     禁用
    +mysql80-community-source             MySQL 8.0 Community Server - S 禁用
    +

    安装MySQL

    yum install mysql-community-server
    +

    1.如遇以下报错,可尝试运行yum install mysql-community-server --nogpgcheck安装
    Public key for mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm is not installed
    Failing package is: mysql-community-libs-compat-5.7.37-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    2.如遇以下报错,可执行yum module disable mysql后重试安装
    All matches were filtered out by modular filtering for argument: mysql-community-serve
    Error: Unable to find a match: mysql-community-server

    配置MySQL服务

    安装好的MySQL配置文件路径是/etc/my.cnf,这里可以根据需要调整,比如可以调整:

    • datadir:MySQL存放数据的路径,如果有额外挂载磁盘,可以考虑指向相关路径

    启动MySQL服务

    systemctl start mysqld
    +

    确认MySQL正常启动

    systemctl status mysqld
    +

    查看生成 MySQL root用户临时密码:

    grep 'temporary password' /var/log/mysqld.log
    +

    修改root用户密码

    连接MySQL服务

    $ mysql -uroot -p
    +# 输出上述查询到的临时密码
    +

    修改root用户的密码(下面是改成 Password@2021,这里根据自行需要进行调整):

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password@2021';
    +

    参考文档

    + + + diff --git a/en/advanced/install_nginx_from_source.html b/en/advanced/install_nginx_from_source.html new file mode 100644 index 000000000..a716afde9 --- /dev/null +++ b/en/advanced/install_nginx_from_source.html @@ -0,0 +1,103 @@ + + + + + + + + + 源码安装 Nginx | Tencent Cloud Code Analysis + + + + +

    源码安装 Nginx

    运行环境

    1. 基于x86_64的CentOS
    2. 基于aarch64(鲲鹏920)的UOS V20
    3. 基于aarch64(飞腾2000)的TencentOS Server

    环境准备

    安装编译打包需要的工具

    yum -y install gcc zlib-devel pcre-devel bzip2-devel openssl-devel readline-devel
    +

    Ubuntu: apt install gcc libssl-dev zlib1g-dev libpcre3-dev libbz2-dev libreadline-dev

    下载源码

    wget http://nginx.org/download/nginx-1.20.2.tar.gz
    +

    解压安装

    # 解压
    +$ tar zvxf nginx-1.20.2.tar.gz -C /usr/local/src
    +
    +# 进入源码目录
    +$ cd /usr/local/src/nginx-1.20.2
    +
    +# 配置
    +$ ./configure \
    +--sbin-path=/usr/local/nginx/nginx \
    +--conf-path=/etc/nginx/nginx.conf \
    +--pid-path=/run/nginx.pid \
    +--with-stream \
    +--with-http_ssl_module --with-http_v2_module --with-http_auth_request_module
    +
    +# 构建nginx
    +$ make -j4
    +$ make install
    +$ make clean
    +
    +# 建立软链
    +$ ln -s /usr/local/nginx/nginx /usr/local/bin/nginx
    +

    添加nginx配置文件

    mkdir /etc/nginx/conf.d/
    +vi /etc/nginx/nginx.conf
    +

    检查nginx.conf配置文件:

    1. 检查pid /run/nginx.pid,如果缺失或被注释则加上,加上位置如下所示:
    2. 检查是否缺失这一行include conf.d/*.conf;,如果缺失则加上,加上位置如下所示:
    # ...省略内容
    +#pid        logs/nginx.pid;  # 默认有的
    +pid         /run/nginx.pid;
    +
    +events {
    +    # ...省略内容
    +}
    +
    +# ...省略内容
    +
    +http {
    +    # ...省略内容
    +    # 
    +    include conf.d/*.conf;    
    +    server {
    +        # ...省略内容
    +    }
    +}
    +
    +

    后续可以将nginx配置文件放置到/etc/nginx/conf.d/目录下

    配置开机自动启动

    vim /usr/lib/systemd/system/nginx.service
    +

    输入以下内容:

    [Unit]
    +Description=The nginx HTTP and reverse proxy server
    +After=network-online.target remote-fs.target nss-lookup.target
    +Wants=network-online.target
    +
    +[Service]
    +Type=forking
    +PIDFile=/run/nginx.pid
    +# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
    +# SELinux context. This might happen when running `nginx -t` from the cmdline.
    +# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
    +ExecStartPre=/bin/rm -f /run/nginx.pid
    +ExecStartPre=/usr/local/bin/nginx -t
    +ExecStart=/usr/local/bin/nginx
    +ExecReload=/usr/local/bin/nginx -s reload
    +ExecStop=/usr/local/bin/nginx -s stop
    +KillSignal=SIGQUIT
    +TimeoutStopSec=5
    +KillMode=process
    +PrivateTmp=true
    +
    +[Install]
    +WantedBy=multi-user.target
    +

    启动nginx:

    systemctl start nginx
    +

    开机自动启动nginx:

    systemctl enable nginx
    +

    参考文档

    + + + diff --git a/en/advanced/install_python37_on_centos.html b/en/advanced/install_python37_on_centos.html new file mode 100644 index 000000000..bba88f164 --- /dev/null +++ b/en/advanced/install_python37_on_centos.html @@ -0,0 +1,95 @@ + + + + + + + + + 在 CentOS 安装 Python3.7 | Tencent Cloud Code Analysis + + + + +

    在 CentOS 安装 Python3.7

    下载Python源码包

    wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +

    安装前准备

    安装依赖组件

    yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel xz-devel
    +

    解压安装

    # 解压到/usr/local/src目录
    +$ tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +$ cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +$ make -j8
    +# 安装Python
    +$ make install
    +# 清理编译产出的中间文件
    +$ make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +

    检查

    检查Python版本是否安装成功

    $ python --version
    +Python 3.7.12  # 正常输出,表示安装成功
    +

    注:

    1. 链接到/usr/local/bin/目录不会影响系统软件(比如yum)的使用,因为 yum 工具指定的Python路径是/usr/bin/python
    2. 一般情况下,PATH配置是先/usr/local/bin/usr/bin
    3. 检查python -v输出结果是否为Python 3.7.12版本,如果不是该版本,可能影响后续依赖安装和服务运行

    pypi下载源配置

    pip默认是到pypi官方源下载第三方依赖包,下载速度可能会比较慢,可以考虑调整为腾讯云的pypi下载源,调整方式:

    mkdir ~/.pip/
    +echo "extra-index-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +

    一键安装脚本

    以下脚本内容是上面的步骤集合,省去了复制粘贴的重复动作。

    1. 创建文件 install_py37.sh,写入以下 shell 脚本
    2. 赋予执行权限,chmox +x install_py37.sh
    3. 执行脚本,./install_py37.sh
    #!/bin/env bash
    +
    +## 下载 Python 源码,如果已下载源码在脚本当前目录下,可注释跳过下载步骤
    +wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +
    +## 安装编译依赖组件
    +yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel xz-devel
    +
    +## 解压安装
    +# 解压到/usr/local/src目录
    +tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +make -j8
    +# 安装Python
    +make install
    +# 清理编译产出的中间文件
    +make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +ldconfig
    +
    +## 检查Python版本是否安装成功
    +echo -e "\033[1;42;37m[$(date "+%Y/%m/%d %H:%M:%S")] [Check]: 检查Python版本\033[0m"
    +python --version
    +echo -e "\033[1;42;37m[$(date "+%Y/%m/%d %H:%M:%S")] [Check]: 检查Python版本\033[0m"
    +
    +## pypi下载源配置
    +mkdir ~/.pip/
    +echo "extra-index-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +
    + + + diff --git a/en/advanced/install_python37_on_ubuntu.html b/en/advanced/install_python37_on_ubuntu.html new file mode 100644 index 000000000..fd51f2be2 --- /dev/null +++ b/en/advanced/install_python37_on_ubuntu.html @@ -0,0 +1,59 @@ + + + + + + + + + 在 Ubuntu 安装 Python3.7 | Tencent Cloud Code Analysis + + + + +

    在 Ubuntu 安装 Python3.7

    注:当前Ubuntu版本为18.04

    下载Python源码包

    wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +

    安装前准备

    安装依赖组件

    apt-get update
    +apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev wget libbz2-dev tk-dev gcc make
    +

    解压安装

    # 解压到/usr/local/src目录
    +$ tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +$ cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +$ make -j8
    +# 安装Python
    +$ make install
    +# 清理编译产出的中间文件
    +$ make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +

    检查

    检查Python版本是否安装成功

    $ python --version
    +Python 3.7.12  # 正常输出,表示安装成功
    +

    注:

    1. 链接到/usr/local/bin/目录不会影响系统软件
    2. 一般情况下,PATH配置是先/usr/local/bin/usr/bin
    3. 检查python -v输出结果是否为Python 3.7.12版本,如果不是该版本,可能影响后续依赖安装和服务运行

    pypi下载源配置

    pip默认是到pypi官方源下载第三方依赖包,下载速度可能会比较慢,可以考虑调整为腾讯云的pypi下载源,调整方式:

    mkdir ~/.pip/
    +echo "[global]\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +
    + + + diff --git a/en/advanced/install_redis_from_source.html b/en/advanced/install_redis_from_source.html new file mode 100644 index 000000000..bd768d282 --- /dev/null +++ b/en/advanced/install_redis_from_source.html @@ -0,0 +1,77 @@ + + + + + + + + + 源码安装 Redis | Tencent Cloud Code Analysis + + + + +

    源码安装 Redis

    运行环境

    1. 基于x86_64的CentOS
    2. 基于鲲鹏920(aarch64)的UOS V20
    3. 基于飞腾2000(aarch64)的TencentOS Server

    环境准备

    安装编译打包需要的工具

    yum install -y gcc make tcl wget
    +

    下载源码

    wget http://download.redis.io/releases/redis-5.0.4.tar.gz
    +

    编译安装

    # 解压
    +$ tar zvxf redis-5.0.4.tar.gz -C /usr/local/src
    +
    +# 进入源码目录
    +$ cd /usr/local/src/redis-5.0.4
    +
    +# 构建redis依赖库
    +$ cd deps; make -j4 hiredis jemalloc linenoise lua
    +$ cd ..
    +
    +# 构建redis
    +$ make -j4
    +$ make install
    +$ make clean
    +

    安装后,可以在/usr/local/src/redis-5.0.4/src目录和/usr/local/bin/目录下找到redis-serverredis-cli两个文件

    调整配置

    cp /usr/local/src/redis/redis.conf  /etc/redis.conf
    +vim /usr/local/src/redis/redis.conf 
    +
    # 设置Redis密码
    +requirepass 123456
    +
    +# 将 daemonize no 调整为 daemonize yes,将redis-server调整为默认后台启动
    +daemonize yes
    +
    +# 配置日志
    +logfile '/var/log/redis/redis-server.log'
    +

    启动服务

    redis-server /etc/redis.conf 
    +

    配置开机自动启动

    vim /etc/systemd/system/redis.service
    +

    输入以下内容:

    [Unit]
    +Description=redis-server
    +After=network.target
    +
    +[Service]
    +Type=forking
    +ExecStart=/usr/local/bin/redis-server /etc/redis.conf
    +ExecStop=/usr/local/bin/redis-cli shutdown
    +Restart=always
    +
    +PrivateTmp=true
    +
    +[Install]
    +WantedBy=multi-user.target
    +

    启动redis-server:

    systemctl start redis
    +

    开机自动启动redis:

    systemctl enable redis
    +

    参考文档

    + + + diff --git a/en/advanced/install_redis_on_centos.html b/en/advanced/install_redis_on_centos.html new file mode 100644 index 000000000..390e3fbd5 --- /dev/null +++ b/en/advanced/install_redis_on_centos.html @@ -0,0 +1,45 @@ + + + + + + + + + 在 CentOS 安装 Redis | Tencent Cloud Code Analysis + + + + +

    在 CentOS 安装 Redis

    注意

    本文档仅供参考,不适用于正式环境部署,正式环境建议使用专业的Redis服务(比如腾讯云的Redis产品open in new window

    环境

    CentOS 7.3 版本

    yum 安装 redis

    yum install redis
    +

    注:安装redis可能会出现"no package redis available"的错误提示,请执行yum install epel-release后重试redis安装命令。

    修改redis密码

    $ vi /etc/redis.conf
    +
    +# 找到 requirepass foobared
    +# 复制一行并根据自己需要调整密码,比如
    +requirepass tca123
    +

    启动redis

    systemctl start redis
    +

    查看redis运行状态

    systemctl status redis
    +

    访问redis

    $ redis-cli
    +
    +127.0.0.1:6379> auth tca123
    +OK # 鉴权通过
    +
    + + + diff --git "a/en/advanced/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html" "b/en/advanced/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html" new file mode 100644 index 000000000..946a9a5ba --- /dev/null +++ "b/en/advanced/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html" @@ -0,0 +1,33 @@ + + + + + + + + + 任务分布式执行 | Tencent Cloud Code Analysis + + + + +

    任务分布式执行

    适用场景

    • 以往的单机器单进程,性能比较低,工具排队等待时间过长。希望通过并行执行分析来提高分析效率。

    • 希望尽量使用公共资源或使用专机资源。

    为了满足以上需求,TCA已经进行如下支持:

    • 支持工具在多台机器上并行执行。

    • 支持指定工具在指定的机器上运行。

    • 支持与本地启动的任务衔接,加速本地任务扫描。

    • 配套任务状态监控能力,及时重置初始化超时或机器掉线的任务。

    TIP

    TCA 客户端除了通过 localscan 命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。和本地分析一样,需要先安装环境和必要的工具,并配置好服务端地址。

    常驻节点配置

    请参考客户端-常驻节点分析

    + + + diff --git "a/en/advanced/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html" "b/en/advanced/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html" new file mode 100644 index 000000000..ff9d79562 --- /dev/null +++ "b/en/advanced/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html" @@ -0,0 +1,101 @@ + + + + + + + + + 使用自建工具git库 | Tencent Cloud Code Analysis + + + + +

    使用自建工具git库

    为什么要自建工具库

    • Github 对lfs流量有控制导致部分工具拉不下来
    • Github 下载速度有差异,为保证拉取速度建议使用流畅的工具库

    如何使用其他工具库

    1. 工具相对应的仓库地址,环境变量全部存储在puppy-tools-config仓库中,可通过fork该仓库,修改指定的工具仓库
    2. 修改client/config.ini中的字段指定puppy-tools-config,如下
    [COMMON]
    +; [必填]工具配置库git地址
    +; 如果github网络慢,建议修改为腾讯工蜂地址:https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git
    +; 这里可以修改为自己维护的puppy-tools-config
    +TOOL_CONFIG_URL=
    +PASSWORD_KEY=
    +; [可选]日志级别,默认为info级别,设置为True则调整为debug级别
    +DEBUG=
    +; [可选]是否使用本地工具目录,默认为False,如果设置为True,不从git拉取(需要事先准备好工具,存放到tools目录下)
    +USE_LOCAL_TOOL=
    +
    +[TOOL_LOAD_ACCOUNT]
    +; [可选]拉取工具库的账号密码
    +; 如果TOOL_CONFIG_URL使用的是腾讯工蜂,账号密码必填(如果没有,可以先去https://git.code.tencent.com注册)
    +USERNAME=
    +PASSWORD=
    +
    1. 修改puppy-tools-config,如下例
    ; ---------------------------------------------------------------------------------------------------------------------
    +; 配置文件填写说明:
    +; 填写过程中,如果有多个值,用英文分号分隔
    +; [env_path]    - 环境变量路径定义,基于tools目录的相对路径,比如:PYLINT_HOME : puppy_tools_common/pylint-1.4.5
    +; [env_value]   - 环境变量值定义,比如:GIT_SSL_NO_VERIFY : 1
    +; [tool_url]    - 工具库地址定义,格式:工具名:url,比如 CHECKSTYLE : http://xxxxxx.git
    +; [common]      - 公共环境配置,比如git环境变量等, 包含以下4个字段
    +;                 env_path  - 需要的环境变量路径,填写[env_path]中的KEY值,比如 env_path : ANDROID_HOME;CHECKSTYLE_HOME
    +;                 env_value - 需要的环境变量值,填写[env_value]中的KEY值,比如 env_value : GIT_SSL_NO_VERIFY
    +;                 path      - 需要加到path环境变量中的路径,基于tools目录的相对路径,推荐使用变量格式,比如 path : ${env_path:PYLINT_HOME}/bin
    +;                 tool_url  - 需要拉取的工具库,多个地址用英文分号分隔,推荐使用变量格式,比如 tool_url : ${tool_url:PYLINT}
    +; [工具名]       - 各工具配置,工具名需要与tool目录下的模块名匹配,字段格式参考[common]
    +; ---------------------------------------------------------------------------------------------------------------------
    +[base_value]
    +git_url=https://github.com/TCATools
    +
    +;------------------
    +;  1.环境变量路径定义
    +;------------------
    +; 用来记录工具路径,会在工具执行时写入到环境变量中
    +[env_path]
    +CPPLINT_HOME      : cpplint
    +
    +;------------------
    +;  2.环境变量值定义
    +;------------------
    +; 记录部分环境变量并在执行时写入环境变量
    +[env_value]
    +PYTHON_VERSION    : 3
    +
    +
    +;------------------
    +;  3.工具git库定义
    +;------------------
    +; 拉工具的仓库地址
    +[tool_url]
    +CPPLINT       : ${base_value:git_url}/cpplint.git
    +
    +;------------------
    +;  5.各个工具配置
    +;------------------
    +; 整合工具配置
    +[cpplint]
    +env_path  : CPPLINT_HOME
    +env_value : PYTHON_VERSION
    +path      : ${env_path:CPPLINT_HOME}
    +tool_url  : ${tool_url:CPPLINT}
    +
    1. 修改拉取工具需要的账号密码 账号密码需在client/config.ini中指定
    [TOOL_LOAD_ACCOUNT]
    +; [可选]拉取工具库的账号密码
    +; 如果使用的工具仓库必须账号密码才能拉取则必须填写
    +USERNAME=
    +PASSWORD=
    +

    其他工具库建议

    1. 腾讯工蜂open in new window
    2. 自建GitLabopen in new window
    + + + diff --git "a/en/advanced/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html" "b/en/advanced/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html" new file mode 100644 index 000000000..683cc3465 --- /dev/null +++ "b/en/advanced/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html" @@ -0,0 +1,148 @@ + + + + + + + + + 源码集成代码分析工具 | Tencent Cloud Code Analysis + + + + +

    源码集成代码分析工具

    初识TCA任务执行机制

    1. TCA server在接收到开启分析的请求后根据所选规则生成对应的task_request,每个task_request对应一个工具的任务
    2. TCA server将task_request分发到能够执行该工具的机器
    3. TCA client在收到task_request后提取出本次任务的工具名也就是其中的task_name字段,字段对应于工具的name字段
    4. TCA client按照task_name在client中的tool目录查找对应python启动脚本
    5. 执行python启动脚本中的内容

    添加分析工具(以 tca_ql_php 为例)

    根据上述的任务机制添加工具需要做到以下几点

    1. 让server知道存在tca_ql_php工具及其所含的规则
    2. 让server知道哪些客户端可以执行tca_ql_php工具
    3. client下载/找到工具所在目录及需要的环境
    4. 让client知道tca_ql_php对应的启动脚本是什么

    如何让Server知道存在相应工具

    1. 找到server/projects/main/apps/scan_conf/management/commands/open_source目录

    2. 创建工具json文件,json文件名尽量对应工具名称方便查看

    3. json文件内容为(以 tca_ql_php 为例)

    [
    +    {
    +        "name": "tca_ql_php",
    +        "display_name": "Hades_PHP(展示名称用于前端展示使用)",
    +        "description": "工具描述",
    +        "license": "工具license",
    +        "libscheme_set": [], # 暂时不需要
    +        "task_processes": [
    +            "analyze",
    +            "datahandle",
    +            "compile"
    +        ],  # 工具进程,包含compile编译, analyze分析, datahandle数据处理
    +        "scan_app": "codelint",  # 代码分析统一为codelint
    +        "scm_url": "", # 暂时为空
    +        "run_cmd": "",
    +        "envs": null, # 是否需要特殊环境,这里无需填写
    +        "build_flag": false, # 是否需要编译命令才能运行
    +        "checkrule_set": [  # 工具包含的规则
    +            {
    +                "real_name": "deser",  # 规则名
    +                "display_name": "反序列化漏洞",  # 规则前端展示,考虑各工具规则名可能晦涩难懂,设置展示名称方便查找
    +                "severity": "error",  # 规则等级 从上到下分为 fatal, error, warning, info 四个等级
    +                "category": "security",  # 规则类别。correctness 功能 security安全 performance性能 usability可用性 accessibility无障碍化 i18n国际化 convention代码风格 other其他
    +                "rule_title": "反序列化漏洞",  # 一句话概括规则简介
    +                "rule_params": null,  # 规则参数
    +                "languages": [  # 支持语言
    +                    "php"
    +                ],
    +                "solution": "",  # 建议的解决方法
    +                "owner": "",
    +                "labels": [],
    +                "description": "",  # 规则详细介绍
    +            }
    +        ]
    +    }
    +]
    +
    1. server/projects/main/目录执行python manage.py loadcheckers --dir open_source tca_ql_php 加载工具进入数据库

    让server知道哪些客户端可以执行tca_ql_php工具

    1. 进入节点管理页面

    节点管理

    1. 选择其中一台机器 工具进程配置,勾选其工具进程

    工具进程

    client下载/找到工具所在目录及需要的环境

    1. 找到puppy-tool-config若没有额外配置则为默认代码库https://github.com/TCATools/puppy-tools-config.gitopen in new window
    2. 修改其中的 ini 配置文件,每个操作系统对应一个ini
    3. 以 tca_ql_php 为例需要做以下修改
    ; env_path 主要填写存放工具文件所在的相对目录,一般都存放/拉取在tools下,会在工具执行前加载到环境变量中提供使用
    +[env_path]
    +ZEUS_HOME   : Zeus
    +HADES_HOME  : Hades
    +
    +; toolz_url
    +[tool_url] 主要填写工具的git仓库,这里因为 tca_ql_php 直接使用tools下的目录所以不用再进行额外拉取也无需再写
    +CPPCHECK    : ${base_value:git_url}/linux-cppcheck-1.78
    +
    +; 各工具配置 以 tca_ql_php 为例
    +; env_path 填写上面需要加载的环境变量
    +; env_value 通用环境变量,一般无需填写如果有需求需要现在 [env_value] 中定义好再填写
    +; path 工具所在目录填写上面的定义
    +; tool_url 工具git仓库,使用本地相对目录故为空
    +[tca_ql_php]
    +env_path  : ZEUS_HOME;HADES_HOME
    +env_value :
    +path      : ${env_path:ZEUS_HOME};${env_path:HADES_HOME}
    +tool_url  : 
    +
    +

    让client知道tca_ql_php对应的启动脚本是什么

    1. 以上述步骤在client/tool目录添加脚本tca_ql_php.py作为启动脚本 注:启动脚本必须与工具名称相同

    2. 编写脚本

    脚本编写规范

    tca_ql_php为例

    
    +from task.codelintmodel import CodeLintModel
    +from util.logutil import LogPrinter
    +from util.subprocc import SubProcController
    +
    +logger = LogPrinter()
    +
    +
    +class TcaQlPHP(CodeLintModel):
    +    # 代码分析工具集成基类CodeLintModel
    +    def __init__(self, params):
    +        logger.info("找到工具了Q_Q")
    +        super().__init__(params)
    +
    +    def compile(self, params):
    +        logger.info("开始编译了Q_Q")
    +        build_cmd = params.get('build_cmd', None)  # 从params中获取编译命令, params内容可以在最后附录查看
    +        lang = "php"
    +        do_some_things()
    +
    +    def analyze(self, params):
    +        logger.info("开始分析了Q_Q")
    +        lang = "php"
    +        HADES_HOME = envs.get("HADES_HOME", None)
    +        output_json = "result.json"
    +        sp = SubProcController(
    +            command=["Hades", "analyze", "test.php", "-o", output_json],
    +            cwd=HADES_HOME,
    +            stdout_line_callback=subprocc_log,
    +            stderr_line_callback=subprocc_log,
    +        )
    +        sp.wait()  # 执行工具分析命令
    +        issues = []
    +        # 工具结果输出到output_json,具体工具可能有所不同
    +        if os.path.exists(output_json):
    +            with open(output_json, "r") as result_reader:
    +                result = json.load(result_reader)
    +                issues.extend(result)
    +        return issues
    +
    +tool = TcaQlPHP  # 必须,必须包含tool变量并且为该工具的类
    +
    1. 脚本必须包含analyze方法,如果有配置编译进程也需要相应的compile方法来做编译相关工作,datahandle函数不用自定义基类方法已经够用了。方法执行顺序为 compile -> analyze -> datahandle
    2. params参数为task_request中的task_params字段,具体字段将在最后附录进行说明
    3. anlyze方法必须有返回值,返回值为issue列表,issue格式为
    {
    +    "path": "文件相对路径",
    +    "line": "行号,int类型",
    +    "column": "列号, int类型,如果工具没有输出列号信息,可以用0代替",
    +    "msg": "提示信息",
    +    "rule": "规则名称,可以根据需要输出不同的规则名",
    +    "refs": [
    +        {
    +            "line": "回溯行号", 
    +            "msg": "提示信息", 
    +            "tag": "用一个词简要标记该行信息,比如uninit_member,member_decl等,如果没有也可以都写成一样的", 
    +            "path": "回溯行所在文件绝对路径"
    +        },
    +        ...
    +    ]
    +}
    +说明:
    +    refs:可选,记录问题回溯路径信息。比如当前文件的回溯路径其他的3行代码,可以将这三行的路径及提示信息,按顺序添加到refs数组中。
    +

    PR

    如果有意公开您添加的工具欢迎发起PR

    注:别忘了puppy-tool-config 也需要PR

    附录

    params 表格

    字段说明类型
    scan_languages语言字符串列表如 ["python", "php"]
    pre_cmd编译前置命令字符串
    build_cmd编译命令字符串
    envs额外环境变量字符串
    scm_last_revision上次成功分析的代码版本,增量使用字符串
    incr_scan是否为增量分析bool
    rules规则名称列表,只有规则名字符串列表
    rule_list详细的规则列表包含规则名和规则参数等字典列表
    checktool工具详细信息,执行一般用不到字典
    path_filters过滤路径字典
    scm_url代码库url字符串
    source_dir代码库本地目录字符串
    work_dir本次任务的work_dir目录字符串
    project_id分析项目idint
    repo_id仓库idint
    task_id任务idint
    job_id本次分析的idint
    + + + diff --git a/en/api/index.html b/en/api/index.html new file mode 100644 index 000000000..1daaf196f --- /dev/null +++ b/en/api/index.html @@ -0,0 +1,113 @@ + + + + + + + + + 接口调用说明 | Tencent Cloud Code Analysis + + + + +

    接口调用说明

    接口地址

    http://{host}/server/

    注:host 指当前浏览器访问该文档的 URL 域名部分。

    接口鉴权方式

    发起请求时,需要在头部中添加以下格式形式,对应的 value 请看下面获取方式

    {
    +  "Authorization": "当前user的token"
    +}
    +

    获取 token 位置(个人中心-个人令牌):

    API的个人令牌

    获取 org_sid 和 project_team 信息

    通过平台访问具体代码库扫描情况时,可从 URL 中获取对应 org_sid 和 project_team 字段,查看方式如下例子:

    代码库扫描地址:http://{host}/t/xxx/p/yyy/code-analysis/repos/1/projects?limit=10&offset=0

    其中,org_sid 为xxx字段,project_team 为 yyy字段

    Example

    import requests
    +# 假设:
    +# 当前域名为http://tca.com/,当前org_sid为helloworld
    +# 获取helloworld团队下的hellotca项目下登记的代码库
    +url="http://tca.com/server/main/api/orgs/helloworld/teams/hellotca/repos/?limit=12&offset=0"
    +headers = {
    +  "Authorization": token,
    +}
    +
    +response = requests.get(url, headers=headers)
    +print(response.json())
    +# 结果如下:
    +{
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 23,
    +                "name": "repo_name",
    +                "scm_url": "http://git.repo.com/group/repo_name",
    +                "scm_type": "git",
    +                "branch_count": 1,
    +                "scheme_count": 1,
    +                "job_count": 1,
    +                "created_time": "2021-05-14 02:34:44.509118+00:00",
    +                "recent_active": {
    +                    "id": 27,
    +                    "branch_name": "master",
    +                    "active_time": "2021-05-14 02:34:44.509118+00:00",
    +                    "total_line_num": 1,
    +                    "code_line_num": 1
    +                },
    +                "created_from": "tca",
    +                "creator": {
    +                    "username": "author",
    +                    "nickname": "author",
    +                    "status": 1,
    +                    "avatar": "url",
    +                    "org": "org_name"
    +                },
    +                "symbol": null,
    +                "scm_auth": {
    +                    "id": 1,
    +                    "scm_account": null,
    +                    "scm_oauth": null,
    +                    "scm_ssh": {
    +                        "id": 1,
    +                        "name": "test",
    +                        "scm_platform": 2,
    +                        "scm_platform_desc": null,
    +                        "user": {
    +                            "username": "username",
    +                            "nickname": "nickname",
    +                            "status": 1,
    +                            "avatar": "url",
    +                            "org": "org_name"
    +                        }
    +                    },
    +                    "auth_type": "ssh_token",
    +                    "created_time": "2021-05-14T10:34:44.552859+08:00",
    +                    "modified_time": "2021-05-14T10:34:44.552887+08:00"
    +                },
    +                "project_team": {
    +                    "name": "test",
    +                    "display_name": "测试",
    +                    "status": 1,
    +                    "org_sid": "test"
    +                }
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    分页方式

    平台返回的数据分页格式是使用limitoffset参数进行分页处理

    比如:server/main/api/orgs/<org_sid>/teams/?limit=12&offset=12获取得到的数据是从第 13 条开始获取

    + + + diff --git "a/en/api/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/en/api/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..3b2341613 --- /dev/null +++ "b/en/api/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,525 @@ + + + + + + + + + 代码度量数据管理 | Tencent Cloud Code Analysis + + + + +

    代码度量数据管理

    查看指定项目的圈复杂度文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccfiles/
    +

    参数列表

    参数类型描述
    statestr问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    scan_openint发现问题的扫描编号
    scan_closeint修复问题的扫描编号
    worseboolean圈复杂度是否恶化
    over_cc_sum_gteint圈复杂度总和最小值
    over_cc_sum_lteint圈复杂度总和最大值
    over_cc_avg_gteint平均圈复杂度最小值
    over_cc_avg_lteint平均圈复杂度总和最大值
    over_cc_func_count_gteint超标圈复杂度函数个数最小值
    over_cc_func_count_lteint超标圈复杂度函数个数最大值

    返回参数

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的圈复杂度文件问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccfiles/<file_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    ccn_gtestr圈复杂度最小值
    ccn_ltestr圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的圈复杂度问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccissues/
    +

    参数列表

    参数类型描述
    statusstr问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    ccn_gtestr圈复杂度最小值
    ccn_ltestr圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccfiles/
    +

    参数列表

    参数类型描述
    statestr问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    scan_open_idint发现问题的扫描编号
    scan_close_idint修复问题的扫描编号
    worseboolean圈复杂度是否恶化
    over_cc_sum_gteint圈复杂度总和最小值
    over_cc_sum_lteint圈复杂度总和最大值
    over_cc_avg_gteint平均圈复杂度最小值
    over_cc_avg_lteint平均圈复杂度总和最大值
    over_cc_func_count_gteint超标圈复杂度函数个数最小值
    over_cc_func_count_lteint超标圈复杂度函数个数最大值

    返回结果

    {
    +    "data": {
    +        "count": 32,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "tapd_url": null,
    +                "created_time": "2020-06-02T10:59:09.418250+08:00",
    +                "creator": null,
    +                "modified_time": "2020-06-03T16:17:40.892224+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "over_func_cc": 0,
    +                "over_cc_sum": 0,
    +                "over_cc_avg": 0,
    +                "over_cc_func_count": 0,
    +                "diff_over_func_cc": 0,
    +                "diff_over_cc_sum": 0,
    +                "diff_over_cc_avg": 0,
    +                "diff_over_cc_func_count": 0,
    +                "worse": false,
    +                "file_path": "test/demo.py",
    +                "state": 3,
    +                "change_type": 0,
    +                "last_modifier": "author1",
    +                "author": null,
    +                "related_modifiers": "author1;author2",
    +                "file_owners": null,
    +                "language": "python",
    +                "tapd_ws_id": null,
    +                "tapd_bug_id": null,
    +                "revision": null,
    +                "ci_time": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": 2
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度文件问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccfiles/<file_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    ccn_gtestr圈复杂度最小值
    ccn_ltestr圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    ccn_gtestr圈复杂度最小值
    ccn_ltestr圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的重复文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/
    +

    参数列表

    参数类型描述
    issue__statestr问题状态, 1为未处理,2为可忽略,3为关闭,可多选,格式为1,2,3
    change_typestr重复文件更改类型,add为新增,del为删除,mod为删除,可多选,格式为add,del,mod
    issue__ownerstr问题责任人
    last_modifierstr最近修改人
    file_pathstr文件路径
    duplicate_rate_gteint重复率最小值
    duplicate_rate_lteint重复率最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "issue": {
    +                    "id": 1,
    +                    "state": 1,
    +                    "owner": "author"
    +                },
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "issue_id": 1,
    +                "issue_state": 1,
    +                "issue_owner": "author",
    +                "dir_path": "test",
    +                "file_name": "demo.py",
    +                "file_path": "test/demo.py",
    +                "duplicate_rate": 4.63,
    +                "total_line_count": 259,
    +                "total_duplicate_line_count": 12,
    +                "distinct_hash_num": 1,
    +                "block_num": 1,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "scm_revision": "12345678abc",
    +                "is_latest": true
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +} 
    +

    查看指定项目的指定重复文件

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/<file_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "repo": 1,
    +        "issue": {
    +            "id": 1,
    +            "state": 1,
    +            "owner": "author"
    +        },
    +        "blocks": [
    +            {
    +                "id": 1,
    +                "duplicate_file": 1,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "duplicate_file_id": 1,
    +                "token_num": 120,
    +                "duplicate_times": 2,
    +                "duplicate_rate": 4.63,
    +                "start_line_num": 216,
    +                "end_line_num": 227,
    +                "duplicate_line_count": 12,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "related_modifiers": "author"
    +            }
    +        ],
    +        "duplicate_rate_trend": 0.0,
    +        "project_id": 1815,
    +        "scan_id": 488,
    +        "issue_id": 3,
    +        "issue_state": 1,
    +        "issue_owner": "author",
    +        "dir_path": "test",
    +        "file_name": "demo.py",
    +        "file_path": "test/demo.py",
    +        "duplicate_rate": 4.63,
    +        "total_line_count": 259,
    +        "total_duplicate_line_count": 12,
    +        "distinct_hash_num": 1,
    +        "block_num": 1,
    +        "last_modifier": "author",
    +        "change_type": null,
    +        "scm_revision": "xxx",
    +        "is_latest": true
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的指定文件的重复块列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/<file_id>/blocks/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "duplicate_file": 1,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "duplicate_file_id": 1,
    +                "token_num": 120,
    +                "duplicate_times": 2,
    +                "duplicate_rate": 4.63,
    +                "start_line_num": 216,
    +                "end_line_num": 227,
    +                "duplicate_line_count": 12,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "related_modifiers": "author"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的文件行数列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/clocfiles/
    +

    参数列表

    参数类型描述
    change_typestr改变类型(add、mod、del),支持多值,使用英文逗号','分隔
    file_pathstr文件路径

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": "",
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "code_line_num": 108587,
    +                "comment_line_num": 0,
    +                "blank_line_num": 0,
    +                "total_line_num": 108587,
    +                "add_code_line_num": 108587,
    +                "add_comment_line_num": 0,
    +                "add_blank_line_num": 0,
    +                "add_total_line_num": 108587,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "is_latest": true,
    +                "dir_path": "test",
    +                "file_name": "test.json",
    +                "language": "JSON",
    +                "change_type": "add"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}    
    +

    查看指定项目的语言列表

    GET server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/cloclangs/
    +

    返回结果

    {
    +    "data": {
    +        "count": 2,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "code_line_num": 9753,
    +                "comment_line_num": 4220,
    +                "blank_line_num": 2454,
    +                "total_line_num": 16427,
    +                "add_code_line_num": 9753,
    +                "add_comment_line_num": 4220,
    +                "add_blank_line_num": 2454,
    +                "add_total_line_num": 16427,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1815,
    +                "scan_id": 695,
    +                "is_latest": true,
    +                "name": "Python",
    +                "file_num": 165
    +            },
    +            {
    +                "id": 2,
    +                "code_line_num": 379,
    +                "comment_line_num": 0,
    +                "blank_line_num": 153,
    +                "total_line_num": 532,
    +                "add_code_line_num": 379,
    +                "add_comment_line_num": 0,
    +                "add_blank_line_num": 153,
    +                "add_total_line_num": 532,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1815,
    +                "scan_id": 695,
    +                "is_latest": true,
    +                "name": "Markdown",
    +                "file_num": 7
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    + + + diff --git "a/en/api/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/en/api/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..bcc51c1af --- /dev/null +++ "b/en/api/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,137 @@ + + + + + + + + + 代码扫描数据管理 | Tencent Cloud Code Analysis + + + + +

    代码扫描数据管理

    查看扫描问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/
    +

    参数

    参数类型描述
    statestr问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    severitystr严重程度, 1为致命,2为错误,3为警告,4为提示,可多选,格式为1,2,3,4
    resolutionstr解决方式, 0为无,1为修复,2为无需修复,3为误报,4为重复单过滤,5为路径过滤,6为规则移除
    authorstr问题责任人
    scan_openint发现问题的扫描编号
    scan_fixint修复问题的扫描编号
    ci_time_gtestr修复问题的起始时间,格式为"2021-01-01 00:00:00"
    ci_time_ltestr修复问题的结束时间
    file_pathstr文件路径
    checkrule_display_namestr检查规则名
    checkpackageint问题所属的规则包

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "file_path": "test/demo.py",
    +                "project": 1,
    +                "repo": 1,
    +                "checkrule_real_name": "xxx",
    +                "checkrule_display_name": "xxx",
    +                "checktool_name": "xxx",
    +                "msg": "xxx",
    +                "state": 3,
    +                "resolution": 1,
    +                "author": "author",
    +                "author_email": null,
    +                "severity": 2,
    +                "revision": "revision",
    +                "ci_time": "2021-02-02T13:31:38+08:00",
    +                "file_owners": null,
    +                "is_external": false,
    +                "scm_url": "",
    +                "real_file_path": "",
    +                "scan_open": 1,
    +                "scan_fix": 2,
    +                "fixed_time": "2021-02-19T15:25:15.152350+08:00"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看问题详情

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/<issue_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "issue_details": [
    +            {
    +                "id": 1,
    +                "issue_refers": [],
    +                "creator": null,
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "issuedetail_uuid": "0fcc376e-7283-11eb-bd53-5254005e71ca",
    +                "checkrule_real_name": "xxx",
    +                "checktool_name": "xxx",
    +                "author": "author",
    +                "author_email": null,
    +                "line": 1809,
    +                "column": 15,
    +                "scan_revision": "scan_revision",
    +                "revision": "revision",
    +                "ci_time": "2021-02-02T13:31:38+08:00",
    +                "real_revision": "",
    +                "created_time": "2021-02-19T15:21:19.625658+08:00",
    +                "modified_time": "2021-02-19T15:21:19.625662+08:00",
    +                "issue": null,
    +                "project": 1
    +            }
    +        ],
    +        "is_external": false,
    +        "repo": 1,
    +        "author": "author",
    +        "created_time": "2021-02-19T15:21:19.625685+08:00",
    +        "creator": null,
    +        "modifier": null,
    +        "deleted_time": null,
    +        "deleter": null,
    +        "file_path": "test/demo.py",
    +        "file_hash": "xxx",
    +        "scm_url": "",
    +        "real_file_path": "",
    +        "checkrule_gid": 1,
    +        "checkrule_real_name": "xxx",
    +        "checkrule_display_name": "xxx",
    +        "checkrule_rule_title": "xxx",
    +        "checktool_name": "xxx",
    +        "category": 7,
    +        "state": 3,
    +        "resolution": 1,
    +        "scan_revision": null,
    +        "severity": 2,
    +        "language": "python",
    +        "revision": "revision",
    +        "ci_time": "2021-02-02T13:31:38+08:00",
    +        "file_owners": null,
    +        "fixed_time": "2021-02-19T15:25:15.152350+08:00",
    +        "tapd_ws_id": null,
    +        "tapd_bug_id": null,
    +        "modified_time": "2021-02-19T15:25:17.807478+08:00",
    +        "project": 1,
    +        "scan_open": 1,
    +        "scan_fix": 2
    +    },
    +    "code": 0,
    +    "msg": "xxx",
    +    "status_code": 200
    +}
    +
    + + + diff --git "a/en/api/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/en/api/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..0cb96d3e8 --- /dev/null +++ "b/en/api/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,116 @@ + + + + + + + + + 任务管理模块 | Tencent Cloud Code Analysis + + + + +

    任务管理模块

    执行指定代码库指定分析项目扫描任务

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/scans/create/
    +

    参数列表

    参数类型描述
    incr_scanbool增量扫描标志,true表示增量,false表示全量
    async_flagbool异步启动标志,true表示异步,false表示同步,建议选择异步
    force_createbool强制启动标志,true表示强制启动,不等待上一个任务结束

    返回结果

    {
    +    "job": {
    +        "id": 7974
    +    },
    +    "scan": {
    +        "id": 5528
    +    }
    +}
    +

    查看指定项目的任务列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/
    +

    参数列表

    参数类型描述
    create_time_gtedatetime最小任务启动时间
    create_time_ltedatetime最大任务启动时间
    result_code_gteint最小错误码值
    result_code_lteint最大错误码值
    result_msgstr结果信息
    stateint任务状态, 0为等待中,1为执行中,2为关闭,3为入库中,可多选,格式为1,2,3
    created_fromstr创建来源
    creatorstr创建用户

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "state": 2,
    +                "result_code": 0,
    +                "result_msg": "success",
    +                "code_line_num": 1000,
    +                "comment_line_num": 5,
    +                "blank_line_num": 305,
    +                "total_line_num": 1400
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的指定任务详情

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/<job_id>/detail/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "scan_id": 1,
    +        "create_time": "2021-01-28T10:27:26.442961+08:00",
    +        "waiting_time": "1",
    +        "start_time": "2021-01-28T11:14:56.760427+08:00",
    +        "execute_time": "3",
    +        "project": {
    +            "id": 1,
    +            "branch": "master",
    +            "repo_id": 1,
    +            "scan_scheme": 1,
    +            "repo_scm_url": "http://github.com/xxx/test_demo.git"
    +        },
    +        "end_time": "2021-01-28T11:14:59.760427+08:00",
    +        "expire_time": "2021-01-28T14:07:52.968932+08:00",
    +        "task_num": 1,
    +        "task_done": 1,
    +        "tasks": [
    +            {
    +                "id": 1,
    +                "module": "codelint",
    +                "task_name": "pylint",
    +                "progress_rate": 1,
    +                "state": 2,
    +                "result_code": 0,
    +                "result_msg": "success",
    +                "result_path": null
    +            }
    +        ],
    +        "co_jobs": [],
    +        "state": 2,
    +        "result_code": 0,
    +        "result_code_msg": null,
    +        "result_msg": "success",
    +        "result_path": null,
    +        "remarks": null,
    +        "remarked_by": null,
    +        "code_line_num": 1000,
    +        "comment_line_num": 5,
    +        "blank_line_num": 305,
    +        "total_line_num": 1400,
    +        "created_from": "codedog_web",
    +        "creator": "creator"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    + + + diff --git "a/en/api/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html" "b/en/api/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html" new file mode 100644 index 000000000..bce8339b3 --- /dev/null +++ "b/en/api/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html" @@ -0,0 +1,73 @@ + + + + + + + + + 对象主要字段说明 | Tencent Cloud Code Analysis + + + + +

    对象主要字段说明

    注:以下字段用于参考,具体字段格式需要以具体接口返回为准

    团队(org):

    org_sid: str,团队编号
    +name: str,团队名称
    +description: str,团队描述
    +certificated: boolean,团队认证标志位
    +created_time: datetime,团队创建时间
    +updated_time: datetime,团队更新时间
    +admins: list,管理员列表
    +project_count: int,分析任务数量
    +team_count: int,项目组数量
    +user_count: int,成员数量
    +owner: str,负责人名称
    +tel_number: str,负责人电话
    +address: str,办公地址
    +

    项目(team):

    name: str,项目组名称
    +display_name: str,项目组展示名称
    +description: str,项目组描述信息
    +

    代码库(repository):

    name: str,代码库名称
    +scm_url: str,代码库地址
    +scm_type: int,代码库类型
    +created_from: str,创建来源
    +state:str,代码库状态,1表示活跃,2表示失活,3表示暂停使用
    +labels:list,标签
    +project_team: 项目
    +organization: 团队
    +

    扫描方案(scanscheme):

    name: str,扫描方案名称
    +repo:关联的代码库
    +refer_scheme: 参照的扫描方案
    +description: str,描述
    +tag: 执行标签
    +languages: 包含语言
    +default_flag: boolean,默认方案标志
    +created_from: str,创建来源
    +ignore_merged_issue: boolean,过滤其他分支引入的问题,默认False,不过滤
    +ignore_branch_issue: str,过滤指定分支引入的问题
    +ignore_submodule_clone: boolean,不拉取子模块,默认False
    +ignore_submodule_issue: boolean,忽略子模块问题,默认False
    +issue_global_ignore: boolean,开启问题全局忽略,默认False
    +daily_save: boolean,日常扫描记录保存7天开关,默认False
    +lfs_flag: boolean,自动拉取lfs文件,默认True
    +status: int,扫描方案状态,1为活跃,2为废弃
    +
    + + + diff --git "a/en/api/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/en/api/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..fcc62656d --- /dev/null +++ "b/en/api/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,762 @@ + + + + + + + + + 代码扫描管理 | Tencent Cloud Code Analysis + + + + +

    代码扫描管理

    查看项目扫描最新结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/
    +

    返回结果

    {
    +    "lintscan": {
    +        "issue_open_num": 74,
    +        "issue_fix_num": 439,
    +        "issue_detail_num": 310,
    +        "scan": {
    +            "id": 1,
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "execute_time": "00:02:17.844712"
    +        },
    +        "current_scan": {
    +            "active_category_detail": {
    +                "convention": 70,
    +                "other": 4
    +            },
    +            "active_severity_detail": {
    +                "error": 69,
    +                "warning": 5
    +            },
    +            "issue_open_num": 74,
    +            "issue_fix_num": 439
    +        },
    +        "total": {
    +            "state_detail": {
    +                "active": 197,
    +                "resolved": 13,
    +                "closed": 23297
    +            },
    +            "category_detail": {
    +                "convention": {
    +                    "active": 184,
    +                    "resolved": 13,
    +                    "closed": 21143
    +                },
    +                "other": {
    +                    "active": 13,
    +                    "closed": 154
    +                },
    +                "correctness": {
    +                    "closed": 1997
    +                },
    +                "performance": {
    +                    "closed": 3
    +                }
    +            },
    +            "severity_detail": {
    +                "error": {
    +                    "active": 157,
    +                    "resolved": 11,
    +                    "closed": 20113
    +                },
    +                "warning": {
    +                    "active": 40,
    +                    "resolved": 2,
    +                    "closed": 2930
    +                },
    +                "info": {
    +                    "closed": 254
    +                }
    +            }
    +        },
    +        "status": 0,
    +        "text": "成功",
    +        "description": null,
    +        "scan_summary": {
    +            "convention": {
    +                "error": {
    +                    "rule_count": 7,
    +                    "active": 65
    +                },
    +                "warning": {
    +                    "rule_count": 2,
    +                    "active": 5
    +                }
    +            },
    +            "other": {
    +                "error": {
    +                    "rule_count": 1,
    +                    "active": 4
    +                }
    +            }
    +        },
    +        "total_summary": {
    +            "correctness": {
    +                "error": {
    +                    "rule_count": 16,
    +                    "closed": 1315
    +                },
    +                "warning": {
    +                    "rule_count": 10,
    +                    "closed": 629
    +                },
    +                "info": {
    +                    "rule_count": 1,
    +                    "closed": 53
    +                }
    +            },
    +            "performance": {
    +                "warning": {
    +                    "rule_count": 1,
    +                    "closed": 3
    +                }
    +            },
    +            "convention": {
    +                "error": {
    +                    "rule_count": 42,
    +                    "active": 149,
    +                    "resolved": 11,
    +                    "closed": 18778
    +                },
    +                "warning": {
    +                    "rule_count": 17,
    +                    "active": 35,
    +                    "resolved": 2,
    +                    "closed": 2298
    +                },
    +                "info": {
    +                    "rule_count": 1,
    +                    "closed": 67
    +                }
    +            },
    +            "other": {
    +                "error": {
    +                    "rule_count": 2,
    +                    "active": 8,
    +                    "closed": 20
    +                },
    +                "warning": {
    +                    "rule_count": 1,
    +                    "active": 5
    +                },
    +                "info": {
    +                    "rule_count": 3,
    +                    "closed": 134
    +                }
    +            }
    +        }
    +    },
    +    "cyclomaticcomplexityscan": {
    +        "id": 1,
    +        "scan_revision": "scan_revision",
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +        "default_summary": {
    +            "min_ccn": 20,
    +            "over_cc_func_count": 6,
    +            "under_cc_func_count": 796,
    +            "diff_over_cc_func_count": 0,
    +            "over_cc_func_average": 22.333333333333332,
    +            "cc_func_average": 2.5099750623441395,
    +            "over_cc_sum": 14,
    +            "cc_average_of_lines": 1.0422094841063054
    +        },
    +        "custom_summary": null,
    +        "created_time": "2021-03-11T20:48:59.976947+08:00",
    +        "creator": null,
    +        "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +        "modifier": null,
    +        "deleted_time": null,
    +        "deleter": null,
    +        "last_revision": "last_revision",
    +        "diff_cc_num": 0,
    +        "cc_open_num": 6,
    +        "cc_average_of_lines": 1.0422094841063054,
    +        "cc_fix_num": 0,
    +        "worse_cc_file_num": 0,
    +        "min_ccn": 20,
    +        "code_line_num": 13433,
    +        "scan": 1
    +    },
    +    "duplicatescan": {
    +        "id": 1,
    +        "scan_revision": "scan_revision",
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +        "default_summary": {
    +            "exhi_risk": {
    +                "range": [
    +                    0.2,
    +                    1
    +                ],
    +                "file_count": 1,
    +                "diff": {
    +                    "diff_file_count": 0
    +                }
    +            },
    +            "high_risk": {
    +                "range": [
    +                    0.11,
    +                    0.2
    +                ],
    +                "file_count": 3,
    +                "diff": {
    +                    "diff_file_count": 0
    +                }
    +            },
    +            "midd_risk": {
    +                "range": [
    +                    0.05,
    +                    0.11
    +                ],
    +                "file_count": 2,
    +                "diff": {
    +                    "diff_file_count": 0
    +                }
    +            },
    +            "low_risk": {
    +                "range": [
    +                    0,
    +                    0.05
    +                ],
    +                "file_count": 2,
    +                "diff": {
    +                    "diff_file_count": 0
    +                }
    +            }
    +        },
    +        "custom_summary": null,
    +        "last_revision": "last_revision",
    +        "duplicate_file_count": 8,
    +        "duplicate_block_count": 55,
    +        "duplicate_line_count": 1177,
    +        "diff_duplicate_block_count": 0,
    +        "diff_duplicate_line_count": 0,
    +        "close_issue_count": 0,
    +        "new_issue_count": 0,
    +        "reopen_issue_count": 5,
    +        "ignored_issue_count": 0,
    +        "duplicate_rate": 4.98,
    +        "unique_duplicate_line_count": 1083,
    +        "total_duplicate_line_count": 1083,
    +        "total_line_count": 21745,
    +        "scan": 1
    +    },
    +    "clocscan": {
    +        "id": 1,
    +        "scan_revision": "scan_revision",
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +        "last_revision": "last_revision",
    +        "code_line_num": 140490,
    +        "comment_line_num": 5410,
    +        "blank_line_num": 3408,
    +        "total_line_num": 149308,
    +        "add_code_line_num": 6673,
    +        "add_comment_line_num": 2309,
    +        "add_blank_line_num": 1289,
    +        "add_total_line_num": 10271,
    +        "mod_code_line_num": 965,
    +        "mod_comment_line_num": 297,
    +        "mod_blank_line_num": 0,
    +        "mod_total_line_num": 1262,
    +        "del_code_line_num": 35844,
    +        "del_comment_line_num": 2117,
    +        "del_blank_line_num": 1794,
    +        "del_total_line_num": 39755,
    +        "scan": 1
    +    }
    +}
    +

    查看项目代码最新扫描结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/latestscan/
    +

    参数列表

    参数类型描述
    scan_revisionstr指定查询的扫描版本号,如不指定则为当前项目最新的一次扫描

    返回结果

    {
    +    "data": {
    +        "id": 1,                            # 扫描编号
    +        "repo_id": 1,                       # 代码库编号
    +        "project_id": 1,                    # 项目编号
    +        "job_gid": 1,                       # 关联任务编号
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +        "current_revision": "current_revision",  # 扫描版本号
    +        "result_code": 0,                   # 扫描任务结果码,0表示正常
    +        "result_code_msg": "成功",
    +        "result_msg": null,
    +        "lintscan": {                         # 代码扫描结果信息
    +            "current_scan": {                 # 本次扫描信息
    +                "active_severity_detail": {   # 不同严重级别的活跃问题数,包含 fatal(1-致命), error(2-错误), warning(3-警告), info(4-提示)
    +                    "error": 69,              
    +                    "warning": 5              
    +                },
    +                "issue_open_num": 10,         # 本次扫描新发现问题数
    +                "issue_fix_num": 2            # 本次扫描关闭存量问题数
    +            },
    +            "total": {                        # 当前项目整体信息
    +                "state_detail": {             # 不同处理状态的问题数,包含 active(1-活跃)、resolved(2-已处理)、closed(3-已关闭)
    +                    "active": 197,            
    +                    "resolved": 13,
    +                    "closed": 23297
    +                },
    +                "severity_detail": {         # 不同严重级别下不同处理状态的问题量
    +                    "error": {
    +                        "active": 157,
    +                        "resolved": 11,
    +                        "closed": 20113
    +                    },
    +                    "warning": {
    +                        "active": 40,
    +                        "resolved": 2,
    +                        "closed": 2930
    +                    },
    +                    "info": {
    +                        "closed": 254
    +                    }
    +                }
    +            }
    +        },
    +        "duplicatescan": {                    # 重复代码扫描结果信息
    +            "id": 1,                          # 扫描任务编号
    +            "scan_revision": "scan_revision", # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +            "default_summary": {              # 默认概览
    +                "exhi_risk": {                # 极高风险
    +                    "range": [                # 重复率范围: 0.2-1
    +                        0.2,
    +                        1
    +                    ],
    +                    "file_count": 1,          # 文件数量
    +                    "diff": {                 # 增量数据
    +                        "diff_file_count": 0  # 增量文件数量
    +                    }
    +                },
    +                "high_risk": {                # 高风险
    +                    "range": [                # 重复率范围:0.11-0.2
    +                        0.11,
    +                        0.2
    +                    ],
    +                    "file_count": 3,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "midd_risk": {                # 中风险
    +                    "range": [                # 重复率范围:0.05-0.11
    +                        0.05,
    +                        0.11
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "low_risk": {                 # 低风险
    +                    "range": [                # 重复率范围:0-0.05
    +                        0,
    +                        0.05
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                }
    +            },
    +            "custom_summary": null,           # 自定义概览数据
    +            "last_revision": "2010ef28ff3a26424d4e8f32df022f90cd682eda",  # 上次扫描版本号
    +            "duplicate_file_count": 8,        # 重复文件数量
    +            "duplicate_block_count": 55,      # 重复代码块数量
    +            "duplicate_line_count": 1177,     # 重复代码行数
    +            "diff_duplicate_block_count": 0,  # 增量重复代码块数量
    +            "diff_duplicate_line_count": 0,   # 增量重复代码行数
    +            "close_issue_count": 0,           # 关闭问题数
    +            "new_issue_count": 0,             # 新增问题数
    +            "reopen_issue_count": 5,          # 重新打开问题数
    +            "ignored_issue_count": 0,         # 忽略问题数
    +            "duplicate_rate": 4.98,           # 重复率
    +            "unique_duplicate_line_count": 1083,  # 去重后的重复代码行数
    +            "total_duplicate_line_count": 1083,   # 项目总的去重后的重复代码行数
    +            "total_line_count": 21745,            # 项目总行书
    +            "scan": 1                         # 关联扫描任务编号
    +        },
    +        "cyclomaticcomplexityscan": {         # 圈复杂度扫描数据
    +            "id": 1,                          # 圈复杂度扫描编号
    +            "scan_revision": "scan_revision", # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "default_summary": {                      # 默认概览数据
    +                "min_ccn": 20,                        # 最小圈复杂度阈值
    +                "over_cc_func_count": 6,              # 超标函数数量
    +                "under_cc_func_count": 796,           # 未超标函数数量
    +                "diff_over_cc_func_count": 0,         # 增量超标函数数据
    +                "over_cc_func_average": 22.333333333333332,  # 平均超标圈复杂度
    +                "cc_func_average": 2.5099750623441395,  # 平均圈复杂度
    +                "over_cc_sum": 14,                      # 文件超标方法圈复杂度超过阈值的差值之和
    +                "cc_average_of_lines": 1.0422094841063054 # 千行代码平均圈复杂度
    +            },
    +            "custom_summary": null,                     # 自定义概览数据
    +            "created_time": "2021-03-11T20:48:59.976947+08:00",
    +            "creator": null,
    +            "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +            "modifier": null,
    +            "deleted_time": null,
    +            "deleter": null,
    +            "last_revision": "last_revision",           # 上一次扫描版本号
    +            "diff_cc_num": 0,                           # 增量超标函数数量
    +            "cc_open_num": 6,                           # 超标函数量
    +            "cc_average_of_lines": 1.0422094841063054,  # 千行代码平均圈复杂度
    +            "cc_fix_num": 0,                            # 修复数量
    +            "worse_cc_file_num": 0,                     # 圈复杂度恶化的文件数据
    +            "min_ccn": 20,                              # 最小圈复杂度阈值
    +            "code_line_num": 13433,                     # 代码行数
    +            "scan": 1
    +        },
    +        "clocscan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",           # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +            "last_revision": "last_revision",           # 上一次扫描版本号
    +            "code_line_num": 140490,                    # 代码行数
    +            "comment_line_num": 5410,                   # 注释行数
    +            "blank_line_num": 3408,                     # 空白行数
    +            "total_line_num": 149308,                   # 总行数
    +            "add_code_line_num": 6673,                  # 增加的代码行数
    +            "add_comment_line_num": 2309,               # 增加的注释行数
    +            "add_blank_line_num": 1289,                 # 增加的空白行数
    +            "add_total_line_num": 10271,                # 增加的总行数
    +            "mod_code_line_num": 965,                   # 修改的代码行数
    +            "mod_comment_line_num": 297,                # 修改的注释行数
    +            "mod_blank_line_num": 0,                    # 修改的空白行数
    +            "mod_total_line_num": 1262,                 # 修改的总行数
    +            "del_code_line_num": 35844,                 # 删除的代码行数
    +            "del_comment_line_num": 2117,               # 删除的注释行数
    +            "del_blank_line_num": 1794,                 # 删除的空白行数
    +            "del_total_line_num": 39755,                # 删除的总行数
    +            "scan": 1
    +        }
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码扫描结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/lintscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "issue_open_num": 10,             # 本次扫描新发现问题数
    +                "issue_fix_num": 2,               # 本次扫描关闭存量问题数
    +                "issue_detail_num": 310,          # 本次扫描上报原始问题数(问题展示会进行聚合)
    +                "scan": {                         # 扫描信息
    +                    "id": 1,                      # 扫描任务编号
    +                    "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描开始时间
    +                    "execute_time": "00:02:17.844712"                 # 扫描执行耗时
    +                },
    +                "current_scan": {                 # 本次扫描信息
    +                    "active_category_detail": {   # 活跃问题分类,包含 CORRECTNESS(1-功能)、SECURITY(2-安全)、PERFORMANCE(3-性能)、USABILITY(4-可用性)、ACCESSIBILITY(5-无障碍化)、I18N(6-国际化)、CONVENTION(7-代码风格)、OTHER(8-其他)
    +                        "convention": 70,         # 代码风格类型问题
    +                        "other": 4                # 其他类型问题
    +                    },
    +                    "active_severity_detail": {   # 不同严重级别的活跃问题数,包含 fatal(1-致命), error(2-错误), warning(3-警告), info(4-提示)
    +                        "error": 69,              
    +                        "warning": 5              
    +                    },
    +                    "issue_open_num": 10,         # 本次扫描新发现问题数
    +                    "issue_fix_num": 2            # 本次扫描关闭存量问题数
    +                },
    +                "total": {                        # 当前项目整体信息
    +                    "state_detail": {             # 不同处理状态的问题数,包含 active(1-活跃)、resolved(2-已处理)、closed(3-已关闭)
    +                        "active": 197,            
    +                        "resolved": 13,
    +                        "closed": 23297
    +                    },
    +                    "category_detail": {          # 不同分类下不同处理状态的问题量
    +                        "convention": {           
    +                            "active": 184,
    +                            "resolved": 13,
    +                            "closed": 21143
    +                        },
    +                        "other": {                
    +                            "active": 13,
    +                            "closed": 154
    +                        },
    +                        "correctness": {
    +                            "closed": 1997
    +                        },
    +                        "performance": {
    +                            "closed": 3
    +                        }
    +                    },
    +                    "severity_detail": {         # 不同严重级别下不同处理状态的问题量
    +                        "error": {
    +                            "active": 157,
    +                            "resolved": 11,
    +                            "closed": 20113
    +                        },
    +                        "warning": {
    +                            "active": 40,
    +                            "resolved": 2,
    +                            "closed": 2930
    +                        },
    +                        "info": {
    +                            "closed": 254
    +                        }
    +                    }
    +                },
    +                "status": 0,                     # 扫描状态,0表示成功
    +                "text": "成功",
    +                "description": null,
    +                "scan_summary": {                # 扫描概览
    +                    "convention": {              
    +                        "error": {               
    +                            "rule_count": 7,     # 规则数
    +                            "active": 65         # 活跃问题数
    +                        },
    +                        "warning": {
    +                            "rule_count": 2,
    +                            "active": 5
    +                        }
    +                    },
    +                    "other": {
    +                        "error": {
    +                            "rule_count": 1,
    +                            "active": 4
    +                        }
    +                    }
    +                },
    +                "total_summary": {
    +                    "correctness": {
    +                        "error": {
    +                            "rule_count": 16,
    +                            "closed": 1315
    +                        },
    +                        "warning": {
    +                            "rule_count": 10,
    +                            "closed": 629
    +                        },
    +                        "info": {
    +                            "rule_count": 1,
    +                            "closed": 53
    +                        }
    +                    },
    +                    "performance": {
    +                        "warning": {
    +                            "rule_count": 1,
    +                            "closed": 3
    +                        }
    +                    },
    +                    "convention": {
    +                        "error": {
    +                            "rule_count": 42,
    +                            "active": 149,
    +                            "resolved": 11,
    +                            "closed": 18778
    +                        },
    +                        "warning": {
    +                            "rule_count": 17,
    +                            "active": 35,
    +                            "resolved": 2,
    +                            "closed": 2298
    +                        },
    +                        "info": {
    +                            "rule_count": 1,
    +                            "closed": 67
    +                        }
    +                    },
    +                    "other": {
    +                        "error": {
    +                            "rule_count": 2,
    +                            "active": 8,
    +                            "closed": 20
    +                        },
    +                        "warning": {
    +                            "rule_count": 1,
    +                            "active": 5
    +                        },
    +                        "info": {
    +                            "rule_count": 3,
    +                            "closed": 134
    +                        }
    +                    }
    +                }
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量圈复杂度结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/cycscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "default_summary": {
    +                    "min_ccn": 20,
    +                    "over_cc_func_count": 6,
    +                    "under_cc_func_count": 796,
    +                    "diff_over_cc_func_count": 0,
    +                    "over_cc_func_average": 22.333333333333332,
    +                    "cc_func_average": 2.5099750623441395,
    +                    "over_cc_sum": 14,
    +                    "cc_average_of_lines": 1.0422094841063054
    +                },
    +                "custom_summary": null,
    +                "created_time": "2021-03-11T20:48:59.976947+08:00",
    +                "creator": null,
    +                "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "last_revision": "last_revision",
    +                "diff_cc_num": 0,
    +                "cc_open_num": 6,
    +                "cc_average_of_lines": 1.0422094841063054,
    +                "cc_fix_num": 0,
    +                "worse_cc_file_num": 0,
    +                "min_ccn": 20,
    +                "code_line_num": 13433,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量重复代码结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/dupscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "default_summary": {
    +                    "exhi_risk": {
    +                        "range": [
    +                            0.2,
    +                            1
    +                        ],
    +                        "file_count": 1,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "high_risk": {
    +                        "range": [
    +                            0.11,
    +                            0.2
    +                        ],
    +                        "file_count": 3,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "midd_risk": {
    +                        "range": [
    +                            0.05,
    +                            0.11
    +                        ],
    +                        "file_count": 2,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "low_risk": {
    +                        "range": [
    +                            0,
    +                            0.05
    +                        ],
    +                        "file_count": 2,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    }
    +                },
    +                "custom_summary": null,
    +                "last_revision": "last_revision",
    +                "duplicate_file_count": 8,
    +                "duplicate_block_count": 55,
    +                "duplicate_line_count": 1177,
    +                "diff_duplicate_block_count": 0,
    +                "diff_duplicate_line_count": 0,
    +                "close_issue_count": 0,
    +                "new_issue_count": 0,
    +                "reopen_issue_count": 5,
    +                "ignored_issue_count": 0,
    +                "duplicate_rate": 4.98,
    +                "unique_duplicate_line_count": 1083,
    +                "total_duplicate_line_count": 1083,
    +                "total_line_count": 21745,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量代码统计结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/clocscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "last_revision": "last_revision",
    +                "code_line_num": 140490,
    +                "comment_line_num": 5410,
    +                "blank_line_num": 3408,
    +                "total_line_num": 149308,
    +                "add_code_line_num": 6673,
    +                "add_comment_line_num": 2309,
    +                "add_blank_line_num": 1289,
    +                "add_total_line_num": 10271,
    +                "mod_code_line_num": 965,
    +                "mod_comment_line_num": 297,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 1262,
    +                "del_code_line_num": 35844,
    +                "del_comment_line_num": 2117,
    +                "del_blank_line_num": 1794,
    +                "del_total_line_num": 39755,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    + + + diff --git "a/en/api/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/en/api/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..a3ccc1dfe --- /dev/null +++ "b/en/api/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,571 @@ + + + + + + + + + 项目管理模块 | Tencent Cloud Code Analysis + + + + +

    项目管理模块

    查看指定代码库的指定分析项目列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/
    +

    参数列表

    参数类型描述
    scm_url_or_namestr代码库地址或者名称,支持模糊匹配
    scm_urlstr代码库仓库匹配
    scopestr过滤范围(my/subscribed/related_me),my表示我创建的,subscribed表示我关注的,related_me表示我有权限的

    返回结果

    {
    +    "count": 1,
    +    "next": null,
    +    "previous": null,
    +    "results": [
    +        {
    +            "id": 1,
    +            "name": "test_repo.git",
    +            "scm_url": "http://git.com/xxx/test_repo",
    +            "scm_type": "git",
    +            "branch_count": 1,
    +            "scheme_count": 1,
    +            "job_count": 1,
    +            "created_time": "2021-03-15 02:26:31.423674+00:00",
    +            "recent_active": {
    +                "id": 1,
    +                "branch_name": "master",
    +                "active_time": "2021-03-15T03:14:56.760427Z",
    +                "total_line_num": null,
    +                "code_line_num": null
    +            },
    +            "created_from": "codedog_web",
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "symbol": null
    +        }
    +    ]
    +}
    +

    查看指定代码库详情

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/
    +

    返回结果

    {
    +    "data":{
    +        "id": 1,
    +        "name": "test_repo.git",
    +        "scm_url": "http://git.com/xxx/test_repo",
    +        "scm_type": "git",
    +        "branch_count": 1,
    +        "scheme_count": 1,
    +        "job_count": 1,
    +        "created_time": "2021-03-15 02:26:31.423674+00:00",
    +        "recent_active": {
    +            "id": 1,
    +            "branch_name": "master",
    +            "active_time": "2021-03-15T03:14:56.760427Z",
    +            "total_line_num": null,
    +            "code_line_num": null
    +        },
    +        "created_from": "codedog_web",
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "symbol": null
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的不同分支的列表接口

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/branches/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "branch": "master",
    +                "schemes": [
    +                    {
    +                        "project_id": 1,
    +                        "scan_scheme_id": 1,
    +                        "scan_scheme_name": "默认"
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的分析项目列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    参数列表

    参数类型描述
    branchstr分支名称
    scan_schemeint扫描方案名称
    scan_scheme__statusint扫描方案状态,1为活跃,2为废弃
    branch_or_schemestr分支名称/扫描方案名称
    statusint项目状态筛选,1表示活跃,2表示失活,3表示关闭

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "creator": {
    +                    "username": "username",
    +                    "nickname": "nickname",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "org": 1
    +                },
    +                "created_time": "2021-01-28 02:27:26.256015+00:00",
    +                "modifier": null,
    +                "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +                "deleter": null,
    +                "deleted_time": null,
    +                "scan_scheme": {
    +                    "id": 1,
    +                    "creator": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    },
    +                    "created_time": "2021-01-28 02:27:26.209661+00:00",
    +                    "modifier": null,
    +                    "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +                    "deleter": null,
    +                    "deleted_time": null,
    +                    "languages": [
    +                        "python"
    +                    ],
    +                    "tag": "TCA_Linux",
    +                    "refer_scheme_info": null,
    +                    "name": "默认",
    +                    "description": null,
    +                    "default_flag": true,
    +                    "created_from": "web",
    +                    "job_runtime_limit": 600,
    +                    "ignore_merged_issue": false,
    +                    "ignore_branch_issue": null,
    +                    "ignore_submodule_clone": false,
    +                    "ignore_submodule_issue": true,
    +                    "issue_global_ignore": false,
    +                    "daily_save": false,
    +                    "lfs_flag": null,
    +                    "webhook_flag": false,
    +                    "issue_revision_merge_flag": false,
    +                    "status": 1,
    +                    "scheme_key": null,
    +                    "repo": 1
    +                },
    +                "branch": "master",
    +                "status": 1,
    +                "created_from": "codedog_web",
    +                "repo": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    创建指定代码库的指定分析项目

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    参数列表

    参数类型描述
    scan_scheme_idint当前代码库的扫描方案编号
    global_scheme_idint扫描方案模板编号
    custom_scheme_namestr自定义方案名称
    branchstr分支
    created_fromstr创建渠道,用于区分不同运行场景

    返回结果

    {
    +    "data": {
    +        "id":1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.256015+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "repo": {
    +            "id": 1,
    +            "name": "test_demo.git",
    +            "scm_url": "http://github.com/xxxx/test_demo.git",
    +            "scm_type": "git",
    +            "scm_auth": {
    +                "id": 1,
    +                "scm_account": null,
    +                "scm_oauth": null,
    +                "scm_ssh": {
    +                    "id": 1,
    +                    "name": "1",
    +                    "scm_platform": 1,
    +                    "scm_platform_desc": null,
    +                    "user": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    }
    +                },
    +                "auth_type": "ssh_token",
    +                "created_time": "2021-01-28T10:26:31.453389+08:00",
    +                "modified_time": "2021-01-28T10:26:31.453417+08:00"
    +            },
    +            "symbol": null
    +        },
    +        "scan_scheme": {
    +            "id": 1,
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "created_time": "2021-01-28 02:27:26.209661+00:00",
    +            "modifier": null,
    +            "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +            "deleter": null,
    +            "deleted_time": null,
    +            "languages": [
    +                "python"
    +            ],
    +            "tag": "TCA_Linux",
    +            "refer_scheme_info": null,
    +            "name": "默认",
    +            "description": null,
    +            "default_flag": true,
    +            "created_from": "web",
    +            "job_runtime_limit": 600,
    +            "ignore_merged_issue": false,
    +            "ignore_branch_issue": null,
    +            "ignore_submodule_clone": false,
    +            "ignore_submodule_issue": true,
    +            "issue_global_ignore": false,
    +            "daily_save": false,
    +            "lfs_flag": null,
    +            "webhook_flag": false,
    +            "issue_revision_merge_flag": false,
    +            "status": 1,
    +            "scheme_key": null,
    +            "repo": 1
    +        },
    +        "branch": "master",
    +        "status": 1,
    +        "created_from": "tca_web"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的指定分析项目

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/<project_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id":1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.256015+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "repo": {
    +            "id": 1,
    +            "name": "test_demo.git",
    +            "scm_url": "http://github.com/xxxx/test_demo.git",
    +            "scm_type": "git",
    +            "scm_auth": {
    +                "id": 1,
    +                "scm_account": null,
    +                "scm_oauth": null,
    +                "scm_ssh": {
    +                    "id": 1,
    +                    "name": "1",
    +                    "scm_platform": 1,
    +                    "scm_platform_desc": null,
    +                    "user": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    }
    +                },
    +                "auth_type": "ssh_token",
    +                "created_time": "2021-01-28T10:26:31.453389+08:00",
    +                "modified_time": "2021-01-28T10:26:31.453417+08:00"
    +            },
    +            "symbol": null
    +        },
    +        "scan_scheme": {
    +            "id": 1,
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "created_time": "2021-01-28 02:27:26.209661+00:00",
    +            "modifier": null,
    +            "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +            "deleter": null,
    +            "deleted_time": null,
    +            "languages": [
    +                "python"
    +            ],
    +            "tag": "TCA_Linux",
    +            "refer_scheme_info": null,
    +            "name": "默认",
    +            "description": null,
    +            "default_flag": true,
    +            "created_from": "web",
    +            "job_runtime_limit": 600,
    +            "ignore_merged_issue": false,
    +            "ignore_branch_issue": null,
    +            "ignore_submodule_clone": false,
    +            "ignore_submodule_issue": true,
    +            "issue_global_ignore": false,
    +            "daily_save": false,
    +            "lfs_flag": null,
    +            "webhook_flag": false,
    +            "issue_revision_merge_flag": false,
    +            "status": 1,
    +            "scheme_key": null,
    +            "repo": 1
    +        },
    +        "branch": "master",
    +        "status": 1,
    +        "created_from": "tca_web"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的扫描方案列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/
    +

    参数列表

    参数类型描述
    namestr扫描方案名称
    statusint扫描方案状态,1为活跃,2为废弃

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "creator": {
    +                    "username": "username",
    +                    "nickname": "nickname",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "org": 1
    +                },
    +                "created_time": "2021-01-28 02:27:26.209661+00:00",
    +                "modifier": null,
    +                "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +                "deleter": null,
    +                "deleted_time": null,
    +                "languages": [
    +                    "python"
    +                ],
    +                "tag": "TCA_Linux",
    +                "refer_scheme": null,
    +                "name": "默认",
    +                "description": null,
    +                "default_flag": true,
    +                "created_from": "web",
    +                "job_runtime_limit": 600,
    +                "ignore_merged_issue": false,
    +                "ignore_branch_issue": null,
    +                "ignore_submodule_clone": false,
    +                "ignore_submodule_issue": true,
    +                "issue_global_ignore": false,
    +                "daily_save": false,
    +                "lfs_flag": null,
    +                "issue_revision_merge_flag": false,
    +                "status": 1,
    +                "repo": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    使用指定扫描方案模板创建指定代码库的扫描方案

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/copyscheme/
    +

    参数列表

    参数类型描述
    namestr扫描方案名称
    ref_schemeint参照扫描方案编号

    返回结果

    {
    +    "data": {
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    查看指定代码库的指定扫描方案

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/basicconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.209661+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "languages": [
    +            "python"
    +        ],
    +        "tag": "TCA_Linux",
    +        "refer_scheme": null,
    +        "name": "默认",
    +        "description": null,
    +        "default_flag": true,
    +        "created_from": "web",
    +        "job_runtime_limit": 600,
    +        "ignore_merged_issue": false,
    +        "ignore_branch_issue": null,
    +        "ignore_submodule_clone": false,
    +        "ignore_submodule_issue": true,
    +        "issue_global_ignore": false,
    +        "daily_save": false,
    +        "lfs_flag": null,
    +        "issue_revision_merge_flag": false,
    +        "status": 1,
    +        "repo": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/basicconf/
    +

    参数列表

    参数类型描述
    languageslist代码语言
    tagstr执行标签,目前只支持 CodeDog_Linux
    namestr方案名称
    descriptionstr方案描述
    default_flagbool默认方案标志,一个代码库只能有一个默认方案
    job_runtime_limitint任务执行超时时间,默认为600分钟
    ignore_merged_issuebool忽略合入的问题
    ignore_branch_issuestr过滤参考分支引入的问题
    ignore_submodule_clonebool不拉取子模块扫描,True表示不拉取,False表示拉取
    ignore_submodule_issuebool忽略子模块引入的问题,True表示忽略,False表示不忽略
    issue_global_ignorebool问题全局忽略
    daily_savebool每次扫描原始数据存储,默认存储7天
    lfs_flagbool拉取lfs模块开关
    issue_revision_merge_flagbool"是否开启Issue按引入版本号聚合开关
    statusint方案状态,1表示活跃,2表示废弃

    返回结果

    查看指定代码库的指定扫描方案的返回结果一致

    查看指定代码库的扫描方案的代码扫描配置

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/lintconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "enabled": true,
    +        "checkprofile": {
    +            "id": 1,
    +            "profile_type": 1,
    +            "custom_checkpackage": 1,
    +            "checkpackages": [
    +                1
    +            ]
    +        },
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的代码扫描配置

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/lintconf/
    +

    参数列表

    参数类型描述
    enabledbool是否开启代码扫描

    返回结果

    指定代码库的指定方案的代码扫描配置的返回结果一致

    查看指定代码库的扫描方案的代码度量配置

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "cc_scan_enabled": false,
    +        "min_ccn": 20,
    +        "dup_scan_enabled": false,
    +        "dup_block_length_min": 120,
    +        "dup_block_length_max": null,
    +        "dup_min_dup_times": 2,
    +        "dup_max_dup_times": null,
    +        "dup_min_midd_rate": 5,
    +        "dup_min_high_rate": 11,
    +        "dup_min_exhi_rate": 20,
    +        "dup_issue_limit": 1000,
    +        "cloc_scan_enabled": false,
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的代码度量配置

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    参数列表

    参数类型描述
    cc_scan_enabledbool圈复杂度扫描开关
    min_ccnint最小圈复杂度
    dup_scan_enabledbool重复代码扫描开关
    dup_block_length_minint重复块最小长度
    dup_block_length_maxint重复块最大长度
    dup_max_dup_timesint最大重复次数
    dup_min_midd_rateint中风险最小重复率
    dup_min_high_rateint高风险最小重复率
    dup_min_exhi_rateint极高风险风险最小重复率
    dup_issue_limitint上报重复代码块数上限
    cloc_scan_enabledboolean代码统计扫描开关

    返回结果

    指定代码库的指定方案的代码度量配置的返回结果一致

    查看指定代码库的扫描方案的过滤路径列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "dir_path": "test/*",
    +                "path_type": 1,
    +                "scan_type": 1,
    +                "scan_scheme": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    创建指定代码库的指定方案的过滤路径列表

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/
    +

    参数列表

    参数类型描述
    dir_pathstr指定过滤路径
    path_typeint路径格式,1表示通配符,2表示正则表达式,默认为通配符
    scan_typeint扫描类型,1表示包含,2表示排除

    返回结果

    {
    +    "data": {
    +        "id": 13,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 36
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    查看指定代码库的扫描方案的指定过滤路径

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的指定过滤路径

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    参数列表

    参数类型描述
    dir_pathstr指定过滤路径
    path_typeint路径格式,1表示通配符,2表示正则表达式,默认为通配符
    scan_typeint扫描类型,1表示包含,2表示排除

    返回结果

    {
    +    "data": {
    +        "id": 13,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 36
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    删除指定代码库的指定方案的指定过滤路径

    DELETE /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    返回结果

    + + + diff --git a/en/community/changelog.html b/en/community/changelog.html new file mode 100644 index 000000000..5053da70b --- /dev/null +++ b/en/community/changelog.html @@ -0,0 +1,33 @@ + + + + + + + + + 更新日志 | Tencent Cloud Code Analysis + + + + +

    更新日志

    V1.4.1 (2022-7-28)

    Features

    • 【服务端】统一部署脚本,封装local、docker、docker-compose部署方式启动server&web&client
    • 【服务端】支持源码安装Redis与Nginx
    • 【服务端】macOS启动docker desktop
    • 【服务端】完善github action脚本
    • 【工具】更新工具列表

    Docs

    • 上传新版本白皮书
    • 调整快速入门指引文档

    V1.4.0 (2022-7-18)

    Features

    • 【客户端】jenkins插件增加分析方案模版ID和分析方案名称参数
    • 【服务端】增加扫描方案模板API
    • 【服务器】优化文件服务器鉴权交互
    • 【客户端】QuickScan支持指定分析方案模板进行扫描;支持从环境变量读取文件服务器url和token
    • 【Web端】升级moment依赖

    Docs

    • 更新插件使用说明书和启动参数说明

    V1.3.3 (2022-6-29)

    Features

    • 【服务端】支持团队、项目组禁用,支持代码库、分析项目删除
    • 【服务端】扫描方案支持分支过滤
    • 【Web端】支持禁用团队、项目,代码库登记支持ssh_url
    • 【Web端】支持分支过滤配置,修复代码统计文件选中效果,支持工具、依赖凭证移除
    • 【工具】增加tca_ql工具
    • 【客户端】节点模式不再由客户端加载编译工具的环境变量,避免覆盖机器原有环境变量
    • 【客户端】QuickScan模式,异常时输出task.log方便排查问题
    • 【客户端】.code.yml支持.yaml后缀

    Bugfixes

    • 【客户端】tool_scheme和ini配置共用时,可能出现工具重复,需要对工具库去重后再拉取

    Docs

    • 更新TCA Action相关文档
    • 更新Jenkins插件文档;增加环境依赖说明
    • 更新自定义工具文档,使用工具依赖
    • 更新CLS readme

    V1.3.2 (2022-6-16)

    Features

    • 【客户端】QuickScan根据语言执行不同的任务

    Docs

    • docker-compose部署文档中数据库注意事项

    V1.3.1 (2022-6-14)

    Features

    • 【客户端】新增merge quest分支增量扫描
    • 【客户端】新增Quickscan模式
    • 【客户端】localscan支持工具并发
    • 【工具】新增二进制文件依赖分析工具
    • 【服务端】server调整服务监控探测脚本:celery状态判断
    • 【服务端】增加子任务接口,完善部署脚本
    • 【服务端】更新CLS版本v20220613.1
    • 【服务端】基于 CentOS7.9.2009(已测)的运行环境一键安装脚本,并已安装及配置命令 gunicorn 和 celery
    • 【Web端】调整OAuth显示

    V1.3.0 (2022-6-7)

    Features

    • 【工具】新增独立工具Loong
    • 【工具】新增Java、JS基础安全规则包
    • 【工具】增加Go和Python技术安全规则包
    • 【服务端】新增oauth授权及工具依赖管理
    • 【服务端】docker-compose部署支持挂载本地日志目录
    • 【客户端】支持工具依赖管理
    • 【Web端】支持工具依赖管理设置和Git OAuth设置
    • 【Web端】团队列表支持滚动加载

    Bugfixes

    • 【服务端】补充scmproxy缺失依赖
    • 【服务端】修复issue入库忽略处理操作

    Docs

    • 更新工具目录readme
    • 更新client README.md

    V1.2.1 (2022-5-24)

    Features

    • 【工具】新增Collie/Compass(测试版)工具
    • 【工具】添加tscancode系列工具
    • 【工具】工具区分编译型和非编译型
    • 【客户端】更新cmdscm二进制文件,调整获取ssh端口号方式
    • 【客户端】增加腾讯工蜂作为工具拉取源,支持选用
    • 【服务端】调整工程配置和文档,支持https克隆
    • 【Web端】前端页面优化

    Docs

    • 添加集成工具说明文档
    • readme增加微信公众号和腾讯开源摘星计划的说明及链接
    • 修改帮助文档的脚本名称;修改工蜂镜像仓库链接位置
    • 调整自定义规则文档
    • 调整doc,优化部署、使用文档

    V1.2.0 (2022-4-27)

    Features

    • 【Web端】增加工具管理
    • 【工具】增加logback检查的安全规则
    • 【服务端】增加TCA server&web 一键部署脚本
    • 【服务端】删除main部分异步任务;调整server nginx启动位置
    • 【服务端】增加server健康监测

    Docs

    • 完善部署和Q&A文档
    • 上传工具列表

    V1.1.3 (2022-4-18)

    Features

    • 【工具】上传开源合规检查规则
    • 【工具】新增PHP安全相关规则
    • 【服务端】上线license鉴权
    • 【客户端】支持对工具license校验

    Docs

    • 更新文档内的工具默认路径
    • 增加任务分布式执行能力操作文档
    • 增加PR操作流程

    V1.1.2 (2022-4-2)

    Features

    • 【服务端】优化部署构建脚本

    Docs

    • 简化前端部署脚本&文档
    • 优化指引文档

    V1.1.1 (2022-3-31)

    Features

    • 【工具】增加0daychecker工具
    • 【工具】增加Log4j、LogBack漏洞检查规则包

    Docs

    • 完善部署文档说明,推荐使用Docker-Compose 2.3.3版本

    V1.1.0 (2022-3-29)

    Features

    • 【客户端】client支持arm64架构执行环境
    • 【客户端】client新增分布式节点模式
    • 【客户端】修改参数isTotal(是否开启全量扫描)判断方式及参数startCommand(启动客户端命令)拼接方式
    • 【服务端】支持任务分布式下发
    • 【服务端】完善基于minio的文件存储配置
    • 【Web端】调整文件资源引用地址
    • 【Web端】web模块部署脚本问题修复及优化
    • 【Web端】增加管理后台、增加在线分析
    • 【Web端】调整前端部署脚本,支持传递nginx配置地址、前端资源部署地址

    Bugfixes

    • Jenkins插件命令拼装逻辑修正

    Docs

    • 调整pypi下载失败提示
    • 调整前端部署文档及脚本
    • 更新License

    V1.0.1 (2022-03-01)

    Features

    • feat: 【服务端】调整代码库登记ssh url链接格式适配
    • feat: 【工具】上线支持PHP安全工具-Rips
    • feat: 【工具】调整androidlint部分规则描述
    • feat: 【客户端】上线Jenkins插件
    • feat: 【客户端】增加工具拉取可选配置项
    • feat: 【客户端】支持在命令行参数中输入团队编号和项目名称
    • feat: 【客户端】限制PYTHON_VERSION环境变量可选值
    • feat: 【客户端】增加在docker中快速使用client的方式

    Bugfixes

    • fix: 【服务端】补充缺失的依赖
    • fix: 【Web端】修复下载codedog.ini失败提示

    Docs

    • doc: 上线部署文档Q&A
    • doc: 优化部署文档、帮助文档说明
    • doc: 增加产品白皮书
    • doc: 补充redis和nginx源码安装参考文档

    V1.0.0

    初始发布

    + + + diff --git a/en/community/contribute.html b/en/community/contribute.html new file mode 100644 index 000000000..ef1e7b105 --- /dev/null +++ b/en/community/contribute.html @@ -0,0 +1,33 @@ + + + + + + + + + 贡献指南 | Tencent Cloud Code Analysis + + + + +

    贡献指南

    欢迎报告Issue或提交Pull Request。建议在贡献代码前先阅读以下贡献指南。

    报告问题

    我们使用Github Issuesopen in new window来跟踪漏洞和功能请求。

    搜索已知issue

    在您提交新的issue前,请搜索现有issue以查看是否已有人提交任何类似问题或功能请求,确认不存在重复的issue。

    报告新issue

    当您提交新的issue时,请尽量提供更多的信息,例如与问题相关的详细描述、屏幕截图、视频、logcat和导致崩溃的代码块。

    Pull Request

    我们非常欢迎您提出Pull Request来帮助TCA变得更好,操作流程详见PullRequests操作流程

    分支管理

    TCA有两个主要分支:

    • main 分支:
      1. 它是最新的(预)发布分支。我们以 main 作为标签, 带有版本号 v1.0.1, v1.0.2 ...
      2. 请不要在 main 分支提交任何PR.
    • dev 分支:
      1. 这是我们稳定发展的分支。经过全面测试后, dev 分支将合并到 main 分支的下一个版本。
      2. 请您将修复漏洞或开发新功能的PR提交到 dev 分支。

    提交Pull Request

    代码团队将监控所有拉取请求,我们对其进行一些代码检查和测试。在所有测试通过后,我们将接受此PR。但它不会立即合并到 main 分支,这有一些延迟。

    在提交拉取请求之前,请确保完成以下工作:

    1. Fork TCA仓库open in new window,并从 main 创建分支。
    2. 如果您更改了API,请更新代码或文档。
    3. 将版权声明添加到您添加的任何新文件的顶部。
    4. 检查您的代码样式。
    5. 测试您的代码,确保其可以正常运行。
    6. 现在,您可以向 dev 分支提交Pull Request。

    许可

    MIT LICENSEopen in new window 是 TCA 的开源许可证。任何人贡献的代码都受此许可证保护。在贡献代码之前,请确保您可以接受许可。

    + + + diff --git a/en/community/joingroup.html b/en/community/joingroup.html new file mode 100644 index 000000000..26f92a226 --- /dev/null +++ b/en/community/joingroup.html @@ -0,0 +1,33 @@ + + + + + + + + + 加入社区 | Tencent Cloud Code Analysis + + + + + + + + diff --git a/en/community/pr.html b/en/community/pr.html new file mode 100644 index 000000000..98439b1eb --- /dev/null +++ b/en/community/pr.html @@ -0,0 +1,35 @@ + + + + + + + + + PR操作流程 | Tencent Cloud Code Analysis + + + + +

    Welcome

    PR全称为Pull Request,它是一种代码库的协作方式。开发者可以通过PR将自己在代码库的修改通知到代码库负责人,由原作者评审代码并决定是否能合入。

    TIP

    Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

    PR操作流程

    一、Fork目标代码库

    fork

    点击Fork后,会在自己名下产生一个相同代码库,比如我Fork CodeAnalysis项目后,会在我名下多出一个CodeAnalysis代码库,地址为https://github.com/Lingghh/CodeAnalysisopen in new window

    二、克隆Fork的代码库并创建分支

    在本地克隆Fork的代码库并创建分支

    git clone https://github.com/Lingghh/CodeAnalysis
    +git checkout -b dev/add_qa_20220301
    +

    注:也可以在自己Fork的代码库GitHub页面上创建分支。

    fork1

    接下来就可以在本地修改代码,修改完成后先push到Fork的代码库中.

    三、在目标项目中提交PR

    1.进入到目标项目中,点击Pull requests Tab,再点击New pull request就会进入到创建PR的页面

    New pull request

    2.进入PR页面后

    • 点击compare across forks 。

    • 点击head repository 。

    • 选择自己Fork的代码库和比较的分支,比如我这里选择Lingghh/CodeAnalysis和待合入的分支dev/add_arm64_file 。

    • 最后确认commits和changed files是否准确,如果没有问题就可以点击Create pull request 。

      PR

    PR创建后,代码库管理员会评审你提交的代码,并决定是否接受该PR。

    更多信息请参阅GitHub PullRequest官方文档open in new window

    TCA团队诚邀您的加入

    + + + diff --git a/en/guide/index.html b/en/guide/index.html new file mode 100644 index 000000000..a7157d7a7 --- /dev/null +++ b/en/guide/index.html @@ -0,0 +1,33 @@ + + + + + + + + + 腾讯云代码分析 | Tencent Cloud Code Analysis + + + + +

    腾讯云代码分析

    腾讯云代码分析Tencent Cloud Code Analysis, TCA)起步于 2012 年(内部代号CodeDog),是集众多代码分析工具的云原生、分布式、高性能的代码综合分析跟踪管理平台,其主要功能是精准跟踪管理代码分析发现的代码质量缺陷、代码规范、代码安全漏洞、无效代码,以及度量代码复杂度、重复代码、代码统计。持续跟踪分析代码,观测项目代码质量,支撑团队传承代码文化。

    用心关注每行代码迭代,助力传承卓越代码文化!

    代码分析是通过词法分析、语法分析、控制流、数据流分析等技术对程序代码进行扫描,对代码进行综合分析,验证代码是否满足规范性、安全性、可靠性、可维护性等指标的一种代码分析技术。

    主要功能

    代码检查

    通过代码检查精准跟踪管理发现的代码质量缺陷、代码规范、代码安全漏洞、无效代码等。

    目前已集成众多自研、知名开源分析工具,并采用了分层分离架构,可以满足团队快速自助管理工具。

    代码度量

    包含代码圈复杂度、代码重复率和代码统计等度量信息。

    代码圈复杂度

    圈复杂度也称为条件复杂度或循环复杂度,它可以用来衡量一个模块判定结构的复杂程度。圈复杂度大说明程序代码的判断逻辑复杂,可能造成代码质量低下且难于测试和维护。

    定期分析工程项目中代码的圈复杂度,可以有效地帮助开发与测试逐步优化代码质量。

    代码重复率

    定期分析工程项目中的重复代码,可以有效地帮助开发发现冗余代码,进行代码抽象和重构,降低代码风险,以便于更好的管理和维护代码。

    代码统计

    支持全量增量展示代码行数统计,包含代码行、注释行和空白行,可以有效地跟踪了解工程项目中代码量持续变化,并可以查看各个语言的占比情况。

    + + + diff --git a/en/guide/web/deploySource.html b/en/guide/web/deploySource.html new file mode 100644 index 000000000..8b7cf43d8 --- /dev/null +++ b/en/guide/web/deploySource.html @@ -0,0 +1,35 @@ + + + + + + + + + VM 部署文档 | Tencent Cloud Code Analysis + + + + +

    VM 部署文档

    前置条件

    1. Linux 环境

    2. 系统已安装 nginx

    3. TCA Server 服务已部署完毕,具备后端服务地址

    部署步骤

    1. 进入前端部署源码目录

      进入web服务目录,并切换至tca-deploy-source目录,将其视为工作目录(假设工作目录为 /data/CodeAnalysis/web/tca-deploy-source

    2. 部署/更新前端服务

      # 部署、更新都使用此命令
      +sh ./scripts/deploy.sh init -d
      +

      具体请查阅部署脚本内容,可根据业务调整配置。

    3. 额外说明

      tca-deploy-source/scripts/config.sh 已配置默认环境变量,用户可根据需要调整环境变量再部署前端服务,具体可查阅脚本内容。

    + + + diff --git a/en/guide/web/web.html b/en/guide/web/web.html new file mode 100644 index 000000000..61299c03f --- /dev/null +++ b/en/guide/web/web.html @@ -0,0 +1,46 @@ + + + + + + + + + TCA Web | Tencent Cloud Code Analysis + + + + +

    TCA Web

    工程结构

    TCA Web 采用 Lernaopen in new window 进行 monorepo 管理。

    frameworklogintca-layouttca-analysistca-manage微前端以及tca-document前端帮助文档组成。

    packages 目录说明

    • shared: 公共模块

    • framework: 微前端基座

    • login: 登录微前端

    • tca-layout: 腾讯云代码分析layout微前端

    • tca-analysis: 腾讯云代码分析analysis微前端

    • tca-manage: 腾讯云代码分析后台管理微前端

    • tca-document: 腾讯云代码分析帮助文档

    基于构建后资源部署(tca-deploy-source)

    已将当前版本各个微前端构建打包到此目录,可通过阅读该目录下的 README 直接进行前端部署。

    基于开发模式启动

    • 按上一节完成一套 TCA Web 部署

    • 根据要调整的内容,启动对应的微前端(login、tca-layout、tca-analysis),具体可进入不同 package 参考阅读其目录下的 README 进行开发。

    其他

    • 根目录下启动单个项目

      # framework
      +yarn dev --scope framework
      +# login
      +PUBLIC_PATH=http://127.0.0.1:5055/ yarn dev --scope login
      +# tca-layout
      +PUBLIC_PATH=http://127.0.0.1:5056/ yarn dev --scope tca-layout
      +# tca-analysis
      +PUBLIC_PATH=http://127.0.0.1:5057/ yarn dev --scope tca-analysis
      +# tca-manage
      +PUBLIC_PATH=http://127.0.0.1:5058/ yarn dev --scope tca-manage
      +# tca-document
      +yarn dev --scope tca-document
      +# 或进入对应项目内,查阅对应README
      +

    本地开发后构建部署

    • 如对项目进行变更,本地开发结束后,需要部署最新资源可通过执行 sh build-source.sh 将构建后资源更新到tca-deploy-source 目录内,再参考该目录下的 README 直接进行前端更新/重新部署操作。

    • 可通过阅读 build-source.sh 内容,以及 tca-deploy-source 目录下的 README,用户可根据需要自行进行前端部署。

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html" new file mode 100644 index 000000000..1a1916641 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html" @@ -0,0 +1,33 @@ + + + + + + + + + 代码检查结果查看 | Tencent Cloud Code Analysis + + + + +

    代码检查结果查看

    客户端分析完毕后,如果分析方案含有代码检查功能,则代码分析结束后会上报结果信息到腾讯云代码分析平台,用户可在平台上查看问题列表及详情。

    问题列表

    问题列表

    进入代码检查问题列表页面后,默认展示**当前分支 + 当前分析方案(即分析项目)**发现的全部未处理问题。

    如果仅希望查看增量问题,可以进入分析历史页面,指定查看某一次的扫描结果即可。也可以在过滤筛选项中填入发现问题的扫描 id进行筛选查看结果(该id为扫描任务 ID,需要到扫描任务列表中查询)。

    • 责任人说明

      责任人为 git blame操作得到的代码提交人。

    • 问题级别说明

      代码检查的问题级别是根据对应分析方案中规则设置的严重级别定义的,从高到低分为 致命、错误、警告、提示 。如果调整问题级别,则需要进入分析方案中调整这个规则的严重级别,调整后需要进行全量扫描使得调整生效。

    • 批量处理说明

      问题列表支持批量修改问题状态。

      批量处理

    问题详情

    点击规则信息可以查看规则说明。

    查看规则详情

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/Error-Prone.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/Error-Prone.html" new file mode 100644 index 000000000..d789ec905 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/Error-Prone.html" @@ -0,0 +1,90 @@ + + + + + + + + + Error Prone 使用手册 | Tencent Cloud Code Analysis + + + + +

    Error Prone 使用手册

    Error Prone 介绍

    Error Prone是google开源的Java编译时检测工具,将常见的Java错误捕获为编译时错误,增强对java代码的类型分析,从而让开发人员及时发现问题

    TCA使用指引

    TCA原有编译时检测工具JavaWarning获取java代码编译时的告警信息,现集成Error Prone规则至JavaWarning工具以增加获取Error Prone的错误告警信息。

    • 在规则包中添加JavaWarning工具的Error Prone规则(可通过规则解决方法进行区分);
    • 采用TCA Client模式,根据客户端环境配置工具和编译命令,详情参考下文;
    • 客户端启动分析,在TCA Web页面上查看问题。

    Error Prone 配置

    通过Bazel构建

    • Bazel在构建java项目时,默认打开了Error Prone,所以在本地配置Bazel环境,编写Bazel构建文件,bazel build :project构建项目即可。
    • 详情请参考Bazel官方文档open in new window

    Maven 配置 Error Prone

    编辑pom.xml文件将设置添加到maven-compiler-plugin,例如:

    <build>
    +    <plugins>
    +      <plugin>
    +        <groupId>org.apache.maven.plugins</groupId>
    +        <artifactId>maven-compiler-plugin</artifactId>
    +        <version>3.8.0</version>
    +        <configuration>
    +          <source>8</source>
    +          <target>8</target>
    +          <encoding>UTF-8</encoding>
    +          <compilerArgs>
    +            <arg>-XDcompilePolicy=simple</arg>
    +            <arg>-Xplugin:ErrorProne</arg>
    +          </compilerArgs>
    +          <annotationProcessorPaths>
    +            <path>
    +              <groupId>com.google.errorprone</groupId>
    +              <artifactId>error_prone_core</artifactId>
    +              <version>${error-prone.version}</version>
    +            </path>
    +            <!-- Other annotation processors go here.
    +
    +            If 'annotationProcessorPaths' is set, processors will no longer be
    +            discovered on the regular -classpath; see also 'Using Error Prone
    +            together with other annotation processors' below. -->
    +          </annotationProcessorPaths>
    +        </configuration>
    +      </plugin>
    +    </plugins>
    +  </build>
    +

    对于JDK 16或更高的版本,需要将以下内容--add-exports--add-opens标志添加到.mvn/jvm.config文件中:

    --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
    +--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
    +--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
    +

    ###命令行 Error Prone 支持com.sun.source.util.PluginAPI,并且可以通过将 Error Prone 添加到-processorpath并设置-Xplugin标志来与JDK 9及更高版本一起使用:

    wget https://repo1.maven.org/maven2/com/google/errorprone/error_prone_core/${EP_VERSION?}/error_prone_core-${EP_VERSION?}-with-dependencies.jar
    +wget https://repo1.maven.org/maven2/org/checkerframework/dataflow-errorprone/3.15.0/dataflow-errorprone-3.15.0.jar
    +javac \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
    +  -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
    +  -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
    +  -XDcompilePolicy=simple \
    +  -processorpath error_prone_core-${EP_VERSION?}-with-dependencies.jar:dataflow-errorprone-3.15.0.jar \
    +  '-Xplugin:ErrorProne -XepDisableAllChecks -Xep:CollectionIncompatibleType:ERROR' \
    +  Example.java
    +

    其他配置和注意事项

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-C1.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-C1.html" new file mode 100644 index 000000000..1f9223577 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-C1.html" @@ -0,0 +1,118 @@ + + + + + + + + + TCA-Armory-C1 使用手册 | Tencent Cloud Code Analysis + + + + +

    TCA-Armory-C1 使用手册

    TCA-Armory-C1 属于 TCA 的增强分析模块。

    功能

    • Objective-C/C++ 代码规范
    • C/C++/Java 代码安全

    准备

    规则介绍

    CmdInject

    概述

    支持的语言:Java

    CmdInject 规则用于检查代码中是否存在命令行注入漏洞open in new window。 当使用 childprocess 等模块执行命令时,拼接了用户可控的输入,会导致命令执行漏洞。攻击者利用漏洞可以控制目标主机或者容器。

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String cmd = req.getParameter("cmd");
    +    Runtime rt = Runtime.getRuntime();
    +    rt.exec(cmd); // 触发规则
    +}
    +

    修复建议

    需要评估 childprocess 等模块执行命令的使用,应限定或校验命令和参数的内容。

    PathTraversal

    概述

    支持的语言:Java

    PathTraversal 规则用于检查代码中是否存在路径穿越漏洞open in new window。 操作文件时,应该限定文件的路径范围,如果拼接用户输入到文件路径,可能导致路径穿越漏洞。攻击者利用漏洞可以访问到文件系统上的任意文件,这可能导致信息泄漏等问题。

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String image = req.getParameter("image");
    +    File file = new File("resources/images/", image); // 触发规则
    +
    +    if (!file.exists()) {
    +        return Response.status(Status.NOT_FOUND).build();
    +    }
    +
    +    return Response.ok().entity(new FileInputStream(file)).build();
    +}
    +

    修复建议

    按业务需求,使用白名单限定后缀范围,校验并限定文件路径范围。

    SQLInject

    概述

    支持的语言:Java

    SQLInject 规则用于检查代码中是否存在SQL注入漏洞open in new window。 错误的拼接用户可控的值到 sql 语句,可能导致 sql 注入漏洞。攻击者可以修改 sql 语法来更改查询的目标或结果,泄露数据库敏感信息,也可以使用SQL文件操作攻击底层Web服务器。如果使用该 sql 查询进行授权认证,攻击者还可以用于提权。

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String id = req.getParameter("id");
    +    Connection conn = null;
    +    Statement statement = null;
    +    ResultSet rs = null;
    +
    +    Class.forName("com.mysql.cj.jdbc.Driver");
    +    conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/sec_sql", "root", "admin888");
    +    String sql = "select * from userinfo where id = " + id;
    +    statement = conn.createStatement();
    +    statement.executeUpdate(sql); // 触发规则
    +}
    +

    修复建议

    SQL 语句默认使用预编译并绑定变量,使用安全的ORM操作。

    SSRF

    概述

    支持的语言:Java

    SSRF 规则用于检查代码中是否存在服务端请求伪造漏洞 SSRF(Server-side request forgery)open in new window。 攻击者在未能取得服务器所有权限时,利用服务器漏洞以服务器的身份发送一条构造好的请求给服务器所在内网。

    参数设置

    示例

    import org.springframework.context.annotation.Configuration;
    +import org.springframework.security.config.annotation.web.builders.HttpSecurity;
    +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
    +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
    +
    +@EnableWebSecurity
    +@Configuration
    +public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    +  @Override
    +  protected void configure(HttpSecurity http) throws Exception {
    +    http
    +      .csrf(csrf ->
    +        csrf.disable() // 触发规则
    +      );
    +  }
    +}
    +

    修复建议

    限定访问网络资源地址范围,请求网络资源应加密传输。

    XSS

    概述

    支持的语言:Java

    XSS 规则用于检查代码中是否存在跨站脚本攻击漏洞 XSS(Cross-site scripting)open in new window。 如果 web 页面在动态展示数据时使用了用户的输入内容,没有对输入的内容过滤或者进行转义,黑客可以通过参数传入恶意代码,当用户浏览该页面时恶意代码会被执行。

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String id = request.getParameter("id") != null ? request.getParameter("id") : "0";
    +    Doc doc = getdetailsById(id);    
    +    byte[] b = doc.getUploaded();        
    +    try {
    +        response.setContentType("APPLICATION/OCTET-STREAM");
    +        String disHeader = "Attachment;Filename=" + doc.getName();
    +        response.setHeader("Content-Disposition", disHeader);
    +        ServletOutputStream out = response.getOutputStream();
    +        out.print(b); // 触发规则
    +    }
    +}
    +

    修复建议

    在输出所有用户可控的数据时, 对数据做转义或者编码。

    概述

    检查 Objective-C/C++ 代码文件的copyright信息。

    参数设置

    示例

    // 触发规则
    +@interface Test : NSObject
    +@end
    +
    +

    修复建议

    在代码文件头部添加 Copyright 信息。比如:

    // Copyright (c) xxxx Tencent. All rights reserved.
    +//
    +
    +@interface Test : NSObject
    +@end
    +
    +

    ObjectiveC/Indent

    概述

    检查 Objective-C/C++ 代码文件的缩进。

    参数设置

    • IndentStyle: 可选 spaces 空格 和 tabs \t ,默认是 spaces;
    • IndentSize: 缩进长度,默认是4。

    参考以下示例:

    IndentStyle=spaces
    +IndentSize=4
    +

    示例

    for (int i = 0; i < 10; i++) {
    +  doThings(); // 触发规则
    +}
    +

    修复建议

    调整为对应的缩进方式。比如默认是4个空格缩进。

    for (int i = 0; i < 10; i++) {
    +    doThings(); // 触发规则
    +}
    +

    ObjectiveC/MaxLinesPerFunction

    概述

    检查 Objective-C/C++ 代码中超出行数长度阈值的函数。

    参数设置

    • LineThreshold: 方法长度阈值,默认是100。

    参考以下示例:

    LineThreshold=100
    +

    示例

    修复建议

    可以基于单一职责原则拆分函数,缩减函数长度。

    ObjectiveC/MissingDocInterface

    概述

    检查 Objective-C/C++ 代码中 interface 是否有注释信息。

    参数设置

    示例

    修复建议

    为 inferface 增加注释。

    ObjectiveC/MissingDocProperty

    概述

    检查 Objective-C/C++ 代码中 Property 是否有注释信息。

    参数设置

    示例

    修复建议

    为 Property 增加注释。

    ObjectiveC/MissingDocProtocol

    概述

    检查 Objective-C/C++ 代码中 Protocol 是否有注释信息。

    参数设置

    示例

    修复建议

    为 Protocol 增加注释。

    ObjectiveC/ParameterCount

    概述

    检查 Objective-C/C++ 代码中方法的参数个数是否超过阈值。

    参数设置

    • Max: 参数个数阈值,默认是6。

    参考以下示例:

    Max=6
    +

    示例

    无。

    修复建议

    参数个数越少越好,多于 6 个参数时建议考虑重构。

    ObjectiveC/ClassNaming

    概述

    检查 Objective-C/C++ 代码中 class 名称是否符合命名规范。

    参数设置

    • ClassCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 CamelCase。

    参考以下示例:

    ClassCase=CamelCase
    +

    示例

    无。

    修复建议

    修改 class 名称符合命名规范。

    ObjectiveC/FunctionNaming

    概述

    检查 Objective-C/C++ 代码中 Function 名称是否符合命名规范。

    参数设置

    • FunctionCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    FunctionCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Function 名称符合命名规范。

    ObjectiveC/GlobalVariableNaming

    概述

    检查 Objective-C/C++ 代码中 GlobalVariable 名称是否符合命名规范。

    参数设置

    • GlobalVariablePrefix: 全局变量前缀,默认是 g
    • GlobalVariableCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    GlobalVariablePrefix=g
    +GlobalVariableCase=camelBack
    +

    示例

    无。

    修复建议

    修改 GlobalVariable 名称符合命名规范。

    ObjectiveC/LocalVariableNaming

    概述

    检查 Objective-C/C++ 代码中 LocalVariable 名称是否符合命名规范。

    参数设置

    • LocalVariableCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    LocalVariableCase=camelBack
    +

    示例

    无。

    修复建议

    修改 LocalVariable 名称符合命名规范。

    ObjectiveC/MacroNaming

    概述

    检查 Objective-C/C++ 代码中 Macro 名称是否符合命名规范。

    参数设置

    • MacroCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 UPPER_CASE。

    参考以下示例:

    MacroCase=UPPER_CASE
    +

    示例

    无。

    修复建议

    修改 Macro 名称符合命名规范。

    ObjectiveC/MethodNaming

    概述

    检查 Objective-C/C++ 代码中 Method 名称是否符合命名规范。

    参数设置

    • MethodCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    MethodCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Method 名称符合命名规范。

    ObjectiveC/ParameterNaming

    概述

    检查 Objective-C/C++ 代码中 Parameter 名称是否符合命名规范。

    参数设置

    • ParameterCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    ParameterCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Parameter 名称符合命名规范。

    ObjectiveC/MaxLineLength

    概述

    检查 Objective-C/C++ 代码中一行长度是否超过阈值。

    参数设置

    • tabWidth: 缩进宽度,默认是4;
    • MaxLineLength: 长度阈值,默认是150。

    参考以下示例:

    tabWidth=4
    +MaxLineLength=150
    +

    示例

    无。

    修复建议

    通过换行、优化逻辑等方式,缩减一行长度。

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-Q1.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-Q1.html" new file mode 100644 index 000000000..d01e9cc87 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-Q1.html" @@ -0,0 +1,350 @@ + + + + + + + + + TCA-Armory-Q1工具介绍 | Tencent Cloud Code Analysis + + + + +

    TCA-Armory-Q1工具介绍

    TCA-Armory-Q1, 又名 tca_ql_cpp 主要用于分析Cpp质量问题。

    规则详情

    线程锁检查

    包含规则:

    • missing_lock
    • dead_lock

    在使用多线程对文件全局变量或类成员在进行读写时,工具会对未正确的进行上锁操作和上锁异常而引发死锁的情况进行检查。

    支持的多线程标准库库包括(若有其他库需求可提issue):

    • pthread
    • thread

    missing_lock

    missing_lock 如果发现多线程中某个全局变量在未持有锁便更新时,则会上报错误。

    代码示例

    以下提供一个或多个 missing_loc 案例 在下面代码中,函数 increase1, increase2 皆以将 counter 加到 1000 为目的。如果使用 increase1 函数则有可能多个线程皆在 1000 时进入循环导致最后 counter结果大于 1000

    int counter = 0;
    +std::mutex mtx;  // 保护counter
    +void increase1() {
    +    while (1) {
    +        if (counter <= 1000)
    +            counter++;  // defect: missing_lock
    +        else
    +            break;
    +    }
    +}
    +void increase2() {
    +    while (1) {
    +        mtx.lock();  // example_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx.unlock();  // example_release
    +    }
    +}
    +

    dead_lock

    dead_lock 如果发现文件内存在 mtx1 -> mtx2 的上锁顺序时,另存在mtx2 -> mtx1 的上锁顺序,视为死锁或存在死锁的可能,则会上报错误。 死锁发生时程序将会卡死无法正常执行。

    规则参数
    • better-lock: True or False 默认为 False
    代码示例

    以下提供一个或多个 dead_lock 案例

    在下面代码中,函数 increase 以将 counter 加到 1000 为目的。但在线程 1 中第一次释放 mtx 后,线程 2 的 mtx 上锁,此时线程1等待线程2释放mtx,线程2等待线程1释放mtx2,形成死锁,程序卡死。

    int counter = 0;
    +std::mutex mtx;
    +std::mutex mtx2;
    +void increase() {
    +    while (1) {
    +        mtx.lock();
    +        mtx2.lock();
    +        mtx.unlock();
    +        mtx.lock();  // defect: dead_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +

    在下面代码中 线程函数increase1存在mtx -> mtx2 的顺序,increase2顺序为 mtx2 -> mtx;视为出现死锁。

    void increase1() {
    +    while (1) {
    +        mtx.lock();
    +        mtx2.lock();
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +void increase2() {
    +    while (1) {
    +        mtx2.lock();
    +        mtx.lock();  // defect: dead_lock; 
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +

    以下案例在better-lock参数为True时将会生效 使用better-lock规则会检查在上锁期间若调用其他函数时将视为可能会出现预期之外的异常,且上锁期间应只做对全局变量操作以提升性能

    void increase1() {
    +    while (1) {
    +        mtx.lock();
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        read_counter(counter);  // defect: dead_lock
    +        mtx.unlock()
    +    }
    +}
    +void read_counter(counter){
    +    std::cout << counter << std::endl;
    +    do_something_more();
    +}
    +void increase1() {
    +    while (1) {
    +        std::lock_guard<std::mutex> lk(mtx);  // good: 使用lock_guard会自动上锁解锁将不会检查dead_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        read_counter(counter);
    +    }
    +}
    +

    资源泄漏检查

    包含规则

    • resource_leak

    resource_leak

    resource_leak 在程序申请了资源但并未按时释放时上报错误 目前场景包括:句柄打开时未关闭,指针分配内存后没有及时释放

    代码示例

    以下将提供一个或多个resource_leak案例

    int leak_example1(int c) {
    +    void *p = malloc(10); 
    +    if(c)
    +        return -1; // defect: if c "p" is leaked
    +    free(p);
    +    return 0;
    +}
    +
    +int leak_example2() {
    +    void *p = malloc(10);
    +    void *q = malloc(20);
    +    if(!p || !q)
    +        return -1; // defect: "p" or "q" may be leaked if the other is NULL 
    +    /*...*/
    +    free(q);
    +    free(p);
    +    return 0;
    +}
    +
    +void leak_example3(int c) {
    +    FILE *p = fopen("starwar.anakin", "rb");
    +    if(c)
    +        return;       // defect: leaking file pointer "p"
    +    fclose(p);
    +}
    +
    TODO

    指针为返回值目前不会进行上报与检查,需要后期增加对返回值是否释放的检查

    无效值检查

    包含规则

    • unused_value

    unused_value

    unused_value 检查那些赋予给变量的值是否正确被使用,存在连续两次赋予变量值的情况,视为第一次赋予的值未被正确使用,报出错误。 两次连续赋值可能存在条件控制语句出现错误、变量名拼写错误等情况。

    代码示例

    以下提供一个或多个unused_value案例

    以下函数会因为key的不同去不一样的神明,但实际上 Zeus Hades却永远不会使用到。

    const char* key_value(const int key) {
    +    const char * value = 0;
    +    if (key != 0) {
    +        value = "Zeus";
    +    } else if (key != 1) {
    +        value = "Hades";
    +    } 
    +    if (key != 2) { // Should be 'else if' here.
    +        value = "Poseidon";  // defect: unused_value Zeus Hades  never used
    +    }
    +    else {
    +        value = "Unknow
    +    }
    +    return result;
    +}
    +

    以下继续提供几个unused_value代码

    const char* key_value1(const int key) {
    +    const char * value = 0;
    +    value = "Zeus";  // defect: Zeus never used
    +    if (key == 1) {
    +        value = "Hades;
    +    } else if (key == 2) {
    +        value = "Poseidon";
    +    } else {  // May else need not be here
    +        value = "Unknow";
    +    }
    +    return value
    +}
    +
    +const char* key_value2(const int key) {
    +    const char * value = 0;
    +    value = "Zeus";  // better Zeus used
    +    if (key == 1) {
    +        value = "Hades;
    +    } else if (key == 2) {
    +        value = "Poseidon";
    +    }
    +    return value
    +}
    +
    +const char* key_value3(const int key) {
    +    const char * value = 0;
    +    if (key == 1) {
    +        value = "Hades;
    +    } else {
    +        value = "Poseidon";
    +    }
    +    value = "Zeus";  // defect: Hades Poseidon never used
    +    return value
    +}
    +

    数组溢出检查

    包含规则

    • array_overflow
    • buff_overflow

    array_overflow

    array_overflow 检查数组越界的情况。不正确的缓存区访问可能损坏内存,导致程序崩溃或读取到权限外的内存。

    代码示例

    以下提供一个或多个array_overflow案例

    void foo() {
    +    int array[10];
    +    int i = get();
    +    // i = 9;
    +    if (i > 8 && i <= length(array)) {  // Shoud be i < length(array)
    +        array[i] = 1;  // defect: array[10] overflow
    +    }
    +    array[i] = 1;  // defect: array[10] overflow
    +}
    +
    +
    +void test(int i) {
    +    int n= 10;
    +    char *p = malloc(sizeof(int) * 10);
    +    int y = n;
    +    p[y] = 'a'; // defect: writing to buffer[y] overflow
    +}
    +
    TODO
    • 提供规则参数支持函数参数作为数组或索引的情况检查

    buff_overflow

    buff_overflow 检查strcpy,strcat字符串复制/拼接过程中长度不当导致的溢出, 同样gets scanf函数也视为不安全

    代码示例

    以下提供一个或多个buff_overflow案例

    void overflow1() {
    +
    +    char a[4]={0};
    +        strcpy(a, "Poseidon");  // defect: len("Poseidon") > 4 strncpy is better
    +    return;
    +}
    +
    +void overflow2() {
    +    char s1[10] = "1";
    +    char s2[] = "1234567890";
    +    strcat(s1, s2);  // defect: len(s1 + s2) > 10
    +    // strncat(s1, s2, 6)  // strncat is better
    +    return 0;
    +}
    +
    +

    指针检查

    包含规则

    • func_ret_null
    • func_ret_null_full
    • use_after_free
    • forward_null
    • reverse_null
    • glob_null_pointer

    func_ret_null

    func_ret_null 函数返回值可能为nullpointer,但是调用该函数时指针未经判空便进行使用
    在选用func_ret_null_full 时, 检查器会在项目内全局搜索空指针函数的调用情况,否则只会在相关文件内进行检查。

    代码示例

    以下提供一个或多个func_ret_null代码案例

    在下面代码中test函数中调用get_name可能返回空指针,在后续使用name指针前应该判断是否为空指针

    // name.hpp
    +
    +char* get_name(int id) {
    +    char* name = 0;
    +    if (id == 1) {
    +        name = "Zeus";
    +    } else if (id == 2) {
    +        name = "Hades"
    +    } else {
    +        return nullpointer;
    +    }
    +    return name;
    +}
    +
    +void test(int i) {
    +    char* name = get_name(i);
    +    dosomething(name);  // defect: name may nullpointer should check it
    +    if (name != nullpointer) {
    +        dosomething(name);  // good
    +    }
    +}
    +
    +

    在选用full_ret_null_full时,将会全局分析函数get_name调用情况

    // third.cpp
    +# include "name.h"
    +
    +void name_test(int i) {
    +    char* name = get_name(i);
    +    dosomething(name); // defect
    +}
    +

    use_after_free

    use_after_free 检查当指针已经被释放但在后续仍然使用该指针的情况。

    代码示例

    以下提供一个或多个use_after_free代码案例

    通常情况下已经释放的指针只允许置空或重新指向新的值,不允许存在读取或作为函数参数使用。

    
    +void UAR() {
    +    int* p = new int[];
    +    p = get_array();
    +    dosomething(p);
    +    delete p;
    +    p = NULL;  // allow
    +    p = get_array();  // allow: get array again
    +    delete p;
    +    dosomething(p);  // defect: use as param
    +    std::cout << "p[0] = " << p[0] << std::endl;  // defect: read p
    +}
    +

    forward_null

    forward_null 检查可能导致程序终止或运行时异常的错误。它查找指针或引用被检查是否为 null 或被赋值为 null,且之后被解引用的很多情况。

    规则参数
    • trust_param True or False 默认为 True
    代码示例

    以下提供一个或多个forward_null代码案例

    指针曾经有过检查null的操作则会视为有可能为空指针,之后在未被确认为非空指针情况下直接使用。将会视为forward_null错误

    void forward_null_1() {
    +    int * p;
    +    p = get_int_pointer();
    +    dosomething(p);
    +    if (p == NULL) {
    +        std::cout << "Null Pointer Find" << srd::endl;
    +        // return;      // prefer: if return here
    +    } else {
    +        dosomething(p);     // good: p is not NULL
    +    }
    +    dosomething(p);     // defect forward_null: p may NULL
    +}
    +
    +
    +void forward_null_2(int *p) {
    +    dosomething(p);
    +    if (p == NULL) {
    +        return;
    +    } else {
    +        dosomething(p);     // good: p is not NULL
    +    }
    +    dosomething(p);     // good
    +    ...
    +    if (p != NULL) {    // means p may nullpointer here
    +        dosomething(p);
    +    }
    +    dosomething(p);     // defect forward_null:p may NULL
    +}
    +

    以下案例在设置trust_paramFalse时将会生效,其将会默认认为函数参数存在空指针可能,必须确认无空指针可能时方可使用

    void forward_null_2(int *p) {
    +    dosomething(p);     // defect: param p may NULL
    +    if (p != NULL) {    // means p may nullpointer here
    +        dosomething(p);
    +    }
    +    dosomething(p);     // defect forward_null:p may NULL
    +}
    +

    reverse_null

    reverse_null 检查已经使用过指针,但在后续又对指针进行了判空操作;会被认为之前使用指针也有可能是空指针。

    代码示例

    以下将提供一个或多个reverse_null案例

    void reverse_null(int *p) {
    +    dosomething(p);      // use p
    +    if (p != NULL) {    // defect reverse_null: It means p may NULL
    +        dosomething(p);
    +    }
    +    ...
    +

    glob_null_pointer

    glob_null_pointer 检查文件内全局指针是否为空,指针赋值将会被认为不为空指针,但检测到空指针判断则视为指针此时可能为空,如果在可能为空时使用则会报错

    代码示例

    以下将提供一个或多个glob_null_pointer案例

    int *p;
    +
    +
    +void thread1() {
    +    p = get_int_pointer();      // p is not NULL
    +    dosomething(p);     // good
    +    if (p != NULL) {
    +        something(p);   // good
    +    }
    +    something(p);  // defect: p may NULL, because check p before
    +}
    +
    +
    +void thread2() {
    +    *p = 6;     // defect: p may NULL
    +    if (p != NULL) {
    +        something(p);   // good
    +    }
    +    something(p);  // defect: p may NULL
    +}
    +

    函数重写

    包含规则

    • function_override

    仅类虚拟函数允许重写。

    function_override

    function_override 检查非虚拟函数重写的情况。

    代码示例

    以下提供一个或多个function_override代码案例

    
    +
    +class father{
    +    public:
    +        father(){};
    +        ~father(){};
    +    
    +    private:
    +        virtual void test(){};
    +        void test2(){ std::cout<<"hello";};
    +};
    +
    +class man{};
    +
    +
    +class son: public father, public man{
    +    public:
    +        son(){};
    +        ~son(){};
    +    private:
    +        void test(){ std::cout<<"hello";};  // allow: virtual function override
    +        void test2(){ std::cout<<"hello";};  // defect: bad override
    +};
    +
    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-R.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-R.html" new file mode 100644 index 000000000..78b12e414 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-R.html" @@ -0,0 +1,33 @@ + + + + + + + + + TCA-Armory-R 使用手册 | Tencent Cloud Code Analysis + + + + +

    TCA-Armory-R 使用手册

    TCA独立工具TCA-Armory-R,别名RegexScanner,正则匹配工具,支持扫描文件名称和文本内容,支持页面直接自定义创建规则

    适用场景

    • 检测项目中的文件名,比如漏洞文件log4j-core-2.10.1.jar
    • 检测代码文件中的文本内容,比如高危函数vsscanf
    • 检测配置文件中的文本内容,比如账号密码明文

    对比RegexScan、RegexFileScan

    • 单个工具即可完成文件名和文件内容的检查
    • 扫描速度更快,大概减少60%的耗时
    • 单条规则内支持多条正则表达式
    • 支持正则过滤
    • 支持匹配分组和熵检测
    • 只支持go的正则语法open in new window

    快速接入

    以下是接入步骤:

    1. 属于增强分析模块,需要先部署CLS
    2. 在代码分析创建项目,自定义规则包里添加想要进行扫描的TCA-Armory-R规则
    3. 启动分析即可

    自定义规则

    1. 开放支持自定义规则权限

    开放支持自定义规则权限,需平台管理员在管理入口-工具管理中找到TCA-Armory-R工具,并将其权限状态调整为支持自定义规则

    规则权限详见自定义规则权限说明

    2. 添加规则

    进入工具管理入口,进入TCA-Armory-R工具页面,选择上方的“自定义规则”,然后点击“添加规则”:

    添加自定义规则

    3. 填写规则信息

    进入“创建规则”页面,按照需求填写相关信息,完成后,点击页面最后的“确定”按钮提交。

    规则示例:

    规则扫描场景:扫描代码中的 github token,如果token以明文形式写在源码文件中,会造成隐私泄露,可能造成严重的安全事故。

    正则表达式:匹配 github token 字符串,根据github token的一般形式,可以推断出正则表达式 ((ghp|gho|ghu|ghs)_[0-9a-zA-Z]{36})。

    TIP

    只支持go正则语法: regexpopen in new window

    建议先测试好正则表达式是否正确,正则表达式测试网站推荐:http://tool.oschina.net/regex

    填写自定义规则

    字段解释

    规则名称、前端展示名称:建议使用单词首字母大写的格式,如 DetectedGithubToken

    规则简述:作为扫描出来到问题标题

    规则参数:

    TIP

    规则参数中的(3)(4)(5)属于新功能,需要将客户端client和工具库TCA-Armory更新到最新版本

    • (1) 参数格式类似ini的格式, 也就是key = value的格式

    • (2) [必选] regex 参数,用于指定扫描的正则表达式,例如: regex=((ghp|gho|ghu|ghs)_[0-9a-zA-Z]{36})只支持go正则语法: regexpopen in new window。建议先测试好正则表达式是否正确,正则表达式测试网站推荐:http://tool.oschina.net/regexopen in new window

    • (3) [可选] regex{N} 参数,只有在已有regex参数情况下生效,用于扩展扫描的正则表达式,其中 N 从1开始计数,例如: regex1=EAAAACZAVC6ygB[0-9A-Za-z]+, regex2=EAAAAZAw4[0-9A-Za-z]+regex{N}regex的表达式均为关系,每一个匹配结果上报一个问题。

    • (4) [可选] regex_not 参数,用于指定正则过滤表达式,例如: regex_not=(?i)example。可以对(2)(3)中regex匹配的字符串进行筛选,如果匹配则过滤该结果,不予上报。

    • (5) [可选] regex_not{N} 参数,只有在已有regex_not参数情况下生效,用于扩展正则过滤表达式,其中 N 从1开始计数,例如: regex_not1=(?i)test, regex_not2=(?i)fakeregex_not{N}regex_not的表达式均为关系。

    • (6) [必选] msg 参数,用于展现issue说明, 例如: msg=检测到高危函数%s,建议替换。

      • msg中的“%s”使用regex中的group(用“()"括起来的部分)一一匹配,单个%s默认为整个regex匹配的字符串

      • 如果regex没有定义group,则msg最多有一个%s, 并由整个regex匹配的字符串替代

      • 如果msg里没有包含“%s”,则直接显示msg

      • 如果msg没有提供,则会给出默认信息

    • (7) [可选] ignore_comment 参数,用于指定是否忽略注释代码,可选值:True、true、False、false 。例如: ignore_comment=True, 默认是False

    • (8) [可选] file_scan 参数,用于指定是否扫描文件名称,可选值:True、true、False、false 。例如: file_scan=True, 默认是False

    • (9) [可选] include 参数,用于指定只扫描的文件匹配范围,基于相对路径,使用通配符格式,多项使用英文分号(;)隔开。例如: include=src/test;src/main.*;*.cpp

    • (10) [可选] exclude 参数,用于指定不扫描的文件匹配范围,格式同include参数,例如: exclude=tests;*.json

      路径过滤(exclude, include)采用Glob-Style的匹配模式,详见 Go-filepath-Matchopen in new window, 除了 ** 用来匹配零或多个目录,本工具会默认匹配前后目录。举例:

      1. exclude=*.py 会忽略以下文件: main.py, src/main.py, main.py/install.sh
      2. exclude=tests 会忽略以下文件: tests/test.py, a/tests/b/test.py
      3. include=main.* 会只扫描以下文件: src/main.py, app/main.go
      4. include=srcexclude=src/lib 会只扫描以下文件: src/main.py, src/project/proj.py; 忽略以下文件: src/lib/lib.py, src/lib/package/pack.js
    • (11)[可选] match_group 参数,用于指定正则匹配的分组,数值不能大于正则匹配分组数,例如: regex=(aws_account_id)\s{0,50}(:|=>|=)\s{0,50}([0-9]{12})match_group=3,匹配到第3个分组([0-9]{12})

    • (12)[可选] entropy 参数,用于指定正则匹配结果的最小信息熵,例如:entropy=3,熵不大于3的匹配结果将被过滤

      信息熵:熵(信息论)open in new window 可用于敏感信息(密钥、token)的检测 含义:可以理解为字符串的混乱程度,字符越随机,熵越大。因此,设置合适的熵,可以过滤掉一些误报或者人为测试用例。

    4. 将自定义规则添加到项目分析方案中

    进入 代码分析 - 分析方案 - 代码检查 - 自定义规则包 - 查看详细规则,添加规则。

    点击自定义规则包

    添加规则

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/eslint.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/eslint.html" new file mode 100644 index 000000000..1c38b9957 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/eslint.html" @@ -0,0 +1,36 @@ + + + + + + + + + Eslint 使用手册 | Tencent Cloud Code Analysis + + + + +

    Eslint 使用手册

    代码分析支持 Eslint 分析,并支持用户自由扩展配置。

    适用场景

    目前 TCA-Eslint 的适用场景很广,灵活扩展:

    • JavaScript
    • TypeScript
    • React
    • Vue
    • Google 代码规范分析
    • 其他,包括项目自己维护的 Eslint 配置

    快速接入

    以下是接入步骤:

    1. 在代码分析创建项目,会自动匹配 JavaScript 或者 TypeScript 对应的推荐规则集
    2. 启动分析即可

    高级配置

    基础概念

    在进行高级配置之前,这里先普及下代码分析这边的基础概念——Eslint 类型。 由于 JavaScript 语法、 Vue 语法和 TypeScript 语法之间的区别,三者使用的语法解析器也是不一样的,这里基于其使用的语法解析器的不同,从 Eslint 中拆分出来了 Eslint_vue 和 Eslint_typescript 工具。可以根据需要选择对应工具下的规则进行分析。而配置也会基于类型的不同匹配到对应的工具中。 目前代码分析上 Eslint 类型有:

    • JAVASCRIPT
      分析 JavaScript 以及基于 JavaScript 写的 React 代码,默认分析文件后缀名为.js,.jsx
    • VUE
      分析 Vue 框架的代码,默认分析文件后缀名为.vue
    • TYPESCRIPT
      分析 TypeScript 以及基于 TypeScript 写的 React 代码,默认分析文件后缀名为.ts,tsx

    设置 Globals

    因为项目会用到各式各样的框架,其中会有全局变量是 Eslint 无法识别到的,比如 _ 或者 jtest,从而导致分析出不少误报。这里支持使用下面环境变量设置这些全局变量,减少误报。可以在代码分析项目中设置对应的环境变量。

    环境变量名称描述
    ESLINT_JAVASCRIPT_GLOBALS字符串,以分号分割
    ESLINT_VUE_GLOBALS字符串,以分号分割
    ESLINT_TYPESCRIPT_GLOBALS字符串,以分号分割

    比如:

    ESLINT_JAVASCRIPT_GLOBALS=_:readonly;jtest:readonly
    +

    其中,

    • writable 表示允许重写变量
    • readonly 表示不允许重写变量
    • off 表示禁用该全局变量

    指定参数配置文件

    代码分析执行 Eslint 分析,默认会使用 Alloy Team 的 Eslint 配置来分析,但是也支持修改配置。

    1. 在代码库中创建一个参数配置 Json 文件,结果类似 Eslint 的 Json 配置文件
    2. 在代码分析项目设置下面对应环境变量,指向这个参数配置文件 指定了参数配置文件之后,Eslint 分析时候就会自动将代码分析默认的配置与该参数配置文件进行合并。
    3. 启动全量分析即可
    环境变量名称描述
    ESLINT_JAVASCRIPT_OPTIONS字符串,相对代码库根目录路径
    ESLINT_VUE_OPTIONS字符串,相对代码库根目录路径
    ESLINT_TYPESCRIPT_OPTIONS字符串,相对代码库根目录路径

    指定 Eslint 配置文件

    代码分析也支持用户指定自己维护的 Eslint 配置文件进行分析。

    环境变量名称描述
    ESLINT_JAVASCRIPT_CONFIG字符串,相对代码库根目录路径
    ESLINT_VUE_CONFIG字符串,相对代码库根目录路径
    ESLINT_TYPESCRIPT_CONFIG字符串,相对代码库根目录路径

    设置配置类型

    代码分析自带支持 Google 代码规范,可以在代码分析项目设置对应环境变量,使用对应的配置文件。

    环境变量名称描述
    ESLINT_JAVASCRIPT_CONFIG_TYPE字符串, google,default,custom
    ESLINT_VUE_CONFIG_TYPE字符串, 可选:default,custom
    ESLINT_TYPESCRIPT_CONFIG_TYPE字符串, 可选:default,custom

    其中:

    • google,表示使用 google 代码规范配置文件
    • default,表示使用代码分析维护的配置文件
    • custom,表示使用项目代码库中 Eslint 配置文件

    配置优先顺序

    这里介绍 TCA-Eslint 的配置使用顺序:

    1. 优先检查是否设置对应的 ESLINT_CONFIG 环境变量,比如 ESLINT_JAVASCRIPT_CONFIG
    2. 然后检查是否设置对应的 ESLINT_CONFIG_TYPE 环境变量,比如 ESLINT_JAVASCRIPT_CONFIG_TYPE
    3. 若是 JAVASCRIPT 类型的项目,会自动检测代码库根目录下是否有 ESLINT 配置文件,若有则使用该配置文件进行分析,其他类型的项目便不会有这一步
    4. 使用代码分析维护的 Alloy Team 的配置文件进行分析

    分析路径配置

    可以在代码分析页面上设置分析路径设置,这里建议多使用 Exclude 设置,因为 Eslint 工具本身对 include 支持不友好。

    Q&A

    Q:JavaScript 内存溢出

    A:Eslint 执行可能会出现 Js 内存溢出,以下有三种方案可以解决:

    • 可以设置环境变量 NODE_OPTIONS,比如
    NODE_OPTIONS="--max-old-space-size=4096"
    +
    • 设置环境变量 ESLINT_MAX_OLD_SPACE_SIZE,比如
    ESLINT_MAX_OLD_SPACE_SIZE=4096
    +
    • 设置分析路径过滤,将无用的文件进行过滤

    Q:一个配置同时分析 JS 和 TS

    A:若代码库中既有 JavaScript 代码,又有 TypeScript 代码,并且共用一个配置文件。 若规则集中既有 Eslint 规则又有 Eslint_typescript 规则,为了避免执行两次 Eslint 以及可能出现重复单的情况,并且因为 Eslint_typescript 的语法解析器也能够解析 JavaScript 代码,所以这里将这样的项目当作 TypeScript 项目。

    1. 这里建议只指定 ESLINT_TYPESCRIPT_CONFIG 环境变量
    2. 规则集中剔除 Eslint 的规则,只保留 Eslint_typescript 规则。
    3. 并指定 ESLINT_TYPESCRIPT_EXT=.js,.jsx,.ts,.tsx

    Q:找不到依赖

    A:用户自己配置的配置文件中,可能会用到代码分析没有管理到的规则插件,导致分析时候找不到对应的依赖,这里有两个方案提供解决:

    • 在代码库根目录下 npm 安装对应插件,并设置分析路径过滤 node_modules

    Q:custom 与指定配置文件的区别

    A:- custom 模式,会检测代码库中的 Eslint 配置文件进行分析,包括子目录和代码注释中设置的配置,都是可以生效的。

    • 相对的,指定配置文件的方式,只会对指定的配置文件中的配置会生效。
    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/golangcilint.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/golangcilint.html" new file mode 100644 index 000000000..011b20609 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/golangcilint.html" @@ -0,0 +1,36 @@ + + + + + + + + + Golangcilint 使用手册 | Tencent Cloud Code Analysis + + + + +

    Golangcilintopen in new window 使用手册

    对比 GoMetaLinter

    Golangci-lint 是为了解决 GoMetalinter 的弊端而改版升级的。

    1. 比 GoMetaliner 快个 2 到 7 倍

    2. 共享代码缓存,消耗内存比 Gometaliner 少 26%

    3. 更精准的 issue,会内置一些 exclude 列表过滤掉误报 issue

    4. 支持增量分析

    快速接入

    1. 在 CI 系统上选用 TCA 插件,或者下载 TCA 客户端到本地机器上

    2. 因为 GolangCiLint 要求找寻到项目需要的全部依赖,否则就会执行失败。所以这里需要在 Ci 系统或者本地机器上配置好项目的依赖,并确保能够编译通过

    3. 检查是否设置了 GOPATH 和 GOROOT,在分析方案的环境变量中设置 GOPATH=$GOPATH

    4. 在 代码分析 页面上关联待分析的代码库并创建分析方案,并在代码检查-规则设置的自定义规则包里面添加 GolangCiLint 工具规则

    5. 在分析方案中增加编译命令

    6. 然后在 CI 系统上或者本地启动代码分析即可

    高级配置

    Include

    若项目目录结构如下图,需要设置 include 执行 myproj,比如 src/myproj/*

    这是因为 GolangCiLint 分析前会优先检查所有代码文件的依赖是否齐全,所以需要设置 include,让工具只关注 include 下面的代码文件的依赖。

    在分析方案的过滤配置,路径过滤中添加 include 路径。

    include

    Q&A

    • Q:出现 no go files to analyze 问题

      A:这里可能为以下原因:

      1. 机器环境没有项目的完整依赖,使用以下命令查找对应依赖在 GOPATH 下是否存在或者 GOPATH 设置是否完整(有的项目有多个 GOPATH 内容),或者对应依赖是否存在,需要用户部署好机器环境

        grep -nr "path/to/GOPATH" .
        +
      2. 没有指定 include 分析路径过滤,这样才不会检查依赖中的依赖,而是关注源码文件的依赖完整性

      3. 也可能是某 go 文件中使用到该依赖,但是 GOPATH 没有设置正确的依赖搜索路径导致。需要找到依赖相对的当前目录:

        grep -nr "path/to/GOPATH" .
        +

        然后设置到 GOPATH 中,比如

        GOPATH=$GOPATH:$SOURCE_DIR/test
        +
      4. 还有可能是部分依赖是需要编译之后生成的,需要正确填写好编译命令,使得项目编译成功。

    • Q:could not determine GOARCH and Go compiler 问题

      A:跟问题 1 是一样的问题。解决方案也是一样。

    • Q:failed to run 'go env': exit status 1 问题

      A:原因是找不到正确的 GOPATH。解决方案是设置 GOPATH 环境变量。

    • Q:GO 版本限制

      A:因为 golangci-lint 用到了 go mod 特性,该特性是在 1.11 之后才有的。所以要求 go 版本在 1.11 版本以上。

      go版本限制

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html" new file mode 100644 index 000000000..ac7be58b3 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 添加规则配置 | Tencent Cloud Code Analysis + + + + +

    添加规则配置

    规则配置是代码检查应用的规则集合,用于指定用哪些工具和规则进行代码分析扫描。目前,TCA 提供了覆盖代码规范安全扫描风格检查等方面的官方推荐规则包。

    官方推荐规则包是TCA长期以来在业务中实践的经验结果,将相关的有效性高的工具和规则打包在一起。业务可以根据需要选择官方推荐规则包。也可以在自定义规则包中添加希望的工具和规则。

    TIP

    规则配置 = 自定义规则包 + 官方规则包

    自定义规则包中的规则配置会默认覆盖其他官方包中相同规则的配置

    添加规则配置

    可以单选或者批量多选规则 添加规则配置

    也可以根据搜索框进行多维度查询 添加规则配置

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/code_spec_oc.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/code_spec_oc.html" new file mode 100644 index 000000000..73c88c4fb --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/code_spec_oc.html" @@ -0,0 +1,34 @@ + + + + + + + + + 【Objective-C】代码规范规则包 | Tencent Cloud Code Analysis + + + + +

    【Objective-C】代码规范规则包

    该规则包针对 Objective-C/C++ 语言进行代码规范相关检查。

    规则列表

    启用规则包

    分析方案 -> 代码检查 ->【Objective-C】代码规范规则包 -> 启用/查看规则。

    格式化工具

    为了帮助你正确地格式化代码,我们建议你使用clang-format进行代码自动格式化。工具可直接通过 Homebrew 进行安装:

    brew install clang-format
    +

    安装完成后将 .clang-format 配置文件置于工程根目录,执行 clang-format -i FILE.m 即可完成自动格式化。目前格式化工具配置仅支持11.0版本。

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/cpp_doc.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/cpp_doc.html" new file mode 100644 index 000000000..d650b9aa9 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/cpp_doc.html" @@ -0,0 +1,33 @@ + + + + + + + + + 【C/C++】代码质量缺陷规则包 | Tencent Cloud Code Analysis + + + + +

    【C/C++】代码质量缺陷规则包

    采用自研工具检查Cpp代码缺陷,需要使用license;属于 TCA 增强分析模块的能力之一,请参考增强分析模块部署open in new window文档进行部署。

    规则列表

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/dependency_vul.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/dependency_vul.html" new file mode 100644 index 000000000..e6b170510 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/dependency_vul.html" @@ -0,0 +1,71 @@ + + + + + + + + + 依赖漏洞扫描规则包 | Tencent Cloud Code Analysis + + + + +

    依赖漏洞扫描规则包

    概述

    该规则包可分析项目依赖组件,以及依赖组件中是否存在漏洞等问题。辅助开发者准确分析到依赖组件的安全性,选用安全可靠的依赖组件。

    规则包中将漏洞规则分为“低危漏洞”、“中危漏洞”、“高危漏洞”三个等级,扫描出有漏洞的组件,TCA会提供问题组件名称和版本、漏洞情况介绍,以及可用的修复版本(如获取到)。

    已支持语言:C/C++、C#、Go、Java、JavaScript、PHP、Python、Ruby、Scala、TypeScript等。

    示例

    <?xml version="1.0" encoding="UTF-8"?>
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    +
    +    <parent>
    +        <groupId>org.javaweb.vuln</groupId>
    +        <artifactId>javaweb-vuln</artifactId>
    +        <version>3.0.3</version>
    +    </parent>
    +
    +    <dependencies>
    +
    +        <dependency>
    +            <groupId>org.apache.struts</groupId>
    +            <artifactId>struts2-core</artifactId>
    +            <!-- 触发规则  -->
    +            <version>2.1.8</version>
    +            <exclusions>
    +                <exclusion>
    +                    <groupId>org.freemarker</groupId>
    +                    <artifactId>freemarker</artifactId>
    +                </exclusion>
    +
    +                <exclusion>
    +                    <groupId>org.springframework</groupId>
    +                    <artifactId>spring-test</artifactId>
    +                </exclusion>
    +
    +                <exclusion>
    +                    <groupId>commons-fileupload</groupId>
    +                    <artifactId>commons-fileupload</artifactId>
    +                </exclusion>
    +            </exclusions>
    +        </dependency>
    +
    +    </dependencies>
    +
    +</project>
    +

    快速体验

    TCA 现已支持依赖漏洞扫描规则包,可以在 TCA 分析方案中搜索勾选该规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 ->【Objective-C】代码规范规则包 -> 启用/查看规则。

    更多

    更多场景支持,欢迎提 issue 进行咨询扩展。

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/enhanced_safety_java.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/enhanced_safety_java.html" new file mode 100644 index 000000000..eadd064be --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/enhanced_safety_java.html" @@ -0,0 +1,33 @@ + + + + + + + + + 【Java】强化安全规则包 | Tencent Cloud Code Analysis + + + + +

    【Java】强化安全规则包

    针对 Java 语言的强化代码安全规则包,属于 TCA 增强分析模块的能力之一,请参考增强分析模块部署open in new window文档进行部署。

    规则列表

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/front_end_framework_check.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/front_end_framework_check.html" new file mode 100644 index 000000000..b55e50a6a --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/front_end_framework_check.html" @@ -0,0 +1,45 @@ + + + + + + + + + 前端框架检查规则包 | Tencent Cloud Code Analysis + + + + +

    前端框架检查规则包

    背景

    前端项目在长期发展过程中,由于框架开源许可证变更、框架性能外观等不适用等因素,需要对前端框架进行平滑切换,而这就需要腾讯云代码分析 TCA 的介入,方便对企业内所有前端项目进行批量分析统计,方便管理。

    需求

    • 检查代码仓库中使用到指定前端框架的代码位置。

    示例

    {
    +  "name": "framework",
    +  "version": "1.0.0",
    +  "dependencies": {
    +    "react": "^17.0.2", // 触发规则
    +    "react-dom": "^17.0.2", // 触发规则
    +    "react-hotkeys-hook": "^3.4.3", // 触发规则
    +    "react-redux": "^7.2.5", // 触发规则
    +    "single-spa": "^5.9.3",
    +    "universal-cookie": "^4.0.4"
    +  },
    +}
    +

    快速体验

    TCA 现已支持前端框架检查规则包,可以在 TCA 分析方案中搜索勾选以下规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 -> 前端框架检查规则包 -> 启用/查看规则

    支持框架

    • TDesign
    • AntD
    • React
    • Vue

    更多

    更多框架支持,欢迎提 issue 进行咨询扩展。

    + + + diff --git "a/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/test_case_verify_go.html" "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/test_case_verify_go.html" new file mode 100644 index 000000000..fc2c5ad37 --- /dev/null +++ "b/en/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/test_case_verify_go.html" @@ -0,0 +1,42 @@ + + + + + + + + + 【Go】单元测试有效性验证 | Tencent Cloud Code Analysis + + + + +

    【Go】单元测试有效性验证

    背景

    单元测试是用来对一个模块、一个函数或者一个类来进行正确性检验的测试工作。也是提升现网质量的最广泛最简单有效的方式。

    但是在实际开发工作中,由于工作繁忙而遗漏或缺乏对单元测试的正确认识,有些开发盲目追求高覆盖率,没有对单元测试做断言,这样的单元测试用例属于无效用例。 为了检测此类无效用例,业务侧找来了代码分析介入,进行单元测试有效性验证。

    需求

    • 判断一个单元测试用例中是否存在断言。

    示例

    // Bad case
    +func Test_Demo1(t *testing.T) {
    +}
    +
    +
    +// Good case
    +func Test_Demo2(t *testing.T) {
    +    assert.NoError(t, err)
    +}
    +

    快速体验

    TCA 现已支持 Go 语言的单元测试有效行验证,可以在 TCA 分析方案中搜索勾选以下规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 -> 单元测试有效性验证 -> 启用/查看规则

    支持框架

    扩展

    更多语言更多单元测试框架支持,欢迎提 issue 进行咨询扩展。

    + + + diff --git "a/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html" "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html" new file mode 100644 index 000000000..cce311a5e --- /dev/null +++ "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 代码度量配置 | Tencent Cloud Code Analysis + + + + +

    代码度量配置

    圈复杂度

    可以发现执行路径较多的方法,降低代码的圈复杂度,可测性更高

    • 检测阈值

      默认为 20,表示当一个方法的圈复杂度超过 20 时则认为该方法为超标方法,需要被关注修改。

      可以根据需要调整

    重复代码

    可以发现重复的代码,避免重复代码可以让代码更简洁,更易维护

    • 长度区间

      是一个区间值,默认代码中一个单词(变量/操作符)长度为 1。

    • 重复次数

      是一个区间值,当一段代码重复次数达到指定区间才认为是有风险的。

    • 上报限制

      限制上报的重复代码块数,可以减少开发的压力,提高修复积极性。

    代码统计

    从目录和业务纬度统计代码行数,也可以获取提交记录便于代码 Review

    + + + diff --git "a/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html" "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html" new file mode 100644 index 000000000..0bac32f03 --- /dev/null +++ "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html" @@ -0,0 +1,44 @@ + + + + + + + + + 代码检查-编译配置 | Tencent Cloud Code Analysis + + + + +

    代码检查-编译配置

    腾讯云代码分析平台支持给编译类的工具或编译型项目配置相关命令。

    由于对代码进行编译型分析会存在安全风险,需要用户自行进行专机扫描,申购完成后可联系平台管理员进行相关配置。

    TIP

    对于编译型语言,有些分析工具是可以通过分析编译产出的中间文件,更为准确地发现代码质量问题。


    WARNING

    由于对代码进行编译型分析会存在安全风险,需要用户自行进行专机扫描(私有化版由客户自行评估即可)。


    编译所需环境说明(重要)

    如果配置了编译命令,则需要在具有代码执行所需的编译环境的节点上执行代码分析。即需要用户在专机上提供编译环境(针对私有化版,客户可根据业务情况选择在公共节点机、用户专机、本地节点机提供编译环境即可)。

    如以下一些编译环境:

    • JDK 环境及版本

    • gradle 环境

    • cmake & make 环境

    • visual studio 环境

    • ...

    WARNING

    如果机器有多个 JDK 或者 gradle 环境,项目编译需指定 JDK 或 gradle 版本,可以在分析方案的基础属性当中设定相应环境变量。

    编译配置字段说明

    前置命令

    通常是项目编译前需要执行的命令,或用于清理之前编译过程的命令,如:make clean, xcodebuild clean [-optionName]。如无需要,可以不填。

    编译命令

    项目的编译命令,具体可以咨询该代码库所属项目的开发

    能够使项目编译成功的编译命令,可以填写多行或用 && 连接命令。

    TIP

    前置命令与编译命令是隔离的,即在前置命令中的操作不会对编译命令产生影响。

    如在前置命令中 cd src && export TEST=src,在执行编译命令时并不会跳到src目录和获取TEST环境变量。

    编译配置示例

    TIP

    咨询该代码库所属项目的开发,先确保先在本地工程根目录调试通过

    JAVA 项目

    编译命令

    android-studio 项目编译命令示例

    gradle compileDebugSources --no-daemon -Dorg.gradle.jvmargs=
    +

    ant 项目编译命令示例

    ant build
    +

    Object-C 项目

    编译命令

    xcodebuild 命令(确保先在本地工程根目录调试通过)

    xcodebuild -target dailybuildipa -configuration DailyBuild -sdk iphonesimulator
    +

    环境变量(分析方案-基础属性中配置):

    XCODE_VERISON=10.1
    +

    C/C++ 项目

    编译命令

    VS 项目编译命令示例

    devenv.com demo.sln /Build "Debug|Win32"
    +# 或
    +msbuild demo.sln /t:Build /p:Configuration=DebugCopy
    +

    make 项目编译命令示例

    make all
    +

    C# 项目

    编译命令

    VS 项目编译命令示例

    devenv.com demo.sln /Build "Debug|Win32"
    +# 或
    +msbuild demo.sln /t:Build /p:Configuration=Debug
    +
    + + + diff --git "a/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html" "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html" new file mode 100644 index 000000000..4016bab45 --- /dev/null +++ "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 代码检查-规则配置 | Tencent Cloud Code Analysis + + + + +

    代码检查-规则配置

    在上一节文档代码检查配置中我们大致已经了解规则配置主要由官方规则包自定义规则包构成,本节将详细描述规则配置。

    官方规则包是由腾讯云代码分析平台经过多年深耕,在业务中不断实践整理而出的规则集合包,然而平台有超过**10000+**的规则,有些规则并未放到官方规则包中,甚至有些规则是由用户自定义的规则。此外,有些官方规则包中的规则,对于不同的团队所需可能存在差异,因此产生了如下几种问题:

    • 在规则配置中,如何添加规则?

    • 在规则配置中,如果将官方规则包中的规则进行调整?

    在规则配置中,如何添加规则?

    添加规则存在两种入口

    TIP

    无论何种,最终都是将规则添加到自定义规则包中

    • 用户可直接点击页面中的添加规则

      添加规则配置

    • 用户可点击自定义规则,进入自定义规则包后,再点击添加规则

      点击自定义规则包

      添加规则

    在添加规则过程中,可以单选或者批量多选规则,可以根据搜索栏进行多维度查询规则

    添加规则配置

    添加规则配置

    在规则配置中,如果将官方规则包中的规则进行调整?

    用户可以点击进入官方规则包,进入官方规则包中,对已存在的规则进行编辑。

    WARNING

    在官方规则包中对规则的任意操作,实质上是将对应规则增加到自定义规则包中进行了相关操作。

    自定义规则包中的规则配置会默认覆盖其他官方包中相同规则的配置。

    编辑官方规则包规则

    + + + diff --git "a/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html" "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html" new file mode 100644 index 000000000..3fe10b315 --- /dev/null +++ "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 代码检查配置 | Tencent Cloud Code Analysis + + + + +

    代码检查配置

    腾讯云代码分析采用业界/自研的 80+ 款工具,配置代码检查项能够有效地发现代码中存在的异味代码

    规则配置

    规则配置主要是以规则包为元素,由官方规则包自定义规则包两部分组成。平台提供一些系列的官方规则包,覆盖规范、安全、推荐等方面。

    用户可根据项目语言、规则包类型筛选不同的规则包,并启用/关闭规则包。

    TIP

    用户可以根据需要选择官方规则包进行扫描,并可以在官方规则包的基础上屏蔽某些规则或者调整默认的优先级,设置指定参数。这些操作都会记录在自定义规则包中。

    自定义规则包是提供给用户自由选择工具规则的包。官方规则包上的调整实质上会记录到自定义规则包中,当自定义规则包中的规则和官方规则包的规则发生冲突,则自定义规则包优先级更高。

    创建项目

    编译配置

    通过编译(代码解析和翻译过程)分析中间代码进行辅助分析,能更精准地发现更多潜在的代码问题。

    + + + diff --git "a/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html" "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html" new file mode 100644 index 000000000..870453682 --- /dev/null +++ "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html" @@ -0,0 +1,33 @@ + + + + + + + + + 分析方案模版 | Tencent Cloud Code Analysis + + + + +

    分析方案模版

    为便于用户快速创建代码库进行分析,复用同类型的分析配置,平台提供了分析方案模板功能。

    分析方案模板分为系统方案模板个人自定义方案模板

    • 系统方案模板

      全局可用。但是用户无法变更系统方案模板内容。如系统方案模板产生变更,需用户自行拉取最新模板内容。

      同步分析方案模板配置

    • 个人自定义方案模板

      自定义方案模板与团队挂钩,用户可自行创建、更新、同步方案模板,以及可进行权限控制。默认自定义方案模板团队内都可见。

      自定义方案模板权限管理

    分析方案模版用于在创建分析方案时作为模版参考。分析方案模版全局可用,不用和某个代码库关联。

    使用说明

    • 创建分析项目时,可选择使用分析方案模板创建。默认会根据该分析方案模板创建出一个新的分析方案,并用该方案配置进行分析项目创建。

    • 创建分析方案时,可选择使用分析方案模板创建。

    • 用模版生成的分析方案和模版建立关联关系,当模版和生成的方案由差异时,可以由用户选择是否同步模版的内容到方案。并可以选择拉群哪些功能模块的配置。

    + + + diff --git "a/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html" "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html" new file mode 100644 index 000000000..4c1365021 --- /dev/null +++ "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 基础属性配置 | Tencent Cloud Code Analysis + + + + +

    基础属性配置

    • 方案名称

      用于标示一个方案,每个方案名称都是唯一的。

    • 分析语言

      用于指明该方案是针对代码库何种语言进行分析。初次创建分析方案时会根据语言初始化分析方案相关配置。

    • 运行环境

      用于将任务分配到指定的环境节点机器上执行代码分析,需考虑项目在对应环境的节点机器上能否正常执行。

    • 环境变量

      每行 key-value 形式,非必填项。

      • 可用于指定特殊编译环境:如机器有多个 JDK 或者 gradle 环境,项目编译需指定 JDK 或 gradle 版本的可以设定相应环境变量。

      • 可用于工具传递参数: 如ESLINT_MAX_OLD_SPACE_SIZE=4096配置 Js 内存大小

      • 可用于指定项目配置,如PYTHON_VERSION=2 指定为 python2 项目

        TIP

        对 Python 的分析默认采用 Python3,如果需要分析 Python2 请在环境变量中设置:PYTHON_VERSION=2

    + + + diff --git "a/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\350\277\207\346\273\244\351\205\215\347\275\256.html" "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\350\277\207\346\273\244\351\205\215\347\275\256.html" new file mode 100644 index 000000000..26f64e498 --- /dev/null +++ "b/en/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\350\277\207\346\273\244\351\205\215\347\275\256.html" @@ -0,0 +1,65 @@ + + + + + + + + + 过滤配置 | Tencent Cloud Code Analysis + + + + +

    过滤配置

    路径过滤

    用于设定代码分析的范围,设定后,已经开启的代码检查、代码度量各项功能都会在指定的代码范围内生效。

    目前支持正则表达式通配符两种类型:

    • 正则表达式

      请填写相对路径(基于代码库根目录),要求匹配到文件
      +使用正则表达式格式,示例如下:
      +    代码根目录
      +    |-src
      +      |- test
      +          |- main_test.py
      +          |- input_test.py
      +      |- main.py
      +    |-test
      +      |- param_test.py
      +    匹配src/test目录:src/test/.*
      +    匹配根目录下的test目录:test/.*
      +    匹配所有_test.py后缀的文件:.*_test\\.py
      +修改后,下次分析生效,需要启动一次全量分析处理历史存量问题。
      +
      Include 表示只分析,如只分析 src/ 目录:src/.*
      +Exclude 表示只屏蔽,如要屏蔽 src/lib/ 目录:src/lib/.*
      +
    • 通配符

      请填写相对路径(基于代码库根目录),要求匹配到文件
      +使用Unix通配符格式,示例如下
      +    代码根目录
      +    |-src
      +      |- test
      +          |- main_test.py
      +          |- input_test.py
      +      |- main.py
      +    |-test
      +      |- param_test.py
      +    匹配src/test目录:src/test/*
      +    匹配根目录下的test目录:test/*
      +    匹配所有_test.py后缀的文件:*_test.py
      +修改后,下次分析生效,需要启动一次全量分析处理历史存量问题。
      +
      Include 表示只分析,如只分析 src/ 目录:src/*
      +Exclude 表示只屏蔽,如要屏蔽 src/lib/ 目录:src/lib/*
      +

    如果几个分析方案希望共享相同的路径过滤方案,可以通过导入导出路径配置的方式进行处理。

    TIP

    配置更改后,下次启动分析生效

    问题过滤

    • 全局 Issue 忽略状态同步

      仅对代码检查生效。开启后,在 Issue 页面进行全局忽略操作时,其他利用该方案分析的分析项目在发现相同 Issue 时,会同步忽略该 Issue。否则不受全局 Issue 忽略状态同步影响。

    + + + diff --git "a/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/OAuth\347\256\241\347\220\206.html" "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/OAuth\347\256\241\347\220\206.html" new file mode 100644 index 000000000..029598176 --- /dev/null +++ "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/OAuth\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + OAuth管理 | Tencent Cloud Code Analysis + + + + +

    OAuth管理

    OAuth管理

    OAuth管理

    TIP

    配置OAuth应用时,回调地址栏需填入当前TCA平台配置的域名或IP地址(如当前页面非80端口,需要显式指定端口号),作为Git平台上OAuth应用的回调地址。

    + + + diff --git "a/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html" "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html" new file mode 100644 index 000000000..05591bd04 --- /dev/null +++ "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 分析记录管理 | Tencent Cloud Code Analysis + + + + +

    分析记录管理

    • 可查看平台全部分析记录

    • 可点击查阅分析记录详情

    分析记录列表

    + + + diff --git "a/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" new file mode 100644 index 000000000..e24409649 --- /dev/null +++ "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 团队管理 | Tencent Cloud Code Analysis + + + + +

    团队管理

    • 可查看平台创建的团队列表,并提供了相应筛选

    • 禁用恢复团队

    团队列表

    团队操作

    + + + diff --git "a/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206.html" "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206.html" new file mode 100644 index 000000000..bbdc8d735 --- /dev/null +++ "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 工具管理 | Tencent Cloud Code Analysis + + + + +

    工具管理

    • 可查看全部工具(包含平台提供工具、团队自定义工具)。

    • 查看编辑工具。

    • 可变更工具权限状态

    工具管理

    TIP

    工具的权限状态仅能由平台管理员进行变更调整,需谨慎调整

    • 团队内可用:即工具配置了可用团队白名单的团队可以使用该工具,默认创建工具的团队已在白名单内

    • 全平台可用:即不同团队都可见可用该工具

    • 支持自定义规则,全平台可用:即该工具不同团队都可见可用,且支持用户添加团队所需的自定义规则,该自定义规则存在团队隔离,仅团队内可以,其他团队不可使用

    + + + diff --git "a/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206.html" "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206.html" new file mode 100644 index 000000000..e59ca2847 --- /dev/null +++ "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 用户管理 | Tencent Cloud Code Analysis + + + + +

    用户管理

    • 查看编辑创建平台用户。

    • 可配置用户的登录密码用户级别超级管理员等。

    用户列表

    用户编辑

    + + + diff --git "a/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" new file mode 100644 index 000000000..1ae2bf157 --- /dev/null +++ "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 节点管理 | Tencent Cloud Code Analysis + + + + +

    节点管理

    • 可查看常驻节点状态,包含公共节点团队节点

    • 查看编辑删除常驻节点。

    • 可配置节点工具进程

    • 可配置节点标签

    节点管理节点管理节点管理节点管理

    + + + diff --git "a/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\351\241\271\347\233\256\347\256\241\347\220\206.html" "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\351\241\271\347\233\256\347\256\241\347\220\206.html" new file mode 100644 index 000000000..bcfb9decf --- /dev/null +++ "b/en/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\351\241\271\347\233\256\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 项目管理 | Tencent Cloud Code Analysis + + + + +

    项目管理

    • 可查看平台创建的项目列表,并提供了提供相应筛选

    • 禁用恢复项目

    项目列表

    + + + diff --git "a/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" "b/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" new file mode 100644 index 000000000..88b9d46e6 --- /dev/null +++ "b/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 团队说明 | Tencent Cloud Code Analysis + + + + +

    团队说明

    成员权限

    层级关系

    团队 > 项目 > 代码库 > 分析项目

    您可以创建一个团队,并可以在团队中创建多个项目来进行项目区分和项目管理。可以在一个项目中创建多个代码库进行代码分析。

    权限控制

    • 团队成员分为管理员和普通成员两类。团队管理员具备团队全部权限。

    • 项目成员分为管理员和普通成员两类。项目管理员具备项目全部权限。

    成员权限的区分,具体点击查看成员权限

    邀请团队成员

    管理员可以通过成员管理为您的团队添加成员,通过分享邀请链接的方式邀请您的团队。

    + + + diff --git "a/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\346\210\220\345\221\230\346\235\203\351\231\220.html" "b/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\346\210\220\345\221\230\346\235\203\351\231\220.html" new file mode 100644 index 000000000..9e16171fd --- /dev/null +++ "b/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\346\210\220\345\221\230\346\235\203\351\231\220.html" @@ -0,0 +1,33 @@ + + + + + + + + + 成员权限 | Tencent Cloud Code Analysis + + + + +

    成员权限

    团队成员

    成员权限

    团队成员分为团队管理员团队普通成员两类。

    团队管理员:可以邀请其他成员加入团队,具备团队内所有权限。

    团队普通成员:可以创建项目,可以访问自己有权限的项目。创建项目的人会自动成为这个项目的项目管理员。

    项目成员

    项目成员分为项目管理员项目普通成员

    项目管理员:具备项目内全部权限。

    项目普通成员:可以查看项目内的配置信息和分析结果等各项信息,并且可以启动分析,但是无其他操作权限。

    + + + diff --git "a/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" "b/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" new file mode 100644 index 000000000..1c403a348 --- /dev/null +++ "b/en/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 团队节点与标签 | Tencent Cloud Code Analysis + + + + +

    团队节点与标签

    WARNING

    团队节点及标签说明

    • 团队节点是团队注册并管理的私有节点。

    • 团队标签用于关联团队内的节点机器与分析项目。

    • 团队可以利用团队标签注册并使用团队节点

    • 在项目的分析方案中配置运行环境为团队标签后,才可将该项目的分析任务下发到对应的团队节点。

    • 团队节点仅支持运行当前团队中的分析任务,节点可执行的任务范围取决于该节点的负责人权限:

      • 如果节点负责人为团队管理员,该节点可以执行当前团队所有项目的分析任务
      • 如果节点负责人为项目管理员,该节点只能运行指定项目下的分析任务
      • 如果节点负责人为部分代码库的管理员,该节点只能运行对应代码库的分析任务

    适用场景

    1. 团队因资源可靠性或项目敏感性,需使用私有机器资源

    2. 团队项目分析依赖特定机器环境(比如CPU架构、操作系统等)

    以上场景,团队可接入专机资源作为团队节点,仅分析自己业务的代码库,以保证执行效率保护源码安全支持项目环境依赖等。

    团队节点注册

    参考客户端常驻节点分析进行环境配置和启动节点。

    团队节点管理

    完成团队节点注册后,可以在当前团队节点管理下看到对应的节点信息,同时需要进行节点配置

    WARNING

    • 团队节点首次注册时,需要手动在平台上配置所属标签节点可用性工具进程等。
    • 将节点的节点可用性调整为活跃后,节点终端客户端运行日志会输出心跳上报成功的日志
    • 首次注册团队节点,节点状态默认为不可用,需调整节点状态为“活跃”: 注册团队节点

    • 配置节点关联的工具进程:

      配置工具进程

    TIP

    1. 团队节点使用的所属标签均为当前团队内创建的标签,可参见团队标签管理
    2. 团队标签可以参考CodeDog标签为不同的系统类型(Linux、MacOS、Windows)建立标签,比如专属标签-Linux专属标签-Mac

    使用团队标签

    您可以创建一个团队标签,并配置到您的团队节点和您的分析方案中

    • 创建团队标签。

      创建团队标签

    • 配置团队节点所属标签。

      节点配置团队标签

    • 配置分析方案运行环境。

      方案配置团队标签

    + + + diff --git "a/en/guide/\345\256\242\346\210\267\347\253\257/\345\205\266\344\273\226\351\205\215\347\275\256.html" "b/en/guide/\345\256\242\346\210\267\347\253\257/\345\205\266\344\273\226\351\205\215\347\275\256.html" new file mode 100644 index 000000000..42b7375c3 --- /dev/null +++ "b/en/guide/\345\256\242\346\210\267\347\253\257/\345\205\266\344\273\226\351\205\215\347\275\256.html" @@ -0,0 +1,34 @@ + + + + + + + + + 其他配置与用法 | Tencent Cloud Code Analysis + + + + +

    其他配置与用法

    1. 配置使用本地工具

    WARNING

    如果由于网络原因,执行时无法从github自动拉取工具,或拉取比较慢,可以参考基础配置腾讯工蜂工具地址,或使用以下方式预先下载好工具,配置使用本地工具目录。

    • (1)如果使用的是开源版Client源码,需要在命令行(windows环境下可以启动git bash)中执行以下命令:
    bash ./scripts/base/install_bin.sh
    +
    • (2)下载工具配置库 https://github.com/TCATools/puppy-tools-config.git ,存放到 tools目录下(如果未生成,可先创建该目录)。
    • (3)根据当前机器操作系统,查看puppy-tools-config目录下的linux_tools.inimac_tools.iniwindows_tools.ini文件,将[tool_url]中声明的所有工具下载到 tools目录下。
    • (4)填写client/config.ini中的配置:USE_LOCAL_TOOL=True,即可使用下载好的本地工具,不自动拉取和更新工具。

    2. 使用自建git server存放工具

    WARNING

    如果自己搭建了一套git server,可以将工具配置库 https://github.com/TCATools/puppy-tools-config.git 以及里面声明的工具仓库,存放到自建git serevr上。

    • (1)将工具配置库 https://github.com/TCATools/puppy-tools-config.git 上传到自建git仓库。
    • (2)按所需的操作系统,将puppy-tools-config仓库下的linux_tools.inimac_tools.iniwindows_tools.ini文件中[tool_url]声明的所有工具库,上传到自建git仓库。
    • (3)修改linux_tools.inimac_tools.iniwindows_tools.ini文件中[base_value]中的git_url为自建git server地址。
    • (4)修改client/config.ini中的TOOL_CONFIG_URL为自建git server的puppy-tools-config仓库地址。
    • (5)填写client/config.ini中的[TOOL_LOAD_ACCOUNT]配置,输入有拉取权限的用户名密码,即可使用自建git server拉取工具。

    3. git lfs带宽和存储配额不够问题

    • 如果git拉取工具时,出现git lfs拉取失败,可能是lfs带宽和存储配额不够,可以打开对应的工具github页面,通过Download ZIP的方式下载工具压缩包,再解压到tools目录下。
    + + + diff --git "a/en/guide/\345\256\242\346\210\267\347\253\257/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html" "b/en/guide/\345\256\242\346\210\267\347\253\257/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html" new file mode 100644 index 000000000..e18145d7f --- /dev/null +++ "b/en/guide/\345\256\242\346\210\267\347\253\257/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html" @@ -0,0 +1,37 @@ + + + + + + + + + 常驻节点分析 | Tencent Cloud Code Analysis + + + + +

    常驻节点分析

    TIP

    TCA 客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。

    和本地分析一样,需要先安装环境和必要的工具,并配置好服务端地址。

    使用场景

    • 希望通过并行执行分析来提高分析效率

    • 希望尽量使用公共资源或使用专机资源

    前置步骤

    节点机器上具备客户端及客户端相关依赖环境,可查阅本地分析-前置步骤部分进行配置。

    节点配置

    配置 config.ini 文件

    1. <Server IP地址>替换成实际的 TCA 平台 IP(可包含端口号)。

    2. 国内使用 github 拉取网络较慢,推荐使用腾讯工蜂拉取,需要修改以下配置:

    • 修改 TOOL_CONFIG_URL=https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git
    • 腾讯工蜂open in new window的账号密码填写到TOOL_LOAD_ACCOUNT 中。(注:没有腾讯工蜂账号的需要注册;由于腾讯工蜂的开源仓库也要求使用账号才能拉取,所以此处必须填写账号密码)

    启动常驻节点

    • 从TCA前端页面中获取 token,前往 个人中心-个人令牌-复制Token

      TIP

      节点仅能分析该token具有权限的项目,因此如设置公共的分析节点,推荐使用超级管理员的token。

      可以通过用户管理页面查看到哪些用户是超级管理员。

    • 如启动团队节点,还需获取团队编号:org_sid,获取方式: 从 TCA 平台项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile

    两种方式可选启动客户端:

    使用客户端源码启动常驻节点

    • 如启动公共节点,需进入到源码的client目录下,执行命令:
    python3 codepuppy.py -l codepuppy.log start -t <token>
    +
    • 如启动团队节点,需增加参数 org_sid:
    python3 codepuppy.py -l codepuppy.log start -t <token> --org-sid <org_sid>
    +

    启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    使用客户端二进制启动常驻节点

    • 如启动公共节点,需进入到源码的client目录下,执行命令:
    ./codepuppy -l codepuppy.log start -t <token>
    +
    • 如启动团队节点,需增加参数 org_sid:
    ./codepuppy -l codepuppy.log start -t <token> --org-sid <org_sid>
    +

    启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    管理节点

    常驻节点首次启动后,需要到节点管理页面管理节点状态:

    1. 设置节点状态: 进入 TCA 节点管理页面。管理入口-节点管理,可以看到当前在线的节点,节点状态默认为不可用,需将其设置为**活跃**才可用于接收和执行任务。 也可以按需修改节点名称、标签、负责人等信息。

    2. (按需可选)配置节点工具进程: 进入工具进程配置页面,对节点支持的工具进程进行管理(默认会全部勾选),未勾选的工具进程,将不会在该节点上执行。

    3. (按需可选)设置节点标签: 节点标签会与分析方案中的运行环境标签进行匹配,只有相同标签的任务才会下发到该机器节点上。

    + + + diff --git "a/en/guide/\345\256\242\346\210\267\347\253\257/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html" "b/en/guide/\345\256\242\346\210\267\347\253\257/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html" new file mode 100644 index 000000000..e4df5b4f5 --- /dev/null +++ "b/en/guide/\345\256\242\346\210\267\347\253\257/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html" @@ -0,0 +1,35 @@ + + + + + + + + + 快速扫描模式 | Tencent Cloud Code Analysis + + + + +

    快速扫描模式

    使用场景

    • 对本地代码目录下的临时代码(未关联scm仓库或未提交到scm仓库的本地代码)进行扫描,对某个目录或某些文件进行快速扫描,产出本地扫描结果。

    • 该模式不与scm代码仓库关联,只对给定的目录或文件进行扫描,不依据提交版本号做增量分析,也不定位问题责任人。

    使用步骤

    1. 在页面上创建分析方案模板

    • 由于该模式不与scm代码仓库绑定,因此不能直接使用分析方案(分析方案上归属于某个代码仓库下的),需要使用分析方案模板的配置来扫描。

    • 目前快速扫描模式只支持代码检查,暂不支持代码度量,请勿开启代码度量配置项(无法展示结果)。

    • 配置好方案模板后,从页面URL中获取到分析方案模板ID,分析方案模板页面URL格式:http://{域名}/t/{org_sid}/p/{team_name}/template/{分析方案模板ID}template后面的数字即分析方案模板ID。

    2. 初始化扫描需要的工具

    • 进入到客户端client目录下,使用quickinit命令拉取指定分析方案模板所需要的分析工具:
    python3 codepuppy.py quickinit -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID
    +
    • 参数说明:
      • TOKEN: 必选,从TCA平台页面获取,前往[个人中心]-[个人令牌]-复制Token
      • SCHEME_TEMPLATE_ID: 必选,分析方案模板ID,从步骤1中获取
      • ORG_SID: 必选,团队编号,从TCA平台团队概览URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/profile

    3. 执行快速扫描

    • 进入到客户端client目录下,执行命令:
    python3 codepuppy.py quickscan -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID -s SOURCE_DIR --file FILE 
    +
    • 参数说明:

      • SOURCE_DIR: 必选,需要扫描的代码目录路径
      • FILE: 可选,指定文件扫描,格式为基于SOURCE_DIR的相对路径,多个文件用英文逗号(,)分隔。不指定文件,默认扫描整个代码目录。
      • 其他参数说明参考quickinit命令。
    • 扫描完成后,结果会默认输出到客户端client目录下的tca_quick_scan_report.json文件中。结果只保存在本地,不会上报到服务端展示。

    + + + diff --git "a/en/guide/\345\256\242\346\210\267\347\253\257/\346\234\254\345\234\260\345\210\206\346\236\220.html" "b/en/guide/\345\256\242\346\210\267\347\253\257/\346\234\254\345\234\260\345\210\206\346\236\220.html" new file mode 100644 index 000000000..746fb1f60 --- /dev/null +++ "b/en/guide/\345\256\242\346\210\267\347\253\257/\346\234\254\345\234\260\345\210\206\346\236\220.html" @@ -0,0 +1,40 @@ + + + + + + + + + 客户端本地分析 | Tencent Cloud Code Analysis + + + + +

    客户端本地分析

    使用场景

    • 希望在本地随时分析。

    • 接入持续集成系统实现自动化分析。

    前置步骤

    1. 客户端运行环境机器配置推荐

    操作系统推荐配置
    Linux8核16G内存,硬盘空间256G(可用空间不低于100G)
    Mac8核16G内存,硬盘空间256G(可用空间不低于100G)
    Windows8核16G内存,硬盘空间256G(可用空间不低于100G)

    以上为推荐配置,实际情况需要考虑扫描对象代码库的大小,按实际情况增加磁盘空间。

    2. 本地需具备客户端

    下载开源版源码open in new window。 或从开源版releaseopen in new window下载客户端以运行客户端二进制;

    3. 安装Python环境和第三方库(仅客户端源码启动分析需要)

    • 预装Python3.7、pip,支持 python3pip3 命令
    • 安装依赖:pip3 install -r CodeAnalysis/client/requirements/app_reqs.pip

    4. 安装第三方工具(docker下启动分析可跳过)

    • 在命令行(windows环境下可以启动git bash)中执行以下命令:
    bash ./scripts/base/install_bin.sh
    +
    • 进入到client/requirements目录
    • 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    分析配置

    配置客户端 config.ini 文件

    • <Server IP地址> 替换成实际的TCA平台IP(可包含端口号)

    配置客户端 codedog.ini 文件

    codedog.ini获取方法:

    • 方法一: 打开TCA源码CodeAnalysis/client/codedog.ini,填写配置信息

    • 方法二: 从开源版releaseopen in new window下载客户端包,解压后打开codedog.ini,填写配置信息。

    • 方法三: 在TCA平台平台上配置好对应信息后,下载配置文件到本地使用。

      下载配置文件

    codedog.ini中以下字段为必填项:

    字段名填写说明
    token从TCA平台页面获取,前往[个人中心]-[个人令牌]-复制Token
    org_sid(团队编号)从TCA平台项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile
    team_name(项目名称)同上
    source_dir本地代码目录路径

    其他字段按需填写。

    启动代码分析

    启动客户端分析有三种方式可选:客户端源码下启动分析客户端二进制启动分析docker下启动分析

    客户端源码下启动分析

    • 进入到客户端client目录下

    • 执行命令: 客户端源码:python3 codepuppy.py localscan

    客户端二进制启动分析

    • 进入到客户端client目录下

    • 执行命令: 客户端源码:./codepuppy localscan

    docker下启动分析

    1. 构建docker镜像

    在client目录下,执行以下命令:docker build -t tca-client .
    (需已安装Docker)

    2. 执行Docker容器

    WARNING

    注意:因为以下步骤会将代码目录挂载到容器中,需要先将codedog.ini里面的source_dir修改为/workspace/src,其他参数保持不变。

    执行Docker容器有以下两种方式:

    直接使用docker运行

    client目录下,执行以下命令:(注意:按照实际情况填写SOURCE_DIR环境变量值)

    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +

    使用docker内bash终端运行

    通过以下方式,进入容器内的bash终端后,通过命令行启动client代码:
    client目录下,执行以下命令:(注意:按照实际情况填写SOURCE_DIR环境变量值)

    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client bash
    +# 进入容器内终端,通过命令行执行扫描
    +python3 codepuppy.py localscan
    +
    + + + diff --git "a/en/guide/\345\256\242\346\210\267\347\253\257/\351\205\215\347\275\256\350\257\264\346\230\216.html" "b/en/guide/\345\256\242\346\210\267\347\253\257/\351\205\215\347\275\256\350\257\264\346\230\216.html" new file mode 100644 index 000000000..29aec579f --- /dev/null +++ "b/en/guide/\345\256\242\346\210\267\347\253\257/\351\205\215\347\275\256\350\257\264\346\230\216.html" @@ -0,0 +1,39 @@ + + + + + + + + + TCA Client | Tencent Cloud Code Analysis + + + + +

    TCA Client

    一、基础配置

    1. 机器配置推荐

    操作系统推荐配置
    Linux8核16G内存,硬盘空间256G(可用空间不低于100G)
    Mac8核16G内存,硬盘空间256G(可用空间不低于100G)
    Windows8核16G内存,硬盘空间256G(可用空间不低于100G)

    以上为推荐配置,实际情况需要考虑扫描对象代码库的大小,按实际情况增加磁盘空间。

    2. 配置client/config.ini文件

    -(1)将<Server IP地址>替换成实际的serve ip(可包含端口号)。

    3. 配置client/codedog.ini文件(分布式节点模式无需配置)

    填写以下必填项:token,org_sid,team_name,source_dir

    字段名填写说明
    token从tca页面获取,前往[个人中心]-[个人令牌]-复制Token
    org_sid(团队编号)从tca项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile
    team_name(项目名称)同上
    source_dir本地代码目录路径

    其他可选项按需填写。

    二、使用docker环境快速体验

    TIP

    适用于快速上手体验。使用docker运行,可以免去客户端环境依赖的安装,避免环境兼容性问题。

    但是由于环境受限于docker,会无法复用本地的编译环境,部分需要编译的工具无法使用。

    1. 下载和安装Docker

    参考Docker官方文档:Docker下载和安装open in new window

    2. 构建docker镜像

    client目录下,执行以下命令:docker build -t tca-client .

    3. 执行docker容器,扫描代码,可选以下两种方式

    (1)直接使用docker运行

    • 在client目录下,执行以下命令:
    • (注意:按照实际情况填写SOURCE_DIR环境变量值)
    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +

    (2)使用docker内bash终端运行

    • 通过以下方式,进入容器内的bash终端后,通过命令行启动client代码:
    • 在client目录下,执行以下命令:
    • (注意:按照实际情况填写SOURCE_DIR环境变量值)
    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client bash
    +# 进入容器内终端,通过命令行执行扫描
    +python3 codepuppy.py localscan
    +

    三、使用本地机器环境运行

    TIP

    适用于深度体验,可以复用本地编译环境,使用编译型代码分析工具。

    可能会有系统环境兼容问题。

    1. 安装Python环境和第三方库

    • (1) 预装Python3.7、pip,支持 python3pip3 命令
    • (2) 安装依赖:pip3 install -r client/requirements/app_reqs.pip

    2. 安装第三方工具

    • (1) 进入到client/requirements目录
    • (2) 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    3. 启动代码分析

    • (1) 进入到client目录下
    • (2) 执行命令:python3 codepuppy.py localscan

    四、使用分布式节点模式执行客户端

    TIP

    • CA客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。
    • 和本地执行任务一样,需要先安装环境和必要的工具,并配置好服务端地址。

    1. 安装Python环境和第三方库

    • (1) 预装Python3.7、pip,支持 python3pip3 命令
    • (2) 安装依赖:pip3 install -r client/requirements/app_reqs.pip

    2. 安装第三方工具

    • 进入到client/requirements目录
    • 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    3. 启动代码分析节点

    • (1)从tca页面个人中心-个人令牌-复制Token
    • (2)进入到client目录下,执行命令:python3 codepuppy.py -l codepuppy.log start -t <token>
    • (3)启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    4. 配置节点

    • 从tca页面管理入口-节点管理,可以看到当前在线的节点,可以修改节点名称、标签、负责人等信息。
    • 可以进入工具进程配置页面,对节点支持的工具进程进行管理(默认会全部勾选),未勾选的工具进程,将不会在该节点上执行。
    • 节点所属标签会与分析方案中的运行环境标签进行匹配,只有相同标签的任务才会下发到该机器节点上。

    五、其他配置与用法

    1. 配置使用本地工具

    WARNING

    如果由于网络原因,执行时无法从github自动拉取工具,或拉取比较慢,可以参考基础配置腾讯工蜂工具地址,或使用以下方式预先下载好工具,配置使用本地工具目录。

    • (1)下载工具配置库 https://github.com/TCATools/puppy-tools-config.git ,存放到 tools目录下(如果未生成,可先创建该目录)。
    • (2)根据当前机器操作系统,查看puppy-tools-config目录下的linux_tools.inimac_tools.iniwindows_tools.ini文件,将[tool_url]中声明的所有工具下载到 tools目录下。
    • (3)填写client/config.ini中的配置:USE_LOCAL_TOOL=True,即可使用下载好的本地工具,不自动拉取和更新工具。

    2. 使用自建git server存放工具

    WARNING

    如果自己搭建了一套git server,可以将工具配置库 https://github.com/TCATools/puppy-tools-config.git 以及里面声明的工具仓库,存放到自建git serevr上。

    • (1)将工具配置库 https://github.com/TCATools/puppy-tools-config.git 上传到自建git仓库。
    • (2)按所需的操作系统,将puppy-tools-config仓库下的linux_tools.inimac_tools.iniwindows_tools.ini文件中[tool_url]声明的所有工具库,上传到自建git仓库。
    • (3)修改linux_tools.inimac_tools.iniwindows_tools.ini文件中[base_value]中的git_url为自建git server地址。
    • (4)修改client/config.ini中的TOOL_CONFIG_URL为自建git server的puppy-tools-config仓库地址。
    • (5)填写client/config.ini中的[TOOL_LOAD_ACCOUNT]配置,输入有拉取权限的用户名密码,即可使用自建git server拉取工具。

    3. git lfs带宽和存储配额不够问题

    • 如果git拉取工具时,出现git lfs拉取失败,可能是lfs带宽和存储配额不够,可以打开对应的工具github页面,通过Download ZIP的方式下载工具压缩包,再解压到tools目录下。
    + + + diff --git "a/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\345\210\227\350\241\250.html" "b/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\345\210\227\350\241\250.html" new file mode 100644 index 000000000..ca0e338b0 --- /dev/null +++ "b/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\345\210\227\350\241\250.html" @@ -0,0 +1,33 @@ + + + + + + + + + 工具列表 | Tencent Cloud Code Analysis + + + + +

    工具列表

    目前 TCA 支持以下工具:

    官方工具第三方工具
    TCA-0Day_Checker(测试版)open in new windowandroidlint
    clangwarningcheckstyle
    codecountclang
    customfilescancobra
    customscancpd
    fbrjscppcheck
    javawarningcpplint
    regexfilescandart_code_metrics
    regexscandartanalyzer
    TCA-Armory(测试版)open in new windowdetekt
    TCA-Loong_Beta龙(测试版)open in new windoweslint
    unusedresourceeslint_typescript
    eslint_vue
    findbugs
    flake8
    flawfinderopen in new window
    flow
    golangcilint
    gometalinter
    htmlcs
    infer_cpp
    infer_java
    infer_objectivec
    ktlintopen in new window
    kunlun-Mopen in new window
    lizard
    luacheck
    phpcsopen in new window
    pmd
    pylint
    ripsopen in new window
    scalastyle
    semgrepopen in new window
    shellcheckopen in new window
    spotbugsopen in new window
    stylecop
    stylelint
    swiftlint
    sonarqubeopen in new window
    sonarqube_javaopen in new window
    sonarqube_csopen in new window
    tca_plugin_sqlcheckopen in new window
    tscan_cppopen in new window
    tscan_csharpopen in new window
    tscan_luaopen in new window
    include-what-you-use
    + + + diff --git "a/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html" "b/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html" new file mode 100644 index 000000000..31aed3fd5 --- /dev/null +++ "b/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html" @@ -0,0 +1,33 @@ + + + + + + + + + 工具管理说明 | Tencent Cloud Code Analysis + + + + +

    工具管理说明

    腾讯云代码分析平台目前已集成众多自研、知名开源工具,并采用分层分离的架构,可以快速对接企业内部团队研发的工具,并将其集成到平台内供企业内部团队使用,满足快速自助的管理工具。

    • 按工具来源划分,工具包含平台提供的工具,以及团队接入的工具。

      平台提供工具:由腾讯云代码分析平台提供的一系列自研、知名开源工具,此类工具都为公开工具,任何团队都可以使用此工具及工具规则进行代码分析。

      团队接入:由团队自行接入的工具,默认该工具仅能在团队内使用,如需跨团队使用或任何团队都可以使用需联系平台管理员进行配置。

    • 按工具使用划分,工具包含可自定义规则工具可使用工具两种。

      可自定义规则工具:该工具任何团队都可以使用,且该工具可以支持添加团队所需的自定义规则。如RegexScan工具,各个团队都可以使用该工具提供的规则,也可以自定义规则,此自定义规则团队隔离。

      可使用工具:该工具团队内可使用,但不能添加自定义规则

    TIP

    目前开源版仅**RegexFileScanRegexScanTCA-Armory-R**等三款工具支持用户自定义规则

    需平台管理员在后台管理-工具管理中找到对应工具,并将其权限状态调整为支持自定义规则

    自定义工具

    工具白名单

    默认自定义工具只能当前团队内使用,添加 工具白名单 后可以让其他团队使用。

    使用场景说明

    TIP

    添加工具、添加工具规则、添加自定义规则等均需团队内管理员可操作。分析。


    【用户 A1】【用户 A2】为【团队 O1】的管理员,【用户 A3】为【团队 O2】的普通成员。

    【用户 B1】【用户 B2】为【团队 O2】的管理员,【用户 A3】为【团队 O2】的普通成员。

    场景 1

    • 【用户 A1】在工具管理页面添加了【工具 T1】,该工具为团队内工具; -【用户 A1】【用户 A2】均可操作该工具,如修改工具信息、添加工具规则等,【用户 A3】仅可以使用该工具,如在规则配置页面添加该工具规则;

    • 由于【工具 T1】目前仅【团队 O1】可用,【团队 O2】中无法看到此工具,即【团队 O2】内的成员无法使用该工具。

    • 如需【工具 T1】也让【团队 O2】使用有两种解决方法:1. 【工具 T1】将【团队 O2】加入使用白名单;2. 向平台发起申请,由平台管理员将【工具 T1】调整为全部团队都可使用。

    场景 2

    • 【用户 A3】在工具管理页面发现了可自定义规则的工具,如正则工具 RegexScan,进入工具-自定义规则栏,发现没有添加规则的入口;
    • 由于【用户 A3】仅为普通成员权限,因此无法添加规则,此时需要【团队 O1】的管理员才能操作;
    • 添加【自定义规则 R1】完成后,团队内全部成员均可使用该自定义规则,如在规则配置页面添加该自定义规则;
    • 由于【自定义规则 R1】是团队隔离的,即【团队 O1】创建的自定义规则,在【团队 O2】中并看不到,且无法使用该规则;
    • 如需【自定义规则 R1】也让【团队 O2】使用,则仅能向工具方发起申请,由工具方将该自定义规则调整为工具规则。
    + + + diff --git "a/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html" "b/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html" new file mode 100644 index 000000000..f1632ce1c --- /dev/null +++ "b/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html" @@ -0,0 +1,67 @@ + + + + + + + + + 自定义工具 | Tencent Cloud Code Analysis + + + + +

    自定义工具

    腾讯云代码分析平台支持用户自助添加代码分析工具。

    适用场景:自定义规则无法满足团队业务复杂需求,需要更多的代码逻辑来匹配目标代码的情况。通常需要团队业务方自行实现对应代码分析工具。

    只需要几步操作:

    1. 编写代码,实现扫描工具逻辑
    2. 提交工具到 git 代码库
    3. 在页面创建新工具
    4. 为工具添加规则
    5. 将工具配置到执行节点
    6. 在项目分析方案中添加规则

    扩展集成工具免责声明

    被扩展集成进腾讯云代码分析系统的任何非官方工具,该类工具对于腾讯云代码分析系统等于黑盒,腾讯云代码分析系统不对该类工具负责,由该类工具方承担所有责任(包括但不限于分发被分析代码,产生代码以及相关信息泄漏)。

    自定义工具步骤说明

    第一步,编写代码,实现分析工具逻辑

    根据需要匹配的目标代码场景,编写对应的工具逻辑。 可以参考 Python 实现的 Demo 项目open in new window

    必要:

    • 运行方式:支持命令行执行,比如 python run.py 或 run.exe,执行命令的工作目录为工具代码的根目录。

    • 运行环境说明

      • 建议将工具打包编译成可执行程序,拉取下来直接可以执行。
      • 如果工具需要在特定的环境中运行,比如python、java环境,平台提供了丰富的工具依赖包,可以在工具管理-工具依赖中查看,创建工具时可供选择,执行时会自动配置好依赖环境。
      • 如果现有的工具依赖包未支持所需依赖,也可以创建新的工具依赖使用。
    • 平台已提供的环境变量

      SOURCE_DIR:要扫描的代码目录路径
      +DIFF_FILES: 值为一个json文件路径,文件内容为增量扫描的文件列表(增量扫描时可用)
      +SCAN_FILES: 值为一个json文件路径,文件内容为需要扫描的文件列表(增量或全量扫描均可用)
      +TASK_REQUEST: 值为一个json文件路径,文件内容为当前扫描任务参数
      +RESULT_DIR: 结果result.json输出的结果目录路径
      +
    • 工具命令声明

      在工具仓库根目录下,添加一个tool.json文件,声明工具的检查和扫描命令,比如:

      {
      +  "check_cmd": "python src/main.py check",
      +  "run_cmd": "python src/main.py scan"
      +}
      +

      参数说明:

      • check_cmd
        • 功能:判断当前执行环境是否满足工具要求(如果不需要检查,也可以没有这个命令)。 比如某些工具只能在linux下执行,需要判断当前是否为linux环境。
        • 输出:将判断结果输出到check_result.json文件中,文件内容为{"usable": true}{"usable": false}
      • run_cmd
        • 功能:扫描代码,执行自定义检查器逻辑(该命令必须存在)。
        • 输出:按照指定格式,输出结果到结果目录下的result.json文件中。
    • 工具输出格式要求

      • 将扫描结果输出到RESULT_DIR环境变量指定的目录下的result.json文件中(Python 示例代码)
      import os
      +import json
      +result_dir = os.getenv("RESULT_DIR", os.getcwd())
      +result_path = os.path.join(result_dir, "result.json")
      +with open(result_path, "w") as fp:
      +    json.dump(result, fp, indent=2)
      +
      • result.json 文件格式如下:
      [
      +    {
      +        "path": "文件绝对路径",
      +        "line": "行号,int类型",
      +        "column": "列号, int类型,如果工具没有输出列号信息,可以用0代替",
      +        "msg": "提示信息",
      +        "rule": "规则名称,可以根据需要输出不同的规则名",
      +        "refs": [
      +            {
      +                "line": "回溯行号",
      +                "msg": "提示信息",
      +                "tag": "用一个词简要标记该行信息,比如uninit_member,member_decl等,如果没有也可以都写成一样的",
      +                "path": "回溯行所在文件绝对路径"
      +            },
      +            ...
      +        ]
      +    },
      +    ...
      +]
      +

      refs 字段说明:

      非必需项,可无。该字段记录问题回溯路径信息。比如当前行的代码问题,是经过上下文的三行代码执行路径而导致的,可以将这三行的位置及提示信息,按顺序添加到 refs 数组中。

    第二步,提交工具到 git 代码库

    • 创建代码库,将工具源代码或编译打包后的可执行文件,提交到代码仓库中(建议提交到master分支,TCA默认拉取的是master分支)。

    • 建议代码库中加入 README.md 文件,说明工具功能和维护人。

    • 后续需要修改工具实现逻辑,可以直接更新代码库,TCA 平台在执行该工具时,会自动拉取最新工具代码版本。

    第三步,在工具管理页面中创建工具

    • 进入工具管理页面,点击创建工具

      enter image description here

    • 填写工具信息

      enter image description here

      部分参数说明:

      • 工具仓库地址,即前述步骤中提交的工具 git 代码库地址,默认拉取的是master分支,如果是其他分支,需要在仓库地址后加上#分支名,比如:https://github.com/xxx/xxx.git#main

      • 工具认证,授权拉取工具仓库的权限

      • 执行命令,该命令会在工具根目录下执行

      • 环境变量,工具执行所需的环境变量

      • License,如果是开源工具,填写工具遵循的开源协议,或者填写自研共建

      • 是否为编译型工具,表示在使用该工具对用户代码进行分析时,是否要求代码需要编译或可执行编译

      • 注意:针对特殊扫描场景的工具(比如检查代码库下是否包含某些第三方依赖目录,结果不涉及单个代码文件的),无法对结果进行代码文件处理,可以通过设置以下环境变量,跳过一些通用的结果处理步骤,避免问题结果被过滤掉:

        • BLAME_TYPE=NO_BLAME,跳过对代码行/代码文件进行文件责任人定位(结果非单个文件/代码行时使用)
        • FILTER_TYPE=NO_VERSION_FILTER,跳过检查问题路径(path字段)是否为已提交到代码库中的文件(结果非单个文件/代码行时使用)
        • IGNORE_TYPE=NO_ISSUE_IGNORE,跳过注释忽略处理(结果非单个文件/代码行时使用)
    • 添加工具依赖

      enter image description here

      添加完成后,会展示已添加的依赖方案:

      enter image description here

    工具依赖说明:

    • 比如当前的demo工具,只需要依赖python3运行,而且支持在linux x86_64、linux arm64、mac和windows下执行,那么只需要配置一个依赖方案(如上图),并配置为默认方案。在不同的操作系统中,会自动加载对应操作系统的python环境。
    • 如果需要根据扫描项目设置的环境变量,加载不同的依赖配置,则可以配置不同的判断条件,使用多个依赖方案。

    第四步,为工具添加规则

    • 完成工具创建后,进入规则列表,为工具添加规则

      enter image description here

    • 填写规则信息

      部分参数说明:

      • 规则简介:简要描述规则发现的是什么问题,扫描结果中会作为问题标题展示

      • 详细描述:可详细描述规则,以及规则的解决方式,建议附上解决案例 demo

      • 解决方法:按照实际情况,说明该代码问题的解决方法,建议附上解决案例 demo

      • 规则参数:如果不需要通过规则参数传递信息,可留空

    第五步,将工具配置到执行节点

    TIP

    需要联系平台管理员协助操作,在管理入口-节点管理中进入需要配置的机器节点的工具进程配置中,找到对应工具,勾选工具进程。

    完成节点配置工具进程后,才能在项目中采用该工具进行分析。

    enter image description here

    第六步,完成上述操作,在项目中使用工具规则

    • 进入到项目中,在分析方案-代码检查进行规则配置。

    • 点击添加规则,找到对应工具规则进行添加。

    • 添加完成后,启动分析,为了将规则应用到所有代码文件,建议启动一次全量分析(增量分析只会分析自上次扫描后变更的文件)。

    自定义工具权限说明

    • 默认自定义工具仅团队管理员可操作,团队内所有成员可使用。

      • 团队管理员才能创建工具,添加工具规则等,具备该工具全部权限

      • 团队内所有成员可使用该工具规则,如在规则配置中添加此工具规则,团队普通成员仅只读权限

    • 工具希望全平台使用?

      由于全平台使用的工具影响范围较大,建议团队先在团队内对工具进行充分测试,保障团队内工具的高有效性,如需全平台使用,需联系平台管理员进行申请

      平台管理员需对此工具进行审核,在确保工具的高有效性下可将此工具权限调整为全平台可使用

    + + + diff --git "a/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html" "b/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html" new file mode 100644 index 000000000..734453f29 --- /dev/null +++ "b/en/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html" @@ -0,0 +1,33 @@ + + + + + + + + + 自定义规则 | Tencent Cloud Code Analysis + + + + +

    自定义规则

    自定义规则即由业务团队根据自身需求,由业务团队自行设计提供的规则。

    自定义规则权限说明

    • 工具需开放支持自定义规则权限,才可添加自定义规则。

      • 当前平台提供的工具中,仅TCA-Armory-RRegexFileScanRegexScan三款工具支持使用用户自定义规则。

      • 开放支持自定义规则权限,需平台管理员在管理入口-工具管理中找到对应工具,并将其权限状态调整为支持自定义规则

    • 自定义规则仅支持团队管理员添加,且默认仅团队内可见。

      • 满足不同团队自定义规则可能存在的差异和隐私性。
    • 如需将自定义规则加入工具默认规则,需联系工具提供方团队管理员添加。

    平台提供的正则工具 TCA-Armory-R 说明

    详见TCA-Armory-R使用手册

    平台提供的正则工具 RegexScan 说明

    正则工具 RegexScan 即为开放了自定义规则功能的工具,可进入工具管理页面,搜索工具名称RegexScan,查看该工具已存在的规则以及根据团队业务需求,添加自定义规则。

    适用场景:通过正则表达式,能够匹配到目标代码的情况。

    自定义规则步骤

    1. 根据团队业务需求设计正则表达式

      TIP

      建议先测试好正则表达式是否正确,正则表达式测试网站推荐:http://tool.oschina.net/regexopen in new window

      规则示例:

      • 规则分析场景

        分析代码中的 usleep() 方法调用,如果参数小于 100 ,容易造成 CPU 使用率过高,造成性能浪费,判断为缺陷。

      • 正则表达式

        匹配 usleep() 字符串,括号中的内容为 1 位或 2 位整数,那么正则表达式可以写成 \busleep\s*\(\s*\d{1,2}\s*\),这里考虑了字符串中存在空格的情况。

    2. 进入正则工具添加自定义规则

      进入工具管理页面,找到正则工具RegexScan,并点击进入自定义规则列表页,点击添加规则按钮。

    3. 填写规则信息

      规则参数填写说明(必要):

      参数格式类似 ini 的格式, 也就是 key = value 的格式

      • 【必要】 regex 参数,用于指定分析的正则表达式, 例如: regex = \busleep\s*\(\s*\d{1,2}\s*\)

      • 【必要】 msg 参数,用于展现 issue 说明, 例如: msg = 函数方法%s 已经废弃,请使用 xxx 方法

        msg 中的“%s”使用 regex 中的 group(用“()"括起来的部分)一一匹配。

        如果 regex 没有定义 group,则 msg 最多有一个%s, 并由整个 regex 匹配的字符串替代

        如果 msg 里没有包含“%s”,则直接显示 msg

        如果 msg 没有提供,则默认为“发现不规范代码:%s”(不建议使用默认格式,太笼统)

      • 【可选填】 ignore_comment 参数,用于指定是否忽略注释代码,可选值:True、true、False、false 。例如 ignore_comment=True, 默认是 False

      • 【可选填】 include 参数,用于将指定分析文件匹配范围,使用 unix 的文件匹配格式,多项使用英文分号;隔开。例如 include = path/to/dir;path/to/\*.cpp

      • 【可选填】 exclude 参数,用于指定不分析的文件。格式参考 include 参数。

    4. 将自定义规则添加到项目分析方案中

      添加完成,可在分析方案-代码检查-规则配置中添加该自定义规则

    + + + diff --git "a/en/guide/\345\277\253\351\200\237\345\205\245\351\227\250/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html" "b/en/guide/\345\277\253\351\200\237\345\205\245\351\227\250/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html" new file mode 100644 index 000000000..64ad83fa3 --- /dev/null +++ "b/en/guide/\345\277\253\351\200\237\345\205\245\351\227\250/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html" @@ -0,0 +1,33 @@ + + + + + + + + + Quick start a code analysis | Tencent Cloud Code Analysis + + + + +

    Quick start a code analysis

    Create teams and projects

    • Create a new team
      Check here about Team manage

      Create a new team

    • Create a new project for your team, or select an existing project then open the project

      Create a new project

    Register your repository

    • Register your repository and go to code analysis

      Register your repository

      Go to code analysis

    Start code analysis

    Initialization

    Start a analysis

    TIP

    1. When starting code analysis for the first time, you can choose an existing analysis scheme template or create one.
    2. When you click "确认", the TCA will first create an analysis scheme for your repository, and create branch projects based on repository's branches and current analysis scheme for users to start code analysis.

    Run a code analysis

    After initialization, you can use Online analysis or Client analysis to start a code analysis。

    Code analysis

    Online analysis

    Online analysis means that the analysis task is registered to the execution queue in the server, and the task is assigned to the resident analysis node configured in the TCA. After the analysis is completed, the analysis result will upload to the TCA.

    TIP

    Use online analysis, the TCA must have at least resident analysis node:

    • If your TCA is deployed using the official out-of-the-box deployment script (Docker deployment, Docker-compose deployment, and source code deployment), an analysis node (client) has been started by default, which can be directly used for online analysis. Check here about Node management.

    • You can also add more analysis nodes to perform parallel code analysis. To add new nodes, see About node

    If there is no node avaliable, online analysis tasks cannot be assigned. Unassigned tasks will be automatically cancelled after timeout

    Client analysis

    Client analysis is local analysis. You need to have a client locally and configure the client configuration file codelog.ini, see Start a local analysis to configure your local client. After analysis, the report data will be uploaded.

    Analysis history

    After the analysis, the data will be reported to the server. You can enter the analysis history page to check the analysis records and results.

    Analysis history

    Analysis overview

    After the analysis, you can check a branch overview and Defects list by entering Branch overview 等。

    Branch overview

    + + + diff --git "a/en/guide/\346\217\222\344\273\266/Jenkins_Plugin.html" "b/en/guide/\346\217\222\344\273\266/Jenkins_Plugin.html" new file mode 100644 index 000000000..6dbc36bbf --- /dev/null +++ "b/en/guide/\346\217\222\344\273\266/Jenkins_Plugin.html" @@ -0,0 +1,73 @@ + + + + + + + + + Jenkins插件使用说明 | Tencent Cloud Code Analysis + + + + +

    Jenkins插件使用说明

    TIP

    以下说明以 Jenkins 2.361.2 版本为例。

    使用前准备

    获取Jenkins插件

    Jenkins插件有以下两种获取方式:

    方式一:在 TCA 源码的plugin/jenkins_plugin目录下,执行命令mvn package -DskipTests,打包完成后进入target目录会看到tca_jenkins_plugin.hpi 的安装包。

    方式二:从TCA release 安装包中,获取jenkins_plugin.hpihttps://github.com/Tencent/CodeAnalysis/releasesopen in new window

    在Jenkins安装插件

    在Jenkins中通过【Manage Plugin】-> 【Advanced】->【Deploy plugin】的方式选择 Jenkins_plugin.hpi文件上传安装,并重启Jenkins。

    最终在【Installed】里搜索出【TCA】代表插件安装成功。

    完善启动客户端的环境

    在CodeAnalysis目录下执行代码

    bash ./scripts/base/install_bin.sh
    +

    client目录下的config.ini文件中的<Server IP地址>替换为部署的开源版TCA的IP地址(可包含端口号)

    使用插件

    在 TCA 创建团队和项目

    如已创建后待使用的团队和项目,可跳过此步。

    进入已部署好的TCA页面,点击【创建团队】,成功后【创建项目】。

    配置Jenkins环境变量

    进入Jenkins设置界面,在【Manage Jenkins】->【Configure System】->【Global properties】中添加环境变量:
    Name:PYTHONPATH Value:xxxx(路径不包含python3)
    Value:GITPATH Value:xxxx(路径不包含git)

    配置 TCA 插件

    方式一:可视化界面配置 TCA 插件

    创建一个构建任务,配置代码库信息,进入Jenkins,通过【New Item】创建一个空白任务,在任务配置中【Source Code Management】配置待分析的代码库地址和凭证。
    Repository URL: 填入远端仓库地址
    Credentials: 添加仓库的用户名和密码作为凭证,如果是公开仓库,可以不设置仓库凭证

    在构建任务的【Build】中选择【TCA】插件并配置以下参数:

    CodeAnalysis目录绝对路径: 拉取到本地的CodeAnalysis开源仓库目录的绝对路径(例如:/data/CodeAnalysis/)
    团队ID: 在 TCA 中创建的团队的标识ID,可在TCA【团队概览】中获取“团队唯一标识”
    项目名称: 在 TCA 中创建的项目的标识ID,可在TCA【项目概览】中获取“项目唯一标识”
    Token: 在 TCA 的【个人中心】->【个人令牌】中获取
    分支名称: 需要扫描的代码分支名称
    语言类别: 项目需要扫描的语言
    分析方案模板ID: 需要使用的分析方案模板ID,在分析方案模板的“基础属性”中获取,将根据此模板创建分析方案(选填)
    分析方案名称: 指定创建出来的分析方案的名称(选填)
    全量扫描: 不勾选默认启动增量扫描
    质量门禁: 设置质量门禁值,配置和使用参考 设置质量门禁

    配置完成后点击【Save】保存。

    方式二:pipeline语法配置 TCA 插件

    在步骤中添加TCA插件参数配置语句,下面的配置语句可作为参考;注意:如果是release版本v1.11.0及之前的老版本(包含源代码构建生成和release获取)插件,语法参数略有差别,请参考issue1150open in new window

    pipeline{
    +  agent any
    +
    +    stages{
    +      stage('Build'){
    +        steps{
    +            TCA(codeAnalysisPath: '/data/CodeAnalysis/', teamId: 'xxxx', projectName: 'demo', token: 'xxxxxxxxxxxx', branchName: 'master', languageType: 'Java', refSchemeID: '1', scanPlan: 'model', threshold: '90', total:true)
    +        }
    +      }
    +    }
    +}
    +
    +

    codeAnalysisPath: 拉取到本地的CodeAnalysis开源仓库目录的绝对路径(例如:/data/CodeAnalysis/)
    teamId:团队ID
    projectName: 项目名称
    token: 在 TCA 的【个人中心】->【个人令牌】中获取
    branchName: 需要扫描的代码分支名称
    languageType: 项目需要扫描的语言
    refSchemeID: 需要使用的分析方案模板ID,在分析方案模板的“基础属性”中获取,将根据此模板创建分析方案(选填)
    scanPlan: 指定创建出来的分析方案的名称(选填)
    threshold: 设置质量门禁值
    total: 是否全量扫描,填ture为全量扫描,不填或填false为增量扫描

    启动构建并查看结果

    点击【Build Now】启动构建。
    进入构建任务,在【Console Output】中查看执行过程。
    执行完成后,可在下方看到代码分析的结果链接,也可在【代码分析报告】中获取代码分析的json报告。

    设置质量门禁

    在上述 TCA 插件配置部分填写质量门禁参数,需要填写一个整数,即当前分支的扫描问题量大于该质量门禁值时,判断为不通过;否则为通过。完成后会将TCA结果状态(success|failure)输出到工作空间下的tca_threshold.txt文件中,供后续步骤判断和终止流水线。

    可视化界面使用质量门禁

    在TCA插件后增加shell命令步骤,输入以下脚本内容:

    tca_status=`cat tca_threshold.txt`
    +if [ "${tca_status}" == "success" ]; then
    +  echo ">> tca scan pass!"
    +else
    +  echo ">> tca scan fail! exit code 255"
    +  exit 255
    +fi
    +

    当质量门禁不通过时,会终止流水线(退出码:255)。

    pipeline脚本使用质量门禁

    以下是pipeline脚本使用质量门禁进行相应操作的示例,你可以在if和else部分写入你想要运行的脚本

    pipeline{
    +  agent any
    +
    +    stages{
    +      stage('Build'){
    +        steps{
    +            TCA(codeAnalysisPath: '/data/CodeAnalysis/', teamId: 'xxxx', projectName: 'demo', token: 'xxxxxxxxxxxx', branchName: 'master', languageType: 'Java', refSchemeID: '1', scanPlan: 'model', threshold: '90', total:true)
    +            script{
    +                def tca_status = readFile('tca_threshold.txt')
    +                if (tca_status == "success") {
    +                    echo ">> tca scan pass!"
    +                } else {
    +                    echo ">> tca scan fail! exit code 255"
    +                    error("TCA scan failed. Terminating pipeline.")
    +                }
    +            }
    +        }
    +      }
    +    }
    +}
    +
    + + + diff --git "a/en/guide/\346\234\215\345\212\241\347\253\257/deploy_with_minio.html" "b/en/guide/\346\234\215\345\212\241\347\253\257/deploy_with_minio.html" new file mode 100644 index 000000000..62d9f9199 --- /dev/null +++ "b/en/guide/\346\234\215\345\212\241\347\253\257/deploy_with_minio.html" @@ -0,0 +1,53 @@ + + + + + + + + + 基于MinIO部署文件服务器 | Tencent Cloud Code Analysis + + + + +

    基于MinIO部署文件服务器

    TCA的file服务支持对接MinIO作为底层存储,将文件转发到已部署的MinIO平台上进行持久化存储

    本地部署

    注意:如果之前已经使用本地进行存储,切换为MinIO后,之前已经上传的文件只能到服务部署的目录server/projects/file/data查看,不支持通过页面进行下载

    前置步骤

    获取MinIO平台登录的账号密码,用于上传文件

    配置步骤

    1. 调整file服务的配置

    修改server/configs/django/local_file.py文件,取消以下代码的注释

    # MINIO
    +STORAGE = {
    +    "CLIENT": os.environ.get("FILE_STORAGE_CLIENT", "MINIO"),  # 存储方式
    +    "OPTIONS": {
    +        "MINIO_ENTRYPOINT": os.environ.get("FILE_MINIO_ENTRYPOINT"),
    +        "MINIO_ACCESS_KEY": os.environ.get("FILE_MINIO_ACCESS_KEY"),
    +        "MINIO_SECRET_KEY": os.environ.get("FILE_MINIO_SECRET_KEY"),
    +    }
    +}
    +

    修改server/scripts/config.sh文件,填写MinIO的信息

    export FILE_MINIO_ENTRYPOINT=<MinIO平台的地址>
    +export FILE_MINIO_ACCESS_KEY=<MinIO平台的登录账号>
    +export FILE_MINIO_SECRET_KEY=<MinIO平台的登录密码>
    +

    修改完配置后,如果服务已经正在运行,则执行以下命令重启服务

    $ cd server
    +$ ./scripts/deploy.sh start
    +

    2. 修改nginx服务的配置文件

    删除nginx已有的文件服务器配置文件/etc/nginx/conf.d/tca_file_local.conf文件,然后执行

    rm /etc/nginx/conf.d/tca_file_local.conf
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_minio.conf /etc/nginx/conf.d/tca_file_local.conf
    +

    也可以修改server/scripts/init_config.sh

    # 注释这一行
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_local.conf /etc/nginx/conf.d/tca_file_local.conf
    +# 取消注释这一行
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_minio.conf /etc/nginx/conf.d/tca_file_local.conf
    +

    修改完配置后,如果nginx已经正在运行,则执行nginx -s reload

    结尾

    以上两个步骤操作完成后,就可以通过MinIO存储文件了~

    + + + diff --git "a/en/guide/\346\234\215\345\212\241\347\253\257/deploy_without_migrate.html" "b/en/guide/\346\234\215\345\212\241\347\253\257/deploy_without_migrate.html" new file mode 100644 index 000000000..52314e385 --- /dev/null +++ "b/en/guide/\346\234\215\345\212\241\347\253\257/deploy_without_migrate.html" @@ -0,0 +1,33 @@ + + + + + + + + + Tencent Cloud Code Analysis + + + + +

    在实际的生产环境的部署过程中,团队的MySQL的管理员可能不会给到应用账号create等比较敏感的权限,这种情况下,我们可以通过手动迁移数据的方式起到和等同Django migrate的效果。

    操作步骤:

    1. 进入Server服务工作目录后(假设工作目录为 /data/CodeAnalysis/server/,以下路径均为工作目录内的相对路径)
    2. 在开发环境一个有全部权限的MySQL地址,初始化数据(MySQL版本运行版本:5.7)
      • 执行vi ./scripts/config.sh:填写一个有全部权限的MySQL数据库地址和Redis信息以及根据需要调整配置信息,主要的工程配置已提供默认值,字段说明可以查看文档
      • 执行bash ./scripts/deploy.sh init:初始化DB、安装依赖和运行初始化脚本
      • 使用MySQLDump工具导出表结构与数据:mysqldump -u user -p –databases codedog_main codedog_analysis codedog_file codedog_login > codedog_all.sql
    3. 在生产环境建数据库,详情见:server/sql/init.sql
    4. 连接MySQL,导入数据:
      • 临时关闭外键检查: SET SESSION FOREIGN_KEY_CHECKS=0,否则会因为数据中有外键关联导致导入失败
      • 导入表结构与数据: source /youdir/codedog_all.sql;
      • 开启外键检查: SET SESSION FOREIGN_KEY_CHECKS=1
    5. 启动服务: 直接执行 bash ./scripts/deploy.sh start,无需执行 init方法,否则会导致数据重复写入
    + + + diff --git "a/en/guide/\346\234\215\345\212\241\347\253\257/server.html" "b/en/guide/\346\234\215\345\212\241\347\253\257/server.html" new file mode 100644 index 000000000..e7f210eea --- /dev/null +++ "b/en/guide/\346\234\215\345\212\241\347\253\257/server.html" @@ -0,0 +1,37 @@ + + + + + + + + + TCA Server | Tencent Cloud Code Analysis + + + + +

    TCA Server

    工程结构

    TCA Server由Main、Analysis、Login、File、ScmProxy五个微服务组成,主要技术栈为Django+uwsgi+nginx

    配置说明

    注意:以下配置内容可以参考 config.shopen in new window文件进行查阅,使用时主要关注 MySQL、Redis 的配置,其他配置均已提供默认值,可以根据需要进行调整

    Main服务

    框架配置:

    • MAIN_DEBUG_MODE: Main服务的Debug模式,true/false
    • MAIN_SECRET_KEY: Main服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Main服务DB配置:

    • MAIN_DB_NAME:Main服务的数据库名称
    • MAIN_DB_USER:Main服务的数据库用户名
    • MAIN_DB_PASSWORD:Main服务的数据库密码
    • MAIN_DB_HOST:Main服务的数据库地址
    • MAIN_DB_PORT:Main服务的数据库端口号

    Main服务Redis配置:

    • MAIN_REDIS_HOST:Main服务访问的Redis地址
    • MAIN_REDIS_PORT:Main服务访问的Redis端口号
    • MAIN_REDIS_PASSWD:Main服务访问的Redis密码
    • MAIN_REDIS_DBID:Main服务访问的Redis DB编号,默认为1(Analysis服务默认访问0号DB)

    服务交互配置:

    • MAIN_SENTRY_DSN:Main服务异常日志上报至sentry配置
    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token
    • FILE_SERVER_TOKEN:文件服务器访问Token
    • CODEDOG_TOKEN:CodeDog默认访问的Token

    Analysis服务

    框架配置:

    • ANALYSIS_DEBUG_MODE: Analysis服务的Debug模式,true/false
    • ANALYSIS_SECRET_KEY: Analysis服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Analysis服务DB配置:

    • ANALYSIS_DB_NAME:Analysis服务的数据库名称
    • ANALYSIS_DB_USER:Analysis服务的数据库用户名
    • ANALYSIS_DB_PASSWORD:Analysis服务的数据库密码
    • ANALYSIS_DB_HOST:Analysis服务的数据库地址
    • ANALYSIS_DB_PORT:Analysis服务的数据库端口号

    Analysis服务Redis配置:

    • ANALYSIS_REDIS_HOST:Analysis服务访问的Redis地址
    • ANALYSIS_REDIS_PORT:Analysis服务访问的Redis端口号
    • ANALYSIS_REDIS_PASSWD:Analysis服务访问的Redis密码
    • ANALYSIS_REDIS_DBID:Analysis服务访问的Redis DB编号,默认为0(Main服务默认访问1号DB)

    服务交互配置:

    • ANALYSIS_SENTRY_DSN:Analysis服务异常日志上报至sentry配置
    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    Login服务

    框架配置:

    • LOGIN_DEBUG_MODE: Login服务的Debug模式,true/false
    • LOGIN_SECRET_KEY: Login服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Login服务DB配置:

    • LOGIN_DB_NAME:Login服务的数据库名称
    • LOGIN_DB_USER:Login服务的数据库用户名
    • LOGIN_DB_PASSWORD:Login服务的数据库密码
    • LOGIN_DB_HOST:Login服务的数据库地址
    • LOGIN_DB_PORT:Login服务的数据库端口号

    服务交互配置:

    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    注:配置文件中的pub_key与private_key生成方式可以参考以下方法:

    $ ssh-keygen -t rsa -b 1024 -m PEM -f tca_login.key
    +$ openssl rsa -in tca_login.key -pubout -outform PEM -out tca_login.key.pub
    +$ cat tca_login.key  # 作为private_key的内容
    +$ cat tca_login.key.pub  # 作为pub_key的内容
    +

    File服务

    框架配置:

    • FILE_DEBUG_MODE: File服务的Debug模式,true/false
    • FILE_SECRET_KEY: File服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    File服务DB配置:

    • FILE_DB_NAME:File服务的数据库名称
    • FILE_DB_USER:File服务的数据库用户名
    • FILE_DB_PASSWORD:File服务的数据库密码
    • FILE_DB_HOST:File服务的数据库地址
    • FILE_DB_PORT:File服务的数据库端口号

    服务交互配置:

    • FILE_SENTRY_DSN:File服务异常日志上报至sentry配置
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    File存储引擎配置

    • FILE_STORAGE_CLIENT: 文件存储引擎,可选项:LOCAL/MINIO/COS
      • 当配置引擎为LOCAL,可以指定FILE_STORAGE_DIR文件存放的路径
      • 当配置引擎为MINIO,可以指定以下变量:
        • FILE_MINIO_ENTRYPOINT:MINIO服务地址
        • FILE_MINIO_ACCESS_KEY:MINIO服务访问账号
        • MINIO_SECRET_KEY:MINIO服务访问密码
      • 当配置引擎为COS,可以指定以下变量
        • TENCENT_COS_APPID
        • TENCENT_COS_SECRETID
        • TENCENT_COS_SECRETKEY
        • TENCENT_COS_REGION
        • TENCENT_COS_ROOT_BUCKET:填写格式为bucket-appid

    ScmProxy

    服务配置:

    • SCMPROXY_HOST:ScmProxy服务的HOST,默认为0.0.0.0
    • SCMPROXY_PORT:ScmProxy服务监听端口,默认为8009
    • SCMPROXY_SENTRY_URL:ScmProxy服务异常日志上报至sentry配置
    • SCMPROXY: 通过本环境变量去指定其他服务调用ScmProxy服务的地址,默认值为127.0.0.1:8009
    + + + diff --git a/en/index.html b/en/index.html new file mode 100644 index 000000000..314d19ae6 --- /dev/null +++ b/en/index.html @@ -0,0 +1,33 @@ + + + + + + + + + Tencent Cloud Code Analysis Doc | Tencent Cloud Code Analysis + + + + +
    Tencent Cloud Code Analysis

    Tencent Cloud Code Analysis

    用心关注每行代码迭代、助力传承卓越代码文化!

    Quick start Guide

    Stable and reliable architecture

    Support distributed architecture and cloud native architecture; flexible scaling; run faster with more stability.

    Multi-tool support

    Integrated many self-developed and well-known open-source tools; adopted a layered separation architecture, can meet the needs of the team's rapid self-service management tools.

    Multi-language support

    Support Java/C++/Objective-C/C#/JavaScript/Python/Go/PHP and other 29 languages, cover frequently-used programming languages.

    Incremental/Full analysis scan

    Incremental analysis can quickly locate defects, while a full analysis ensure total coverage of your code.

    Customize rules

    Customize your rules, gradually optimize your code.

    Full range quality report

    Report with graphics, easy to monitor quality trend.

    Standardized API

    Standardized API make a fast docking to DevOps tools.

    Distributed client

    Distributed clients on Linux, Mac and Windows, meet local high-frequency analysis scenario.

    + + + diff --git a/en/quickStarted/FAQ.html b/en/quickStarted/FAQ.html new file mode 100644 index 000000000..f48a63a77 --- /dev/null +++ b/en/quickStarted/FAQ.html @@ -0,0 +1,94 @@ + + + + + + + + + FAQ | Tencent Cloud Code Analysis + + + + +

    FAQ

    TIP

    该Q&A文档会持续更新,非常欢迎您的建议与共建!

    如果您遇到任何未在此处列出的部署或使用问题,请在 GitHub issue 系统中进行搜索。如果仍未找到该错误消息,您可以通过社区提出问题,获得帮助。

    Server常见问题与处理方法

    1. 环境部署

    1.1 pypi下载超时或失败

    如果在执行pip install环节出现以下错误,可以调整一下镜像源:

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted. org', port=443): Read timed out.(read timeout=15)") '
    +

    该错误是访问官方pypi下载源时网络不通或者不稳定导致,可以通过以下方式调整:

    本地部署时,调整pypi下载源配置方式:

    mkdir ~/.pip/
    +echo "[global]\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +

    Docker-Compose部署时,调整pypi下载源配置方式:

    vi server/dockerconfs/Dockerfile-common
    +

    调整文件中最后一行 RUN指令

    RUN mkdir -p log/ && \
    +    mkdir ~/.pip/ && \
    +    echo "[global]\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf && \
    +    pip install -U setuptools pip && \
    +    pip install -r requirements.txt
    +

    注:如果需要指定其他pypi下载源,可以将https://mirrors.cloud.tencent.com/pypi/simple进行替换

    如果出现以下错误:

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f6d4ac24910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
    +

    该错误是无法正常解析pypi访问域名,需要检查一下本地的dns配置是否正常

    1.2 Docker未安装或版本过低

    TCA Server使用Docker-Compose依赖的Docker版本需要是1.13.0及以上,可以执行以下命令查看Docker版本

    $ docker --version
    +Docker version 18.09.7, build 2d0083d
    +

    文档相关:

    1.3 Docker-Compose启动失败

    如果启动Docker-Compose输出以下错误:

    * Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +

    问题原因:可能镜像构建目录权限不足,导致异常。 解决方案:

    1. 执行docker-compose build可以通过日志查看是哪个镜像构建异常
    2. 切换到具体目录执行docker build .可以看到详细错误信息,结合具体错误信息进行处理
    3. 收集常见的错误日志,整理相关解决方案(注:欢迎大家补充)

    文档相关:

    1.4 Docker镜像源下载超时或失败

    目前TCA基础镜像是使用python:3.7.12-slim,该镜像是基于debian bullseye(debian 11)版本构建的,对应的源需要选择 bullseye 版本的源。

    如果使用默认的下载源会报错或访问速度比较慢,可以调整server/dockerconfs/Dockerfile-common,指定其他国内下载源:

    # FROM python:3.7.12-slim
    +
    +# 增加一下内容用于指定下载源
    +RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
    +    echo 'deb http://mirrors.tencent.com/debian/ bullseye main non-free contrib' > /etc/apt/sources.list && \
    +    echo 'deb http://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib' >> /etc/apt/sources.list && \
    +    echo 'deb http://mirrors.tencent.com/debian-security bullseye-security main non-free contrib' >> /etc/apt/sources.list
    +
    +# ARG EXTRA_TOOLS=...
    +

    如果出现以下错误:E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages 可以做以下检查,确认是什么原因:

    1. 检查一下本地服务器的时间配置是否正常
    2. 调整下载源

    1.5 Python安装或执行失败

    使用Python执行时提示ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory,该如何处理

    1. 在本地安装Python的目录中查找该文件,比如Python的安装目录是/usr/local/python3,可以执行find /usr/local/python3 -name "libpython3.7m.so.1.0",确认本地是否存在该文件

    2. 如果本地存在该文件,则执行以下命令:(注:需要将/usr/local/python3调整为本地实际的Python3安装路径)

      # 链接构建产出的Python动态库
      +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
      +# 配置动态库
      +$ ldconfig
      +
    3. 如果本地不存在该文件,则可能需要重新安装Python3:(注:以下是将Python安装到/usr/local/python3,可以根据实际情况进行调整)

      # 编译前配置,注意重点:需要加上参数 --enable-shared
      +$ ./configure prefix=/usr/local/python3 --enable-shared
      +

    文档相关:

    1.6 执行compose_init.sh脚本的pip install提示sha256不匹配错误

    在构建镜像的pip install步骤提示以下报错时:

    ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    +    setuptools from https://mirrors.cloud.tencent.com/pypi/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8:
    +        Expected sha256 26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8
    +             Got        ddaacc49de5c08c09d744573240a9a49f24f65c5c72380e972433784caa68d98
    +

    可以执行export ORIGIN=normal,然后再执行./compose_init.sh

    注:执行export命令的作用是调整为pypi默认官方下载源进行pip install

    1.7 MacBook M1 使用 Docker-Compose报错

    在M1机器上使用默认配置启动docker-compose,会出现mysqlscmproxy服务启动失败,需要做以下两步调整

    1. 调整docker-compose.yml文件,修改MySQL的镜像版本:

      # 默认:
      +image: mysql:5.7.24
      +
      +# 调整后:
      +image: mariadb:10.5.8
      +
    2. 调整server/dockerconfs/Dockerfile-common文件,修改Python的镜像版本:

      # 默认:
      +FROM python:3.7.12-slim
      +
      +# 调整后:
      +FROM amd64/python:3.7.12-slim
      +

    1.8 celery、gunicorn命令找不到

    如果启动服务时,提示:celery could not be foundgunicorn could not be found,需要做以下检查

    1. 执行python -v检查输出,确认当前python版本是否为python3.7
    2. 执行pip install celerypip install gunicorn检查celery和gunicorn是否已经安装
    3. 如果已经安装,可以执行以下命令建立软链:(注:需要将/usr/local/python3调整为本地实际的Python3安装路径)
    ln -s /usr/local/python3/bin/gunicorn /usr/local/bin/gunicorn
    +ln -s /usr/local/python3/bin/celery /usr/local/bin/celery
    +

    2. 服务启动与初始化

    2.1 服务占用端口异常

    TCA 本地部署启动后,会监听多个端口:

    • web服务:80
    • nginx服务:8000
    • main服务:8001
    • analysis服务:8002
    • login服务:8003
    • file-nginx服务:8004
    • file服务:8804
    • scmproxy服务:8009

    如果出现端口占用冲突,建议采用以下方式解决:

    1. 调整其他程序监听的端口号,避免跟上述TCA服务的端口号出现冲突
    2. 采用Docker-Compose方式启动TCA,仅监听80端口

    不推荐调整TCA指定服务的端口号,需要调整多处配置,以及可能会影响到后续服务的升级

    2.2 服务输出日志找不到

    本地部署输出的日志位置:

    1. main服务输出的日志目录:server/projects/main/log
      • 服务启动日志:server/projects/main/log/gunicorn_error.log
      • 服务接收请求日志:server/projects/main/log/gunicorn_access.log
      • Celery Worker启动日志(处理异步任务):server/projects/main/nohup_worker.out
      • Celery Beat启动日志(启动定时任务):server/projects/main/nohup_beat.out
      • 服务运行日志:server/projects/main/log/codedog.log
      • Celery Worker运行日志:server/projects/main/log/main_celery.log
      • Celery Beat运行日志:server/projects/main/log/main_beat.log
    2. analysis服务输出的日志目录:server/projects/analysis/log
      • 服务启动日志:server/projects/analysis/log/gunicorn_error.log
      • Celery Worker启动日志:server/projects/analysis/nohup.out
      • 服务接收请求日志:server/projects/analysis/log/gunicorn_access.log
      • 服务运行日志:server/projects/analysis/log/codedog.log
      • Celery Worker运行日志(处理结果入库):server/projects/analysis/log/celery.log
    3. login服务输出的日志目录:server/projects/login/log
      • 服务启动日志:server/projects/login/log/gunicorn_error.log
      • 服务接收请求日志:server/projects/login/log/gunicorn_access.log
      • 服务运行日志:server/projects/login/log/codedog.log
    4. file服务输出的日志目录:server/projects/file/log
      • 服务启动日志:server/projects/file/log/gunicorn_error.log
      • 服务接收请求日志:server/projects/file/log/gunicorn_access.log
      • 服务运行日志:server/projects/file/log/codedog_file.log
    5. scmproxy服务输出的日志目录:server/projects/scmproxy/logs
      • 服务启动日志:server/projects/scmproxy/nohup.out
      • 服务运行日志:server/projects/scmproxy/logs/scmproxy.log

    3. 平台使用

    3.1 平台登录的默认账号密码是什么?

    默认账号: CodeDog,密码: admin

    3.2 平台默认的API Token是什么?

    默认Token是0712b895f30c5e958ec71a7c22e1b1a2ad1d5c6b

    如果在平台上刷新了CodeDog用户的Token,需要将刷新后的Token填写到以下文件中:

    1. server/scripts/config.sh文件
      • 更新CODEDOG_TOKENFILE_SERVER_TOKEN变量的值(3个位置)
    2. server/dockerconfs/.env.local文件
      • 更新CODEDOG_TOKENFILE_SERVER_TOKEN变量的值(3个位置)

    然后重启服务。

    1. 本地部署:

      cd server/
      +./scripts/deploy.sh start
      +
    2. docker-compose部署:

      $ docker-compose stop
      +# 稍等片刻
      +$ docker-compose up -d
      +

    3.3 代码库登记出错,出现代码库及账号不匹配

    该错误出现可能有以下几个原因:

    1. 账号密码不准确或登记的代码库地址不存在
    2. 登记github使用的密码需要使用personal access tokenopen in new window
    3. scmproxy服务启动失败
      • 本地部署:执行ps aux | grep proxyserver看看是否有python proxyserver.py执行进程,如果不存在可以看一下server/projects/scmproxy/nohup.out看看启动失败的原因
      • docker-compose部署:在项目根目录执行docker-compose ps看看scmproxy容器是否正常启动,如果没有启动,可以执行docker-compose logs scmproxy看看启动失败的原因
    4. scmproxy所在的机器/容器因为网络问题无法访问对应的代码库
      • 可以手动在机器/容器中执行git clone xxxx(xxx表示待登记的代码库),检查看看是否能够正常拉取
    5. scmproxy所在的机器git版本较低,出现unknown option `local` 错误
      • 可以升级机器上的git版本,目前工具支持最低的git版本为1.8.3.1

    3.4 查看问题文件提示获取代码信息耗时较久,请稍后再试

    出现该提示的原因是,代码库偏大或clone代码库时间较长,可以稍等一会再刷新重试

    3.5 客户端访问文件服务器,提示method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)

    出现这种错误,可能是本地配置异常或token配置有问题,检查方式如下:

    1. 检查客户端的config.ini文件配置的URL是否为当前Server部署的地址:(xxx需要调整为实际的路径)

      [SERVER_URL]
      +URL=http://xxx/server/main/
      +[FILE_SERVER]
      +URL=http:/xxx/server/files/
      +

      如果xxx不一致需要调整为一致

      注: xxx地址与在浏览器访问平台的xxx地址是一致的,不需要区分端口

    2. 检查客户端访问Server是否能通:

      curl -v http://xxx/server/main/
      +

      如果不通,则需要检查客户端机器访问Server机器是否有网络限制

    3. 检查当前在codedog.ini-[config]tokenconfig.ini文件配置的[FILE_SERVER]TOKEN是否一致,如果不一致需要调整为一致

    4. 检查用户CodeDogToken是否被刷新了然后没有更新到配置文件中

    3.6 客户端访问文件服务器,提示Connection timed out

    本地客户端执行过程提示method (upload file) call fails on error: <urlopen error [Errno 110] Connection timed out> 该如何处理? 一般情况下,这个问题是客户端与Server之间网络不通导致,可以检查一下是否有防火墙限制或者配置的URL是内部IP或地址,可以通过以下方式检查

    1. 检查客户端的config.ini文件配置的URL是否为当前Server部署的地址:(xxx需要调整为实际的路径)

      [SERVER_URL]
      +URL=http://xxx/server/main/
      +[FILE_SERVER]
      +URL=http:/xxx/server/files/
      +
    2. 检查客户端访问Server是否能通:

      curl -v http://xxx/server/main/
      +

      如果不通,则需要检查客户端机器访问Server机器是否有网络限制

    3.7 任务执行结果异常,提示第三方依赖文件服务器异常

    出现该错误提示,一般是访问文件器出错或文件服务器本身有问题,可以通过以下方式检查: 需要检查analysis-worker的日志(本地部署:server/projects/analysis/log/celery.log,docker-compose部署:docker-compose exec analysis-worker /bin/bash进入容器后访问log/celery.log查看具体错误原因

    如果提示no route to host可能是当前机器/容器无法访问当前宿主机的IP,可以检查一下当前防火墙的设置,是否限制了analysis-worker来源的访问

    3.8 客户端执行时提示工具(xxx)扫描进程为空,请联系管理员配置工具进程!

    出现该错误提示,一般是Server未进行初始化,可以通过执行以下命令初始化后再启动测试

    • 本地部署:cd server && ./scripts/deploy.sh init
    • docker-compose部署:./compose_init.sh

    CodeAnalysis仓库文件问题

    1. clone到本地时相关md文件内资源图片无法显示

    为防止国内用户访问CodeAnalysis Github首页时图片资源加载失败,目前各个md文件中的图片资源引用地址调整增加了URL前缀https://tencent.github.io/CodeAnalysis/

    用户下载代码库到本地后,发现无法访问资源文件时,请检查本地网络是否能够连通外网,如果无法连通外网,可以在文档引入资源地址中进行相对路径替换,调整各个资源文件的链接。

    • 对于根目录下的md文件,直接删除URL前缀即可:

      例如在https://tencent.github.io/CodeAnalysis/media/homepage.png这个链接可以调整为media/homepage.png

    • 对于其他目录下的md文件,删除URL前缀后,需调整文件相对路径链接:

      例如对于doc/client.md, 需将https://tencent.github.io/CodeAnalysis/media/clientConfigIni.png这个链接调整为../media/clientConfigIni.png

    + + + diff --git a/en/quickStarted/codeDeploy.html b/en/quickStarted/codeDeploy.html new file mode 100644 index 000000000..a2545d1f5 --- /dev/null +++ b/en/quickStarted/codeDeploy.html @@ -0,0 +1,39 @@ + + + + + + + + + 源代码快速部署 | Tencent Cloud Code Analysis + + + + +

    源代码快速部署

    TCA提供部署脚本,支持一键式快速部署Server、Web、Client。
    脚本共提供三种部署方式:Docker部署(平台体验首推)Docker-Compose部署、源码部署, 可根据您的具体使用场景任意选择其一进行部署。

    依赖环境

    • 系统环境

      • Linux
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备

      TIP

      TCA 一键部署脚本已封装好 Python、Mariadb、Redis 与 Nginx 安装步骤,无需自行安装本地部署体验可按 操作说明 内容直接进行部署操作。

      注意:生产环境建议使用专业的 MySQL、Redis 等服务

      • Python 3.7

      • MySQL 服务(MySQL5.7.8 以上版本或 Mariadb 10.5 以上版本)

      • Redis 服务(4.0版本以上)

      • Nginx 服务

    • 权限准备

      • 环境权限:安装 Server 依赖软件(python、nginx、yum 等软件包)需要使用 ROOT 权限
        • 启动 Server 服务时可以使用非 ROOT 用户运行
      • 数据库权限:Server 服务执行数据库初始化需要依赖 CREATE、ALTER、INDEX、DELETE、LOCK TABLES、SELECT、INSERT、REFERENCES、UPDATE 权限
    • 端口使用:需要开放80端口的访问权限(80为TCA平台默认访问端口),或调整 Web 服务默认的访问端口地址

    操作说明

    首次启动操作
    1. 进入 CodeAnalysis 工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径

    2. 安装基础软件与部署 TCA(可根据脚本选项确定是否要安装 Python、MySQL、Redis、Nginx 相关基础软件),执行

    $ bash ./quick_install.sh local deploy
    +

    执行该命令会做以下四个步骤:

    • Install:检测本地 Python3.7、Mariadb/MySQL、Redis 与 Nginx,如果不存在会提示安装
    • Init:部署 TCA Server、Web与Client,并进行初始化
    • Start:启动 TCA Server、Web与Client
    • Check:检测 TCA 的运行状态

    注意:在运行过程中,脚本会检测本地是否安装了相关基础软件(Python3.7、MySQL/Mariadb、Redis、Nignx),如果未安装会输出以下类似提示语:

    Do you want to install [Redis] by this script?
    +Please enter:[Y/N]
    +

    如果确定通过脚本安装可以输入Y

    1. 执行完成,无其他报错,即可登录:

    TIP

    至此,您已完成 TCA 平台部署,请在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可开启您的腾讯云代码分析。
    平台内操作指引请查看:快速启动一次代码分析

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    更新操作

    1. 更新代码

    2. 执行以下命令

    bash ./quick_install.sh local install tca  #更新相关配置
    +bash ./quick_install.sh local start  #启动服务(会自动关闭之前的服务)
    +bash ./quick_install.sh local check  #检查服务是否启动失败
    +

    注意:
    local install命令行参数说明:
    - base:安装 Python、Mariadb/MySQL、Redis 与 Nginx
    - tca:初始化或更新 TCA Server、Web、Client 相关配置和数据
    - server:初始化或更新 TCA Server 相关配置和数据
    - web:初始化或更新 TCA Web 相关配置和数据
    - client:初始化或更新 TCA Client 相关配置和数据
    - 不填参数,默认会执行basetca相关操作

    启动和停止服务
    • 启动所有服务:bash ./quick_install.sh local start

    • 启动Main相关服务:bash ./quick_install.sh local start main

      • local start支持启动指定服务,如上述的启动Main服务,还支持mysql/redis/analysis/file/login/scmproxy/nginx/client/all
    • 停止所有服务:bash ./quick_install.sh local stop

    • 停止Main相关服务:bash ./quick_install.sh local stop main

      • local stop支持停止指定服务,如上述的停止Main服务,还支持analysis/file/login/scmproxy/nginx/client/all

    注意:

    1. 启动时会自动关闭之前已经运行的服务

    2. mysqlredis默认会使用systemctl进行启动,如果systemctl无法使用,则会直接使用nohup方式运行相关服务

    检查服务运行状态

    检查服务运行状态:bash ./quick_install.sh local check

    • 目前支持检查 server 与 web,暂不支持 client
    获取服务输出日志

    打印 TCA Server 各个服务的日志路径: bash ./quick_install.sh local log

    + + + diff --git a/en/quickStarted/deployClient.html b/en/quickStarted/deployClient.html new file mode 100644 index 000000000..b7581851c --- /dev/null +++ b/en/quickStarted/deployClient.html @@ -0,0 +1,57 @@ + + + + + + + + + 部署与配置客户端 | Tencent Cloud Code Analysis + + + + +

    部署与配置客户端

    通过源代码

    依赖环境

    • 系统环境

      • Linux,Windows或macOS
    • 环境准备

    使用步骤

    安装第三方库

    # 源码根目录下执行
    +pip3 install -r client/requirements/app_reqs.pip
    +

    安装第三方工具

    # 源码根目录
    +cd client/requirements
    +
    +# 执行安装脚本
    +# Linux/macOS环境
    +./install.sh
    +# Windows环境
    +./install.bat
    +

    配置客户端

    • 配置 client/config.ini 文件

      <Server IP地址> 替换成实际的serve ip(可包含端口号)。

      客户端执行环境配置

    • 配置 client/codedog.ini 文件

      必填项:tokenorg_sidteam_namesource_dir

      • 个人令牌 - token:从 TCA 页面获取,前往[个人中心]-[个人令牌]-复制Token

        personalToken

      • 团队编号 - org_sid:进入 TCA 项目概览页,从 URL 中获取

      • 项目名称 - team_name::进入 TCA 项目概览页,从 URL 中获取

        TIP

        项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile

      • 分析路径 - source_dir: 本地代码目录路径

      TIP

      • 如果项目代码为编译型语言(比如:C/C++,C#,Go,Java,Kotlin,Objective-C等),且使用的分析方案中配置了编译型工具(如图,使用了OC推荐规则包),需要填写build_cmd编译命令。

      • 其他可选项按需填写,不填写时按默认配置执行

    启动客户端

    # 源码根目录
    +cd client
    +
    +# 执行客户端脚本
    +python3 codepuppy.py localscan
    +

    WARNING

    Client 的实现及启动脚本均依赖 Python3 版本为 3.7,可执行 python3 --version 查看版本。若版本有误,可安装版本为3.7的python并软链接到python3命令。

    TIP

    • codedog.ini 各项参数可由命令行传入,获取详细参数说明可运行 python3 codepuppy.py localscan -h

    • 使用localscan命令启动本地单次的代码分析,如需启动分布式并行分析任务,请参考使用分布式节点模式进行配置。

    通过Docker-Compose

    TIP

    适用于快速上手体验。使用docker运行,可以免去客户端环境依赖的安装,避免环境兼容性问题。

    但是由于环境受限于docker,会无法复用本地的编译环境,部分需要编译的工具无法使用。

    使用步骤

    配置客户端

    • 配置 client/config.ini 文件

    • 配置 client/codedog.ini 文件

    TIP

    同通过源代码使用-配置客户端

    构建镜像

    1. 安装Docker,安装教程:官方文档open in new window

    2. 安装Docker-Compose,安装教程:官方文档open in new window

    3. 进入client目录,构建docker镜像

    docker build -t tca-client .
    +

    启动客户端

    方案一:直接使用docker运行

    进入client目录,执行以下命令

    # 按照实际情况填写`SOURCE_DIR`环境变量值
    +export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +
    方案二:使用docker内bash终端运行
    1. 进入docker容器内的bash终端

      # 按照实际情况填写`SOURCE_DIR`环境变量值
      +export SOURCE_DIR=需要扫描的代码目录绝对路径
      +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src --name tca-client tca-client bash
      +
    2. 通过命令行启动client代码

      python3 codepuppy.py localscan
      +

    通过可执行文件

    依赖环境

    • 系统环境

      • Linux,Windows或macOS

    使用步骤

    下载客户端

    1. 发布页面open in new window下载与系统相对应的客户端压缩包到本地。

    2. 解压缩。

    配置客户端

    • 配置 client/config.ini 文件

    • 配置 client/codedog.ini 文件

    TIP

    同通过源代码使用-配置客户端

    启动客户端

    进入到client目录下,执行客户端

    ./codepuppy localscan
    +
    + + + diff --git a/en/quickStarted/deploySever.html b/en/quickStarted/deploySever.html new file mode 100644 index 000000000..36e4ffa0b --- /dev/null +++ b/en/quickStarted/deploySever.html @@ -0,0 +1,36 @@ + + + + + + + + + 部署 TCA | Tencent Cloud Code Analysis + + + + +

    部署 TCA

    TCA提供部署脚本,支持一键式快速部署Server、Web、Client。
    脚本共提供三种部署方式:Docker部署(推荐)、Docker-Compose部署源码部署,可根据您的具体使用场景任意选择其一进行部署。

    Docker快速部署

    WARNING

    仅适用于Docker部署体验,生产环境建议使用专业的 MySQL、Redis 等服务

    依赖环境

    • 系统环境
      • Linux、macOS、Windows
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备
      • Docker
    • 权限准备
      • 需要开放80、8000端口的访问权限(80为TCA平台访问端口,8000为TCA Server访问端口)

    部署对象

    Server、Web 与 Client

    操作说明

    首次启动操作

    1. 进入CodeAnalysis工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径
    2. 执行命令:
      bash ./quick_install.sh docker deploy
      +

    TIP

    通过Docker部署默认会在当前根目录下的挂载三个路径:

    • .docker_temp/logs:容器内的/var/log/tca/,存放TCA平台的日输出文件;
    • .docker_temp/data:容器内的/var/opt/tca/, 存放TCA平台的服务数据,主要是Mariadb、Redis;
    • .docker_temp/configs:容器内的/etc/tca,存放TCA平台的配置文件,主要是config.sh

    更新操作

    1. 更新代码
    2. 执行以下命令:
      • TCA_IMAGE_BUILD=true ./quick_install.sh docker deploy:重新构建并启动tca容器

    TIP

    TCA_IMAGE_BUILD=true表示从本地构建TCA镜像运行

    运行容器

    如果已经在机器上执行过docker deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行TCA

    bash ./quick_install.sh docker start
    +

    停止容器

    如果容器正在运行,希望停止容器,可以运行

    bash ./quick_install.sh docker stop
    +

    使用TCA

    成功部署TCA后,请开始您的代码分析。

    进入平台页面

    在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可跳转到团队列表页

    TIP

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    创建团队及项目

    • 完成团队创建

    • 完成项目创建

    登记代码库

    登记代码库,输入代码库地址以及凭证信息等,完成代码库登记。

    registerCodeRepo

    创建分析项目

    开始分析

    TIP

    1. 用户可选择使用分析方案模板,或创建分析方案的方式,利用方案的分析配置进行代码分析。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目。

    分析方案说明

    • 分析方案是用于对代码库进行分析的一套配置集合。

    • 更多分析方案配置可查阅帮助文档-分析方案

    creataAnalysePlan

    TIP

    本次部署会默认启动运行环境为「Codedog_Linux」的客户端,若需扩展更多运行环境,详见客户端常驻节点分析

    planPage

    执行代码分析

    初始化创建项目后,可通过 在线分析客户端分析 来启动代码分析。

    代码分析

    TIP

    • TCA推荐使用在线分析,您可根据具体使用场景选择其一。
    • 在线分析表示配置代码库链接后,TCA客户端拉取代码后进行分析;客户端分析在配置本地待扫描代码路径后,无需代码拉取直接分析本地代码。
    • 在线分析客户端分析具体详情及配置参考TCA客户端配置详情

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 问题列表 等。

    分支概览

    + + + diff --git a/en/quickStarted/dockerDeploy.html b/en/quickStarted/dockerDeploy.html new file mode 100644 index 000000000..f3bb17e2c --- /dev/null +++ b/en/quickStarted/dockerDeploy.html @@ -0,0 +1,37 @@ + + + + + + + + + Docker rapid deployment(Recommended for a out of the box try) | Tencent Cloud Code Analysis + + + + +

    Docker rapid deployment(Recommended for a out of the box try)

    WARNING

    Docker deployment include Mariadb and Redis. Configuration file can be modified to indicate a MySQL/Mariadb and Redis, which satisfied operation and maintenance specification for extensive use.

    Requirements

    • System
      • Linux, macOS or Windows
      • Minimum requirement:2-core processor, 4GB RAM, 100 GB available disk space
    • Environment
      • Docker
    • Privilege
      • Open port 80, 8000's access(80 for TCA's requests, 8000 for TCA Server)

    To be deployed

    Server, Web and Client

    Operating instructions

    First start
    1. Enter the CodeAnalysis's work directory (e.g ~/CodeAnalysis), the following paths are relative paths within the directory.
    2. Execute command:
      bash ./quick_install.sh docker deploy
      +

    TIP

    1. During docker deployment, the tencenttca/tca:latest image will be pulled from dockerhub by default.
    2. During docker deployment, three paths will be mounted under the current root directory by default:
      • .docker_temp/logs/var/log/tca/ in container,TCA daily log output;
      • .docker_temp/data/var/opt/tca/ in container, TCA service data, mainly about Mariadb,Redis;
      • .docker_temp/configs/etc/tca in container,TCA configuration file,mainly config.sh
    Update
    1. Update the code.
    2. Execute command below:
    TCA_IMAGE_BUILD=true ./quick_install.sh docker deploy  # Re-build and start TCA Container
    +

    TIP

    TCA_IMAGE_BUILD=true Indicates that the TCA image is built locally to run

    Run a Docker container

    If docker deploy has been executed on the machine and the container data is retained, you can execute the following command to start the container and continue to run TCA

    bash ./quick_install.sh docker start
    +
    Stop a Docker container

    If a container is running and you want to stop it, you can run command

    bash ./quick_install.sh docker stop
    +

    Use your TCA

    Now, you have done the deployment of your first TCA. Please type http://<Deploy server IP> in your browser. click "立即体验", after login you can start your Tencent Code Analysis trip.
    More operation instructions please check:Quick start a code analysis

    TIP

    Default account/Password:CodeDog/admin

    If the default account password has been modified during deployment, please login according to the modified account and password.

    + + + diff --git a/en/quickStarted/dockercomposeDeploy.html b/en/quickStarted/dockercomposeDeploy.html new file mode 100644 index 000000000..1d6c377c2 --- /dev/null +++ b/en/quickStarted/dockercomposeDeploy.html @@ -0,0 +1,40 @@ + + + + + + + + + Docker-Compose快速部署 | Tencent Cloud Code Analysis + + + + +

    Docker-Compose快速部署

    TCA提供部署脚本,支持一键式快速部署 Server、Web、Client。
    脚本共提供三种部署方式:Docker部署(平台体验首推)、Docker-Compose部署、源码部署, 可根据您的具体使用场景任意选择其一进行部署。

    部署对象

    Server、Web 与 Client

    WARNING

    仅适用于 Docker-Compose 部署体验,生产环境建议使用专业的 MySQL、Redis 等服务

    操作说明

    首次启动操作
    1. 进入 CodeAnalysis 工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径

    2. 执行命令:

    bash ./quick_install.sh docker-compose deploy #启动tca_server容器
    +

    注意:通过 Docker-Compose 部署默认会在当前根目录下的挂载三个路径:

    • .docker_data/logs:存放 TCA 平台的各个服务日志输出目录;
    • .docker_data/mysql:存放 TCA 平台的 MySQL 数据
    • .docker_data/redis:存放 TCA 平台的 Redis 数据
    • .docker_data/filedata:存放 TCA 平台文件服务器的文件

    TIP

    完成 TCA 平台部署后,请在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可开启您的腾讯云代码分析。
    平台内操作指引请查看:快速启动一次代码分析

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    更新操作
    1. 更新代码

    2. 执行以下命令:

    bash ./quick_install.sh docker-compose build  #重新构建TCA相关镜像
    +bash ./quick_install.sh docker-compose stop  #停止运行中的TCA容器
    +bash ./quick_install.sh docker-compose deploy  #重新部署TCA相关容器与初始化(或刷新数据)
    +
    运行操作

    如果已经在机器上执行过docker-compose deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行 TCA

    bash ./quick_install.sh docker-compose start
    +
    停止操作

    如果容器正在运行,希望停止容器,可以执行以下命令

    bash ./quick_install.sh docker-compose stop
    +
    构建镜像操作

    如果希望构建镜像,可以执行以下命令

    bash ./quick_install.sh docker-compose build
    +
    + + + diff --git a/en/quickStarted/enhanceDeploy.html b/en/quickStarted/enhanceDeploy.html new file mode 100644 index 000000000..3b565a3d4 --- /dev/null +++ b/en/quickStarted/enhanceDeploy.html @@ -0,0 +1,64 @@ + + + + + + + + + Enhanced Analysis Module Deployment | Tencent Cloud Code Analysis + + + + +

    Enhanced Analysis Module Deployment

    In addition to integrating well-known analysis tools in the industry, TCA also has its own independently developed tools, which serve as the enhanced analysis module of TCA.

    The TCA enhanced analysis module requires users to additionally deploy the License authentication microservice and apply for a License by email.

    TIP

    1. License application is completely free! 2. Enterprises or universities are given priority in applying for a License.

    Concepts

    • Independent tools: Code analysis tools independently developed by TCA;
    • CLS(Common License Server): The License authentication microservice for TCA independent tools.

    Module Features

    • Supports Objective-C/C++ code specification check;
    • Supports analysis of project dependency components;
    • Supports analysis of whether dependency components have vulnerabilities and other issues;
    • Supports Java/Kotlin API and function call chain analysis;
    • Supports code safety, null pointer check, memory leak, and other rules.

    Continuously updating...

    TCA official website version enhanced capability application

    If users usually use TCA official website version public serviceopen in new window and want to experience the analysis capabilities of the enhanced analysis module on the official website version, they can follow this help documentopen in new window to apply for configuration.

    TCA Private Deployment Enhanced Capability Application

    If you are using TCA in an enterprise intranet environment and want to experience the enhanced analysis module capabilities of TCA on the intranet, you can apply as follows.

    Preparation

    • A dedicated machine for the CLS microservice, the CLS microservice needs to be bound to this machine

    WARNING

    Note: The CLS directory cannot be deleted at will

    Steps

    1. Execute the following command in the server/cls directory of the TCA source code to obtain the Server ID and Client License

    WARNING

    Note: The command needs to be executed in the CLS directory

    # install Git LFS
    +$ bash ./scripts/base/install_git_lfs.sh
    +# If the cls binary is not found in this directory, you can execute the following command to synchronize.
    +$ bash ./scripts/base/install_bin.sh
    +$ cd server/cls
    +$ ./cls server
    +2022-04-13 18:35:29.356510559 +0800 CST [INFO] Version: 20220328.1
    +2022-04-13 18:35:29.44083463 +0800 CST [INFO] The client license is:
    +xxx
    +2022-04-13 18:35:29.454552966 +0800 CST [INFO] License Server ID: xxx
    +
    • Server ID: Machine code, used to apply for License authorization from the TCA team
    • Client License: Provided to the TCA Client to facilitate tool authentication (important, it is recommended to back up)
    1. Configure the CLS microservice information in the config.ini of the TCA Client directory, for example
    [LICENSE_CONFIG]
    +; [optional] Fill in when using independent tools, no need by default
    +; Domain name and port of the License service
    +URL=http://<IP or domain name>:<port>
    +BASE_PATH=
    +LICENSE=<Client License>
    +

    WARNING

    Note: The URL corresponding value does not need to follow the slash / at the end.

    WARNING

    Different deployment methods can modify the config.ini configuration according to the following methods:

    • Source code deployment:
      • Modify the client/config.ini in the source code directory
      • Restart the client: ./quick_install.sh local start client
    • Docker deployment:
      • Method 1: Modify the .docker_temp/configs/client/config.ini in the source code directory and restart the tca-services container
      • Method 2: Enter the tca-service container, modify /CodeAnalysis/client/config.ini, and exit and restart the tca-services container
      • Restart the container method: docker restart tca-service
    • Docker-Compose deployment:
      • Modify the client/config.ini in the source code directory and restart the client container
      • Restart the container method: docker-compose restart client
    1. Submit a private cloud license application on the TCA Cloud official website
    • (1) Register or log in to an account on the TCA Cloud official websiteopen in new window;
    • (2) Enter the team that needs to apply for a private cloud license (if there is no team, you need to create a corresponding team);
    • (3) On the team page, enter the [Node Management]->[Private Cloud License Configuration] page in turn, then click the [Apply for License] button in the upper right corner, fill in the relevant information and submit the application. The specific information is as follows:
      • Applicant name
      • Applicant's organization name
      • Applicant's organization type: company/university/individual
      • Applicant's email address
      • Applicant's mobile phone number
      • Server ID: Server ID output in step 1, the machine code for the first registration
      • Client License: Client License output in step 1
      • Application scenario
    • (4) Then wait for the application license to be reviewed and approved, you can copy the private cloud license and continue with the following step 4.
    1. Fill in the License in the config.yaml file in the CLS directory

    WARNING

    Note: Follow the yaml format, for example:

    • In key-value pairs, there is a blank character after the colon :, for example key: value.
    1. Execute the following command to start CLS
    ./cls server -d
    +
    1. Verify that the CLS process starts normally
    # Find if there is a CLS process
    +ps aux|grep cls
    +

    WARNING

    Note: If the above command does not find the CLS process, it means that CLS did not start normally.
    Please try to change the port in the config.yaml file to another port, such as 8080, the default is port 80, and then re-execute the command in step 5.

    1. Start the TCA analysis task Check the independent tool-related rule package in the analysis plan on the TCA platform, such as the dependency component analysis rule package, and then start an analysis task. If it runs normally, it means the setting takes effect.

    CLS Operation and Maintenance

    Automatic Restart

    # Find the CLS process ID
    +ps aux|grep cls
    +# Restart the microservice
    +kill -USR2 <pid>
    +

    Network Exception

    If the above deployment steps have been completed, but the enhanced function still encounters the License check failed! Please check the license. License Server is not available! exception. You can troubleshoot as follows:

    • Enter the task page, click on the abnormal tool, and download the execution log of the tool. If the following logs appear in the log, it means that the network access to CLS is abnormal;
    method(head) call fails on error: <urlopen error [Errno 111] Connection refused>
    +
    • Continue to verify. If it is Docker or Docker-Compose deployment method, enter the TCA Client container. If it is a source code deployment, go to the TCA Client machine. Execute the following command to confirm whether the network is accessible:
    ping <CLS IP or domain name filled in config.ini>
    +telnet <CLS IP or domain name filled in config.ini> <corresponding port>
    +
    • If the network is not accessible, please check:
      • Whether the firewall has opened the corresponding port;
      • Whether the corresponding domain name of CLS is set in the host;
      • Whether the IP setting is wrong.
    Case Sharing

    Background: Xiao Ming deployed TCA in Docker mode and deployed the CLS service on the same host. Then he set the IP in the URL in config.ini to 127.0.0.1, restarted and started the enhanced function task and encountered the above network disconnection exception.
    Reason: The reason is that the 127.0.0.1 at this time points to the TCA Client container itself, not the CLS service deployed on the host.
    Solution: Change 127.0.0.1 to the host's own IP.

    CLS Update

    1. Use the following command to find the cls process and kill the process
    # Find the CLS process ID
    +ps aux|grep cls
    +# Restart the microservice
    +kill -9 <pid>
    +
    1. Download the latest version of cls and replace the cls binary file in it

    WARNING

    Note: You cannot delete the original cls directory, you only need to replace the cls binary file in it.

    1. Use the following command to restart the cls service
    ./cls server -d
    +
    + + + diff --git a/en/quickStarted/index.html b/en/quickStarted/index.html new file mode 100644 index 000000000..1264548d8 --- /dev/null +++ b/en/quickStarted/index.html @@ -0,0 +1,33 @@ + + + + + + + + + Tencent Cloud Code Analysis | Tencent Cloud Code Analysis + + + + +

    Tencent Cloud Code Analysis

    Tencent Cloud Code Analysis (TCA for short, code-named CodeDog inside the company early) is a comprehensive platform for code analysis and issue tracking. TCA consist of three components, server, web and client. It integrates of a number of self-developed tools, and also supports dynamic integration of code analysis tools in various programming languages.

    Code analysis is a technology, using lexical analysis, syntax analysis, control-flow analysis, data-flow analysis to make a comprehensive analysis of the code, so as to verify whether the code meets the requirements of normative, security, reliability, maintainability and other indicators.

    Using TCA can help team find normative, structural, security vulnerabilities and other issues in the code, continuously monitor the quality of the project code and issue alerts. At the same time, TCA opens up APIs to support connection with upstream and downstream systems, so as to integrate code analysis capabilities, ensure code quality, and be more conducive to inheriting an excellent team code culture.

    组件图

    流程图


    For the first experience, it is recommended that you use the Docker deployment to quickly build and experience the Tencent Cloud code analysis platform for the first experience.

    If you have more environmental requirements, you can also deploy Tencent Cloud Code Analysis Platform in the following two ways:

    + + + diff --git a/en/quickStarted/initRepo.html b/en/quickStarted/initRepo.html new file mode 100644 index 000000000..a94da0cb1 --- /dev/null +++ b/en/quickStarted/initRepo.html @@ -0,0 +1,33 @@ + + + + + + + + + 创建代码分析项目 | Tencent Cloud Code Analysis + + + + +

    创建代码分析项目

    成功部署并启动 Server 与 Web 服务后,通过以下步骤创建您的第一个代码分析项目。

    进入平台页面

    在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可跳转到团队列表页

    TIP

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    创建团队及项目

    • 完成团队创建

    • 完成项目创建

    登记代码库

    登记代码库,输入代码库地址以及凭证信息等,完成代码库登记。

    registerCodeRepo

    创建分析项目

    开始分析

    TIP

    1. 用户可选择使用分析方案模板,或创建分析方案的方式,利用方案的分析配置进行代码分析。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目。

    分析方案说明

    • 分析方案是用于对代码库进行分析的一套配置集合。

    • 更多分析方案配置可查阅帮助文档-分析方案

    creataAnalysePlan

    planPage

    + + + diff --git a/en/quickStarted/intro.html b/en/quickStarted/intro.html new file mode 100644 index 000000000..ed9297989 --- /dev/null +++ b/en/quickStarted/intro.html @@ -0,0 +1,33 @@ + + + + + + + + + 平台概述 | Tencent Cloud Code Analysis + + + + +

    平台概述

    腾讯云代码分析(Tencent Cloud Code Analysis,简称TCA,内部曾用研发代号 CodeDog )是集众多分析工具的云原生、分布式、高性能的代码综合分析跟踪平台,包含服务端、Web端和客户端三个组件,已集成一批自研工具,同时也支持动态集成业界各编程语言的分析工具。

    使用TCA Action快速体验

    使用TCA Action,只需要在代码仓库中添加.github/workflows/tca.yml文件,就可以直接在GitHub工作流中快速体验代码分析。请参考:TCA-action指引open in new window

    部署TCA

    拉取 代码库open in new window 后,您可以通过以下三种方式部署腾讯云代码分析平台:

    创建首个代码分析项目

    成功部署并启动TCA后,您可以按照 指引 创建您的首个代码分析项目。

    TIP

    默认平台登录账号/密码:CodeDog/admin

    快速扩展客户端

    TCA客户端支持通过可执行文件进行快速扩展部署,详见通过可执行文件

    TIP

    客户端可在本地执行代码分析,也可以作为在线常驻节点进行在线分析。

    了解更多

    更多关于腾讯云代码分析平台的使用指南和配置说明,参见帮助文档

    + + + diff --git a/en/quickStarted/runProject.html b/en/quickStarted/runProject.html new file mode 100644 index 000000000..b85a1a5de --- /dev/null +++ b/en/quickStarted/runProject.html @@ -0,0 +1,33 @@ + + + + + + + + + 启动代码分析 | Tencent Cloud Code Analysis + + + + +

    启动代码分析

    在完成 Server、Web 和 Client 相关部署和配置后,可通过平台执行代码分析。

    执行代码分析

    初始化创建项目后,可通过 在线分析客户端分析 来启动代码分析。

    代码分析

    注:

    • TCA推荐使用在线分析,您可根据具体使用场景选择其一。
    • 在线分析表示配置代码库链接后,TCA客户端拉取代码后进行分析;客户端分析在配置本地待扫描代码路径后,无需代码拉取直接分析本地代码。
    • 在线分析客户端分析具体详情及配置参考TCA客户端配置详情

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 问题列表 等。

    分支概览

    + + + diff --git a/images/Logo.svg b/images/Logo.svg new file mode 100644 index 000000000..5a9af40da --- /dev/null +++ b/images/Logo.svg @@ -0,0 +1,20 @@ + + + logo-1280-2 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/favicon.png b/images/favicon.png new file mode 100644 index 000000000..d23675e16 Binary files /dev/null and b/images/favicon.png differ diff --git a/index.html b/index.html new file mode 100644 index 000000000..48a177384 --- /dev/null +++ b/index.html @@ -0,0 +1,33 @@ + + + + + + + + + 腾讯云代码分析文档 | 腾讯云代码分析 + + + + +
    腾讯云代码分析

    腾讯云代码分析

    用心关注每行代码迭代、助力传承卓越代码文化!

    快速部署 帮助文档

    稳定可靠的架构

    支持分布式云原生计算架构,支持灵活扩缩容,执行更快更稳定。

    多工具支持

    已集成众多自研、知名开源工具等,采用分层分离架构,支持团队快速自助管理工具。

    多语言覆盖

    支持 Java/C++/Objective-C/C#/JavaScript/Python/Go/PHP 等数29种语言,覆盖常用编程语言。

    增量全量分析

    增量分析快速发现问题,全量分析保证问题全覆盖。

    自定义指标

    自定义代码标准,逐步优化代码。

    全方位质量报告

    图形化可视报告,轻松监管代码综合质量趋势。

    持续跟踪管理问题

    持续跟踪问题状态,支持主动标记处理问题、过滤问题。

    标准化 API 接口

    提供标准化 API 接口,支持快速对接 DevOps 平台。

    分布式客户端

    支持分布式客户端,包含 Linux、Mac、Windows,满足用户本地高频分析场景。

    腾讯工蜂代码库镜像库

    https://git.code.tencent.com/Tencent_Open_Source/CodeAnalysis.git在新窗口打开

    金牌🏅️服务微信群

    微信群

    团队成员

    团队成员

    + + + diff --git a/media/Components.png b/media/Components.png new file mode 100644 index 000000000..0eeaf6dcc Binary files /dev/null and b/media/Components.png differ diff --git a/media/Flow.png b/media/Flow.png new file mode 100644 index 000000000..e43ed5716 Binary files /dev/null and b/media/Flow.png differ diff --git a/media/Fork.png b/media/Fork.png new file mode 100644 index 000000000..99895e1b4 Binary files /dev/null and b/media/Fork.png differ diff --git a/media/Logo.png b/media/Logo.png new file mode 100644 index 000000000..aab4be80c Binary files /dev/null and b/media/Logo.png differ diff --git a/media/Logo.svg b/media/Logo.svg new file mode 100644 index 000000000..5a9af40da --- /dev/null +++ b/media/Logo.svg @@ -0,0 +1,20 @@ + + + logo-1280-2 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/media/NewPullRequest.png b/media/NewPullRequest.png new file mode 100644 index 000000000..ad6b12ebb Binary files /dev/null and b/media/NewPullRequest.png differ diff --git a/media/Nodemanagement.png b/media/Nodemanagement.png new file mode 100644 index 000000000..dd566582e Binary files /dev/null and b/media/Nodemanagement.png differ diff --git a/media/PR.png b/media/PR.png new file mode 100644 index 000000000..5321bc135 Binary files /dev/null and b/media/PR.png differ diff --git a/media/ProcessConfiguration.png b/media/ProcessConfiguration.png new file mode 100644 index 000000000..ade2d90c6 Binary files /dev/null and b/media/ProcessConfiguration.png differ diff --git a/media/ProcessConfiguration2.png b/media/ProcessConfiguration2.png new file mode 100644 index 000000000..0b283f7d9 Binary files /dev/null and b/media/ProcessConfiguration2.png differ diff --git a/media/StateSwitch.png b/media/StateSwitch.png new file mode 100644 index 000000000..83890036b Binary files /dev/null and b/media/StateSwitch.png differ diff --git a/media/TeamMembers.png b/media/TeamMembers.png new file mode 100644 index 000000000..c6600a89b Binary files /dev/null and b/media/TeamMembers.png differ diff --git a/media/WechatQRCode.png b/media/WechatQRCode.png new file mode 100644 index 000000000..5223d3223 Binary files /dev/null and b/media/WechatQRCode.png differ diff --git a/media/Welcome.png b/media/Welcome.png new file mode 100644 index 000000000..0184d09b4 Binary files /dev/null and b/media/Welcome.png differ diff --git a/media/clientConfigIni.png b/media/clientConfigIni.png new file mode 100644 index 000000000..89e05b26a Binary files /dev/null and b/media/clientConfigIni.png differ diff --git a/media/cover-distributed execution.png b/media/cover-distributed execution.png new file mode 100644 index 000000000..962ee890c Binary files /dev/null and b/media/cover-distributed execution.png differ diff --git a/media/creataAnalysePlan.png b/media/creataAnalysePlan.png new file mode 100644 index 000000000..cc548ea39 Binary files /dev/null and b/media/creataAnalysePlan.png differ diff --git a/media/createProject.png b/media/createProject.png new file mode 100644 index 000000000..d0400a326 Binary files /dev/null and b/media/createProject.png differ diff --git a/media/createTeam.png b/media/createTeam.png new file mode 100644 index 000000000..5056418b7 Binary files /dev/null and b/media/createTeam.png differ diff --git a/media/fork1.png b/media/fork1.png new file mode 100644 index 000000000..f93cdcbe5 Binary files /dev/null and b/media/fork1.png differ diff --git a/media/helpopensource.png b/media/helpopensource.png new file mode 100644 index 000000000..75aadea51 Binary files /dev/null and b/media/helpopensource.png differ diff --git a/media/homepage.png b/media/homepage.png new file mode 100644 index 000000000..b964a420f Binary files /dev/null and b/media/homepage.png differ diff --git a/media/order.png b/media/order.png new file mode 100644 index 000000000..a7f896518 Binary files /dev/null and b/media/order.png differ diff --git a/media/orgsid.png b/media/orgsid.png new file mode 100644 index 000000000..7b53c6d69 Binary files /dev/null and b/media/orgsid.png differ diff --git a/media/personalToken.png b/media/personalToken.png new file mode 100644 index 000000000..78e5cdba9 Binary files /dev/null and b/media/personalToken.png differ diff --git a/media/planPage.png b/media/planPage.png new file mode 100644 index 000000000..eb90909fb Binary files /dev/null and b/media/planPage.png differ diff --git a/media/registerCodeRepo.png b/media/registerCodeRepo.png new file mode 100644 index 000000000..647cdb287 Binary files /dev/null and b/media/registerCodeRepo.png differ diff --git a/zh/advanced/install_mysql_on_centos.html b/zh/advanced/install_mysql_on_centos.html new file mode 100644 index 000000000..b6a5ff16e --- /dev/null +++ b/zh/advanced/install_mysql_on_centos.html @@ -0,0 +1,61 @@ + + + + + + + + + 在 CentOS 安装 MySQL | 腾讯云代码分析 + + + + +

    在 CentOS 安装 MySQL

    注意

    本文档仅供参考,不适用于正式环境部署,正式环境建议使用专业的MySQL服务(比如腾讯云的MySQL产品在新窗口打开

    环境

    CentOS 7.3 版本

    安装 mysql yum源

    wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
    +yum localinstall mysql57-community-release-el7-11.noarch.rpm
    +

    安装成功后,查看MySQL版本:

    yum repolist all | grep mysql
    +

    输出结果:

    mysql-cluster-7.5-community/x86_64   MySQL Cluster 7.5 Community    禁用
    +mysql-cluster-7.5-community-source   MySQL Cluster 7.5 Community -  禁用
    +mysql-cluster-7.6-community/x86_64   MySQL Cluster 7.6 Community    禁用
    +mysql-cluster-7.6-community-source   MySQL Cluster 7.6 Community -  禁用
    +!mysql-connectors-community/x86_64   MySQL Connectors Community     启用:    221
    +mysql-connectors-community-source    MySQL Connectors Community - S 禁用
    +!mysql-tools-community/x86_64        MySQL Tools Community          启用:    135
    +mysql-tools-community-source         MySQL Tools Community - Source 禁用
    +mysql-tools-preview/x86_64           MySQL Tools Preview            禁用
    +mysql-tools-preview-source           MySQL Tools Preview - Source   禁用
    +mysql55-community/x86_64             MySQL 5.5 Community Server     禁用
    +mysql55-community-source             MySQL 5.5 Community Server - S 禁用
    +mysql56-community/x86_64             MySQL 5.6 Community Server     禁用
    +mysql56-community-source             MySQL 5.6 Community Server - S 禁用
    +!mysql57-community/x86_64            MySQL 5.7 Community Server     启用:    544
    +mysql57-community-source             MySQL 5.7 Community Server - S 禁用
    +mysql80-community/x86_64             MySQL 8.0 Community Server     禁用
    +mysql80-community-source             MySQL 8.0 Community Server - S 禁用
    +

    安装MySQL

    yum install mysql-community-server
    +

    1.如遇以下报错,可尝试运行yum install mysql-community-server --nogpgcheck安装
    Public key for mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm is not installed
    Failing package is: mysql-community-libs-compat-5.7.37-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    2.如遇以下报错,可执行yum module disable mysql后重试安装
    All matches were filtered out by modular filtering for argument: mysql-community-serve
    Error: Unable to find a match: mysql-community-server

    配置MySQL服务

    安装好的MySQL配置文件路径是/etc/my.cnf,这里可以根据需要调整,比如可以调整:

    • datadir:MySQL存放数据的路径,如果有额外挂载磁盘,可以考虑指向相关路径

    启动MySQL服务

    systemctl start mysqld
    +

    确认MySQL正常启动

    systemctl status mysqld
    +

    查看生成 MySQL root用户临时密码:

    grep 'temporary password' /var/log/mysqld.log
    +

    修改root用户密码

    连接MySQL服务

    $ mysql -uroot -p
    +# 输出上述查询到的临时密码
    +

    修改root用户的密码(下面是改成 Password@2021,这里根据自行需要进行调整):

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password@2021';
    +

    参考文档

    + + + diff --git a/zh/advanced/install_nginx_from_source.html b/zh/advanced/install_nginx_from_source.html new file mode 100644 index 000000000..92bccfebb --- /dev/null +++ b/zh/advanced/install_nginx_from_source.html @@ -0,0 +1,103 @@ + + + + + + + + + 源码安装 Nginx | 腾讯云代码分析 + + + + +

    源码安装 Nginx

    运行环境

    1. 基于x86_64的CentOS
    2. 基于aarch64(鲲鹏920)的UOS V20
    3. 基于aarch64(飞腾2000)的TencentOS Server

    环境准备

    安装编译打包需要的工具

    yum -y install gcc zlib-devel pcre-devel bzip2-devel openssl-devel readline-devel
    +

    Ubuntu: apt install gcc libssl-dev zlib1g-dev libpcre3-dev libbz2-dev libreadline-dev

    下载源码

    wget http://nginx.org/download/nginx-1.20.2.tar.gz
    +

    解压安装

    # 解压
    +$ tar zvxf nginx-1.20.2.tar.gz -C /usr/local/src
    +
    +# 进入源码目录
    +$ cd /usr/local/src/nginx-1.20.2
    +
    +# 配置
    +$ ./configure \
    +--sbin-path=/usr/local/nginx/nginx \
    +--conf-path=/etc/nginx/nginx.conf \
    +--pid-path=/run/nginx.pid \
    +--with-stream \
    +--with-http_ssl_module --with-http_v2_module --with-http_auth_request_module
    +
    +# 构建nginx
    +$ make -j4
    +$ make install
    +$ make clean
    +
    +# 建立软链
    +$ ln -s /usr/local/nginx/nginx /usr/local/bin/nginx
    +

    添加nginx配置文件

    mkdir /etc/nginx/conf.d/
    +vi /etc/nginx/nginx.conf
    +

    检查nginx.conf配置文件:

    1. 检查pid /run/nginx.pid,如果缺失或被注释则加上,加上位置如下所示:
    2. 检查是否缺失这一行include conf.d/*.conf;,如果缺失则加上,加上位置如下所示:
    # ...省略内容
    +#pid        logs/nginx.pid;  # 默认有的
    +pid         /run/nginx.pid;
    +
    +events {
    +    # ...省略内容
    +}
    +
    +# ...省略内容
    +
    +http {
    +    # ...省略内容
    +    # 
    +    include conf.d/*.conf;    
    +    server {
    +        # ...省略内容
    +    }
    +}
    +
    +

    后续可以将nginx配置文件放置到/etc/nginx/conf.d/目录下

    配置开机自动启动

    vim /usr/lib/systemd/system/nginx.service
    +

    输入以下内容:

    [Unit]
    +Description=The nginx HTTP and reverse proxy server
    +After=network-online.target remote-fs.target nss-lookup.target
    +Wants=network-online.target
    +
    +[Service]
    +Type=forking
    +PIDFile=/run/nginx.pid
    +# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
    +# SELinux context. This might happen when running `nginx -t` from the cmdline.
    +# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
    +ExecStartPre=/bin/rm -f /run/nginx.pid
    +ExecStartPre=/usr/local/bin/nginx -t
    +ExecStart=/usr/local/bin/nginx
    +ExecReload=/usr/local/bin/nginx -s reload
    +ExecStop=/usr/local/bin/nginx -s stop
    +KillSignal=SIGQUIT
    +TimeoutStopSec=5
    +KillMode=process
    +PrivateTmp=true
    +
    +[Install]
    +WantedBy=multi-user.target
    +

    启动nginx:

    systemctl start nginx
    +

    开机自动启动nginx:

    systemctl enable nginx
    +

    参考文档

    + + + diff --git a/zh/advanced/install_python37_on_centos.html b/zh/advanced/install_python37_on_centos.html new file mode 100644 index 000000000..94c6d60ba --- /dev/null +++ b/zh/advanced/install_python37_on_centos.html @@ -0,0 +1,95 @@ + + + + + + + + + 在 CentOS 安装 Python3.7 | 腾讯云代码分析 + + + + +

    在 CentOS 安装 Python3.7

    下载Python源码包

    wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +

    安装前准备

    安装依赖组件

    yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel xz-devel
    +

    解压安装

    # 解压到/usr/local/src目录
    +$ tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +$ cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +$ make -j8
    +# 安装Python
    +$ make install
    +# 清理编译产出的中间文件
    +$ make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +

    检查

    检查Python版本是否安装成功

    $ python --version
    +Python 3.7.12  # 正常输出,表示安装成功
    +

    注:

    1. 链接到/usr/local/bin/目录不会影响系统软件(比如yum)的使用,因为 yum 工具指定的Python路径是/usr/bin/python
    2. 一般情况下,PATH配置是先/usr/local/bin/usr/bin
    3. 检查python -v输出结果是否为Python 3.7.12版本,如果不是该版本,可能影响后续依赖安装和服务运行

    pypi下载源配置

    pip默认是到pypi官方源下载第三方依赖包,下载速度可能会比较慢,可以考虑调整为腾讯云的pypi下载源,调整方式:

    mkdir ~/.pip/
    +echo "extra-index-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +

    一键安装脚本

    以下脚本内容是上面的步骤集合,省去了复制粘贴的重复动作。

    1. 创建文件 install_py37.sh,写入以下 shell 脚本
    2. 赋予执行权限,chmox +x install_py37.sh
    3. 执行脚本,./install_py37.sh
    #!/bin/env bash
    +
    +## 下载 Python 源码,如果已下载源码在脚本当前目录下,可注释跳过下载步骤
    +wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +
    +## 安装编译依赖组件
    +yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel xz-devel
    +
    +## 解压安装
    +# 解压到/usr/local/src目录
    +tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +make -j8
    +# 安装Python
    +make install
    +# 清理编译产出的中间文件
    +make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +ldconfig
    +
    +## 检查Python版本是否安装成功
    +echo -e "\033[1;42;37m[$(date "+%Y/%m/%d %H:%M:%S")] [Check]: 检查Python版本\033[0m"
    +python --version
    +echo -e "\033[1;42;37m[$(date "+%Y/%m/%d %H:%M:%S")] [Check]: 检查Python版本\033[0m"
    +
    +## pypi下载源配置
    +mkdir ~/.pip/
    +echo "extra-index-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +
    + + + diff --git a/zh/advanced/install_python37_on_ubuntu.html b/zh/advanced/install_python37_on_ubuntu.html new file mode 100644 index 000000000..72af1e809 --- /dev/null +++ b/zh/advanced/install_python37_on_ubuntu.html @@ -0,0 +1,59 @@ + + + + + + + + + 在 Ubuntu 安装 Python3.7 | 腾讯云代码分析 + + + + +

    在 Ubuntu 安装 Python3.7

    注:当前Ubuntu版本为18.04

    下载Python源码包

    wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
    +

    安装前准备

    安装依赖组件

    apt-get update
    +apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev wget libbz2-dev tk-dev gcc make
    +

    解压安装

    # 解压到/usr/local/src目录
    +$ tar zvxf Python-3.7.12.tgz -C /usr/local/src
    +$ cd /usr/local/src/Python-3.7.12
    +# 编译前配置
    +$ ./configure prefix=/usr/local/python3 --enable-shared
    +# 编译构建
    +$ make -j8
    +# 安装Python
    +$ make install
    +# 清理编译产出的中间文件
    +$ make clean
    +# 链接构建产出的Python可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/python3 /usr/local/bin/python
    +# 链接构建产出的pip3可执行文件到/usr/local/bin目录
    +$ ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
    +# 链接构建产出的Python动态库
    +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
    +# 配置动态库
    +$ ldconfig
    +

    检查

    检查Python版本是否安装成功

    $ python --version
    +Python 3.7.12  # 正常输出,表示安装成功
    +

    注:

    1. 链接到/usr/local/bin/目录不会影响系统软件
    2. 一般情况下,PATH配置是先/usr/local/bin/usr/bin
    3. 检查python -v输出结果是否为Python 3.7.12版本,如果不是该版本,可能影响后续依赖安装和服务运行

    pypi下载源配置

    pip默认是到pypi官方源下载第三方依赖包,下载速度可能会比较慢,可以考虑调整为腾讯云的pypi下载源,调整方式:

    mkdir ~/.pip/
    +echo "[global]\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +
    + + + diff --git a/zh/advanced/install_redis_from_source.html b/zh/advanced/install_redis_from_source.html new file mode 100644 index 000000000..9e05b783a --- /dev/null +++ b/zh/advanced/install_redis_from_source.html @@ -0,0 +1,77 @@ + + + + + + + + + 源码安装 Redis | 腾讯云代码分析 + + + + +

    源码安装 Redis

    运行环境

    1. 基于x86_64的CentOS
    2. 基于鲲鹏920(aarch64)的UOS V20
    3. 基于飞腾2000(aarch64)的TencentOS Server

    环境准备

    安装编译打包需要的工具

    yum install -y gcc make tcl wget
    +

    下载源码

    wget http://download.redis.io/releases/redis-5.0.4.tar.gz
    +

    编译安装

    # 解压
    +$ tar zvxf redis-5.0.4.tar.gz -C /usr/local/src
    +
    +# 进入源码目录
    +$ cd /usr/local/src/redis-5.0.4
    +
    +# 构建redis依赖库
    +$ cd deps; make -j4 hiredis jemalloc linenoise lua
    +$ cd ..
    +
    +# 构建redis
    +$ make -j4
    +$ make install
    +$ make clean
    +

    安装后,可以在/usr/local/src/redis-5.0.4/src目录和/usr/local/bin/目录下找到redis-serverredis-cli两个文件

    调整配置

    cp /usr/local/src/redis/redis.conf  /etc/redis.conf
    +vim /usr/local/src/redis/redis.conf 
    +
    # 设置Redis密码
    +requirepass 123456
    +
    +# 将 daemonize no 调整为 daemonize yes,将redis-server调整为默认后台启动
    +daemonize yes
    +
    +# 配置日志
    +logfile '/var/log/redis/redis-server.log'
    +

    启动服务

    redis-server /etc/redis.conf 
    +

    配置开机自动启动

    vim /etc/systemd/system/redis.service
    +

    输入以下内容:

    [Unit]
    +Description=redis-server
    +After=network.target
    +
    +[Service]
    +Type=forking
    +ExecStart=/usr/local/bin/redis-server /etc/redis.conf
    +ExecStop=/usr/local/bin/redis-cli shutdown
    +Restart=always
    +
    +PrivateTmp=true
    +
    +[Install]
    +WantedBy=multi-user.target
    +

    启动redis-server:

    systemctl start redis
    +

    开机自动启动redis:

    systemctl enable redis
    +

    参考文档

    + + + diff --git a/zh/advanced/install_redis_on_centos.html b/zh/advanced/install_redis_on_centos.html new file mode 100644 index 000000000..4b0370b00 --- /dev/null +++ b/zh/advanced/install_redis_on_centos.html @@ -0,0 +1,45 @@ + + + + + + + + + 在 CentOS 安装 Redis | 腾讯云代码分析 + + + + +

    在 CentOS 安装 Redis

    注意

    本文档仅供参考,不适用于正式环境部署,正式环境建议使用专业的Redis服务(比如腾讯云的Redis产品在新窗口打开

    环境

    CentOS 7.3 版本

    yum 安装 redis

    yum install redis
    +

    注:安装redis可能会出现"no package redis available"的错误提示,请执行yum install epel-release后重试redis安装命令。

    修改redis密码

    $ vi /etc/redis.conf
    +
    +# 找到 requirepass foobared
    +# 复制一行并根据自己需要调整密码,比如
    +requirepass tca123
    +

    启动redis

    systemctl start redis
    +

    查看redis运行状态

    systemctl status redis
    +

    访问redis

    $ redis-cli
    +
    +127.0.0.1:6379> auth tca123
    +OK # 鉴权通过
    +
    + + + diff --git "a/zh/advanced/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html" "b/zh/advanced/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html" new file mode 100644 index 000000000..ec26c8ee7 --- /dev/null +++ "b/zh/advanced/\344\273\273\345\212\241\345\210\206\345\270\203\345\274\217\346\211\247\350\241\214.html" @@ -0,0 +1,33 @@ + + + + + + + + + 任务分布式执行 | 腾讯云代码分析 + + + + +

    任务分布式执行

    适用场景

    • 以往的单机器单进程,性能比较低,工具排队等待时间过长。希望通过并行执行分析来提高分析效率。

    • 希望尽量使用公共资源或使用专机资源。

    为了满足以上需求,TCA已经进行如下支持:

    • 支持工具在多台机器上并行执行。

    • 支持指定工具在指定的机器上运行。

    • 支持与本地启动的任务衔接,加速本地任务扫描。

    • 配套任务状态监控能力,及时重置初始化超时或机器掉线的任务。

    提示

    TCA客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。和本地分析一样,需要先安装环境和必要的工具,并配置好服务端地址。

    常驻节点配置

    请参考客户端-常驻节点分析

    + + + diff --git "a/zh/advanced/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html" "b/zh/advanced/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html" new file mode 100644 index 000000000..339dd7b97 --- /dev/null +++ "b/zh/advanced/\344\275\277\347\224\250\350\207\252\345\273\272\345\267\245\345\205\267git\345\272\223.html" @@ -0,0 +1,101 @@ + + + + + + + + + 使用自建工具git库 | 腾讯云代码分析 + + + + +

    使用自建工具git库

    为什么要自建工具库

    • Github 对lfs流量有控制导致部分工具拉不下来
    • Github 下载速度有差异,为保证拉取速度建议使用流畅的工具库

    如何使用其他工具库

    1. 工具相对应的仓库地址,环境变量全部存储在puppy-tools-config仓库中,可通过fork该仓库,修改指定的工具仓库
    2. 修改client/config.ini中的字段指定puppy-tools-config,如下
    [COMMON]
    +; [必填]工具配置库git地址
    +; 如果github网络慢,建议修改为腾讯工蜂地址:https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git
    +; 这里可以修改为自己维护的puppy-tools-config
    +TOOL_CONFIG_URL=
    +PASSWORD_KEY=
    +; [可选]日志级别,默认为info级别,设置为True则调整为debug级别
    +DEBUG=
    +; [可选]是否使用本地工具目录,默认为False,如果设置为True,不从git拉取(需要事先准备好工具,存放到tools目录下)
    +USE_LOCAL_TOOL=
    +
    +[TOOL_LOAD_ACCOUNT]
    +; [可选]拉取工具库的账号密码
    +; 如果TOOL_CONFIG_URL使用的是腾讯工蜂,账号密码必填(如果没有,可以先去https://git.code.tencent.com注册)
    +USERNAME=
    +PASSWORD=
    +
    1. 修改puppy-tools-config,如下例
    ; ---------------------------------------------------------------------------------------------------------------------
    +; 配置文件填写说明:
    +; 填写过程中,如果有多个值,用英文分号分隔
    +; [env_path]    - 环境变量路径定义,基于tools目录的相对路径,比如:PYLINT_HOME : puppy_tools_common/pylint-1.4.5
    +; [env_value]   - 环境变量值定义,比如:GIT_SSL_NO_VERIFY : 1
    +; [tool_url]    - 工具库地址定义,格式:工具名:url,比如 CHECKSTYLE : http://xxxxxx.git
    +; [common]      - 公共环境配置,比如git环境变量等, 包含以下4个字段
    +;                 env_path  - 需要的环境变量路径,填写[env_path]中的KEY值,比如 env_path : ANDROID_HOME;CHECKSTYLE_HOME
    +;                 env_value - 需要的环境变量值,填写[env_value]中的KEY值,比如 env_value : GIT_SSL_NO_VERIFY
    +;                 path      - 需要加到path环境变量中的路径,基于tools目录的相对路径,推荐使用变量格式,比如 path : ${env_path:PYLINT_HOME}/bin
    +;                 tool_url  - 需要拉取的工具库,多个地址用英文分号分隔,推荐使用变量格式,比如 tool_url : ${tool_url:PYLINT}
    +; [工具名]       - 各工具配置,工具名需要与tool目录下的模块名匹配,字段格式参考[common]
    +; ---------------------------------------------------------------------------------------------------------------------
    +[base_value]
    +git_url=https://github.com/TCATools
    +
    +;------------------
    +;  1.环境变量路径定义
    +;------------------
    +; 用来记录工具路径,会在工具执行时写入到环境变量中
    +[env_path]
    +CPPLINT_HOME      : cpplint
    +
    +;------------------
    +;  2.环境变量值定义
    +;------------------
    +; 记录部分环境变量并在执行时写入环境变量
    +[env_value]
    +PYTHON_VERSION    : 3
    +
    +
    +;------------------
    +;  3.工具git库定义
    +;------------------
    +; 拉工具的仓库地址
    +[tool_url]
    +CPPLINT       : ${base_value:git_url}/cpplint.git
    +
    +;------------------
    +;  5.各个工具配置
    +;------------------
    +; 整合工具配置
    +[cpplint]
    +env_path  : CPPLINT_HOME
    +env_value : PYTHON_VERSION
    +path      : ${env_path:CPPLINT_HOME}
    +tool_url  : ${tool_url:CPPLINT}
    +
    1. 修改拉取工具需要的账号密码 账号密码需在client/config.ini中指定
    [TOOL_LOAD_ACCOUNT]
    +; [可选]拉取工具库的账号密码
    +; 如果使用的工具仓库必须账号密码才能拉取则必须填写
    +USERNAME=
    +PASSWORD=
    +

    其他工具库建议

    1. 腾讯工蜂在新窗口打开
    2. 自建GitLab在新窗口打开
    + + + diff --git "a/zh/advanced/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html" "b/zh/advanced/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html" new file mode 100644 index 000000000..68a662c8d --- /dev/null +++ "b/zh/advanced/\351\233\206\346\210\220\344\273\243\347\240\201\345\210\206\346\236\220\345\267\245\345\205\267.html" @@ -0,0 +1,148 @@ + + + + + + + + + 源码集成代码分析工具 | 腾讯云代码分析 + + + + +

    源码集成代码分析工具

    初识TCA任务执行机制

    1. TCA server在接收到开启分析的请求后根据所选规则生成对应的task_request,每个task_request对应一个工具的任务
    2. TCA server将task_request分发到能够执行该工具的机器
    3. TCA client在收到task_request后提取出本次任务的工具名也就是其中的task_name字段,字段对应于工具的name字段
    4. TCA client按照task_name在client中的tool目录查找对应python启动脚本
    5. 执行python启动脚本中的内容

    添加分析工具(以 tca_ql_php 为例)

    根据上述的任务机制添加工具需要做到以下几点

    1. 让server知道存在tca_ql_php工具及其所含的规则
    2. 让server知道哪些客户端可以执行tca_ql_php工具
    3. client下载/找到工具所在目录及需要的环境
    4. 让client知道tca_ql_php对应的启动脚本是什么

    如何让Server知道存在相应工具

    1. 找到server/projects/main/apps/scan_conf/management/commands/open_source目录

    2. 创建工具json文件,json文件名尽量对应工具名称方便查看

    3. json文件内容为(以 tca_ql_php 为例)

    [
    +    {
    +        "name": "tca_ql_php",
    +        "display_name": "Hades_PHP(展示名称用于前端展示使用)",
    +        "description": "工具描述",
    +        "license": "工具license",
    +        "libscheme_set": [], # 暂时不需要
    +        "task_processes": [
    +            "analyze",
    +            "datahandle",
    +            "compile"
    +        ],  # 工具进程,包含compile编译, analyze分析, datahandle数据处理
    +        "scan_app": "codelint",  # 代码分析统一为codelint
    +        "scm_url": "", # 暂时为空
    +        "run_cmd": "",
    +        "envs": null, # 是否需要特殊环境,这里无需填写
    +        "build_flag": false, # 是否需要编译命令才能运行
    +        "checkrule_set": [  # 工具包含的规则
    +            {
    +                "real_name": "deser",  # 规则名
    +                "display_name": "反序列化漏洞",  # 规则前端展示,考虑各工具规则名可能晦涩难懂,设置展示名称方便查找
    +                "severity": "error",  # 规则等级 从上到下分为 fatal, error, warning, info 四个等级
    +                "category": "security",  # 规则类别。correctness 功能 security安全 performance性能 usability可用性 accessibility无障碍化 i18n国际化 convention代码风格 other其他
    +                "rule_title": "反序列化漏洞",  # 一句话概括规则简介
    +                "rule_params": null,  # 规则参数
    +                "languages": [  # 支持语言
    +                    "php"
    +                ],
    +                "solution": "",  # 建议的解决方法
    +                "owner": "",
    +                "labels": [],
    +                "description": "",  # 规则详细介绍
    +            }
    +        ]
    +    }
    +]
    +
    1. server/projects/main/目录执行python manage.py loadcheckers --dir open_source tca_ql_php 加载工具进入数据库

    让server知道哪些客户端可以执行tca_ql_php工具

    1. 进入节点管理页面

    节点管理

    1. 选择其中一台机器 工具进程配置,勾选其工具进程

    工具进程

    client下载/找到工具所在目录及需要的环境

    1. 找到puppy-tool-config若没有额外配置则为默认代码库https://github.com/TCATools/puppy-tools-config.git在新窗口打开
    2. 修改其中的 ini 配置文件,每个操作系统对应一个ini
    3. 以 tca_ql_php 为例需要做以下修改
    ; env_path 主要填写存放工具文件所在的相对目录,一般都存放/拉取在tools下,会在工具执行前加载到环境变量中提供使用
    +[env_path]
    +ZEUS_HOME   : Zeus
    +HADES_HOME  : Hades
    +
    +; toolz_url
    +[tool_url] 主要填写工具的git仓库,这里因为 tca_ql_php 直接使用tools下的目录所以不用再进行额外拉取也无需再写
    +CPPCHECK    : ${base_value:git_url}/linux-cppcheck-1.78
    +
    +; 各工具配置 以 tca_ql_php 为例
    +; env_path 填写上面需要加载的环境变量
    +; env_value 通用环境变量,一般无需填写如果有需求需要现在 [env_value] 中定义好再填写
    +; path 工具所在目录填写上面的定义
    +; tool_url 工具git仓库,使用本地相对目录故为空
    +[tca_ql_php]
    +env_path  : ZEUS_HOME;HADES_HOME
    +env_value :
    +path      : ${env_path:ZEUS_HOME};${env_path:HADES_HOME}
    +tool_url  : 
    +
    +

    让client知道tca_ql_php对应的启动脚本是什么

    1. 以上述步骤在client/tool目录添加脚本tca_ql_php.py作为启动脚本 注:启动脚本必须与工具名称相同

    2. 编写脚本

    脚本编写规范

    tca_ql_php为例

    
    +from task.codelintmodel import CodeLintModel
    +from util.logutil import LogPrinter
    +from util.subprocc import SubProcController
    +
    +logger = LogPrinter()
    +
    +
    +class TcaQlPHP(CodeLintModel):
    +    # 代码分析工具集成基类CodeLintModel
    +    def __init__(self, params):
    +        logger.info("找到工具了Q_Q")
    +        super().__init__(params)
    +
    +    def compile(self, params):
    +        logger.info("开始编译了Q_Q")
    +        build_cmd = params.get('build_cmd', None)  # 从params中获取编译命令, params内容可以在最后附录查看
    +        lang = "php"
    +        do_some_things()
    +
    +    def analyze(self, params):
    +        logger.info("开始分析了Q_Q")
    +        lang = "php"
    +        HADES_HOME = envs.get("HADES_HOME", None)
    +        output_json = "result.json"
    +        sp = SubProcController(
    +            command=["Hades", "analyze", "test.php", "-o", output_json],
    +            cwd=HADES_HOME,
    +            stdout_line_callback=subprocc_log,
    +            stderr_line_callback=subprocc_log,
    +        )
    +        sp.wait()  # 执行工具分析命令
    +        issues = []
    +        # 工具结果输出到output_json,具体工具可能有所不同
    +        if os.path.exists(output_json):
    +            with open(output_json, "r") as result_reader:
    +                result = json.load(result_reader)
    +                issues.extend(result)
    +        return issues
    +
    +tool = TcaQlPHP  # 必须,必须包含tool变量并且为该工具的类
    +
    1. 脚本必须包含analyze方法,如果有配置编译进程也需要相应的compile方法来做编译相关工作,datahandle函数不用自定义基类方法已经够用了。方法执行顺序为 compile -> analyze -> datahandle
    2. params参数为task_request中的task_params字段,具体字段将在最后附录进行说明
    3. anlyze方法必须有返回值,返回值为issue列表,issue格式为
    {
    +    "path": "文件相对路径",
    +    "line": "行号,int类型",
    +    "column": "列号, int类型,如果工具没有输出列号信息,可以用0代替",
    +    "msg": "提示信息",
    +    "rule": "规则名称,可以根据需要输出不同的规则名",
    +    "refs": [
    +        {
    +            "line": "回溯行号", 
    +            "msg": "提示信息", 
    +            "tag": "用一个词简要标记该行信息,比如uninit_member,member_decl等,如果没有也可以都写成一样的", 
    +            "path": "回溯行所在文件绝对路径"
    +        },
    +        ...
    +    ]
    +}
    +说明:
    +    refs:可选,记录问题回溯路径信息。比如当前文件的回溯路径其他的3行代码,可以将这三行的路径及提示信息,按顺序添加到refs数组中。
    +

    PR

    如果有意公开您添加的工具欢迎发起PR

    注:别忘了puppy-tool-config 也需要PR

    附录

    params 表格

    字段说明类型
    scan_languages语言字符串列表如 ["python", "php"]
    pre_cmd编译前置命令字符串
    build_cmd编译命令字符串
    envs额外环境变量字符串
    scm_last_revision上次成功分析的代码版本,增量使用字符串
    incr_scan是否为增量分析bool
    rules规则名称列表,只有规则名字符串列表
    rule_list详细的规则列表包含规则名和规则参数等字典列表
    checktool工具详细信息,执行一般用不到字典
    path_filters过滤路径字典
    scm_url代码库url字符串
    source_dir代码库本地目录字符串
    work_dir本次任务的work_dir目录字符串
    project_id分析项目idint
    repo_id仓库idint
    task_id任务idint
    job_id本次分析的idint
    + + + diff --git a/zh/api/index.html b/zh/api/index.html new file mode 100644 index 000000000..6eb58cc29 --- /dev/null +++ b/zh/api/index.html @@ -0,0 +1,119 @@ + + + + + + + + + 接口调用说明 | 腾讯云代码分析 + + + + +

    接口调用说明

    接口地址

    http://{host}/server/

    注:host 指当前浏览器访问该文档的 URL 域名部分。

    接口鉴权方式

    发起请求时,需要在头部中添加以下格式形式,对应的 value 请看下面获取方式

    {
    +  "Authorization": "Token 当前user的token"
    +}
    +

    获取 token 位置(个人中心-个人令牌):

    API的个人令牌

    获取 org_sid 和 project_team 信息

    通过平台访问具体代码库扫描情况时,可从 URL 中获取对应 org_sid 和 project_team 字段,查看方式如下例子:

    代码库扫描地址:http://{host}/t/xxx/p/yyy/code-analysis/repos/1/projects?limit=10&offset=0

    其中,org_sid 为xxx字段,project_team 为 yyy字段

    Example

    import requests
    +# 假设:
    +# 当前域名为http://tca.com/,当前org_sid为helloworld
    +# 获取helloworld团队下的hellotca项目下登记的代码库
    +url="http://tca.com/server/main/api/orgs/helloworld/teams/hellotca/repos/?limit=12&offset=0"
    +headers = {
    +  "Authorization": "Token %s" % token,
    +}
    +
    +response = requests.get(url, headers=headers)
    +print(response.json())
    +# 结果如下:
    +{
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 23,
    +                "name": "repo_name",
    +                "scm_url": "http://git.repo.com/group/repo_name",
    +                "scm_type": "git",
    +                "branch_count": 1,
    +                "scheme_count": 1,
    +                "job_count": 1,
    +                "created_time": "2021-05-14 02:34:44.509118+00:00",
    +                "recent_active": {
    +                    "id": 27,
    +                    "branch_name": "master",
    +                    "active_time": "2021-05-14 02:34:44.509118+00:00",
    +                    "total_line_num": 1,
    +                    "code_line_num": 1
    +                },
    +                "created_from": "tca",
    +                "creator": {
    +                    "username": "author",
    +                    "nickname": "author",
    +                    "status": 1,
    +                    "avatar": "url",
    +                    "org": "org_name"
    +                },
    +                "symbol": null,
    +                "scm_auth": {
    +                    "id": 1,
    +                    "scm_account": null,
    +                    "scm_oauth": null,
    +                    "scm_ssh": {
    +                        "id": 1,
    +                        "name": "test",
    +                        "scm_platform": 2,
    +                        "scm_platform_desc": null,
    +                        "user": {
    +                            "username": "username",
    +                            "nickname": "nickname",
    +                            "status": 1,
    +                            "avatar": "url",
    +                            "org": "org_name"
    +                        }
    +                    },
    +                    "auth_type": "ssh_token",
    +                    "created_time": "2021-05-14T10:34:44.552859+08:00",
    +                    "modified_time": "2021-05-14T10:34:44.552887+08:00"
    +                },
    +                "project_team": {
    +                    "name": "test",
    +                    "display_name": "测试",
    +                    "status": 1,
    +                    "org_sid": "test"
    +                }
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    分页方式

    平台返回的数据分页格式是使用limitoffset参数进行分页处理

    比如:server/main/api/orgs/<org_sid>/teams/?limit=12&offset=12获取得到的数据是从第 13 条开始获取

    响应格式

    平台返回的响应格式如下:

    {
    +    "data": {...},      # 详细数据
    +    "code": 0,          # 请求结果码,为0表示正常
    +    "msg": "xxx" ,      # 请求结果信息
    +    "status_code": 200  # 请求响应码
    +}
    +
    + + + diff --git "a/zh/api/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/zh/api/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..9ef052c4a --- /dev/null +++ "b/zh/api/\344\273\243\347\240\201\345\272\246\351\207\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,525 @@ + + + + + + + + + 代码度量数据管理 | 腾讯云代码分析 + + + + +

    代码度量数据管理

    查看指定项目的圈复杂度文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccfiles/
    +

    参数列表

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    scan_openint选填,发现问题的扫描编号
    scan_closeint选填,修复问题的扫描编号
    worseboolean选填,圈复杂度是否恶化
    over_cc_sum_gteint选填, 圈复杂度总和最小值
    over_cc_sum_lteint选填,圈复杂度总和最大值
    over_cc_avg_gteint选填,平均圈复杂度最小值
    over_cc_avg_lteint选填,平均圈复杂度总和最大值
    over_cc_func_count_gteint选填,超标圈复杂度函数个数最小值
    over_cc_func_count_lteint选填,超标圈复杂度函数个数最大值

    返回参数

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的圈复杂度文件问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccfiles/<file_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr选填,问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    ccn_gtestr选填,圈复杂度最小值
    ccn_ltestr选填,圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的圈复杂度问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccissues/
    +

    参数列表

    参数类型描述
    statusstr选填,问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    ccn_gtestr选填,圈复杂度最小值
    ccn_ltestr选填,圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccfiles/
    +

    参数列表

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    scan_open_idint选填,发现问题的扫描编号
    scan_close_idint选填,修复问题的扫描编号
    worseboolean选填,圈复杂度是否恶化
    over_cc_sum_gteint选填,圈复杂度总和最小值
    over_cc_sum_lteint选填,圈复杂度总和最大值
    over_cc_avg_gteint选填,平均圈复杂度最小值
    over_cc_avg_lteint选填,平均圈复杂度总和最大值
    over_cc_func_count_gteint选填,超标圈复杂度函数个数最小值
    over_cc_func_count_lteint选填,超标圈复杂度函数个数最大值

    返回结果

    {
    +    "data": {
    +        "count": 32,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "tapd_url": null,
    +                "created_time": "2020-06-02T10:59:09.418250+08:00",
    +                "creator": null,
    +                "modified_time": "2020-06-03T16:17:40.892224+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "over_func_cc": 0,
    +                "over_cc_sum": 0,
    +                "over_cc_avg": 0,
    +                "over_cc_func_count": 0,
    +                "diff_over_func_cc": 0,
    +                "diff_over_cc_sum": 0,
    +                "diff_over_cc_avg": 0,
    +                "diff_over_cc_func_count": 0,
    +                "worse": false,
    +                "file_path": "test/demo.py",
    +                "state": 3,
    +                "change_type": 0,
    +                "last_modifier": "author1",
    +                "author": null,
    +                "related_modifiers": "author1;author2",
    +                "file_owners": null,
    +                "language": "python",
    +                "tapd_ws_id": null,
    +                "tapd_bug_id": null,
    +                "revision": null,
    +                "ci_time": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": 2
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度文件问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccfiles/<file_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr选填,问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    ccn_gtestr选填,圈复杂度最小值
    ccn_ltestr选填,圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目指定扫描的圈复杂度问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/scans/<scan_id>/ccissues/
    +

    参数列表

    参数类型描述
    statusstr选填,问题状态,1为需要关注,2为无需关注,可多选,格式为1,2,3
    change_typestr选填,圈复杂度变化情况,0为无,1为新增,2为删除,3为无变化,可多选,格式为1,2,3
    authorstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    ccn_gtestr选填,圈复杂度最小值
    ccn_ltestr选填,圈复杂度最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "created_time": "2021-02-19T15:30:20.968525+08:00",
    +                "creator": null,
    +                "modified_time": "2021-02-19T15:30:20.968532+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "ccn": 22,
    +                "g_cc_hash": null,
    +                "cc_hash": null,
    +                "file_path": "test/demo.py",
    +                "func_name": "test_func",
    +                "func_param_num": 4,
    +                "long_name": "test_func( project , result_data , scan , task_params )",
    +                "change_type": 0,
    +                "status": 1,
    +                "last_modifier": "author",
    +                "author": null,
    +                "related_modifiers": "author,author2",
    +                "is_tapdbug": false,
    +                "ignore_time": null,
    +                "is_latest": true,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2020-03-18T19:46:48+08:00",
    +                "diff_ccn": null,
    +                "project": 1,
    +                "scan_open": 1,
    +                "scan_close": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的重复文件列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/
    +

    参数列表

    参数类型描述
    issue__statestr选填,问题状态, 1为未处理,2为可忽略,3为关闭,可多选,格式为1,2,3
    change_typestr选填,重复文件更改类型,add为新增,del为删除,mod为删除,可多选,格式为add,del,mod
    issue__ownerstr选填,问题责任人
    last_modifierstr选填,最近修改人
    file_pathstr选填,文件路径
    duplicate_rate_gteint选填,重复率最小值
    duplicate_rate_lteint选填,重复率最大值

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo": 1,
    +                "issue": {
    +                    "id": 1,
    +                    "state": 1,
    +                    "owner": "author"
    +                },
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "issue_id": 1,
    +                "issue_state": 1,
    +                "issue_owner": "author",
    +                "dir_path": "test",
    +                "file_name": "demo.py",
    +                "file_path": "test/demo.py",
    +                "duplicate_rate": 4.63,
    +                "total_line_count": 259,
    +                "total_duplicate_line_count": 12,
    +                "distinct_hash_num": 1,
    +                "block_num": 1,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "scm_revision": "12345678abc",
    +                "is_latest": true
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +} 
    +

    查看指定项目的指定重复文件

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/<file_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "repo": 1,
    +        "issue": {
    +            "id": 1,
    +            "state": 1,
    +            "owner": "author"
    +        },
    +        "blocks": [
    +            {
    +                "id": 1,
    +                "duplicate_file": 1,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "duplicate_file_id": 1,
    +                "token_num": 120,
    +                "duplicate_times": 2,
    +                "duplicate_rate": 4.63,
    +                "start_line_num": 216,
    +                "end_line_num": 227,
    +                "duplicate_line_count": 12,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "related_modifiers": "author"
    +            }
    +        ],
    +        "duplicate_rate_trend": 0.0,
    +        "project_id": 1815,
    +        "scan_id": 488,
    +        "issue_id": 3,
    +        "issue_state": 1,
    +        "issue_owner": "author",
    +        "dir_path": "test",
    +        "file_name": "demo.py",
    +        "file_path": "test/demo.py",
    +        "duplicate_rate": 4.63,
    +        "total_line_count": 259,
    +        "total_duplicate_line_count": 12,
    +        "distinct_hash_num": 1,
    +        "block_num": 1,
    +        "last_modifier": "author",
    +        "change_type": null,
    +        "scm_revision": "xxx",
    +        "is_latest": true
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的指定文件的重复块列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/<file_id>/blocks/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "duplicate_file": 1,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "duplicate_file_id": 1,
    +                "token_num": 120,
    +                "duplicate_times": 2,
    +                "duplicate_rate": 4.63,
    +                "start_line_num": 216,
    +                "end_line_num": 227,
    +                "duplicate_line_count": 12,
    +                "last_modifier": "author",
    +                "change_type": null,
    +                "related_modifiers": "author"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的文件行数列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/clocfiles/
    +

    参数列表

    参数类型描述
    change_typestr选填,改变类型(add、mod、del),支持多值,使用英文逗号','分隔
    file_pathstr选填,文件路径

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": "",
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "code_line_num": 108587,
    +                "comment_line_num": 0,
    +                "blank_line_num": 0,
    +                "total_line_num": 108587,
    +                "add_code_line_num": 108587,
    +                "add_comment_line_num": 0,
    +                "add_blank_line_num": 0,
    +                "add_total_line_num": 108587,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1,
    +                "scan_id": 1,
    +                "is_latest": true,
    +                "dir_path": "test",
    +                "file_name": "test.json",
    +                "language": "JSON",
    +                "change_type": "add"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}    
    +

    查看指定项目的语言列表

    GET server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/cloclangs/
    +

    返回结果

    {
    +    "data": {
    +        "count": 2,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "code_line_num": 9753,
    +                "comment_line_num": 4220,
    +                "blank_line_num": 2454,
    +                "total_line_num": 16427,
    +                "add_code_line_num": 9753,
    +                "add_comment_line_num": 4220,
    +                "add_blank_line_num": 2454,
    +                "add_total_line_num": 16427,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1815,
    +                "scan_id": 695,
    +                "is_latest": true,
    +                "name": "Python",
    +                "file_num": 165
    +            },
    +            {
    +                "id": 2,
    +                "code_line_num": 379,
    +                "comment_line_num": 0,
    +                "blank_line_num": 153,
    +                "total_line_num": 532,
    +                "add_code_line_num": 379,
    +                "add_comment_line_num": 0,
    +                "add_blank_line_num": 153,
    +                "add_total_line_num": 532,
    +                "mod_code_line_num": 0,
    +                "mod_comment_line_num": 0,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 0,
    +                "del_code_line_num": 0,
    +                "del_comment_line_num": 0,
    +                "del_blank_line_num": 0,
    +                "del_total_line_num": 0,
    +                "project_id": 1815,
    +                "scan_id": 695,
    +                "is_latest": true,
    +                "name": "Markdown",
    +                "file_num": 7
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    + + + diff --git "a/zh/api/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/zh/api/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..c6a3bb2ba --- /dev/null +++ "b/zh/api/\344\273\243\347\240\201\346\211\253\346\217\217\346\225\260\346\215\256\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,229 @@ + + + + + + + + + 代码扫描数据管理 | 腾讯云代码分析 + + + + +

    代码扫描数据管理

    查看扫描问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/
    +

    参数

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    severitystr选填,严重程度, 1为致命,2为错误,3为警告,4为提示,可多选,格式为1,2,3,4
    resolutionstr选填,解决方式, 0为无,1为修复,2为无需修复,3为误报,4为重复单过滤,5为路径过滤,6为规则移除
    authorstr选填,问题责任人
    scan_openint选填,发现问题的扫描编号
    scan_fixint选填,修复问题的扫描编号
    ci_time_gtestr选填,修复问题的起始时间,格式为"2021-01-01 00:00:00"
    ci_time_ltestr选填,修复问题的结束时间
    file_pathstr选填,文件路径
    checkrule_display_namestr选填,检查规则名
    checkpackageint选填,问题所属的规则包

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "file_path": "test/demo.py",
    +                "project": 1,
    +                "repo": 1,
    +                "checkrule_real_name": "xxx",
    +                "checkrule_display_name": "xxx",
    +                "checktool_name": "xxx",
    +                "msg": "xxx",
    +                "state": 3,
    +                "resolution": 1,
    +                "author": "author",
    +                "author_email": null,
    +                "severity": 2,
    +                "revision": "revision",
    +                "ci_time": "2021-02-02T13:31:38+08:00",
    +                "file_owners": null,
    +                "is_external": false,
    +                "scm_url": "",
    +                "real_file_path": "",
    +                "scan_open": 1,
    +                "scan_fix": 2,
    +                "fixed_time": "2021-02-19T15:25:15.152350+08:00"
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看问题详情

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/<issue_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "issue_details": [
    +            {
    +                "id": 1,
    +                "issue_refers": [],
    +                "creator": null,
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "issuedetail_uuid": "0fcc376e-7283-11eb-bd53-5254005e71ca",
    +                "checkrule_real_name": "xxx",
    +                "checktool_name": "xxx",
    +                "author": "author",
    +                "author_email": null,
    +                "line": 1809,
    +                "column": 15,
    +                "scan_revision": "scan_revision",
    +                "revision": "revision",
    +                "ci_time": "2021-02-02T13:31:38+08:00",
    +                "real_revision": "",
    +                "created_time": "2021-02-19T15:21:19.625658+08:00",
    +                "modified_time": "2021-02-19T15:21:19.625662+08:00",
    +                "issue": null,
    +                "project": 1
    +            }
    +        ],
    +        "is_external": false,
    +        "repo": 1,
    +        "author": "author",
    +        "created_time": "2021-02-19T15:21:19.625685+08:00",
    +        "creator": null,
    +        "modifier": null,
    +        "deleted_time": null,
    +        "deleter": null,
    +        "file_path": "test/demo.py",
    +        "file_hash": "xxx",
    +        "scm_url": "",
    +        "real_file_path": "",
    +        "checkrule_gid": 1,
    +        "checkrule_real_name": "xxx",
    +        "checkrule_display_name": "xxx",
    +        "checkrule_rule_title": "xxx",
    +        "checktool_name": "xxx",
    +        "category": 7,
    +        "state": 3,
    +        "resolution": 1,
    +        "scan_revision": null,
    +        "severity": 2,
    +        "language": "python",
    +        "revision": "revision",
    +        "ci_time": "2021-02-02T13:31:38+08:00",
    +        "file_owners": null,
    +        "fixed_time": "2021-02-19T15:25:15.152350+08:00",
    +        "tapd_ws_id": null,
    +        "tapd_bug_id": null,
    +        "modified_time": "2021-02-19T15:25:17.807478+08:00",
    +        "project": 1,
    +        "scan_open": 1,
    +        "scan_fix": 2
    +    },
    +    "code": 0,
    +    "msg": "xxx",
    +    "status_code": 200
    +}
    +

    查看每次扫描的问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/scans/<scan_id>/issues/
    +

    参数

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    severitystr选填,严重程度, 1为致命,2为错误,3为警告,4为提示,可多选,格式为1,2,3,4
    resolutionstr选填,解决方式, 0为无,1为修复,2为无需修复,3为误报,4为重复单过滤,5为路径过滤,6为规则移除
    authorstr选填,问题责任人
    scan_open_idint选填,发现问题的扫描编号
    scan_fix_idint选填,修复问题的扫描编号
    ci_time_gtestr选填,修复问题的起始时间
    ci_time_ltestr选填,修复问题的结束时间
    file_pathstr选填,文件路径
    checkrule_display_namestr选填,检查规则名
    checkpackageint选填,问题所属的规则包

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo_id": 1,
    +                "project_id": 1,
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "file_path": "test/demo.py",
    +                "scm_url": "",
    +                "real_file_path": "",
    +                "line": 21,
    +                "column": 68,
    +                "checkrule_gid": 1,
    +                "checkrule_real_name": "xxx",
    +                "checkrule_display_name": "xxx",
    +                "checkrule_rule_title": "xxx",
    +                "checktool_name": "xxx",
    +                "category": 7,
    +                "msg": "xxx",
    +                "state": 1,
    +                "resolution": null,
    +                "author": "author",
    +                "scan_open_id": 1,
    +                "scan_fix_id": null,
    +                "issuedetail_uuid": "26d7ba88-8268-11eb-a304-5254005e71ca",
    +                "scan_revision": "scan_revision",
    +                "real_revision": "",
    +                "severity": 2,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2019-07-01T10:28:19+08:00",
    +                "file_owners": null,
    +                "created_time": "2021-03-11T20:49:00.539537+08:00",
    +                "fixed_time": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "xxx",
    +    "status_code": 200
    +}
    +

    查看指定CR扫描的问题列表

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/crscans/<scan_id>/issues/
    +

    参数

    参数类型描述
    statestr选填,问题状态, 1为未处理,2为已处理,3为关闭,可多选,格式为1,2,3
    severitystr选填,严重程度, 1为致命,2为错误,3为警告,4为提示,可多选,格式为1,2,3,4
    resolutionstr选填,解决方式, 0为无,1为修复,2为无需修复,3为误报,4为重复单过滤,5为路径过滤,6为规则移除
    authorstr选填,问题责任人
    scan_open_idint选填,发现问题的扫描编号
    scan_fix_idint选填,修复问题的扫描编号
    ci_time_gtestr选填,修复问题的起始时间
    ci_time_ltestr选填,修复问题的结束时间
    file_pathstr选填,文件路径
    checkrule_display_namestr选填,检查规则名
    checkpackageint选填,问题所属的规则包

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "repo_id": 1,
    +                "project_id": 1,
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "file_path": "test/demo.py",
    +                "scm_url": "",
    +                "real_file_path": "",
    +                "line": 21,
    +                "column": 68,
    +                "checkrule_gid": 1,
    +                "checkrule_real_name": "xxx",
    +                "checkrule_display_name": "xxx",
    +                "checkrule_rule_title": "xxx",
    +                "checktool_name": "xxx",
    +                "category": 7,
    +                "msg": "xxx",
    +                "state": 1,
    +                "resolution": null,
    +                "author": "author",
    +                "scan_open_id": 1,
    +                "scan_fix_id": null,
    +                "issuedetail_uuid": "26d7ba88-8268-11eb-a304-5254005e71ca",
    +                "scan_revision": "scan_revision",
    +                "real_revision": "",
    +                "severity": 2,
    +                "language": "python",
    +                "revision": "revision",
    +                "ci_time": "2019-07-01T10:28:19+08:00",
    +                "file_owners": null,
    +                "created_time": "2021-03-11T20:49:00.539537+08:00",
    +                "fixed_time": null
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "xxx",
    +    "status_code": 200
    +}
    +
    + + + diff --git "a/zh/api/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/zh/api/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..508f0a44a --- /dev/null +++ "b/zh/api/\344\273\273\345\212\241\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,116 @@ + + + + + + + + + 任务管理模块 | 腾讯云代码分析 + + + + +

    任务管理模块

    执行指定代码库指定分析项目扫描任务

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/scans/create/
    +

    参数列表

    参数类型描述
    incr_scanbool选填,增量扫描标志,true表示增量,false表示全量
    async_flagbool选填,异步启动标志,true表示异步,false表示同步,建议选择异步
    force_createbool选填,强制启动标志,true表示强制启动,不等待上一个任务结束

    返回结果

    {
    +    "job": {
    +        "id": 7974
    +    },
    +    "scan": {
    +        "id": 5528
    +    }
    +}
    +

    查看指定项目的任务列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/
    +

    参数列表

    参数类型描述
    create_time_gtedatetime选填,最小任务启动时间
    create_time_ltedatetime选填,最大任务启动时间
    result_code_gteint选填,最小错误码值
    result_code_lteint选填,最大错误码值
    result_msgstr选填,结果信息
    stateint选填,任务状态, 0为等待中,1为执行中,2为关闭,3为入库中,可多选,格式为1,2,3
    created_fromstr选填,创建来源
    creatorstr选填,创建用户

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "state": 2,
    +                "result_code": 0,
    +                "result_msg": "success",
    +                "code_line_num": 1000,
    +                "comment_line_num": 5,
    +                "blank_line_num": 305,
    +                "total_line_num": 1400
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定项目的指定任务详情

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/<job_id>/detail/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "scan_id": 1,
    +        "create_time": "2021-01-28T10:27:26.442961+08:00",
    +        "waiting_time": "1",
    +        "start_time": "2021-01-28T11:14:56.760427+08:00",
    +        "execute_time": "3",
    +        "project": {
    +            "id": 1,
    +            "branch": "master",
    +            "repo_id": 1,
    +            "scan_scheme": 1,
    +            "repo_scm_url": "http://github.com/xxx/test_demo.git"
    +        },
    +        "end_time": "2021-01-28T11:14:59.760427+08:00",
    +        "expire_time": "2021-01-28T14:07:52.968932+08:00",
    +        "task_num": 1,
    +        "task_done": 1,
    +        "tasks": [
    +            {
    +                "id": 1,
    +                "module": "codelint",
    +                "task_name": "pylint",
    +                "progress_rate": 1,
    +                "state": 2,
    +                "result_code": 0,
    +                "result_msg": "success",
    +                "result_path": null
    +            }
    +        ],
    +        "co_jobs": [],
    +        "state": 2,
    +        "result_code": 0,
    +        "result_code_msg": null,
    +        "result_msg": "success",
    +        "result_path": null,
    +        "remarks": null,
    +        "remarked_by": null,
    +        "code_line_num": 1000,
    +        "comment_line_num": 5,
    +        "blank_line_num": 305,
    +        "total_line_num": 1400,
    +        "created_from": "codedog_web",
    +        "creator": "creator"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    + + + diff --git "a/zh/api/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html" "b/zh/api/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html" new file mode 100644 index 000000000..a41923eab --- /dev/null +++ "b/zh/api/\345\257\271\350\261\241\344\270\273\350\246\201\345\255\227\346\256\265\350\257\264\346\230\216.html" @@ -0,0 +1,73 @@ + + + + + + + + + 对象主要字段说明 | 腾讯云代码分析 + + + + +

    对象主要字段说明

    注:以下字段用于参考,具体字段格式需要以具体接口返回为准

    团队(org):

    org_sid: str,团队编号
    +name: str,团队名称
    +description: str,团队描述
    +certificated: boolean,团队认证标志位
    +created_time: datetime,团队创建时间
    +updated_time: datetime,团队更新时间
    +admins: list,管理员列表
    +project_count: int,分析任务数量
    +team_count: int,项目组数量
    +user_count: int,成员数量
    +owner: str,负责人名称
    +tel_number: str,负责人电话
    +address: str,办公地址
    +

    项目(team):

    name: str,项目组名称
    +display_name: str,项目组展示名称
    +description: str,项目组描述信息
    +

    代码库(repository):

    name: str,代码库名称
    +scm_url: str,代码库地址
    +scm_type: int,代码库类型
    +created_from: str,创建来源
    +state:str,代码库状态,1表示活跃,2表示失活,3表示暂停使用
    +labels:list,标签
    +project_team: 项目
    +organization: 团队
    +

    扫描方案(scanscheme):

    name: str,扫描方案名称
    +repo:关联的代码库
    +refer_scheme: 参照的扫描方案
    +description: str,描述
    +tag: 执行标签
    +languages: 包含语言
    +default_flag: boolean,默认方案标志
    +created_from: str,创建来源
    +ignore_merged_issue: boolean,过滤其他分支引入的问题,默认False,不过滤
    +ignore_branch_issue: str,过滤指定分支引入的问题
    +ignore_submodule_clone: boolean,不拉取子模块,默认False
    +ignore_submodule_issue: boolean,忽略子模块问题,默认False
    +issue_global_ignore: boolean,开启问题全局忽略,默认False
    +daily_save: boolean,日常扫描记录保存7天开关,默认False
    +lfs_flag: boolean,自动拉取lfs文件,默认True
    +status: int,扫描方案状态,1为活跃,2为废弃
    +
    + + + diff --git "a/zh/api/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/zh/api/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..5173e303d --- /dev/null +++ "b/zh/api/\347\273\223\346\236\234\346\246\202\350\247\210\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,767 @@ + + + + + + + + + 代码扫描管理 | 腾讯云代码分析 + + + + +

    代码扫描管理

    查看项目扫描最新结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/
    +

    返回结果

    {
    +    "data": {
    +        "lintscan": {
    +            "issue_open_num": 74,
    +            "issue_fix_num": 439,
    +            "issue_detail_num": 310,
    +            "scan": {
    +                "id": 1,
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "execute_time": "00:02:17.844712"
    +            },
    +            "current_scan": {
    +                "active_category_detail": {
    +                    "convention": 70,
    +                    "other": 4
    +                },
    +                "active_severity_detail": {
    +                    "error": 69,
    +                    "warning": 5
    +                },
    +                "issue_open_num": 74,
    +                "issue_fix_num": 439
    +            },
    +            "total": {
    +                "state_detail": {
    +                    "active": 197,
    +                    "resolved": 13,
    +                    "closed": 23297
    +                },
    +                "category_detail": {
    +                    "convention": {
    +                        "active": 184,
    +                        "resolved": 13,
    +                        "closed": 21143
    +                    },
    +                    "other": {
    +                        "active": 13,
    +                        "closed": 154
    +                    },
    +                    "correctness": {
    +                        "closed": 1997
    +                    },
    +                    "performance": {
    +                        "closed": 3
    +                    }
    +                },
    +                "severity_detail": {
    +                    "error": {
    +                        "active": 157,
    +                        "resolved": 11,
    +                        "closed": 20113
    +                    },
    +                    "warning": {
    +                        "active": 40,
    +                        "resolved": 2,
    +                        "closed": 2930
    +                    },
    +                    "info": {
    +                        "closed": 254
    +                    }
    +                }
    +            },
    +            "status": 0,
    +            "text": "成功",
    +            "description": null,
    +            "scan_summary": {
    +                "convention": {
    +                    "error": {
    +                        "rule_count": 7,
    +                        "active": 65
    +                    },
    +                    "warning": {
    +                        "rule_count": 2,
    +                        "active": 5
    +                    }
    +                },
    +                "other": {
    +                    "error": {
    +                        "rule_count": 1,
    +                        "active": 4
    +                    }
    +                }
    +            },
    +            "total_summary": {
    +                "correctness": {
    +                    "error": {
    +                        "rule_count": 16,
    +                        "closed": 1315
    +                    },
    +                    "warning": {
    +                        "rule_count": 10,
    +                        "closed": 629
    +                    },
    +                    "info": {
    +                        "rule_count": 1,
    +                        "closed": 53
    +                    }
    +                },
    +                "performance": {
    +                    "warning": {
    +                        "rule_count": 1,
    +                        "closed": 3
    +                    }
    +                },
    +                "convention": {
    +                    "error": {
    +                        "rule_count": 42,
    +                        "active": 149,
    +                        "resolved": 11,
    +                        "closed": 18778
    +                    },
    +                    "warning": {
    +                        "rule_count": 17,
    +                        "active": 35,
    +                        "resolved": 2,
    +                        "closed": 2298
    +                    },
    +                    "info": {
    +                        "rule_count": 1,
    +                        "closed": 67
    +                    }
    +                },
    +                "other": {
    +                    "error": {
    +                        "rule_count": 2,
    +                        "active": 8,
    +                        "closed": 20
    +                    },
    +                    "warning": {
    +                        "rule_count": 1,
    +                        "active": 5
    +                    },
    +                    "info": {
    +                        "rule_count": 3,
    +                        "closed": 134
    +                    }
    +                }
    +            }
    +        },
    +        "cyclomaticcomplexityscan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "default_summary": {
    +                "min_ccn": 20,
    +                "over_cc_func_count": 6,
    +                "under_cc_func_count": 796,
    +                "diff_over_cc_func_count": 0,
    +                "over_cc_func_average": 22.333333333333332,
    +                "cc_func_average": 2.5099750623441395,
    +                "over_cc_sum": 14,
    +                "cc_average_of_lines": 1.0422094841063054
    +            },
    +            "custom_summary": null,
    +            "created_time": "2021-03-11T20:48:59.976947+08:00",
    +            "creator": null,
    +            "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +            "modifier": null,
    +            "deleted_time": null,
    +            "deleter": null,
    +            "last_revision": "last_revision",
    +            "diff_cc_num": 0,
    +            "cc_open_num": 6,
    +            "cc_average_of_lines": 1.0422094841063054,
    +            "cc_fix_num": 0,
    +            "worse_cc_file_num": 0,
    +            "min_ccn": 20,
    +            "code_line_num": 13433,
    +            "scan": 1
    +        },
    +        "duplicatescan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "default_summary": {
    +                "exhi_risk": {
    +                    "range": [
    +                        0.2,
    +                        1
    +                    ],
    +                    "file_count": 1,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "high_risk": {
    +                    "range": [
    +                        0.11,
    +                        0.2
    +                    ],
    +                    "file_count": 3,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "midd_risk": {
    +                    "range": [
    +                        0.05,
    +                        0.11
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "low_risk": {
    +                    "range": [
    +                        0,
    +                        0.05
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                }
    +            },
    +            "custom_summary": null,
    +            "last_revision": "last_revision",
    +            "duplicate_file_count": 8,
    +            "duplicate_block_count": 55,
    +            "duplicate_line_count": 1177,
    +            "diff_duplicate_block_count": 0,
    +            "diff_duplicate_line_count": 0,
    +            "close_issue_count": 0,
    +            "new_issue_count": 0,
    +            "reopen_issue_count": 5,
    +            "ignored_issue_count": 0,
    +            "duplicate_rate": 4.98,
    +            "unique_duplicate_line_count": 1083,
    +            "total_duplicate_line_count": 1083,
    +            "total_line_count": 21745,
    +            "scan": 1
    +        },
    +        "clocscan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "last_revision": "last_revision",
    +            "code_line_num": 140490,
    +            "comment_line_num": 5410,
    +            "blank_line_num": 3408,
    +            "total_line_num": 149308,
    +            "add_code_line_num": 6673,
    +            "add_comment_line_num": 2309,
    +            "add_blank_line_num": 1289,
    +            "add_total_line_num": 10271,
    +            "mod_code_line_num": 965,
    +            "mod_comment_line_num": 297,
    +            "mod_blank_line_num": 0,
    +            "mod_total_line_num": 1262,
    +            "del_code_line_num": 35844,
    +            "del_comment_line_num": 2117,
    +            "del_blank_line_num": 1794,
    +            "del_total_line_num": 39755,
    +            "scan": 1
    +        }
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码最新扫描结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/latestscan/
    +

    参数列表

    参数类型描述
    scan_revisionstr选填,指定查询的扫描版本号,如不指定则为当前项目最新的一次扫描

    返回结果

    {
    +    "data": {
    +        "id": 1,                            # 扫描编号
    +        "repo_id": 1,                       # 代码库编号
    +        "project_id": 1,                    # 项目编号
    +        "job_gid": 1,                       # 关联任务编号
    +        "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +        "current_revision": "current_revision",  # 扫描版本号
    +        "result_code": 0,                   # 扫描任务结果码,0表示正常
    +        "result_code_msg": "成功",
    +        "result_msg": null,
    +        "lintscan": {                         # 代码扫描结果信息
    +            "current_scan": {                 # 本次扫描信息
    +                "active_severity_detail": {   # 不同严重级别的活跃问题数,包含 fatal(1-致命), error(2-错误), warning(3-警告), info(4-提示)
    +                    "error": 69,              
    +                    "warning": 5              
    +                },
    +                "issue_open_num": 10,         # 本次扫描新发现问题数
    +                "issue_fix_num": 2            # 本次扫描关闭存量问题数
    +            },
    +            "total": {                        # 当前项目整体信息
    +                "state_detail": {             # 不同处理状态的问题数,包含 active(1-活跃)、resolved(2-已处理)、closed(3-已关闭)
    +                    "active": 197,            
    +                    "resolved": 13,
    +                    "closed": 23297
    +                },
    +                "severity_detail": {         # 不同严重级别下不同处理状态的问题量
    +                    "error": {
    +                        "active": 157,
    +                        "resolved": 11,
    +                        "closed": 20113
    +                    },
    +                    "warning": {
    +                        "active": 40,
    +                        "resolved": 2,
    +                        "closed": 2930
    +                    },
    +                    "info": {
    +                        "closed": 254
    +                    }
    +                }
    +            }
    +        },
    +        "duplicatescan": {                    # 重复代码扫描结果信息
    +            "id": 1,                          # 扫描任务编号
    +            "scan_revision": "scan_revision", # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +            "default_summary": {              # 默认概览
    +                "exhi_risk": {                # 极高风险
    +                    "range": [                # 重复率范围: 0.2-1
    +                        0.2,
    +                        1
    +                    ],
    +                    "file_count": 1,          # 文件数量
    +                    "diff": {                 # 增量数据
    +                        "diff_file_count": 0  # 增量文件数量
    +                    }
    +                },
    +                "high_risk": {                # 高风险
    +                    "range": [                # 重复率范围:0.11-0.2
    +                        0.11,
    +                        0.2
    +                    ],
    +                    "file_count": 3,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "midd_risk": {                # 中风险
    +                    "range": [                # 重复率范围:0.05-0.11
    +                        0.05,
    +                        0.11
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                },
    +                "low_risk": {                 # 低风险
    +                    "range": [                # 重复率范围:0-0.05
    +                        0,
    +                        0.05
    +                    ],
    +                    "file_count": 2,
    +                    "diff": {
    +                        "diff_file_count": 0
    +                    }
    +                }
    +            },
    +            "custom_summary": null,           # 自定义概览数据
    +            "last_revision": "2010ef28ff3a26424d4e8f32df022f90cd682eda",  # 上次扫描版本号
    +            "duplicate_file_count": 8,        # 重复文件数量
    +            "duplicate_block_count": 55,      # 重复代码块数量
    +            "duplicate_line_count": 1177,     # 重复代码行数
    +            "diff_duplicate_block_count": 0,  # 增量重复代码块数量
    +            "diff_duplicate_line_count": 0,   # 增量重复代码行数
    +            "close_issue_count": 0,           # 关闭问题数
    +            "new_issue_count": 0,             # 新增问题数
    +            "reopen_issue_count": 5,          # 重新打开问题数
    +            "ignored_issue_count": 0,         # 忽略问题数
    +            "duplicate_rate": 4.98,           # 重复率
    +            "unique_duplicate_line_count": 1083,  # 去重后的重复代码行数
    +            "total_duplicate_line_count": 1083,   # 项目总的去重后的重复代码行数
    +            "total_line_count": 21745,            # 项目总行书
    +            "scan": 1                         # 关联扫描任务编号
    +        },
    +        "cyclomaticcomplexityscan": {         # 圈复杂度扫描数据
    +            "id": 1,                          # 圈复杂度扫描编号
    +            "scan_revision": "scan_revision", # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +            "default_summary": {                      # 默认概览数据
    +                "min_ccn": 20,                        # 最小圈复杂度阈值
    +                "over_cc_func_count": 6,              # 超标函数数量
    +                "under_cc_func_count": 796,           # 未超标函数数量
    +                "diff_over_cc_func_count": 0,         # 增量超标函数数据
    +                "over_cc_func_average": 22.333333333333332,  # 平均超标圈复杂度
    +                "cc_func_average": 2.5099750623441395,  # 平均圈复杂度
    +                "over_cc_sum": 14,                      # 文件超标方法圈复杂度超过阈值的差值之和
    +                "cc_average_of_lines": 1.0422094841063054 # 千行代码平均圈复杂度
    +            },
    +            "custom_summary": null,                     # 自定义概览数据
    +            "created_time": "2021-03-11T20:48:59.976947+08:00",
    +            "creator": null,
    +            "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +            "modifier": null,
    +            "deleted_time": null,
    +            "deleter": null,
    +            "last_revision": "last_revision",           # 上一次扫描版本号
    +            "diff_cc_num": 0,                           # 增量超标函数数量
    +            "cc_open_num": 6,                           # 超标函数量
    +            "cc_average_of_lines": 1.0422094841063054,  # 千行代码平均圈复杂度
    +            "cc_fix_num": 0,                            # 修复数量
    +            "worse_cc_file_num": 0,                     # 圈复杂度恶化的文件数据
    +            "min_ccn": 20,                              # 最小圈复杂度阈值
    +            "code_line_num": 13433,                     # 代码行数
    +            "scan": 1
    +        },
    +        "clocscan": {
    +            "id": 1,
    +            "scan_revision": "scan_revision",           # 扫描版本号
    +            "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描时间
    +            "last_revision": "last_revision",           # 上一次扫描版本号
    +            "code_line_num": 140490,                    # 代码行数
    +            "comment_line_num": 5410,                   # 注释行数
    +            "blank_line_num": 3408,                     # 空白行数
    +            "total_line_num": 149308,                   # 总行数
    +            "add_code_line_num": 6673,                  # 增加的代码行数
    +            "add_comment_line_num": 2309,               # 增加的注释行数
    +            "add_blank_line_num": 1289,                 # 增加的空白行数
    +            "add_total_line_num": 10271,                # 增加的总行数
    +            "mod_code_line_num": 965,                   # 修改的代码行数
    +            "mod_comment_line_num": 297,                # 修改的注释行数
    +            "mod_blank_line_num": 0,                    # 修改的空白行数
    +            "mod_total_line_num": 1262,                 # 修改的总行数
    +            "del_code_line_num": 35844,                 # 删除的代码行数
    +            "del_comment_line_num": 2117,               # 删除的注释行数
    +            "del_blank_line_num": 1794,                 # 删除的空白行数
    +            "del_total_line_num": 39755,                # 删除的总行数
    +            "scan": 1
    +        }
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码扫描结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/lintscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr选填,扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr选填,扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "issue_open_num": 10,             # 本次扫描新发现问题数
    +                "issue_fix_num": 2,               # 本次扫描关闭存量问题数
    +                "issue_detail_num": 310,          # 本次扫描上报原始问题数(问题展示会进行聚合)
    +                "scan": {                         # 扫描信息
    +                    "id": 1,                      # 扫描任务编号
    +                    "scan_time": "2021-03-11T20:46:44.171607+08:00",  # 扫描开始时间
    +                    "execute_time": "00:02:17.844712"                 # 扫描执行耗时
    +                },
    +                "current_scan": {                 # 本次扫描信息
    +                    "active_category_detail": {   # 活跃问题分类,包含 CORRECTNESS(1-功能)、SECURITY(2-安全)、PERFORMANCE(3-性能)、USABILITY(4-可用性)、ACCESSIBILITY(5-无障碍化)、I18N(6-国际化)、CONVENTION(7-代码风格)、OTHER(8-其他)
    +                        "convention": 70,         # 代码风格类型问题
    +                        "other": 4                # 其他类型问题
    +                    },
    +                    "active_severity_detail": {   # 不同严重级别的活跃问题数,包含 fatal(1-致命), error(2-错误), warning(3-警告), info(4-提示)
    +                        "error": 69,              
    +                        "warning": 5              
    +                    },
    +                    "issue_open_num": 10,         # 本次扫描新发现问题数
    +                    "issue_fix_num": 2            # 本次扫描关闭存量问题数
    +                },
    +                "total": {                        # 当前项目整体信息
    +                    "state_detail": {             # 不同处理状态的问题数,包含 active(1-活跃)、resolved(2-已处理)、closed(3-已关闭)
    +                        "active": 197,            
    +                        "resolved": 13,
    +                        "closed": 23297
    +                    },
    +                    "category_detail": {          # 不同分类下不同处理状态的问题量
    +                        "convention": {           
    +                            "active": 184,
    +                            "resolved": 13,
    +                            "closed": 21143
    +                        },
    +                        "other": {                
    +                            "active": 13,
    +                            "closed": 154
    +                        },
    +                        "correctness": {
    +                            "closed": 1997
    +                        },
    +                        "performance": {
    +                            "closed": 3
    +                        }
    +                    },
    +                    "severity_detail": {         # 不同严重级别下不同处理状态的问题量
    +                        "error": {
    +                            "active": 157,
    +                            "resolved": 11,
    +                            "closed": 20113
    +                        },
    +                        "warning": {
    +                            "active": 40,
    +                            "resolved": 2,
    +                            "closed": 2930
    +                        },
    +                        "info": {
    +                            "closed": 254
    +                        }
    +                    }
    +                },
    +                "status": 0,                     # 扫描状态,0表示成功
    +                "text": "成功",
    +                "description": null,
    +                "scan_summary": {                # 扫描概览
    +                    "convention": {              
    +                        "error": {               
    +                            "rule_count": 7,     # 规则数
    +                            "active": 65         # 活跃问题数
    +                        },
    +                        "warning": {
    +                            "rule_count": 2,
    +                            "active": 5
    +                        }
    +                    },
    +                    "other": {
    +                        "error": {
    +                            "rule_count": 1,
    +                            "active": 4
    +                        }
    +                    }
    +                },
    +                "total_summary": {
    +                    "correctness": {
    +                        "error": {
    +                            "rule_count": 16,
    +                            "closed": 1315
    +                        },
    +                        "warning": {
    +                            "rule_count": 10,
    +                            "closed": 629
    +                        },
    +                        "info": {
    +                            "rule_count": 1,
    +                            "closed": 53
    +                        }
    +                    },
    +                    "performance": {
    +                        "warning": {
    +                            "rule_count": 1,
    +                            "closed": 3
    +                        }
    +                    },
    +                    "convention": {
    +                        "error": {
    +                            "rule_count": 42,
    +                            "active": 149,
    +                            "resolved": 11,
    +                            "closed": 18778
    +                        },
    +                        "warning": {
    +                            "rule_count": 17,
    +                            "active": 35,
    +                            "resolved": 2,
    +                            "closed": 2298
    +                        },
    +                        "info": {
    +                            "rule_count": 1,
    +                            "closed": 67
    +                        }
    +                    },
    +                    "other": {
    +                        "error": {
    +                            "rule_count": 2,
    +                            "active": 8,
    +                            "closed": 20
    +                        },
    +                        "warning": {
    +                            "rule_count": 1,
    +                            "active": 5
    +                        },
    +                        "info": {
    +                            "rule_count": 3,
    +                            "closed": 134
    +                        }
    +                    }
    +                }
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量圈复杂度结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/cycscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr选填,扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr选填,扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "default_summary": {
    +                    "min_ccn": 20,
    +                    "over_cc_func_count": 6,
    +                    "under_cc_func_count": 796,
    +                    "diff_over_cc_func_count": 0,
    +                    "over_cc_func_average": 22.333333333333332,
    +                    "cc_func_average": 2.5099750623441395,
    +                    "over_cc_sum": 14,
    +                    "cc_average_of_lines": 1.0422094841063054
    +                },
    +                "custom_summary": null,
    +                "created_time": "2021-03-11T20:48:59.976947+08:00",
    +                "creator": null,
    +                "modified_time": "2021-03-11T20:49:00.088841+08:00",
    +                "modifier": null,
    +                "deleted_time": null,
    +                "deleter": null,
    +                "last_revision": "last_revision",
    +                "diff_cc_num": 0,
    +                "cc_open_num": 6,
    +                "cc_average_of_lines": 1.0422094841063054,
    +                "cc_fix_num": 0,
    +                "worse_cc_file_num": 0,
    +                "min_ccn": 20,
    +                "code_line_num": 13433,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量重复代码结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/dupscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr选填,扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr选填,扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "default_summary": {
    +                    "exhi_risk": {
    +                        "range": [
    +                            0.2,
    +                            1
    +                        ],
    +                        "file_count": 1,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "high_risk": {
    +                        "range": [
    +                            0.11,
    +                            0.2
    +                        ],
    +                        "file_count": 3,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "midd_risk": {
    +                        "range": [
    +                            0.05,
    +                            0.11
    +                        ],
    +                        "file_count": 2,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    },
    +                    "low_risk": {
    +                        "range": [
    +                            0,
    +                            0.05
    +                        ],
    +                        "file_count": 2,
    +                        "diff": {
    +                            "diff_file_count": 0
    +                        }
    +                    }
    +                },
    +                "custom_summary": null,
    +                "last_revision": "last_revision",
    +                "duplicate_file_count": 8,
    +                "duplicate_block_count": 55,
    +                "duplicate_line_count": 1177,
    +                "diff_duplicate_block_count": 0,
    +                "diff_duplicate_line_count": 0,
    +                "close_issue_count": 0,
    +                "new_issue_count": 0,
    +                "reopen_issue_count": 5,
    +                "ignored_issue_count": 0,
    +                "duplicate_rate": 4.98,
    +                "unique_duplicate_line_count": 1083,
    +                "total_duplicate_line_count": 1083,
    +                "total_line_count": 21745,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看项目代码度量代码统计结果概览

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/clocscans/
    +

    参数列表

    参数类型描述
    scan_time_beforestr选填,扫描任务起始时间,格式: 2021-01-01 00:00:00
    scan_time_afterstr选填,扫描任务结束时间

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "scan_revision": "scan_revision",
    +                "scan_time": "2021-03-11T20:46:44.171607+08:00",
    +                "last_revision": "last_revision",
    +                "code_line_num": 140490,
    +                "comment_line_num": 5410,
    +                "blank_line_num": 3408,
    +                "total_line_num": 149308,
    +                "add_code_line_num": 6673,
    +                "add_comment_line_num": 2309,
    +                "add_blank_line_num": 1289,
    +                "add_total_line_num": 10271,
    +                "mod_code_line_num": 965,
    +                "mod_comment_line_num": 297,
    +                "mod_blank_line_num": 0,
    +                "mod_total_line_num": 1262,
    +                "del_code_line_num": 35844,
    +                "del_comment_line_num": 2117,
    +                "del_blank_line_num": 1794,
    +                "del_total_line_num": 39755,
    +                "scan": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +
    + + + diff --git "a/zh/api/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" "b/zh/api/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" new file mode 100644 index 000000000..cbbd7d832 --- /dev/null +++ "b/zh/api/\351\241\271\347\233\256\347\256\241\347\220\206\346\250\241\345\235\227\346\216\245\345\217\243.html" @@ -0,0 +1,660 @@ + + + + + + + + + 项目管理模块 | 腾讯云代码分析 + + + + +

    项目管理模块

    查看指定代码库的指定分析项目列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/
    +

    参数列表

    参数类型描述
    scm_url_or_namestr选填,代码库地址或者名称,支持模糊匹配
    scm_urlstr选填,代码库仓库匹配
    scopestr选填,过滤范围(my/subscribed/related_me),my表示我创建的,subscribed表示我关注的,related_me表示我有权限的

    返回结果

    {
    +    "count": 1,
    +    "next": null,
    +    "previous": null,
    +    "results": [
    +        {
    +            "id": 1,
    +            "name": "test_repo.git",
    +            "scm_url": "http://git.com/xxx/test_repo",
    +            "scm_type": "git",
    +            "branch_count": 1,
    +            "scheme_count": 1,
    +            "job_count": 1,
    +            "created_time": "2021-03-15 02:26:31.423674+00:00",
    +            "recent_active": {
    +                "id": 1,
    +                "branch_name": "master",
    +                "active_time": "2021-03-15T03:14:56.760427Z",
    +                "total_line_num": null,
    +                "code_line_num": null
    +            },
    +            "created_from": "codedog_web",
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "symbol": null
    +        }
    +    ]
    +}
    +

    查看已创建的授权信息

    GET /server/main/api/authen/scmallaccounts/
    +

    返回结果

    {
    +    "data": {
    +        "ssh": [
    +            {
    +                "id": 1,
    +                "user": {
    +                    "username": "CodeDog",
    +                    "nickname": "CodeDog",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "latest_login_time": "2022-10-22T15:30:30+08:00",
    +                    "org": null
    +                },
    +                "auth_origin": "CodeDog",
    +                "indentity": "xxx",
    +                "display_scm_platform": "tgit",
    +                "name": "gerrit",
    +                "scm_platform": 1,
    +                "scm_platform_desc": null
    +            }
    +        ],
    +        "account": [
    +            {
    +                "id": 1,
    +                "user": {
    +                    "username": "CodeDog",
    +                    "nickname": "CodeDog",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "latest_login_time": "2022-10-22T15:30:30+08:00",
    +                    "org": null
    +                },
    +                "auth_origin": "CodeDog",
    +                "display_scm_platform": "tgit",
    +                "scm_username": "CodeDog",
    +                "scm_platform": 1,
    +                "scm_platform_desc": null
    +            }
    +        ],
    +        "oauth": [
    +            {
    +                "id": 1,
    +                "user": {
    +                    "username": "CodeDog",
    +                    "nickname": "CodeDog",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "latest_login_time": "2022-10-22T15:30:30+08:00",
    +                    "org": null
    +                },
    +                "auth_origin": "CodeDog",
    +                "scm_platform_name": "tgit"
    +            }
    +        ],
    +    }
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    登记代码库

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/
    +

    参数列表

    参数类型描述
    scm_urlstr必填,代码库地址
    scm_typestr必填,git或svn
    ssh_urlstr选填,代码库SSH地址
    namestr选填, 代码库名称
    scm_authdict选填,代码库授权

    例子:

    {
    +    "scm_url": "https://github.com/Tencent/CodeAnalysis",
    +    "scm_type": "git",
    +    "name": "CodeAnalysis",
    +    "scm_auth": {
    +        # 通过 查看已创建的授权信息 接口获取到对应的凭证id,scm_account、scm_oauth、scm_ssh 只需填一个
    +        "scm_account": account_id,
    +        "scm_ssh": ssh_id,
    +        "scm_oauth": oauth_id
    +    }
    +}
    +

    返回结果

    {
    +    "data":{
    +        "id": 1,
    +        "name": "CodeAnalysis",
    +        "scm_url": "http://github.com/Tencent/CodeAnalysis",
    +        "scm_type": "git",
    +        "branch_count": 0,
    +        "scheme_count": 0,
    +        "job_count": 0,
    +        "created_time": "2022-10-22T16:30:30+08:00",
    +        "recent_active": {
    +        },
    +        "created_from": "codedog_web",
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "symbol": null
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库详情

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/
    +

    返回结果

    {
    +    "data":{
    +        "id": 1,
    +        "name": "test_repo.git",
    +        "scm_url": "http://git.com/xxx/test_repo",
    +        "scm_type": "git",
    +        "branch_count": 1,
    +        "scheme_count": 1,
    +        "job_count": 1,
    +        "created_time": "2021-03-15 02:26:31.423674+00:00",
    +        "recent_active": {
    +            "id": 1,
    +            "branch_name": "master",
    +            "active_time": "2021-03-15T03:14:56.760427Z",
    +            "total_line_num": null,
    +            "code_line_num": null
    +        },
    +        "created_from": "codedog_web",
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "symbol": null
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的不同分支的列表接口

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/branches/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "branch": "master",
    +                "schemes": [
    +                    {
    +                        "project_id": 1,
    +                        "scan_scheme_id": 1,
    +                        "scan_scheme_name": "默认"
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的分析项目列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    参数列表

    参数类型描述
    branchstr选填,分支名称
    scan_schemeint选填,扫描方案名称
    scan_scheme__statusint选填,扫描方案状态,1为活跃,2为废弃
    branch_or_schemestr选填,分支名称/扫描方案名称
    statusint选填,项目状态筛选,1表示活跃,2表示失活,3表示关闭

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "creator": {
    +                    "username": "username",
    +                    "nickname": "nickname",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "org": 1
    +                },
    +                "created_time": "2021-01-28 02:27:26.256015+00:00",
    +                "modifier": null,
    +                "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +                "deleter": null,
    +                "deleted_time": null,
    +                "scan_scheme": {
    +                    "id": 1,
    +                    "creator": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    },
    +                    "created_time": "2021-01-28 02:27:26.209661+00:00",
    +                    "modifier": null,
    +                    "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +                    "deleter": null,
    +                    "deleted_time": null,
    +                    "languages": [
    +                        "python"
    +                    ],
    +                    "tag": "TCA_Linux",
    +                    "refer_scheme_info": null,
    +                    "name": "默认",
    +                    "description": null,
    +                    "default_flag": true,
    +                    "created_from": "web",
    +                    "job_runtime_limit": 600,
    +                    "ignore_merged_issue": false,
    +                    "ignore_branch_issue": null,
    +                    "ignore_submodule_clone": false,
    +                    "ignore_submodule_issue": true,
    +                    "issue_global_ignore": false,
    +                    "daily_save": false,
    +                    "lfs_flag": null,
    +                    "webhook_flag": false,
    +                    "issue_revision_merge_flag": false,
    +                    "status": 1,
    +                    "scheme_key": null,
    +                    "repo": 1
    +                },
    +                "branch": "master",
    +                "status": 1,
    +                "created_from": "codedog_web",
    +                "repo": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    创建指定代码库的指定分析项目

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    参数列表

    参数类型描述
    scan_scheme_idint和global_scheme_id二选一进行填写,当前代码库的扫描方案编号
    global_scheme_idint和scan_scheme_id二选一进行填写,扫描方案模板编号
    custom_scheme_namestr选填,自定义方案名称
    branchstr必填,分支
    created_fromstr选填,创建渠道,用于区分不同运行场景

    返回结果

    {
    +    "data": {
    +        "id":1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.256015+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "repo": {
    +            "id": 1,
    +            "name": "test_demo.git",
    +            "scm_url": "http://github.com/xxxx/test_demo.git",
    +            "scm_type": "git",
    +            "scm_auth": {
    +                "id": 1,
    +                "scm_account": null,
    +                "scm_oauth": null,
    +                "scm_ssh": {
    +                    "id": 1,
    +                    "name": "1",
    +                    "scm_platform": 1,
    +                    "scm_platform_desc": null,
    +                    "user": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    }
    +                },
    +                "auth_type": "ssh_token",
    +                "created_time": "2021-01-28T10:26:31.453389+08:00",
    +                "modified_time": "2021-01-28T10:26:31.453417+08:00"
    +            },
    +            "symbol": null
    +        },
    +        "scan_scheme": {
    +            "id": 1,
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "created_time": "2021-01-28 02:27:26.209661+00:00",
    +            "modifier": null,
    +            "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +            "deleter": null,
    +            "deleted_time": null,
    +            "languages": [
    +                "python"
    +            ],
    +            "tag": "TCA_Linux",
    +            "refer_scheme_info": null,
    +            "name": "默认",
    +            "description": null,
    +            "default_flag": true,
    +            "created_from": "web",
    +            "job_runtime_limit": 600,
    +            "ignore_merged_issue": false,
    +            "ignore_branch_issue": null,
    +            "ignore_submodule_clone": false,
    +            "ignore_submodule_issue": true,
    +            "issue_global_ignore": false,
    +            "daily_save": false,
    +            "lfs_flag": null,
    +            "webhook_flag": false,
    +            "issue_revision_merge_flag": false,
    +            "status": 1,
    +            "scheme_key": null,
    +            "repo": 1
    +        },
    +        "branch": "master",
    +        "status": 1,
    +        "created_from": "tca_web"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的指定分析项目

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id":1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.256015+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.256284+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "repo": {
    +            "id": 1,
    +            "name": "test_demo.git",
    +            "scm_url": "http://github.com/xxxx/test_demo.git",
    +            "scm_type": "git",
    +            "scm_auth": {
    +                "id": 1,
    +                "scm_account": null,
    +                "scm_oauth": null,
    +                "scm_ssh": {
    +                    "id": 1,
    +                    "name": "1",
    +                    "scm_platform": 1,
    +                    "scm_platform_desc": null,
    +                    "user": {
    +                        "username": "username",
    +                        "nickname": "nickname",
    +                        "status": 1,
    +                        "avatar": null,
    +                        "org": 1
    +                    }
    +                },
    +                "auth_type": "ssh_token",
    +                "created_time": "2021-01-28T10:26:31.453389+08:00",
    +                "modified_time": "2021-01-28T10:26:31.453417+08:00"
    +            },
    +            "symbol": null
    +        },
    +        "scan_scheme": {
    +            "id": 1,
    +            "creator": {
    +                "username": "username",
    +                "nickname": "nickname",
    +                "status": 1,
    +                "avatar": null,
    +                "org": 1
    +            },
    +            "created_time": "2021-01-28 02:27:26.209661+00:00",
    +            "modifier": null,
    +            "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +            "deleter": null,
    +            "deleted_time": null,
    +            "languages": [
    +                "python"
    +            ],
    +            "tag": "TCA_Linux",
    +            "refer_scheme_info": null,
    +            "name": "默认",
    +            "description": null,
    +            "default_flag": true,
    +            "created_from": "web",
    +            "job_runtime_limit": 600,
    +            "ignore_merged_issue": false,
    +            "ignore_branch_issue": null,
    +            "ignore_submodule_clone": false,
    +            "ignore_submodule_issue": true,
    +            "issue_global_ignore": false,
    +            "daily_save": false,
    +            "lfs_flag": null,
    +            "webhook_flag": false,
    +            "issue_revision_merge_flag": false,
    +            "status": 1,
    +            "scheme_key": null,
    +            "repo": 1
    +        },
    +        "branch": "master",
    +        "status": 1,
    +        "created_from": "tca_web"
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的扫描方案列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/
    +

    参数列表

    参数类型描述
    namestr选填,扫描方案名称
    statusint选填,扫描方案状态,1为活跃,2为废弃

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "creator": {
    +                    "username": "username",
    +                    "nickname": "nickname",
    +                    "status": 1,
    +                    "avatar": null,
    +                    "org": 1
    +                },
    +                "created_time": "2021-01-28 02:27:26.209661+00:00",
    +                "modifier": null,
    +                "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +                "deleter": null,
    +                "deleted_time": null,
    +                "languages": [
    +                    "python"
    +                ],
    +                "tag": "TCA_Linux",
    +                "refer_scheme": null,
    +                "name": "默认",
    +                "description": null,
    +                "default_flag": true,
    +                "created_from": "web",
    +                "job_runtime_limit": 600,
    +                "ignore_merged_issue": false,
    +                "ignore_branch_issue": null,
    +                "ignore_submodule_clone": false,
    +                "ignore_submodule_issue": true,
    +                "issue_global_ignore": false,
    +                "daily_save": false,
    +                "lfs_flag": null,
    +                "issue_revision_merge_flag": false,
    +                "status": 1,
    +                "repo": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    查看指定代码库的指定扫描方案

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/basicconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "creator": {
    +            "username": "username",
    +            "nickname": "nickname",
    +            "status": 1,
    +            "avatar": null,
    +            "org": 1
    +        },
    +        "created_time": "2021-01-28 02:27:26.209661+00:00",
    +        "modifier": null,
    +        "modified_time": "2021-01-28 02:27:26.255023+00:00",
    +        "deleter": null,
    +        "deleted_time": null,
    +        "languages": [
    +            "python"
    +        ],
    +        "tag": "TCA_Linux",
    +        "refer_scheme": null,
    +        "name": "默认",
    +        "description": null,
    +        "default_flag": true,
    +        "created_from": "web",
    +        "job_runtime_limit": 600,
    +        "ignore_merged_issue": false,
    +        "ignore_branch_issue": null,
    +        "ignore_submodule_clone": false,
    +        "ignore_submodule_issue": true,
    +        "issue_global_ignore": false,
    +        "daily_save": false,
    +        "lfs_flag": null,
    +        "issue_revision_merge_flag": false,
    +        "status": 1,
    +        "repo": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/basicconf/
    +

    参数列表

    参数类型描述
    languageslist选填,代码语言
    tagstr选填,执行标签,目前只支持 CodeDog_Linux
    namestr必填,方案名称
    descriptionstr选填,方案描述
    default_flagbool选填,默认方案标志,一个代码库只能有一个默认方案
    job_runtime_limitint选填,任务执行超时时间,默认为600分钟
    ignore_merged_issuebool选填,忽略合入的问题
    ignore_branch_issuestr选填,过滤参考分支引入的问题
    ignore_submodule_clonebool选填,不拉取子模块扫描,True表示不拉取,False表示拉取
    ignore_submodule_issuebool选填,忽略子模块引入的问题,True表示忽略,False表示不忽略
    issue_global_ignorebool选填,问题全局忽略
    daily_savebool选填,每次扫描原始数据存储,默认存储7天
    lfs_flagbool选填,拉取lfs模块开关
    issue_revision_merge_flagbool选填,"是否开启Issue按引入版本号聚合开关
    statusint选填,方案状态,1表示活跃,2表示废弃

    返回结果

    查看指定代码库的指定扫描方案的返回结果一致

    查看指定代码库的扫描方案的代码扫描配置

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/lintconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "enabled": true,
    +        "checkprofile": {
    +            "id": 1,
    +            "profile_type": 1,
    +            "custom_checkpackage": 1,
    +            "checkpackages": [
    +                1
    +            ]
    +        },
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的代码扫描配置

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/lintconf/
    +

    参数列表

    参数类型描述
    enabledbool必填,是否开启代码扫描

    返回结果

    指定代码库的指定方案的代码扫描配置的返回结果一致

    查看指定代码库的扫描方案的代码度量配置

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "cc_scan_enabled": false,
    +        "min_ccn": 20,
    +        "dup_scan_enabled": false,
    +        "dup_block_length_min": 120,
    +        "dup_block_length_max": null,
    +        "dup_min_dup_times": 2,
    +        "dup_max_dup_times": null,
    +        "dup_min_midd_rate": 5,
    +        "dup_min_high_rate": 11,
    +        "dup_min_exhi_rate": 20,
    +        "dup_issue_limit": 1000,
    +        "cloc_scan_enabled": false,
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的代码度量配置

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    参数列表

    参数类型描述
    cc_scan_enabledbool选填,圈复杂度扫描开关
    min_ccnint选填,最小圈复杂度
    dup_scan_enabledbool选填,重复代码扫描开关
    dup_block_length_minint选填,重复块最小长度
    dup_block_length_maxint选填,重复块最大长度
    dup_max_dup_timesint选填,最大重复次数
    dup_min_midd_rateint选填,中风险最小重复率
    dup_min_high_rateint选填,高风险最小重复率
    dup_min_exhi_rateint选填,极高风险风险最小重复率
    dup_issue_limitint选填,上报重复代码块数上限
    cloc_scan_enabledboolean选填,代码统计扫描开关

    返回结果

    指定代码库的指定方案的代码度量配置的返回结果一致

    查看指定代码库的扫描方案的过滤路径列表

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/
    +

    返回结果

    {
    +    "data": {
    +        "count": 1,
    +        "next": null,
    +        "previous": null,
    +        "results": [
    +            {
    +                "id": 1,
    +                "dir_path": "test/*",
    +                "path_type": 1,
    +                "scan_type": 1,
    +                "scan_scheme": 1
    +            }
    +        ]
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    创建指定代码库的指定方案的过滤路径列表

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/
    +

    参数列表

    参数类型描述
    dir_pathstr必填,指定过滤路径
    path_typeint选填,路径格式,1表示通配符,2表示正则表达式,默认为通配符
    scan_typeint选填,扫描类型,1表示包含,2表示排除

    返回结果

    {
    +    "data": {
    +        "id": 13,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 36
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    查看指定代码库的扫描方案的指定过滤路径

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    返回结果

    {
    +    "data": {
    +        "id": 1,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 1
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 200
    +}
    +

    更新指定代码库的指定方案的指定过滤路径

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    参数列表

    参数类型描述
    dir_pathstr必填,指定过滤路径
    path_typeint选填,路径格式,1表示通配符,2表示正则表达式,默认为通配符
    scan_typeint选填,扫描类型,1表示包含,2表示排除

    返回结果

    {
    +    "data": {
    +        "id": 13,
    +        "dir_path": "test/*.py",
    +        "path_type": 1,
    +        "scan_type": 1,
    +        "scan_scheme": 36
    +    },
    +    "code": 0,
    +    "msg": "请求成功",
    +    "status_code": 201
    +}
    +

    删除指定代码库的指定方案的指定过滤路径

    DELETE /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/scandirs/<dir_id>/
    +

    返回结果

    + + + diff --git a/zh/community/changelog.html b/zh/community/changelog.html new file mode 100644 index 000000000..b0f192764 --- /dev/null +++ b/zh/community/changelog.html @@ -0,0 +1,33 @@ + + + + + + + + + 更新日志 | 腾讯云代码分析 + + + + +

    更新日志

    V1.4.1 (2022-7-28)

    Features

    • 【服务端】统一部署脚本,封装local、docker、docker-compose部署方式启动server&web&client
    • 【服务端】支持源码安装Redis与Nginx
    • 【服务端】macOS启动docker desktop
    • 【服务端】完善github action脚本
    • 【工具】更新工具列表

    Docs

    • 上传新版本白皮书
    • 调整快速入门指引文档

    V1.4.0 (2022-7-18)

    Features

    • 【客户端】jenkins插件增加分析方案模版ID和分析方案名称参数
    • 【服务端】增加扫描方案模板API
    • 【服务器】优化文件服务器鉴权交互
    • 【客户端】QuickScan支持指定分析方案模板进行扫描;支持从环境变量读取文件服务器url和token
    • 【Web端】升级moment依赖

    Docs

    • 更新插件使用说明书和启动参数说明

    V1.3.3 (2022-6-29)

    Features

    • 【服务端】支持团队、项目组禁用,支持代码库、分析项目删除
    • 【服务端】扫描方案支持分支过滤
    • 【Web端】支持禁用团队、项目,代码库登记支持ssh_url
    • 【Web端】支持分支过滤配置,修复代码统计文件选中效果,支持工具、依赖凭证移除
    • 【工具】增加tca_ql工具
    • 【客户端】节点模式不再由客户端加载编译工具的环境变量,避免覆盖机器原有环境变量
    • 【客户端】QuickScan模式,异常时输出task.log方便排查问题
    • 【客户端】.code.yml支持.yaml后缀

    Bugfixes

    • 【客户端】tool_scheme和ini配置共用时,可能出现工具重复,需要对工具库去重后再拉取

    Docs

    • 更新TCA Action相关文档
    • 更新Jenkins插件文档;增加环境依赖说明
    • 更新自定义工具文档,使用工具依赖
    • 更新CLS readme

    V1.3.2 (2022-6-16)

    Features

    • 【客户端】QuickScan根据语言执行不同的任务

    Docs

    • docker-compose部署文档中数据库注意事项

    V1.3.1 (2022-6-14)

    Features

    • 【客户端】新增merge quest分支增量扫描
    • 【客户端】新增Quickscan模式
    • 【客户端】localscan支持工具并发
    • 【工具】新增二进制文件依赖分析工具
    • 【服务端】server调整服务监控探测脚本:celery状态判断
    • 【服务端】增加子任务接口,完善部署脚本
    • 【服务端】更新CLS版本v20220613.1
    • 【服务端】基于 CentOS7.9.2009(已测)的运行环境一键安装脚本,并已安装及配置命令 gunicorn 和 celery
    • 【Web端】调整OAuth显示

    V1.3.0 (2022-6-7)

    Features

    • 【工具】新增独立工具Loong
    • 【工具】新增Java、JS基础安全规则包
    • 【工具】增加Go和Python技术安全规则包
    • 【服务端】新增oauth授权及工具依赖管理
    • 【服务端】docker-compose部署支持挂载本地日志目录
    • 【客户端】支持工具依赖管理
    • 【Web端】支持工具依赖管理设置和Git OAuth设置
    • 【Web端】团队列表支持滚动加载

    Bugfixes

    • 【服务端】补充scmproxy缺失依赖
    • 【服务端】修复issue入库忽略处理操作

    Docs

    • 更新工具目录readme
    • 更新client README.md

    V1.2.1 (2022-5-24)

    Features

    • 【工具】新增Collie/Compass(测试版)工具
    • 【工具】添加tscancode系列工具
    • 【工具】工具区分编译型和非编译型
    • 【客户端】更新cmdscm二进制文件,调整获取ssh端口号方式
    • 【客户端】增加腾讯工蜂作为工具拉取源,支持选用
    • 【服务端】调整工程配置和文档,支持https克隆
    • 【Web端】前端页面优化

    Docs

    • 添加集成工具说明文档
    • readme增加微信公众号和腾讯开源摘星计划的说明及链接
    • 修改帮助文档的脚本名称;修改工蜂镜像仓库链接位置
    • 调整自定义规则文档
    • 调整doc,优化部署、使用文档

    V1.2.0 (2022-4-27)

    Features

    • 【Web端】增加工具管理
    • 【工具】增加logback检查的安全规则
    • 【服务端】增加TCA server&web 一键部署脚本
    • 【服务端】删除main部分异步任务;调整server nginx启动位置
    • 【服务端】增加server健康监测

    Docs

    • 完善部署和Q&A文档
    • 上传工具列表

    V1.1.3 (2022-4-18)

    Features

    • 【工具】上传开源合规检查规则
    • 【工具】新增PHP安全相关规则
    • 【服务端】上线license鉴权
    • 【客户端】支持对工具license校验

    Docs

    • 更新文档内的工具默认路径
    • 增加任务分布式执行能力操作文档
    • 增加PR操作流程

    V1.1.2 (2022-4-2)

    Features

    • 【服务端】优化部署构建脚本

    Docs

    • 简化前端部署脚本&文档
    • 优化指引文档

    V1.1.1 (2022-3-31)

    Features

    • 【工具】增加0daychecker工具
    • 【工具】增加Log4j、LogBack漏洞检查规则包

    Docs

    • 完善部署文档说明,推荐使用Docker-Compose 2.3.3版本

    V1.1.0 (2022-3-29)

    Features

    • 【客户端】client支持arm64架构执行环境
    • 【客户端】client新增分布式节点模式
    • 【客户端】修改参数isTotal(是否开启全量扫描)判断方式及参数startCommand(启动客户端命令)拼接方式
    • 【服务端】支持任务分布式下发
    • 【服务端】完善基于minio的文件存储配置
    • 【Web端】调整文件资源引用地址
    • 【Web端】web模块部署脚本问题修复及优化
    • 【Web端】增加管理后台、增加在线分析
    • 【Web端】调整前端部署脚本,支持传递nginx配置地址、前端资源部署地址

    Bugfixes

    • Jenkins插件命令拼装逻辑修正

    Docs

    • 调整pypi下载失败提示
    • 调整前端部署文档及脚本
    • 更新License

    V1.0.1 (2022-03-01)

    Features

    • feat: 【服务端】调整代码库登记ssh url链接格式适配
    • feat: 【工具】上线支持PHP安全工具-Rips
    • feat: 【工具】调整androidlint部分规则描述
    • feat: 【客户端】上线Jenkins插件
    • feat: 【客户端】增加工具拉取可选配置项
    • feat: 【客户端】支持在命令行参数中输入团队编号和项目名称
    • feat: 【客户端】限制PYTHON_VERSION环境变量可选值
    • feat: 【客户端】增加在docker中快速使用client的方式

    Bugfixes

    • fix: 【服务端】补充缺失的依赖
    • fix: 【Web端】修复下载codedog.ini失败提示

    Docs

    • doc: 上线部署文档Q&A
    • doc: 优化部署文档、帮助文档说明
    • doc: 增加产品白皮书
    • doc: 补充redis和nginx源码安装参考文档

    V1.0.0

    初始发布

    + + + diff --git a/zh/community/contribute.html b/zh/community/contribute.html new file mode 100644 index 000000000..957619376 --- /dev/null +++ b/zh/community/contribute.html @@ -0,0 +1,33 @@ + + + + + + + + + 贡献指南 | 腾讯云代码分析 + + + + +

    贡献指南

    欢迎报告Issue或提交Pull Request。建议在贡献代码前先阅读以下贡献指南。

    报告问题

    我们使用Github Issues在新窗口打开来跟踪漏洞和功能请求。

    搜索已知issue

    在您提交新的issue前,请搜索现有issue以查看是否已有人提交任何类似问题或功能请求,确认不存在重复的issue。

    报告新issue

    当您提交新的issue时,请尽量提供更多的信息,例如与问题相关的详细描述、屏幕截图、视频、logcat和导致崩溃的代码块。

    Pull Request

    我们非常欢迎您提出Pull Request来帮助TCA变得更好,操作流程详见PullRequests操作流程

    分支管理

    TCA有两个主要分支:

    • main 分支:
      1. 它是最新的(预)发布分支。我们以 main 作为标签, 带有版本号 v1.0.1, v1.0.2 ...
      2. 请不要在 main 分支提交任何PR.
    • dev 分支:
      1. 这是我们稳定发展的分支。经过全面测试后, dev 分支将合并到 main 分支的下一个版本。
      2. 请您将修复漏洞或开发新功能的PR提交到 dev 分支。

    提交Pull Request

    代码团队将监控所有拉取请求,我们对其进行一些代码检查和测试。在所有测试通过后,我们将接受此PR。但它不会立即合并到 main 分支,这有一些延迟。

    在提交拉取请求之前,请确保完成以下工作:

    1. Fork TCA仓库在新窗口打开,并从 main 创建分支。
    2. 如果您更改了API,请更新代码或文档。
    3. 将版权声明添加到您添加的任何新文件的顶部。
    4. 检查您的代码样式。
    5. 测试您的代码,确保其可以正常运行。
    6. 现在,您可以向 dev 分支提交Pull Request。

    许可

    MIT LICENSE在新窗口打开 是 TCA 的开源许可证。任何人贡献的代码都受此许可证保护。在贡献代码之前,请确保您可以接受许可。

    + + + diff --git a/zh/community/joingroup.html b/zh/community/joingroup.html new file mode 100644 index 000000000..59fa36534 --- /dev/null +++ b/zh/community/joingroup.html @@ -0,0 +1,33 @@ + + + + + + + + + 加入社区 | 腾讯云代码分析 + + + + + + + + diff --git a/zh/community/pr.html b/zh/community/pr.html new file mode 100644 index 000000000..a72de7fdb --- /dev/null +++ b/zh/community/pr.html @@ -0,0 +1,35 @@ + + + + + + + + + PR操作流程 | 腾讯云代码分析 + + + + +

    Welcome

    PR全称为Pull Request,它是一种代码库的协作方式。开发者可以通过PR将自己在代码库的修改通知到代码库负责人,由原作者评审代码并决定是否能合入。

    提示

    Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

    PR操作流程

    一、Fork目标代码库

    fork

    点击Fork后,会在自己名下产生一个相同代码库,比如我Fork CodeAnalysis项目后,会在我名下多出一个CodeAnalysis代码库,地址为https://github.com/Lingghh/CodeAnalysis在新窗口打开

    二、克隆Fork的代码库并创建分支

    在本地克隆Fork的代码库并创建分支

    git clone https://github.com/Lingghh/CodeAnalysis
    +git checkout -b dev/add_qa_20220301
    +

    注:也可以在自己Fork的代码库GitHub页面上创建分支。

    fork1

    接下来就可以在本地修改代码,修改完成后先push到Fork的代码库中.

    三、在目标项目中提交PR

    1.进入到目标项目中,点击Pull requests Tab,再点击New pull request就会进入到创建PR的页面

    New pull request

    2.进入PR页面后

    • 点击compare across forks 。

    • 点击head repository 。

    • 选择自己Fork的代码库和比较的分支,比如我这里选择Lingghh/CodeAnalysis和待合入的分支dev/add_arm64_file 。

    • 最后确认commits和changed files是否准确,如果没有问题就可以点击Create pull request 。

      PR

    PR创建后,代码库管理员会评审你提交的代码,并决定是否接受该PR。

    更多信息请参阅GitHub PullRequest官方文档在新窗口打开

    TCA团队诚邀您的加入

    + + + diff --git a/zh/guide/index.html b/zh/guide/index.html new file mode 100644 index 000000000..0922e4b24 --- /dev/null +++ b/zh/guide/index.html @@ -0,0 +1,33 @@ + + + + + + + + + 腾讯云代码分析 | 腾讯云代码分析 + + + + +

    腾讯云代码分析

    腾讯云代码分析Tencent Cloud Code Analysis, TCA)起步于 2012 年(内部代号CodeDog),是集众多代码分析工具的云原生、分布式、高性能的代码综合分析跟踪管理平台,其主要功能是精准跟踪管理代码分析发现的代码质量缺陷、代码规范、代码安全漏洞、无效代码,以及度量代码复杂度、重复代码、代码统计。持续跟踪分析代码,观测项目代码质量,支撑团队传承代码文化。

    用心关注每行代码迭代,助力传承卓越代码文化!

    代码分析是通过词法分析、语法分析、控制流、数据流分析等技术对程序代码进行扫描,对代码进行综合分析,验证代码是否满足规范性、安全性、可靠性、可维护性等指标的一种代码分析技术。

    主要功能

    代码检查

    通过代码检查精准跟踪管理发现的代码质量缺陷、代码规范、代码安全漏洞、无效代码等。

    目前已集成众多自研、知名开源分析工具,并采用了分层分离架构,可以满足团队快速自助管理工具。

    代码度量

    包含代码圈复杂度、代码重复率和代码统计等度量信息。

    代码圈复杂度

    圈复杂度也称为条件复杂度或循环复杂度,它可以用来衡量一个模块判定结构的复杂程度。圈复杂度大说明程序代码的判断逻辑复杂,可能造成代码质量低下且难于测试和维护。

    定期分析工程项目中代码的圈复杂度,可以有效地帮助开发与测试逐步优化代码质量。

    代码重复率

    定期分析工程项目中的重复代码,可以有效地帮助开发发现冗余代码,进行代码抽象和重构,降低代码风险,以便于更好的管理和维护代码。

    代码统计

    支持全量增量展示代码行数统计,包含代码行、注释行和空白行,可以有效地跟踪了解工程项目中代码量持续变化,并可以查看各个语言的占比情况。

    + + + diff --git a/zh/guide/web/deploySource.html b/zh/guide/web/deploySource.html new file mode 100644 index 000000000..c1b93e479 --- /dev/null +++ b/zh/guide/web/deploySource.html @@ -0,0 +1,35 @@ + + + + + + + + + VM 部署文档 | 腾讯云代码分析 + + + + +

    VM 部署文档

    前置条件

    1. Linux 环境

    2. 系统已安装 nginx

    3. TCA Server 服务已部署完毕,具备后端服务地址

    部署步骤

    1. 进入前端部署源码目录

      进入web服务目录,并切换至tca-deploy-source目录,将其视为工作目录(假设工作目录为 /data/CodeAnalysis/web/tca-deploy-source

    2. 部署/更新前端服务

      # 部署、更新都使用此命令
      +sh ./scripts/deploy.sh init -d
      +

      具体请查阅部署脚本内容,可根据业务调整配置。

    3. 额外说明

      tca-deploy-source/scripts/config.sh 已配置默认环境变量,用户可根据需要调整环境变量再部署前端服务,具体可查阅脚本内容。

    + + + diff --git a/zh/guide/web/web.html b/zh/guide/web/web.html new file mode 100644 index 000000000..3f8db1b89 --- /dev/null +++ b/zh/guide/web/web.html @@ -0,0 +1,46 @@ + + + + + + + + + TCA Web | 腾讯云代码分析 + + + + +

    TCA Web

    工程结构

    TCA Web 采用 Lerna在新窗口打开 进行 monorepo 管理。

    frameworklogintca-layouttca-analysistca-manage微前端以及tca-document前端帮助文档组成。

    packages 目录说明

    • shared: 公共模块

    • framework: 微前端基座

    • login: 登录微前端

    • tca-layout: 腾讯云代码分析layout微前端

    • tca-analysis: 腾讯云代码分析analysis微前端

    • tca-manage: 腾讯云代码分析后台管理微前端

    • tca-document: 腾讯云代码分析帮助文档

    基于构建后资源部署(tca-deploy-source)

    已将当前版本各个微前端构建打包到此目录,可通过阅读该目录下的 README 直接进行前端部署。

    基于开发模式启动

    • 按上一节完成一套 TCA Web 部署

    • 根据要调整的内容,启动对应的微前端(login、tca-layout、tca-analysis),具体可进入不同 package 参考阅读其目录下的 README 进行开发。

    其他

    • 根目录下启动单个项目

      # framework
      +yarn dev --scope framework
      +# login
      +PUBLIC_PATH=http://127.0.0.1:5055/ yarn dev --scope login
      +# tca-layout
      +PUBLIC_PATH=http://127.0.0.1:5056/ yarn dev --scope tca-layout
      +# tca-analysis
      +PUBLIC_PATH=http://127.0.0.1:5057/ yarn dev --scope tca-analysis
      +# tca-manage
      +PUBLIC_PATH=http://127.0.0.1:5058/ yarn dev --scope tca-manage
      +# tca-document
      +yarn dev --scope tca-document
      +# 或进入对应项目内,查阅对应README
      +

    本地开发后构建部署

    • 如对项目进行变更,本地开发结束后,需要部署最新资源可通过执行 sh build-source.sh 将构建后资源更新到tca-deploy-source 目录内,再参考该目录下的 README 直接进行前端更新/重新部署操作。

    • 可通过阅读 build-source.sh 内容,以及 tca-deploy-source 目录下的 README,用户可根据需要自行进行前端部署。

    + + + diff --git "a/zh/guide/\344\270\252\344\272\272\344\270\255\345\277\203/\344\270\252\344\272\272\344\273\244\347\211\214.html" "b/zh/guide/\344\270\252\344\272\272\344\270\255\345\277\203/\344\270\252\344\272\272\344\273\244\347\211\214.html" new file mode 100644 index 000000000..8589850af --- /dev/null +++ "b/zh/guide/\344\270\252\344\272\272\344\270\255\345\277\203/\344\270\252\344\272\272\344\273\244\347\211\214.html" @@ -0,0 +1,33 @@ + + + + + + + + + 个人令牌说明 | 腾讯云代码分析 + + + + +

    个人令牌说明

    个人访问令牌可用于访问腾讯云代码分析 API在新窗口打开和启动客户端分析。

    个人令牌

    出于安全性考虑,腾讯云代码分析平台支持用户主动刷新个人Token。

    注意

    刷新Token后,需要更新所有用到旧Token的配置,并重启服务。

    可能需要更新的位置包括:

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html" new file mode 100644 index 000000000..e77a5fe83 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\210\206\346\236\220\347\273\223\346\236\234\346\237\245\347\234\213.html" @@ -0,0 +1,33 @@ + + + + + + + + + 代码检查结果查看 | 腾讯云代码分析 + + + + +

    代码检查结果查看

    代码分析完毕后,可在分支概览页面查看分析结果概览。如果分析方案含有代码检查功能,则会上报代码检查结果信息到腾讯云代码分析平台,用户可在平台上查看问题列表及问题详情。 问题列表

    问题列表

    问题列表

    进入代码检查问题列表页面后,默认展示当前分析项目发现的全部未处理问题。

    如果仅希望查看增量问题,可以进入分析历史页面,指定查看某一次的扫描结果即可。也可以在过滤筛选项中填入发现问题的扫描 id进行筛选查看结果(该id为扫描任务 ID,需要到扫描任务列表中查询)。

    • 责任人说明

      责任人为 git blame操作得到的代码提交人。

    • 问题级别说明

      代码检查的问题级别是根据对应分析方案中规则设置的严重级别定义的,从高到低分为 致命、错误、警告、提示 。如果调整问题级别,则需要进入分析方案中调整这个规则的严重级别,调整后需要进行全量扫描使得调整生效。

    • 批量处理说明

      问题列表支持批量修改问题状态。

      批量处理

    问题详情

    点击规则信息可以查看规则说明。

    查看规则详情

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/Error-Prone.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/Error-Prone.html" new file mode 100644 index 000000000..fc455f766 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/Error-Prone.html" @@ -0,0 +1,90 @@ + + + + + + + + + Error Prone 使用手册 | 腾讯云代码分析 + + + + +

    Error Prone 使用手册

    Error Prone 介绍

    Error Prone是google开源的Java编译时检测工具,将常见的Java错误捕获为编译时错误,增强对java代码的类型分析,从而让开发人员及时发现问题

    TCA使用指引

    TCA原有编译时检测工具JavaWarning获取java代码编译时的告警信息,现集成Error Prone规则至JavaWarning工具以增加获取Error Prone的错误告警信息。

    • 在规则包中添加JavaWarning工具的Error Prone规则(可通过规则解决方法进行区分);
    • 采用TCA Client模式,根据客户端环境配置工具和编译命令,详情参考下文;
    • 客户端启动分析,在TCA Web页面上查看问题。

    Error Prone 配置

    通过Bazel构建

    • Bazel在构建java项目时,默认打开了Error Prone,所以在本地配置Bazel环境,编写Bazel构建文件,bazel build :project构建项目即可。
    • 详情请参考Bazel官方文档在新窗口打开

    Maven 配置 Error Prone

    编辑pom.xml文件将设置添加到maven-compiler-plugin,例如:

    <build>
    +    <plugins>
    +      <plugin>
    +        <groupId>org.apache.maven.plugins</groupId>
    +        <artifactId>maven-compiler-plugin</artifactId>
    +        <version>3.8.0</version>
    +        <configuration>
    +          <source>8</source>
    +          <target>8</target>
    +          <encoding>UTF-8</encoding>
    +          <compilerArgs>
    +            <arg>-XDcompilePolicy=simple</arg>
    +            <arg>-Xplugin:ErrorProne</arg>
    +          </compilerArgs>
    +          <annotationProcessorPaths>
    +            <path>
    +              <groupId>com.google.errorprone</groupId>
    +              <artifactId>error_prone_core</artifactId>
    +              <version>${error-prone.version}</version>
    +            </path>
    +            <!-- Other annotation processors go here.
    +
    +            If 'annotationProcessorPaths' is set, processors will no longer be
    +            discovered on the regular -classpath; see also 'Using Error Prone
    +            together with other annotation processors' below. -->
    +          </annotationProcessorPaths>
    +        </configuration>
    +      </plugin>
    +    </plugins>
    +  </build>
    +

    对于JDK 16或更高的版本,需要将以下内容--add-exports--add-opens标志添加到.mvn/jvm.config文件中:

    --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
    +--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
    +--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
    +--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
    +

    ###命令行 Error Prone 支持com.sun.source.util.PluginAPI,并且可以通过将 Error Prone 添加到-processorpath并设置-Xplugin标志来与JDK 9及更高版本一起使用:

    wget https://repo1.maven.org/maven2/com/google/errorprone/error_prone_core/${EP_VERSION?}/error_prone_core-${EP_VERSION?}-with-dependencies.jar
    +wget https://repo1.maven.org/maven2/org/checkerframework/dataflow-errorprone/3.15.0/dataflow-errorprone-3.15.0.jar
    +javac \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
    +  -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
    +  -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
    +  -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
    +  -XDcompilePolicy=simple \
    +  -processorpath error_prone_core-${EP_VERSION?}-with-dependencies.jar:dataflow-errorprone-3.15.0.jar \
    +  '-Xplugin:ErrorProne -XepDisableAllChecks -Xep:CollectionIncompatibleType:ERROR' \
    +  Example.java
    +

    其他配置和注意事项

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-C1.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-C1.html" new file mode 100644 index 000000000..54ba9412e --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-C1.html" @@ -0,0 +1,118 @@ + + + + + + + + + TCA-Armory-C1 使用手册 | 腾讯云代码分析 + + + + +

    TCA-Armory-C1 使用手册

    TCA-Armory-C1 属于 TCA 的增强分析模块。

    功能

    • Objective-C/C++ 代码规范
    • C/C++/Java 代码安全

    准备

    规则介绍

    CmdInject

    概述

    支持的语言:Java

    CmdInject 规则用于检查代码中是否存在命令行注入漏洞在新窗口打开。 当使用 childprocess 等模块执行命令时,拼接了用户可控的输入,会导致命令执行漏洞。攻击者利用漏洞可以控制目标主机或者容器。

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String cmd = req.getParameter("cmd");
    +    Runtime rt = Runtime.getRuntime();
    +    rt.exec(cmd); // 触发规则
    +}
    +

    修复建议

    需要评估 childprocess 等模块执行命令的使用,应限定或校验命令和参数的内容。

    PathTraversal

    概述

    支持的语言:Java

    PathTraversal 规则用于检查代码中是否存在路径穿越漏洞在新窗口打开。 操作文件时,应该限定文件的路径范围,如果拼接用户输入到文件路径,可能导致路径穿越漏洞。攻击者利用漏洞可以访问到文件系统上的任意文件,这可能导致信息泄漏等问题。

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String image = req.getParameter("image");
    +    File file = new File("resources/images/", image); // 触发规则
    +
    +    if (!file.exists()) {
    +        return Response.status(Status.NOT_FOUND).build();
    +    }
    +
    +    return Response.ok().entity(new FileInputStream(file)).build();
    +}
    +

    修复建议

    按业务需求,使用白名单限定后缀范围,校验并限定文件路径范围。

    SQLInject

    概述

    支持的语言:Java

    SQLInject 规则用于检查代码中是否存在SQL注入漏洞在新窗口打开。 错误的拼接用户可控的值到 sql 语句,可能导致 sql 注入漏洞。攻击者可以修改 sql 语法来更改查询的目标或结果,泄露数据库敏感信息,也可以使用SQL文件操作攻击底层Web服务器。如果使用该 sql 查询进行授权认证,攻击者还可以用于提权。

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String id = req.getParameter("id");
    +    Connection conn = null;
    +    Statement statement = null;
    +    ResultSet rs = null;
    +
    +    Class.forName("com.mysql.cj.jdbc.Driver");
    +    conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/sec_sql", "root", "admin888");
    +    String sql = "select * from userinfo where id = " + id;
    +    statement = conn.createStatement();
    +    statement.executeUpdate(sql); // 触发规则
    +}
    +

    修复建议

    SQL 语句默认使用预编译并绑定变量,使用安全的ORM操作。

    SSRF

    概述

    支持的语言:Java

    SSRF 规则用于检查代码中是否存在服务端请求伪造漏洞 SSRF(Server-side request forgery)在新窗口打开。 攻击者在未能取得服务器所有权限时,利用服务器漏洞以服务器的身份发送一条构造好的请求给服务器所在内网。

    参数设置

    示例

    import org.springframework.context.annotation.Configuration;
    +import org.springframework.security.config.annotation.web.builders.HttpSecurity;
    +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
    +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
    +
    +@EnableWebSecurity
    +@Configuration
    +public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    +  @Override
    +  protected void configure(HttpSecurity http) throws Exception {
    +    http
    +      .csrf(csrf ->
    +        csrf.disable() // 触发规则
    +      );
    +  }
    +}
    +

    修复建议

    限定访问网络资源地址范围,请求网络资源应加密传输。

    XSS

    概述

    支持的语言:Java

    XSS 规则用于检查代码中是否存在跨站脚本攻击漏洞 XSS(Cross-site scripting)在新窗口打开。 如果 web 页面在动态展示数据时使用了用户的输入内容,没有对输入的内容过滤或者进行转义,黑客可以通过参数传入恶意代码,当用户浏览该页面时恶意代码会被执行。

    参数设置

    示例

    void bad(HttpServletRequest req, HttpServletResponse resp){
    +    String id = request.getParameter("id") != null ? request.getParameter("id") : "0";
    +    Doc doc = getdetailsById(id);    
    +    byte[] b = doc.getUploaded();        
    +    try {
    +        response.setContentType("APPLICATION/OCTET-STREAM");
    +        String disHeader = "Attachment;Filename=" + doc.getName();
    +        response.setHeader("Content-Disposition", disHeader);
    +        ServletOutputStream out = response.getOutputStream();
    +        out.print(b); // 触发规则
    +    }
    +}
    +

    修复建议

    在输出所有用户可控的数据时, 对数据做转义或者编码。

    概述

    检查 Objective-C/C++ 代码文件的copyright信息。

    参数设置

    示例

    // 触发规则
    +@interface Test : NSObject
    +@end
    +
    +

    修复建议

    在代码文件头部添加 Copyright 信息。比如:

    // Copyright (c) xxxx Tencent. All rights reserved.
    +//
    +
    +@interface Test : NSObject
    +@end
    +
    +

    ObjectiveC/Indent

    概述

    检查 Objective-C/C++ 代码文件的缩进。

    参数设置

    • IndentStyle: 可选 spaces 空格 和 tabs \t ,默认是 spaces;
    • IndentSize: 缩进长度,默认是4。

    参考以下示例:

    IndentStyle=spaces
    +IndentSize=4
    +

    示例

    for (int i = 0; i < 10; i++) {
    +  doThings(); // 触发规则
    +}
    +

    修复建议

    调整为对应的缩进方式。比如默认是4个空格缩进。

    for (int i = 0; i < 10; i++) {
    +    doThings(); // 触发规则
    +}
    +

    ObjectiveC/MaxLinesPerFunction

    概述

    检查 Objective-C/C++ 代码中超出行数长度阈值的函数。

    参数设置

    • LineThreshold: 方法长度阈值,默认是100。

    参考以下示例:

    LineThreshold=100
    +

    示例

    修复建议

    可以基于单一职责原则拆分函数,缩减函数长度。

    ObjectiveC/MissingDocInterface

    概述

    检查 Objective-C/C++ 代码中 interface 是否有注释信息。

    参数设置

    示例

    修复建议

    为 inferface 增加注释。

    ObjectiveC/MissingDocProperty

    概述

    检查 Objective-C/C++ 代码中 Property 是否有注释信息。

    参数设置

    示例

    修复建议

    为 Property 增加注释。

    ObjectiveC/MissingDocProtocol

    概述

    检查 Objective-C/C++ 代码中 Protocol 是否有注释信息。

    参数设置

    示例

    修复建议

    为 Protocol 增加注释。

    ObjectiveC/ParameterCount

    概述

    检查 Objective-C/C++ 代码中方法的参数个数是否超过阈值。

    参数设置

    • Max: 参数个数阈值,默认是6。

    参考以下示例:

    Max=6
    +

    示例

    无。

    修复建议

    参数个数越少越好,多于 6 个参数时建议考虑重构。

    ObjectiveC/ClassNaming

    概述

    检查 Objective-C/C++ 代码中 class 名称是否符合命名规范。

    参数设置

    • ClassCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 CamelCase。

    参考以下示例:

    ClassCase=CamelCase
    +

    示例

    无。

    修复建议

    修改 class 名称符合命名规范。

    ObjectiveC/FunctionNaming

    概述

    检查 Objective-C/C++ 代码中 Function 名称是否符合命名规范。

    参数设置

    • FunctionCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    FunctionCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Function 名称符合命名规范。

    ObjectiveC/GlobalVariableNaming

    概述

    检查 Objective-C/C++ 代码中 GlobalVariable 名称是否符合命名规范。

    参数设置

    • GlobalVariablePrefix: 全局变量前缀,默认是 g
    • GlobalVariableCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    GlobalVariablePrefix=g
    +GlobalVariableCase=camelBack
    +

    示例

    无。

    修复建议

    修改 GlobalVariable 名称符合命名规范。

    ObjectiveC/LocalVariableNaming

    概述

    检查 Objective-C/C++ 代码中 LocalVariable 名称是否符合命名规范。

    参数设置

    • LocalVariableCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    LocalVariableCase=camelBack
    +

    示例

    无。

    修复建议

    修改 LocalVariable 名称符合命名规范。

    ObjectiveC/MacroNaming

    概述

    检查 Objective-C/C++ 代码中 Macro 名称是否符合命名规范。

    参数设置

    • MacroCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 UPPER_CASE。

    参考以下示例:

    MacroCase=UPPER_CASE
    +

    示例

    无。

    修复建议

    修改 Macro 名称符合命名规范。

    ObjectiveC/MethodNaming

    概述

    检查 Objective-C/C++ 代码中 Method 名称是否符合命名规范。

    参数设置

    • MethodCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    MethodCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Method 名称符合命名规范。

    ObjectiveC/ParameterNaming

    概述

    检查 Objective-C/C++ 代码中 Parameter 名称是否符合命名规范。

    参数设置

    • ParameterCase: 命名格式,可选 CamelCase 首字母小写驼峰式、UPPER_CASE 全部大写、LOWER_CASE 全部小写、camelBack 首字母大写驼峰式,默认是 camelBack。

    参考以下示例:

    ParameterCase=camelBack
    +

    示例

    无。

    修复建议

    修改 Parameter 名称符合命名规范。

    ObjectiveC/MaxLineLength

    概述

    检查 Objective-C/C++ 代码中一行长度是否超过阈值。

    参数设置

    • tabWidth: 缩进宽度,默认是4;
    • MaxLineLength: 长度阈值,默认是150。

    参考以下示例:

    tabWidth=4
    +MaxLineLength=150
    +

    示例

    无。

    修复建议

    通过换行、优化逻辑等方式,缩减一行长度。

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-Q1.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-Q1.html" new file mode 100644 index 000000000..0126ed5f9 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-Q1.html" @@ -0,0 +1,399 @@ + + + + + + + + + TCA-Armory-Q1工具介绍 | 腾讯云代码分析 + + + + +

    TCA-Armory-Q1工具介绍

    TCA-Armory-Q1, 又名 tca_ql_cpp 主要用于分析Cpp质量问题。

    规则详情

    线程锁检查

    包含规则:

    • missing_lock
    • dead_lock

    在使用多线程对文件全局变量或类成员在进行读写时,工具会对未正确的进行上锁操作和上锁异常而引发死锁的情况进行检查。

    支持的多线程标准库库包括(若有其他库需求可提issue):

    • pthread
    • thread

    missing_lock

    missing_lock 如果发现多线程中某个全局变量在未持有锁便更新时,则会上报错误。

    代码示例

    以下提供一个或多个 missing_loc 案例 在下面代码中,函数 increase1, increase2 皆以将 counter 加到 1000 为目的。如果使用 increase1 函数则有可能多个线程皆在 1000 时进入循环导致最后 counter结果大于 1000

    int counter = 0;
    +std::mutex mtx;  // 保护counter
    +void increase1() {
    +    while (1) {
    +        if (counter <= 1000)
    +            counter++;  // defect: missing_lock
    +        else
    +            break;
    +    }
    +}
    +void increase2() {
    +    while (1) {
    +        mtx.lock();  // example_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx.unlock();  // example_release
    +    }
    +}
    +

    dead_lock

    dead_lock 如果发现文件内存在 mtx1 -> mtx2 的上锁顺序时,另存在mtx2 -> mtx1 的上锁顺序,视为死锁或存在死锁的可能,则会上报错误。 死锁发生时程序将会卡死无法正常执行。

    规则参数
    • better-lock: True or False 默认为 False
    代码示例

    以下提供一个或多个 dead_lock 案例

    在下面代码中,函数 increase 以将 counter 加到 1000 为目的。但在线程 1 中第一次释放 mtx 后,线程 2 的 mtx 上锁,此时线程1等待线程2释放mtx,线程2等待线程1释放mtx2,形成死锁,程序卡死。

    int counter = 0;
    +std::mutex mtx;
    +std::mutex mtx2;
    +void increase() {
    +    while (1) {
    +        mtx.lock();
    +        mtx2.lock();
    +        mtx.unlock();
    +        mtx.lock();  // defect: dead_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +

    在下面代码中 线程函数increase1存在mtx -> mtx2 的顺序,increase2顺序为 mtx2 -> mtx;视为出现死锁。

    void increase1() {
    +    while (1) {
    +        mtx.lock();
    +        mtx2.lock();
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +void increase2() {
    +    while (1) {
    +        mtx2.lock();
    +        mtx.lock();  // defect: dead_lock; 
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        mtx2.unlock();
    +        mtx.unlock()
    +    }
    +}
    +

    以下案例在better-lock参数为True时将会生效 使用better-lock规则会检查在上锁期间若调用其他函数时将视为可能会出现预期之外的异常,且上锁期间应只做对全局变量操作以提升性能

    void increase1() {
    +    while (1) {
    +        mtx.lock();
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        read_counter(counter);  // defect: dead_lock
    +        mtx.unlock()
    +    }
    +}
    +void read_counter(counter){
    +    std::cout << counter << std::endl;
    +    do_something_more();
    +}
    +void increase1() {
    +    while (1) {
    +        std::lock_guard<std::mutex> lk(mtx);  // good: 使用lock_guard会自动上锁解锁将不会检查dead_lock
    +        if (counter <= 1000)
    +            counter++;
    +        else
    +            break;
    +        read_counter(counter);
    +    }
    +}
    +

    资源泄漏检查

    包含规则

    • resource_leak

    resource_leak

    resource_leak 在程序申请了资源但并未按时释放时上报错误 目前场景包括:句柄打开时未关闭,指针分配内存后没有及时释放

    代码示例

    以下将提供一个或多个resource_leak案例

    int leak_example1(int c) {
    +    void *p = malloc(10); 
    +    if(c)
    +        return -1; // defect: if c "p" is leaked
    +    free(p);
    +    return 0;
    +}
    +
    +int leak_example2() {
    +    void *p = malloc(10);
    +    void *q = malloc(20);
    +    if(!p || !q)
    +        return -1; // defect: "p" or "q" may be leaked if the other is NULL 
    +    /*...*/
    +    free(q);
    +    free(p);
    +    return 0;
    +}
    +
    +void leak_example3(int c) {
    +    FILE *p = fopen("starwar.anakin", "rb");
    +    if(c)
    +        return;       // defect: leaking file pointer "p"
    +    fclose(p);
    +}
    +

    无效值检查

    包含规则

    • unused_value

    unused_value

    unused_value 检查那些赋予给变量的值是否正确被使用,存在连续两次赋予变量值的情况,视为第一次赋予的值未被正确使用,报出错误。 两次连续赋值可能存在条件控制语句出现错误、变量名拼写错误等情况。

    代码示例

    以下提供一个或多个unused_value案例

    以下函数会因为key的不同去不一样的神明,但实际上 Zeus Hades却永远不会使用到。

    const char* key_value(const int key) {
    +    const char * value = 0;
    +    if (key != 0) {
    +        value = "Zeus";
    +    } else if (key != 1) {
    +        value = "Hades";
    +    } 
    +    if (key != 2) { // Should be 'else if' here.
    +        value = "Poseidon";  // defect: unused_value Zeus Hades  never used
    +    }
    +    else {
    +        value = "Unknow
    +    }
    +    return result;
    +}
    +

    以下继续提供几个unused_value代码

    const char* key_value1(const int key) {
    +    const char * value = 0;
    +    value = "Zeus";  // defect: Zeus never used
    +    if (key == 1) {
    +        value = "Hades;
    +    } else if (key == 2) {
    +        value = "Poseidon";
    +    } else {  // May else need not be here
    +        value = "Unknow";
    +    }
    +    return value
    +}
    +
    +const char* key_value2(const int key) {
    +    const char * value = 0;
    +    value = "Zeus";  // better Zeus used
    +    if (key == 1) {
    +        value = "Hades;
    +    } else if (key == 2) {
    +        value = "Poseidon";
    +    }
    +    return value
    +}
    +
    +const char* key_value3(const int key) {
    +    const char * value = 0;
    +    if (key == 1) {
    +        value = "Hades;
    +    } else {
    +        value = "Poseidon";
    +    }
    +    value = "Zeus";  // defect: Hades Poseidon never used
    +    return value
    +}
    +

    数组溢出检查

    包含规则

    • array_overflow
    • buff_overflow

    array_overflow

    array_overflow 检查数组越界的情况。不正确的缓存区访问可能损坏内存,导致程序崩溃或读取到权限外的内存。

    代码示例

    以下提供一个或多个array_overflow案例

    void foo() {
    +    int array[10];
    +    int i = get();
    +    // i = 9;
    +    if (i > 8 && i <= length(array)) {  // Shoud be i < length(array)
    +        array[i] = 1;  // defect: array[10] overflow
    +    }
    +    array[i] = 1;  // defect: array[10] overflow
    +}
    +
    +
    +void test(int i) {
    +    int n= 10;
    +    char *p = malloc(sizeof(int) * 10);
    +    int y = n;
    +    p[y] = 'a'; // defect: writing to buffer[y] overflow
    +}
    +

    buff_overflow

    buff_overflow 检查strcpy,strcat字符串复制/拼接过程中长度不当导致的溢出, 同样gets scanf函数也视为不安全

    代码示例

    以下提供一个或多个buff_overflow案例

    void overflow1() {
    +
    +    char a[4]={0};
    +        strcpy(a, "Poseidon");  // defect: len("Poseidon") > 4 strncpy is better
    +    return;
    +}
    +
    +void overflow2() {
    +    char s1[10] = "1";
    +    char s2[] = "1234567890";
    +    strcat(s1, s2);  // defect: len(s1 + s2) > 10
    +    // strncat(s1, s2, 6)  // strncat is better
    +    return 0;
    +}
    +
    +

    指针检查

    包含规则

    • func_ret_null
    • func_ret_null_full
    • use_after_free
    • forward_null
    • reverse_null
    • glob_null_pointer

    func_ret_null

    func_ret_null 函数返回值可能为nullpointer,但是调用该函数时指针未经判空便进行使用
    在选用func_ret_null_full 时, 检查器会在项目内全局搜索空指针函数的调用情况,否则只会在相关文件内进行检查。

    代码示例

    以下提供一个或多个func_ret_null代码案例

    在下面代码中test函数中调用get_name可能返回空指针,在后续使用name指针前应该判断是否为空指针

    // name.hpp
    +
    +char* get_name(int id) {
    +    char* name = 0;
    +    if (id == 1) {
    +        name = "Zeus";
    +    } else if (id == 2) {
    +        name = "Hades"
    +    } else {
    +        return nullpointer;
    +    }
    +    return name;
    +}
    +
    +void test(int i) {
    +    char* name = get_name(i);
    +    dosomething(name);  // defect: name may nullpointer should check it
    +    if (name != nullpointer) {
    +        dosomething(name);  // good
    +    }
    +}
    +
    +

    在选用full_ret_null_full时,将会全局分析函数get_name调用情况

    // third.cpp
    +# include "name.h"
    +
    +void name_test(int i) {
    +    char* name = get_name(i);
    +    dosomething(name); // defect
    +}
    +

    use_after_free

    use_after_free 检查当指针已经被释放但在后续仍然使用该指针的情况。

    代码示例

    以下提供一个或多个use_after_free代码案例

    通常情况下已经释放的指针只允许置空或重新指向新的值,不允许存在读取或作为函数参数使用。

    
    +void UAR() {
    +    int* p = new int[];
    +    p = get_array();
    +    dosomething(p);
    +    delete p;
    +    p = NULL;  // allow
    +    p = get_array();  // allow: get array again
    +    delete p;
    +    dosomething(p);  // defect: use as param
    +    std::cout << "p[0] = " << p[0] << std::endl;  // defect: read p
    +}
    +

    forward_null

    forward_null 检查可能导致程序终止或运行时异常的错误。它查找指针或引用被检查是否为 null 或被赋值为 null,且之后被解引用的很多情况。

    规则参数
    • trust_param True or False 默认为 True
    代码示例

    以下提供一个或多个forward_null代码案例

    指针曾经有过检查null的操作则会视为有可能为空指针,之后在未被确认为非空指针情况下直接使用。将会视为forward_null错误

    void forward_null_1() {
    +    int * p;
    +    p = get_int_pointer();
    +    dosomething(p);
    +    if (p == NULL) {
    +        std::cout << "Null Pointer Find" << srd::endl;
    +        // return;      // prefer: if return here
    +    } else {
    +        dosomething(p);     // good: p is not NULL
    +    }
    +    dosomething(p);     // defect forward_null: p may NULL
    +}
    +
    +
    +void forward_null_2(int *p) {
    +    dosomething(p);
    +    if (p == NULL) {
    +        return;
    +    } else {
    +        dosomething(p);     // good: p is not NULL
    +    }
    +    dosomething(p);     // good
    +    ...
    +    if (p != NULL) {    // means p may nullpointer here
    +        dosomething(p);
    +    }
    +    dosomething(p);     // defect forward_null:p may NULL
    +}
    +

    以下案例在设置trust_paramFalse时将会生效,其将会默认认为函数参数存在空指针可能,必须确认无空指针可能时方可使用

    void forward_null_2(int *p) {
    +    dosomething(p);     // defect: param p may NULL
    +    if (p != NULL) {    // means p may nullpointer here
    +        dosomething(p);
    +    }
    +    dosomething(p);     // defect forward_null:p may NULL
    +}
    +

    reverse_null

    reverse_null 检查已经使用过指针,但在后续又对指针进行了判空操作;会被认为之前使用指针也有可能是空指针。

    代码示例

    以下将提供一个或多个reverse_null案例

    void reverse_null(int *p) {
    +    dosomething(p);      // use p
    +    if (p != NULL) {    // defect reverse_null: It means p may NULL
    +        dosomething(p);
    +    }
    +    ...
    +

    glob_null_pointer

    glob_null_pointer 检查文件内全局指针是否为空,指针赋值将会被认为不为空指针,但检测到空指针判断则视为指针此时可能为空,如果在可能为空时使用则会报错

    代码示例

    以下将提供一个或多个glob_null_pointer案例

    int *p;
    +
    +
    +void thread1() {
    +    p = get_int_pointer();      // p is not NULL
    +    dosomething(p);     // good
    +    if (p != NULL) {
    +        something(p);   // good
    +    }
    +    something(p);  // defect: p may NULL, because check p before
    +}
    +
    +
    +void thread2() {
    +    *p = 6;     // defect: p may NULL
    +    if (p != NULL) {
    +        something(p);   // good
    +    }
    +    something(p);  // defect: p may NULL
    +}
    +

    函数重写

    包含规则

    • function_override

    仅类虚拟函数允许重写。

    function_override

    function_override 检查非虚拟函数重写的情况。

    代码示例

    以下提供一个或多个function_override代码案例

    
    +
    +class father{
    +    public:
    +        father(){};
    +        ~father(){};
    +    
    +    private:
    +        virtual void test(){};
    +        void test2(){ std::cout<<"hello";};
    +};
    +
    +class man{};
    +
    +
    +class son: public father, public man{
    +    public:
    +        son(){};
    +        ~son(){};
    +    private:
    +        void test(){ std::cout<<"hello";};  // allow: virtual function override
    +        void test2(){ std::cout<<"hello";};  // defect: bad override
    +};
    +

    死代码检查

    dead_code

    dead_code 检查永远不会执行到的代码,主要为在同一作用域内 return, break 后的代码

    代码示例

    以下提供一个或多个dead_code代码案例

    // C/Cpp
    +void dead_code(int t) {
    +    int sum = 0;
    +    for (int i = 1; i <= 100; i++) {
    +        if (i == t) {
    +            break;
    +            sum = t;    // Defect: dead_code
    +        }
    +        sum += i;
    +    }
    +}
    +

    dead_branch

    dead_branch 检查永远不会被执行到的分支代码,其原因可能是具有相同效果的控制语句或某些条件在特定情况下永远不会执行。

    代码示例

    以下提供一个或多个dead_branch代码案例

    
    +void dead_branch(int i) {
    +    if (i < 100) {
    +        if ( i > 100) {     // Defect: dead_branch, i 属于 (-inf, 100) 不存在 (100, inf)的可能
    +            dosomething() ;
    +        }
    +        return;
    +    } else if (i >= 100) {
    +        if ( i < 99 ) {     // Defect: dead_branch, i 属于[100, inf) 不存在 (-inf, 99)的可能
    +            dosomething();
    +        }
    +        return;
    +    } else if (i < 10){     // Defect: dead_branch, 在前面分支中已经包含了所有i的可能,这里已经不存在 (-inf, 10)的可能
    +        dosomething();
    +    }
    +    else {                  // Defect: dead_branch, 在前面分支中已经包含了所有i的可能
    +        dosomething();
    +    }
    +    return;
    +}
    +
    +

    变量初始化检查

    包含规则

    • uinit

    uinit

    uinit 检查变量在定义后直接使用,却没有初始化的场景;使用未初始化的变量 可能导致无法预测的行为、崩溃和安全漏洞。

    规则参数
    • deep_level: true, false 设置为true时将会分析作为函数参数的情况,否则无视作为函数参数的使用。
    代码示例

    以下提供一个或多个 uinit 代码案例

    
    +void test(char* t) {
    +    std::cout<< t << std::endl;     // Defect: p 作为函数参数,此处未初始化。
    +    return;
    +}
    +
    +
    +int uinit(int i) {
    +    int a;
    +    char * p;
    +    test(p);    // deep_level = true
    +    if (i < 10)
    +        a = 1;
    +    else
    +        i = 1;
    +    return a;   // Defect: i大于10时,a并未赋值
    +}
    +
    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-R.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-R.html" new file mode 100644 index 000000000..110152bff --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/TCA-Armory-R.html" @@ -0,0 +1,33 @@ + + + + + + + + + TCA-Armory-R 使用手册 | 腾讯云代码分析 + + + + +

    TCA-Armory-R 使用手册

    TCA独立工具TCA-Armory-R,别名RegexScanner,正则匹配工具,支持扫描文件名称和文本内容,支持页面直接自定义创建规则

    适用场景

    • 检测项目中的文件名,比如漏洞文件log4j-core-2.10.1.jar
    • 检测代码文件中的文本内容,比如高危函数vsscanf
    • 检测配置文件中的文本内容,比如账号密码明文

    对比RegexScan、RegexFileScan

    • 单个工具即可完成文件名和文件内容的检查
    • 扫描速度更快,大概减少60%的耗时
    • 单条规则内支持多条正则表达式
    • 支持正则过滤
    • 支持匹配分组和熵检测
    • 只支持go的正则语法在新窗口打开

    快速接入

    以下是接入步骤:

    1. 属于增强分析模块,需要先部署CLS
    2. 在代码分析创建项目,自定义规则包里添加想要进行扫描的TCA-Armory-R规则
    3. 启动分析即可

    自定义规则

    1. 开放支持自定义规则权限

    开放支持自定义规则权限,需平台管理员在管理入口-工具管理中找到TCA-Armory-R工具,并将其权限状态调整为支持自定义规则

    规则权限详见自定义规则权限说明

    2. 添加规则

    进入工具管理入口,进入TCA-Armory-R工具页面,选择上方的“自定义规则”,然后点击“添加规则”:

    添加自定义规则

    3. 填写规则信息

    进入“创建规则”页面,按照需求填写相关信息,完成后,点击页面最后的“确定”按钮提交。

    规则示例:

    规则扫描场景:扫描代码中的 github token,如果token以明文形式写在源码文件中,会造成隐私泄露,可能造成严重的安全事故。

    正则表达式:匹配 github token 字符串,根据github token的一般形式,可以推断出正则表达式 ((ghp|gho|ghu|ghs)_[0-9a-zA-Z]{36})。

    提示

    只支持go正则语法: regexp在新窗口打开

    建议先测试好正则表达式是否正确,正则表达式测试网站推荐:http://tool.oschina.net/regex

    填写自定义规则

    字段解释

    规则名称、前端展示名称:建议使用单词首字母大写的格式,如 DetectedGithubToken

    规则简述:作为扫描出来到问题标题

    规则参数:

    提示

    规则参数中的(3)(4)(5)属于新功能,需要将客户端client和工具库TCA-Armory更新到最新版本

    • (1) 参数格式类似ini的格式, 也就是key = value的格式

    • (2) [必选] regex 参数,用于指定扫描的正则表达式,例如: regex=((ghp|gho|ghu|ghs)_[0-9a-zA-Z]{36})只支持go正则语法: regexp在新窗口打开。建议先测试好正则表达式是否正确,正则表达式测试网站推荐:http://tool.oschina.net/regex在新窗口打开

    • (3) [可选] regex{N} 参数,只有在已有regex参数情况下生效,用于扩展扫描的正则表达式,其中 N 从1开始计数,例如: regex1=EAAAACZAVC6ygB[0-9A-Za-z]+, regex2=EAAAAZAw4[0-9A-Za-z]+regex{N}regex的表达式均为关系,每一个匹配结果上报一个问题。

    • (4) [可选] regex_not 参数,用于指定正则过滤表达式,例如: regex_not=(?i)example。可以对(2)(3)中regex匹配的字符串进行筛选,如果匹配则过滤该结果,不予上报。

    • (5) [可选] regex_not{N} 参数,只有在已有regex_not参数情况下生效,用于扩展正则过滤表达式,其中 N 从1开始计数,例如: regex_not1=(?i)test, regex_not2=(?i)fakeregex_not{N}regex_not的表达式均为关系。

    • (6) [必选] msg 参数,用于展现issue说明, 例如: msg=检测到高危函数%s,建议替换。

      • msg中的“%s”使用regex中的group(用“()"括起来的部分)一一匹配,单个%s默认为整个regex匹配的字符串

      • 如果regex没有定义group,则msg最多有一个%s, 并由整个regex匹配的字符串替代

      • 如果msg里没有包含“%s”,则直接显示msg

      • 如果msg没有提供,则会给出默认信息

    • (7) [可选] ignore_comment 参数,用于指定是否忽略注释代码,可选值:True、true、False、false 。例如: ignore_comment=True, 默认是False

    • (8) [可选] file_scan 参数,用于指定是否扫描文件名称,可选值:True、true、False、false 。例如: file_scan=True, 默认是False

    • (9) [可选] include 参数,用于指定只扫描的文件匹配范围,基于相对路径,使用通配符格式,多项使用英文分号(;)隔开。例如: include=src/test;src/main.*;*.cpp

    • (10) [可选] exclude 参数,用于指定不扫描的文件匹配范围,格式同include参数,例如: exclude=tests;*.json

      路径过滤(exclude, include)采用Glob-Style的匹配模式,详见 Go-filepath-Match在新窗口打开, 除了 ** 用来匹配零或多个目录,本工具会默认匹配前后目录。举例:

      1. exclude=*.py 会忽略以下文件: main.py, src/main.py, main.py/install.sh
      2. exclude=tests 会忽略以下文件: tests/test.py, a/tests/b/test.py
      3. include=main.* 会只扫描以下文件: src/main.py, app/main.go
      4. include=srcexclude=src/lib 会只扫描以下文件: src/main.py, src/project/proj.py; 忽略以下文件: src/lib/lib.py, src/lib/package/pack.js
    • (11)[可选] match_group 参数,用于指定正则匹配的分组,数值不能大于正则匹配分组数,例如: regex=(aws_account_id)\s{0,50}(:|=>|=)\s{0,50}([0-9]{12})match_group=3,匹配到第3个分组([0-9]{12})

    • (12)[可选] entropy 参数,用于指定正则匹配结果的最小信息熵,例如:entropy=3,熵不大于3的匹配结果将被过滤

      信息熵:熵(信息论)在新窗口打开 可用于敏感信息(密钥、token)的检测 含义:可以理解为字符串的混乱程度,字符越随机,熵越大。因此,设置合适的熵,可以过滤掉一些误报或者人为测试用例。

    4. 将自定义规则添加到项目分析方案中

    进入 代码分析 - 分析方案 - 代码检查 - 自定义规则包 - 查看详细规则,添加规则。

    点击自定义规则包

    添加规则

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/eslint.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/eslint.html" new file mode 100644 index 000000000..230ba978d --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/eslint.html" @@ -0,0 +1,36 @@ + + + + + + + + + Eslint 使用手册 | 腾讯云代码分析 + + + + +

    Eslint 使用手册

    代码分析支持 Eslint 分析,并支持用户自由扩展配置。

    适用场景

    目前 TCA-Eslint 的适用场景很广,灵活扩展:

    • JavaScript
    • TypeScript
    • React
    • Vue
    • Google 代码规范分析
    • 其他,包括项目自己维护的 Eslint 配置

    快速接入

    以下是接入步骤:

    1. 在代码分析创建项目,会自动匹配 JavaScript 或者 TypeScript 对应的推荐规则集
    2. 启动分析即可

    高级配置

    基础概念

    在进行高级配置之前,这里先普及下代码分析这边的基础概念——Eslint 类型。 由于 JavaScript 语法、 Vue 语法和 TypeScript 语法之间的区别,三者使用的语法解析器也是不一样的,这里基于其使用的语法解析器的不同,从 Eslint 中拆分出来了 Eslint_vue 和 Eslint_typescript 工具。可以根据需要选择对应工具下的规则进行分析。而配置也会基于类型的不同匹配到对应的工具中。 目前代码分析上 Eslint 类型有:

    • JAVASCRIPT 分析 JavaScript 以及基于 JavaScript 写的 React 代码,默认分析文件后缀名为.js,.jsx
    • VUE 分析 Vue 框架的代码,默认分析文件后缀名为.vue
    • TYPESCRIPT 分析 TypeScript 以及基于 TypeScript 写的 React 代码,默认分析文件后缀名为.ts,tsx

    设置 Globals

    因为项目会用到各式各样的框架,其中会有全局变量是 Eslint 无法识别到的,比如 _ 或者 jtest,从而导致分析出不少误报。这里支持使用下面环境变量设置这些全局变量,减少误报。可以在代码分析项目中设置对应的环境变量。

    环境变量名称描述
    ESLINT_JAVASCRIPT_GLOBALS字符串,以分号分割
    ESLINT_VUE_GLOBALS字符串,以分号分割
    ESLINT_TYPESCRIPT_GLOBALS字符串,以分号分割

    比如:

    ESLINT_JAVASCRIPT_GLOBALS=_:readonly;jtest:readonly
    +

    其中,

    • writable 表示允许重写变量
    • readonly 表示不允许重写变量
    • off 表示禁用该全局变量

    指定参数配置文件

    代码分析执行 Eslint 分析,默认会使用 Alloy Team 的 Eslint 配置来分析,但是也支持修改配置。

    1. 在代码库中创建一个参数配置 Json 文件,结果类似 Eslint 的 Json 配置文件
    2. 在代码分析项目设置下面对应环境变量,指向这个参数配置文件 指定了参数配置文件之后,Eslint 分析时候就会自动将代码分析默认的配置与该参数配置文件进行合并。
    3. 启动全量分析即可
    环境变量名称描述
    ESLINT_JAVASCRIPT_OPTIONS字符串,相对代码库根目录路径
    ESLINT_VUE_OPTIONS字符串,相对代码库根目录路径
    ESLINT_TYPESCRIPT_OPTIONS字符串,相对代码库根目录路径

    指定 Eslint 配置文件

    代码分析也支持用户指定自己维护的 Eslint 配置文件进行分析。

    环境变量名称描述
    ESLINT_JAVASCRIPT_CONFIG字符串,相对代码库根目录路径
    ESLINT_VUE_CONFIG字符串,相对代码库根目录路径
    ESLINT_TYPESCRIPT_CONFIG字符串,相对代码库根目录路径

    设置配置类型

    代码分析自带支持 Google 代码规范,可以在代码分析项目设置对应环境变量,使用对应的配置文件。

    环境变量名称描述
    ESLINT_JAVASCRIPT_CONFIG_TYPE字符串, google,default,custom
    ESLINT_VUE_CONFIG_TYPE字符串, 可选:default,custom
    ESLINT_TYPESCRIPT_CONFIG_TYPE字符串, 可选:default,custom

    其中:

    • google,表示使用 google 代码规范配置文件
    • default,表示使用代码分析维护的配置文件
    • custom,表示使用项目代码库中 Eslint 配置文件

    配置优先顺序

    这里介绍 TCA-Eslint 的配置使用顺序:

    1. 优先检查是否设置对应的 ESLINT_CONFIG 环境变量,比如 ESLINT_JAVASCRIPT_CONFIG
    2. 然后检查是否设置对应的 ESLINT_CONFIG_TYPE 环境变量,比如 ESLINT_JAVASCRIPT_CONFIG_TYPE
    3. 若是 JAVASCRIPT 类型的项目,会自动检测代码库根目录下是否有 ESLINT 配置文件,若有则使用该配置文件进行分析,其他类型的项目便不会有这一步
    4. 使用代码分析维护的 Alloy Team 的配置文件进行分析

    分析路径配置

    可以在代码分析页面上设置分析路径设置,这里建议多使用 Exclude 设置,因为 Eslint 工具本身对 include 支持不友好。

    Q&A

    Q:JavaScript 内存溢出

    A:Eslint 执行可能会出现 Js 内存溢出,以下有三种方案可以解决:

    • 可以设置环境变量 NODE_OPTIONS,比如
    NODE_OPTIONS="--max-old-space-size=4096"
    +
    • 设置环境变量 ESLINT_MAX_OLD_SPACE_SIZE,比如
    ESLINT_MAX_OLD_SPACE_SIZE=4096
    +
    • 设置分析路径过滤,将无用的文件进行过滤

    Q:一个配置同时分析 JS 和 TS

    A:若代码库中既有 JavaScript 代码,又有 TypeScript 代码,并且共用一个配置文件。 若规则集中既有 Eslint 规则又有 Eslint_typescript 规则,为了避免执行两次 Eslint 以及可能出现重复单的情况,并且因为 Eslint_typescript 的语法解析器也能够解析 JavaScript 代码,所以这里将这样的项目当作 TypeScript 项目。

    1. 这里建议只指定 ESLINT_TYPESCRIPT_CONFIG 环境变量
    2. 规则集中剔除 Eslint 的规则,只保留 Eslint_typescript 规则。
    3. 并指定 ESLINT_TYPESCRIPT_EXT=.js,.jsx,.ts,.tsx

    Q:找不到依赖

    A:用户自己配置的配置文件中,可能会用到代码分析没有管理到的规则插件,导致分析时候找不到对应的依赖,这里有两个方案提供解决:

    • 在代码库根目录下 npm 安装对应插件,并设置分析路径过滤 node_modules

    Q:custom 与指定配置文件的区别

    A:- custom 模式,会检测代码库中的 Eslint 配置文件进行分析,包括子目录和代码注释中设置的配置,都是可以生效的。

    • 相对的,指定配置文件的方式,只会对指定的配置文件中的配置会生效。
    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/golangcilint.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/golangcilint.html" new file mode 100644 index 000000000..00d87d1c0 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\345\267\245\345\205\267/golangcilint.html" @@ -0,0 +1,36 @@ + + + + + + + + + Golangcilint 使用手册 | 腾讯云代码分析 + + + + +

    Golangcilint在新窗口打开 使用手册

    对比 GoMetaLinter

    Golangci-lint 是为了解决 GoMetalinter 的弊端而改版升级的。

    1. 比 GoMetaliner 快个 2 到 7 倍

    2. 共享代码缓存,消耗内存比 Gometaliner 少 26%

    3. 更精准的 issue,会内置一些 exclude 列表过滤掉误报 issue

    4. 支持增量分析

    快速接入

    1. 在 CI 系统上选用 TCA 插件,或者下载 TCA 客户端到本地机器上

    2. 因为 GolangCiLint 要求找寻到项目需要的全部依赖,否则就会执行失败。所以这里需要在 Ci 系统或者本地机器上配置好项目的依赖,并确保能够编译通过

    3. 检查是否设置了 GOPATH 和 GOROOT,在分析方案的环境变量中设置 GOPATH=$GOPATH

    4. 在 代码分析 页面上关联待分析的代码库并创建分析方案,并在代码检查-规则设置的自定义规则包里面添加 GolangCiLint 工具规则

    5. 在分析方案中增加编译命令

    6. 然后在 CI 系统上或者本地启动代码分析即可

    高级配置

    Include

    若项目目录结构如下图,需要设置 include 执行 myproj,比如 src/myproj/*

    这是因为 GolangCiLint 分析前会优先检查所有代码文件的依赖是否齐全,所以需要设置 include,让工具只关注 include 下面的代码文件的依赖。

    在分析方案的过滤配置,路径过滤中添加 include 路径。

    include

    Q&A

    • Q:出现 no go files to analyze 问题

      A:这里可能为以下原因:

      1. 机器环境没有项目的完整依赖,使用以下命令查找对应依赖在 GOPATH 下是否存在或者 GOPATH 设置是否完整(有的项目有多个 GOPATH 内容),或者对应依赖是否存在,需要用户部署好机器环境

        grep -nr "path/to/GOPATH" .
        +
      2. 没有指定 include 分析路径过滤,这样才不会检查依赖中的依赖,而是关注源码文件的依赖完整性

      3. 也可能是某 go 文件中使用到该依赖,但是 GOPATH 没有设置正确的依赖搜索路径导致。需要找到依赖相对的当前目录:

        grep -nr "path/to/GOPATH" .
        +

        然后设置到 GOPATH 中,比如

        GOPATH=$GOPATH:$SOURCE_DIR/test
        +
      4. 还有可能是部分依赖是需要编译之后生成的,需要正确填写好编译命令,使得项目编译成功。

    • Q:could not determine GOARCH and Go compiler 问题

      A:跟问题 1 是一样的问题。解决方案也是一样。

    • Q:failed to run 'go env': exit status 1 问题

      A:原因是找不到正确的 GOPATH。解决方案是设置 GOPATH 环境变量。

    • Q:GO 版本限制

      A:因为 golangci-lint 用到了 go mod 特性,该特性是在 1.11 之后才有的。所以要求 go 版本在 1.11 版本以上。

      go版本限制

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html" new file mode 100644 index 000000000..eaf9b0659 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\346\267\273\345\212\240\350\247\204\345\210\231\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 添加规则配置 | 腾讯云代码分析 + + + + +

    添加规则配置

    规则配置是代码检查应用的规则集合,用于指定用哪些工具和规则进行代码分析扫描。目前,TCA 提供了覆盖代码规范安全扫描风格检查等方面的官方推荐规则包。

    官方推荐规则包是TCA长期以来在业务中实践的经验结果,将相关的有效性高的工具和规则打包在一起。业务可以根据需要选择官方推荐规则包。也可以在自定义规则包中添加希望的工具和规则。

    提示

    规则配置 = 自定义规则包 + 官方规则包

    自定义规则包中的规则配置会默认覆盖其他官方包中相同规则的配置

    添加规则配置

    可以单选或者批量多选规则 添加规则配置

    也可以根据搜索框进行多维度查询 添加规则配置

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/code_spec_oc.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/code_spec_oc.html" new file mode 100644 index 000000000..1f4594eb6 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/code_spec_oc.html" @@ -0,0 +1,34 @@ + + + + + + + + + 【Objective-C】代码规范规则包 | 腾讯云代码分析 + + + + +

    【Objective-C】代码规范规则包

    该规则包针对 Objective-C/C++ 语言进行代码规范相关检查。

    规则列表

    启用规则包

    分析方案 -> 代码检查 ->【Objective-C】代码规范规则包 -> 启用/查看规则。

    格式化工具

    为了帮助你正确地格式化代码,我们建议你使用clang-format进行代码自动格式化。工具可直接通过 Homebrew 进行安装:

    brew install clang-format
    +

    安装完成后将 .clang-format 配置文件置于工程根目录,执行 clang-format -i FILE.m 即可完成自动格式化。目前格式化工具配置仅支持11.0版本。

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/cpp_doc.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/cpp_doc.html" new file mode 100644 index 000000000..119bcbe3c --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/cpp_doc.html" @@ -0,0 +1,33 @@ + + + + + + + + + 【C/C++】代码质量缺陷规则包 | 腾讯云代码分析 + + + + +
    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/dependency_vul.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/dependency_vul.html" new file mode 100644 index 000000000..0e98da238 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/dependency_vul.html" @@ -0,0 +1,71 @@ + + + + + + + + + 依赖漏洞扫描规则包 | 腾讯云代码分析 + + + + +

    依赖漏洞扫描规则包

    概述

    该规则包可分析项目依赖组件,以及依赖组件中是否存在漏洞等问题。辅助开发者准确分析到依赖组件的安全性,选用安全可靠的依赖组件。

    规则包中将漏洞规则分为“低危漏洞”、“中危漏洞”、“高危漏洞”三个等级,扫描出有漏洞的组件,TCA会提供问题组件名称和版本、漏洞情况介绍,以及可用的修复版本(如获取到)。

    已支持语言:C/C++、C#、Go、Java、JavaScript、PHP、Python、Ruby、Scala、TypeScript等。

    示例

    <?xml version="1.0" encoding="UTF-8"?>
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    +
    +    <parent>
    +        <groupId>org.javaweb.vuln</groupId>
    +        <artifactId>javaweb-vuln</artifactId>
    +        <version>3.0.3</version>
    +    </parent>
    +
    +    <dependencies>
    +
    +        <dependency>
    +            <groupId>org.apache.struts</groupId>
    +            <artifactId>struts2-core</artifactId>
    +            <!-- 触发规则  -->
    +            <version>2.1.8</version>
    +            <exclusions>
    +                <exclusion>
    +                    <groupId>org.freemarker</groupId>
    +                    <artifactId>freemarker</artifactId>
    +                </exclusion>
    +
    +                <exclusion>
    +                    <groupId>org.springframework</groupId>
    +                    <artifactId>spring-test</artifactId>
    +                </exclusion>
    +
    +                <exclusion>
    +                    <groupId>commons-fileupload</groupId>
    +                    <artifactId>commons-fileupload</artifactId>
    +                </exclusion>
    +            </exclusions>
    +        </dependency>
    +
    +    </dependencies>
    +
    +</project>
    +

    快速体验

    TCA 现已支持依赖漏洞扫描规则包,可以在 TCA 分析方案中搜索勾选该规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 ->【Objective-C】代码规范规则包 -> 启用/查看规则。

    更多

    更多场景支持,欢迎提 issue 进行咨询扩展。

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/enhanced_safety_java.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/enhanced_safety_java.html" new file mode 100644 index 000000000..e4f29b779 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/enhanced_safety_java.html" @@ -0,0 +1,33 @@ + + + + + + + + + 【Java】强化安全规则包 | 腾讯云代码分析 + + + + +

    【Java】强化安全规则包

    针对 Java 语言的强化代码安全规则包,属于 TCA 增强分析模块的能力之一,请参考增强分析模块部署在新窗口打开文档进行部署。

    规则列表

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/front_end_framework_check.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/front_end_framework_check.html" new file mode 100644 index 000000000..52992aaab --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/front_end_framework_check.html" @@ -0,0 +1,45 @@ + + + + + + + + + 前端框架检查规则包 | 腾讯云代码分析 + + + + +

    前端框架检查规则包

    背景

    前端项目在长期发展过程中,由于框架开源许可证变更、框架性能外观等不适用等因素,需要对前端框架进行平滑切换,而这就需要腾讯云代码分析 TCA 的介入,方便对企业内所有前端项目进行批量分析统计,方便管理。

    需求

    • 检查代码仓库中使用到指定前端框架的代码位置。

    示例

    {
    +  "name": "framework",
    +  "version": "1.0.0",
    +  "dependencies": {
    +    "react": "^17.0.2", // 触发规则
    +    "react-dom": "^17.0.2", // 触发规则
    +    "react-hotkeys-hook": "^3.4.3", // 触发规则
    +    "react-redux": "^7.2.5", // 触发规则
    +    "single-spa": "^5.9.3",
    +    "universal-cookie": "^4.0.4"
    +  },
    +}
    +

    快速体验

    TCA 现已支持前端框架检查规则包,可以在 TCA 分析方案中搜索勾选以下规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 -> 前端框架检查规则包 -> 启用/查看规则

    支持框架

    • TDesign
    • AntD
    • React
    • Vue

    更多

    更多框架支持,欢迎提 issue 进行咨询扩展。

    + + + diff --git "a/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/test_case_verify_go.html" "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/test_case_verify_go.html" new file mode 100644 index 000000000..d39d19671 --- /dev/null +++ "b/zh/guide/\344\273\243\347\240\201\346\243\200\346\237\245/\350\247\204\345\210\231\345\214\205/test_case_verify_go.html" @@ -0,0 +1,42 @@ + + + + + + + + + 【Go】单元测试有效性验证 | 腾讯云代码分析 + + + + +

    【Go】单元测试有效性验证

    背景

    单元测试是用来对一个模块、一个函数或者一个类来进行正确性检验的测试工作。也是提升现网质量的最广泛最简单有效的方式。

    但是在实际开发工作中,由于工作繁忙而遗漏或缺乏对单元测试的正确认识,有些开发盲目追求高覆盖率,没有对单元测试做断言,这样的单元测试用例属于无效用例。 为了检测此类无效用例,业务侧找来了代码分析介入,进行单元测试有效性验证。

    需求

    • 判断一个单元测试用例中是否存在断言。

    示例

    // Bad case
    +func Test_Demo1(t *testing.T) {
    +}
    +
    +
    +// Good case
    +func Test_Demo2(t *testing.T) {
    +    assert.NoError(t, err)
    +}
    +

    快速体验

    TCA 现已支持 Go 语言的单元测试有效行验证,可以在 TCA 分析方案中搜索勾选以下规则包,快速体验。

    启用规则包

    分析方案 -> 代码检查 -> 单元测试有效性验证 -> 启用/查看规则

    支持框架

    扩展

    更多语言更多单元测试框架支持,欢迎提 issue 进行咨询扩展。

    + + + diff --git "a/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html" "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html" new file mode 100644 index 000000000..05e9b0a1e --- /dev/null +++ "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\345\272\246\351\207\217\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 代码度量配置 | 腾讯云代码分析 + + + + +

    代码度量配置

    圈复杂度

    可以发现执行路径较多的方法,降低代码的圈复杂度,可测性更高

    • 检测阈值

      默认为 20,表示当一个方法的圈复杂度超过 20 时则认为该方法为超标方法,需要被关注修改。

      可以根据需要调整

    重复代码

    可以发现重复的代码,避免重复代码可以让代码更简洁,更易维护

    • 长度区间

      是一个区间值,默认代码中一个单词(变量/操作符)长度为 1。

    • 重复次数

      是一个区间值,当一段代码重复次数达到指定区间才认为是有风险的。

    • 上报限制

      限制上报的重复代码块数,可以减少开发的压力,提高修复积极性。

    代码统计

    从目录和业务纬度统计代码行数,也可以获取提交记录便于代码 Review

    + + + diff --git "a/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html" "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html" new file mode 100644 index 000000000..b9fbc3434 --- /dev/null +++ "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\347\274\226\350\257\221\351\205\215\347\275\256.html" @@ -0,0 +1,44 @@ + + + + + + + + + 代码检查-编译配置 | 腾讯云代码分析 + + + + +

    代码检查-编译配置

    腾讯云代码分析平台支持给编译类的工具或编译型项目配置相关命令。

    由于对代码进行编译型分析会存在安全风险,需要用户自行进行专机扫描,申购完成后可联系平台管理员进行相关配置。

    提示

    对于编译型语言,有些分析工具是可以通过分析编译产出的中间文件,更为准确地发现代码质量问题。


    注意

    由于对代码进行编译型分析会存在安全风险,需要用户自行进行专机扫描(私有化版由客户自行评估即可)。


    编译所需环境说明(重要)

    如果配置了编译命令,则需要在具有代码执行所需的编译环境的节点上执行代码分析。即需要用户在专机上提供编译环境(针对私有化版,客户可根据业务情况选择在公共节点机、用户专机、本地节点机提供编译环境即可)。

    如以下一些编译环境:

    • JDK 环境及版本

    • gradle 环境

    • cmake & make 环境

    • visual studio 环境

    • ...

    注意

    如果机器有多个 JDK 或者 gradle 环境,项目编译需指定 JDK 或 gradle 版本,可以在分析方案的基础属性当中设定相应环境变量。

    编译配置字段说明

    前置命令

    通常是项目编译前需要执行的命令,或用于清理之前编译过程的命令,如:make clean, xcodebuild clean [-optionName]。如无需要,可以不填。

    编译命令

    项目的编译命令,具体可以咨询该代码库所属项目的开发

    能够使项目编译成功的编译命令,可以填写多行或用 && 连接命令。

    提示

    前置命令与编译命令是隔离的,即在前置命令中的操作不会对编译命令产生影响。

    如在前置命令中 cd src && export TEST=src,在执行编译命令时并不会跳到src目录和获取TEST环境变量。

    编译配置示例

    提示

    咨询该代码库所属项目的开发,先确保先在本地工程根目录调试通过

    JAVA 项目

    编译命令

    android-studio 项目编译命令示例

    gradle compileDebugSources --no-daemon -Dorg.gradle.jvmargs=
    +

    ant 项目编译命令示例

    ant build
    +

    Object-C 项目

    编译命令

    xcodebuild 命令(确保先在本地工程根目录调试通过)

    xcodebuild -target dailybuildipa -configuration DailyBuild -sdk iphonesimulator
    +

    环境变量(分析方案-基础属性中配置):

    XCODE_VERISON=10.1
    +

    C/C++ 项目

    编译命令

    VS 项目编译命令示例

    devenv.com demo.sln /Build "Debug|Win32"
    +# 或
    +msbuild demo.sln /t:Build /p:Configuration=DebugCopy
    +

    make 项目编译命令示例

    make all
    +

    C# 项目

    编译命令

    VS 项目编译命令示例

    devenv.com demo.sln /Build "Debug|Win32"
    +# 或
    +msbuild demo.sln /t:Build /p:Configuration=Debug
    +
    + + + diff --git "a/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html" "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html" new file mode 100644 index 000000000..f53b735f8 --- /dev/null +++ "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\350\247\204\345\210\231\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 代码检查-规则配置 | 腾讯云代码分析 + + + + +

    代码检查-规则配置

    在上一节文档代码检查配置中我们大致已经了解规则配置主要由官方规则包自定义规则包构成,本节将详细描述规则配置。

    官方规则包是由腾讯云代码分析平台经过多年深耕,在业务中不断实践整理而出的规则集合包,然而平台有超过**10000+**的规则,有些规则并未放到官方规则包中,甚至有些规则是由用户自定义的规则。此外,有些官方规则包中的规则,对于不同的团队所需可能存在差异,因此产生了如下几种问题:

    • 在规则配置中,如何添加规则?

    • 在规则配置中,如果将官方规则包中的规则进行调整?

    在规则配置中,如何添加规则?

    添加规则存在两种入口

    提示

    无论何种,最终都是将规则添加到自定义规则包中

    • 用户可直接点击页面中的添加规则

      添加规则配置

    • 用户可点击自定义规则,进入自定义规则包后,再点击添加规则

      点击自定义规则包

      添加规则

    在添加规则过程中,可以单选或者批量多选规则,可以根据搜索栏进行多维度查询规则

    添加规则配置

    添加规则配置

    在规则配置中,如果将官方规则包中的规则进行调整?

    用户可以点击进入官方规则包,进入官方规则包中,对已存在的规则进行编辑。

    注意

    在官方规则包中对规则的任意操作,实质上是将对应规则增加到自定义规则包中进行了相关操作。

    自定义规则包中的规则配置会默认覆盖其他官方包中相同规则的配置。

    编辑官方规则包规则

    + + + diff --git "a/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html" "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html" new file mode 100644 index 000000000..8b8d42e84 --- /dev/null +++ "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\344\273\243\347\240\201\346\243\200\346\237\245\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 代码检查配置 | 腾讯云代码分析 + + + + +

    代码检查配置

    腾讯云代码分析采用业界/自研的 80+ 款工具,配置代码检查项能够有效地发现代码中存在的异味代码

    规则配置

    规则配置主要是以规则包为元素,由官方规则包自定义规则包两部分组成。平台提供一些系列的官方规则包,覆盖规范、安全、推荐等方面。

    用户可根据项目语言、规则包类型筛选不同的规则包,并启用/关闭规则包。

    提示

    用户可以根据需要选择官方规则包进行扫描,并可以在官方规则包的基础上屏蔽某些规则或者调整默认的优先级,设置指定参数。这些操作都会记录在自定义规则包中。

    自定义规则包是提供给用户自由选择工具规则的包。官方规则包上的调整实质上会记录到自定义规则包中,当自定义规则包中的规则和官方规则包的规则发生冲突,则自定义规则包优先级更高。

    创建项目

    编译配置

    通过编译(代码解析和翻译过程)分析中间代码进行辅助分析,能更精准地发现更多潜在的代码问题。

    + + + diff --git "a/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html" "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html" new file mode 100644 index 000000000..5de4bca3f --- /dev/null +++ "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\210\206\346\236\220\346\226\271\346\241\210\346\250\241\346\235\277\350\257\264\346\230\216.html" @@ -0,0 +1,33 @@ + + + + + + + + + 分析方案模版 | 腾讯云代码分析 + + + + +

    分析方案模版

    为便于用户快速创建代码库进行分析,复用同类型的分析配置,平台提供了分析方案模板功能。

    分析方案模板分为系统方案模板个人自定义方案模板

    • 系统方案模板

      全局可用。但是用户无法变更系统方案模板内容。如系统方案模板产生变更,需用户自行拉取最新模板内容。

      同步分析方案模板配置

    • 个人自定义方案模板

      自定义方案模板与团队挂钩,用户可自行创建、更新、同步方案模板,以及可进行权限控制。默认自定义方案模板团队内都可见。

      自定义方案模板权限管理

    分析方案模版用于在创建分析方案时作为模版参考。分析方案模版全局可用,不用和某个代码库关联。

    使用说明

    • 创建分析项目时,可选择使用分析方案模板创建。默认会根据该分析方案模板创建出一个新的分析方案,并用该方案配置进行分析项目创建。

    • 创建分析方案时,可选择使用分析方案模板创建。

    • 用模版生成的分析方案和模版建立关联关系,当模版和生成的方案由差异时,可以由用户选择是否同步模版的内容到方案。并可以选择拉群哪些功能模块的配置。

    + + + diff --git "a/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html" "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html" new file mode 100644 index 000000000..4b9ddb330 --- /dev/null +++ "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\345\237\272\347\241\200\345\261\236\346\200\247\351\205\215\347\275\256.html" @@ -0,0 +1,33 @@ + + + + + + + + + 基础属性配置 | 腾讯云代码分析 + + + + +

    基础属性配置

    • 方案名称

      用于标示一个方案,每个方案名称都是唯一的。

    • 分析语言

      用于指明该方案是针对代码库何种语言进行分析。初次创建分析方案时会根据语言初始化分析方案相关配置。

    • 运行环境

      用于将任务分配到指定的环境节点机器上执行代码分析,需考虑项目在对应环境的节点机器上能否正常执行。

    • 环境变量

      每行 key-value 形式,非必填项。

      • 可用于指定特殊编译环境:如机器有多个 JDK 或者 gradle 环境,项目编译需指定 JDK 或 gradle 版本的可以设定相应环境变量。

      • 可用于工具传递参数: 如ESLINT_MAX_OLD_SPACE_SIZE=4096配置 Js 内存大小

      • 可用于指定项目配置,如PYTHON_VERSION=2 指定为 python2 项目

        提示

        对 Python 的分析默认采用 Python3,如果需要分析 Python2 请在环境变量中设置:PYTHON_VERSION=2

    + + + diff --git "a/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\350\277\207\346\273\244\351\205\215\347\275\256.html" "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\350\277\207\346\273\244\351\205\215\347\275\256.html" new file mode 100644 index 000000000..b101ee441 --- /dev/null +++ "b/zh/guide/\345\210\206\346\236\220\346\226\271\346\241\210/\350\277\207\346\273\244\351\205\215\347\275\256.html" @@ -0,0 +1,65 @@ + + + + + + + + + 过滤配置 | 腾讯云代码分析 + + + + +

    过滤配置

    路径过滤

    用于设定代码分析的范围,设定后,已经开启的代码检查、代码度量各项功能都会在指定的代码范围内生效。

    目前支持正则表达式通配符两种类型:

    • 正则表达式

      请填写相对路径(基于代码库根目录),要求匹配到文件
      +使用正则表达式格式,示例如下:
      +    代码根目录
      +    |-src
      +      |- test
      +          |- main_test.py
      +          |- input_test.py
      +      |- main.py
      +    |-test
      +      |- param_test.py
      +    匹配src/test目录:src/test/.*
      +    匹配根目录下的test目录:test/.*
      +    匹配所有_test.py后缀的文件:.*_test\\.py
      +修改后,下次分析生效,需要启动一次全量分析处理历史存量问题。
      +
      Include 表示只分析,如只分析 src/ 目录:src/.*
      +Exclude 表示只屏蔽,如要屏蔽 src/lib/ 目录:src/lib/.*
      +
    • 通配符

      请填写相对路径(基于代码库根目录),要求匹配到文件
      +使用Unix通配符格式,示例如下
      +    代码根目录
      +    |-src
      +      |- test
      +          |- main_test.py
      +          |- input_test.py
      +      |- main.py
      +    |-test
      +      |- param_test.py
      +    匹配src/test目录:src/test/*
      +    匹配根目录下的test目录:test/*
      +    匹配所有_test.py后缀的文件:*_test.py
      +修改后,下次分析生效,需要启动一次全量分析处理历史存量问题。
      +
      Include 表示只分析,如只分析 src/ 目录:src/*
      +Exclude 表示只屏蔽,如要屏蔽 src/lib/ 目录:src/lib/*
      +

    如果几个分析方案希望共享相同的路径过滤方案,可以通过导入导出路径配置的方式进行处理。

    提示

    配置更改后,下次启动分析生效

    问题过滤

    • 全局 Issue 忽略状态同步

      仅对代码检查生效。开启后,在 Issue 页面进行全局忽略操作时,其他利用该方案分析的分析项目在发现相同 Issue 时,会同步忽略该 Issue。否则不受全局 Issue 忽略状态同步影响。

    + + + diff --git "a/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/OAuth\347\256\241\347\220\206.html" "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/OAuth\347\256\241\347\220\206.html" new file mode 100644 index 000000000..6dff67dda --- /dev/null +++ "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/OAuth\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + OAuth管理 | 腾讯云代码分析 + + + + +

    OAuth管理

    OAuth管理

    OAuth管理

    提示

    配置OAuth应用时,回调地址栏需填入当前TCA平台配置的域名或IP地址(如当前页面非80端口,需要显式指定端口号),作为Git平台上OAuth应用的回调地址。

    + + + diff --git "a/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html" "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html" new file mode 100644 index 000000000..376fcaab6 --- /dev/null +++ "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\210\206\346\236\220\350\256\260\345\275\225\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 分析记录管理 | 腾讯云代码分析 + + + + +

    分析记录管理

    • 可查看平台全部分析记录

    • 可点击查阅分析记录详情

    分析记录列表

    + + + diff --git "a/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" new file mode 100644 index 000000000..357fd0529 --- /dev/null +++ "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 团队管理 | 腾讯云代码分析 + + + + +

    团队管理

    • 可查看平台创建的团队列表,并提供了相应筛选

    • 禁用恢复团队

    团队列表

    团队操作

    + + + diff --git "a/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206.html" "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206.html" new file mode 100644 index 000000000..3aaf898c0 --- /dev/null +++ "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 工具管理 | 腾讯云代码分析 + + + + +

    工具管理

    • 可查看全部工具(包含平台提供工具、团队自定义工具)。

    • 查看编辑工具。

    • 可变更工具权限状态

    工具管理

    提示

    工具的权限状态仅能由平台管理员进行变更调整,需谨慎调整

    • 团队内可用:即工具配置了可用团队白名单的团队可以使用该工具,默认创建工具的团队已在白名单内

    • 全平台可用:即不同团队都可见可用该工具

    • 支持自定义规则,全平台可用:即该工具不同团队都可见可用,且支持用户添加团队所需的自定义规则,该自定义规则存在团队隔离,仅团队内可以,其他团队不可使用

    + + + diff --git "a/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206.html" "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206.html" new file mode 100644 index 000000000..c08fd361a --- /dev/null +++ "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\347\224\250\346\210\267\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 用户管理 | 腾讯云代码分析 + + + + +

    用户管理

    • 查看编辑创建平台用户。

    • 可配置用户的登录密码用户级别超级管理员等。

    用户列表

    用户编辑

    + + + diff --git "a/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" new file mode 100644 index 000000000..aaa96f8dd --- /dev/null +++ "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 节点管理 | 腾讯云代码分析 + + + + +

    节点管理

    • 可查看常驻节点状态,包含公共节点团队节点

    • 查看编辑删除常驻节点。

    • 可配置节点工具进程

    • 可配置节点标签

    节点管理节点管理节点管理节点管理

    + + + diff --git "a/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\351\241\271\347\233\256\347\256\241\347\220\206.html" "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\351\241\271\347\233\256\347\256\241\347\220\206.html" new file mode 100644 index 000000000..0e894ebfe --- /dev/null +++ "b/zh/guide/\345\220\216\345\217\260\347\256\241\347\220\206/\351\241\271\347\233\256\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 项目管理 | 腾讯云代码分析 + + + + +

    项目管理

    • 可查看平台创建的项目列表,并提供了提供相应筛选

    • 禁用恢复项目

    项目列表

    + + + diff --git "a/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" "b/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" new file mode 100644 index 000000000..1e8c52936 --- /dev/null +++ "b/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\345\233\242\351\230\237\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 团队说明 | 腾讯云代码分析 + + + + +

    团队说明

    成员权限

    层级关系

    团队 > 项目 > 代码库 > 分析项目

    您可以创建一个团队,并可以在团队中创建多个项目来进行项目区分和项目管理。可以在一个项目中创建多个代码库进行代码分析。

    权限控制

    • 团队成员分为管理员和普通成员两类。团队管理员具备团队全部权限。

    • 项目成员分为管理员和普通成员两类。项目管理员具备项目全部权限。

    成员权限的区分,具体点击查看成员权限

    邀请团队成员

    管理员可以通过成员管理为您的团队添加成员,通过分享邀请链接的方式邀请您的团队。

    + + + diff --git "a/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\346\210\220\345\221\230\346\235\203\351\231\220.html" "b/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\346\210\220\345\221\230\346\235\203\351\231\220.html" new file mode 100644 index 000000000..41e7f9147 --- /dev/null +++ "b/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\346\210\220\345\221\230\346\235\203\351\231\220.html" @@ -0,0 +1,33 @@ + + + + + + + + + 成员权限 | 腾讯云代码分析 + + + + +

    成员权限

    团队成员

    成员权限

    团队成员分为团队管理员团队普通成员两类。

    团队管理员:可以邀请其他成员加入团队,具备团队内所有权限。

    团队普通成员:可以创建项目,可以访问自己有权限的项目。创建项目的人会自动成为这个项目的项目管理员。

    项目成员

    项目成员分为项目管理员项目普通成员

    项目管理员:具备项目内全部权限。

    项目普通成员:可以查看项目内的配置信息和分析结果等各项信息,并且可以启动分析,但是无其他操作权限。

    + + + diff --git "a/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" "b/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" new file mode 100644 index 000000000..de2b715de --- /dev/null +++ "b/zh/guide/\345\233\242\351\230\237\347\256\241\347\220\206/\350\212\202\347\202\271\347\256\241\347\220\206.html" @@ -0,0 +1,33 @@ + + + + + + + + + 团队节点与标签 | 腾讯云代码分析 + + + + +

    团队节点与标签

    注意

    团队节点及标签说明

    • 团队节点是团队注册并管理的私有节点。

    • 团队标签用于关联团队内的节点机器与分析项目。

    • 团队可以利用团队标签注册并使用团队节点

    • 在项目的分析方案中配置运行环境为团队标签后,才可将该项目的分析任务下发到对应的团队节点。

    • 团队节点仅支持运行当前团队中的分析任务,节点可执行的任务范围取决于该节点的负责人权限:

      • 如果节点负责人为团队管理员,该节点可以执行当前团队所有项目的分析任务
      • 如果节点负责人为项目管理员,该节点只能运行指定项目下的分析任务
      • 如果节点负责人为部分代码库的管理员,该节点只能运行对应代码库的分析任务

    适用场景

    1. 团队因资源可靠性或项目敏感性,需使用私有机器资源

    2. 团队项目分析依赖特定机器环境(比如CPU架构、操作系统等)

    以上场景,团队可接入专机资源作为团队节点,仅分析自己业务的代码库,以保证执行效率保护源码安全支持项目环境依赖等。

    团队节点注册

    参考客户端常驻节点分析进行环境配置和启动节点。

    团队节点管理

    完成团队节点注册后,可以在当前团队节点管理下看到对应的节点信息,同时需要进行节点配置

    注意

    • 团队节点首次注册时,需要手动在平台上配置所属标签节点可用性工具进程等。
    • 将节点的节点可用性调整为活跃后,节点终端客户端运行日志会输出心跳上报成功的日志
    • 首次注册团队节点,节点状态默认为不可用,需调整节点状态为“活跃”: 注册团队节点

    • 配置节点关联的工具进程:

      配置工具进程

    提示

    1. 团队节点使用的所属标签均为当前团队内创建的标签,可参见团队标签管理
    2. 团队标签可以参考CodeDog标签为不同的系统类型(Linux、MacOS、Windows)建立标签,比如专属标签-Linux专属标签-Mac

    使用团队标签

    您可以创建一个团队标签,并配置到您的团队节点和您的分析方案中

    • 创建团队标签。

      创建团队标签

    • 配置团队节点所属标签。

      节点配置团队标签

    • 配置分析方案运行环境。

      方案配置团队标签

    + + + diff --git "a/zh/guide/\345\256\242\346\210\267\347\253\257/\345\205\266\344\273\226\351\205\215\347\275\256.html" "b/zh/guide/\345\256\242\346\210\267\347\253\257/\345\205\266\344\273\226\351\205\215\347\275\256.html" new file mode 100644 index 000000000..5fe6b9a31 --- /dev/null +++ "b/zh/guide/\345\256\242\346\210\267\347\253\257/\345\205\266\344\273\226\351\205\215\347\275\256.html" @@ -0,0 +1,34 @@ + + + + + + + + + 其他配置与用法 | 腾讯云代码分析 + + + + +

    其他配置与用法

    1. 配置使用本地工具

    注意

    如果由于网络原因,执行时无法从github自动拉取工具,或拉取比较慢,可以参考基础配置腾讯工蜂工具地址,或使用以下方式预先下载好工具,配置使用本地工具目录。

    • (1)如果使用的是开源版Client源码,需要在命令行(windows环境下可以启动git bash)中执行以下命令:
    bash ./scripts/base/install_bin.sh
    +
    • (2)下载工具配置库 https://github.com/TCATools/puppy-tools-config.git ,存放到 tools目录下(如果未生成,可先创建该目录)。
    • (3)根据当前机器操作系统,查看puppy-tools-config目录下的linux_tools.inimac_tools.iniwindows_tools.ini文件,将[tool_url]中声明的所有工具下载到 tools目录下。
    • (4)填写client/config.ini中的配置:USE_LOCAL_TOOL=True,即可使用下载好的本地工具,不自动拉取和更新工具。

    2. 使用自建git server存放工具

    注意

    如果自己搭建了一套git server,可以将工具配置库 https://github.com/TCATools/puppy-tools-config.git 以及里面声明的工具仓库,存放到自建git serevr上。

    • (1)将工具配置库 https://github.com/TCATools/puppy-tools-config.git 上传到自建git仓库。
    • (2)按所需的操作系统,将puppy-tools-config仓库下的linux_tools.inimac_tools.iniwindows_tools.ini文件中[tool_url]声明的所有工具库,上传到自建git仓库。
    • (3)修改linux_tools.inimac_tools.iniwindows_tools.ini文件中[base_value]中的git_url为自建git server地址。
    • (4)修改client/config.ini中的TOOL_CONFIG_URL为自建git server的puppy-tools-config仓库地址。
    • (5)填写client/config.ini中的[TOOL_LOAD_ACCOUNT]配置,输入有拉取权限的用户名密码,即可使用自建git server拉取工具。

    3. git lfs带宽和存储配额不够问题

    • 如果git拉取工具时,出现git lfs拉取失败,可能是lfs带宽和存储配额不够,可以打开对应的工具github页面,通过Download ZIP的方式下载工具压缩包,再解压到tools目录下。
    + + + diff --git "a/zh/guide/\345\256\242\346\210\267\347\253\257/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html" "b/zh/guide/\345\256\242\346\210\267\347\253\257/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html" new file mode 100644 index 000000000..8d44862ab --- /dev/null +++ "b/zh/guide/\345\256\242\346\210\267\347\253\257/\345\270\270\351\251\273\350\212\202\347\202\271\345\210\206\346\236\220.html" @@ -0,0 +1,37 @@ + + + + + + + + + 常驻节点分析 | 腾讯云代码分析 + + + + +

    常驻节点分析

    提示

    TCA 客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。

    和本地分析一样,需要先安装环境和必要的工具,并配置好服务端地址。

    使用场景

    • 希望通过并行执行分析来提高分析效率

    • 希望尽量使用公共资源或使用专机资源

    前置步骤

    节点机器上具备客户端及客户端相关依赖环境,可查阅本地分析-前置步骤部分进行配置。

    节点配置

    配置 config.ini 文件

    1. <Server IP地址>替换成实际的 TCA 平台 IP(可包含端口号)。

    2. 国内使用 github 拉取网络较慢,推荐使用腾讯工蜂拉取,需要修改以下配置:

    • 修改 TOOL_CONFIG_URL=https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git
    • 腾讯工蜂在新窗口打开的账号密码填写到TOOL_LOAD_ACCOUNT 中。(注:没有腾讯工蜂账号的需要注册;由于腾讯工蜂的开源仓库也要求使用账号才能拉取,所以此处必须填写账号密码)

    启动常驻节点

    • 从TCA前端页面中获取 token,前往 个人中心-个人令牌-复制Token

      提示

      节点仅能分析该token具有权限的项目,因此如设置公共的分析节点,推荐使用超级管理员的token。

      可以通过用户管理页面查看到哪些用户是超级管理员。

    • 如启动团队节点,还需获取团队编号:org_sid,获取方式: 从 TCA 平台项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile

    两种方式可选启动客户端:

    使用客户端源码启动常驻节点

    • 如启动公共节点,需进入到源码的client目录下,执行命令:
    python3 codepuppy.py -l codepuppy.log start -t <token>
    +
    • 如启动团队节点,需增加参数 org_sid:
    python3 codepuppy.py -l codepuppy.log start -t <token> --org-sid <org_sid>
    +

    启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    使用客户端二进制启动常驻节点

    • 如启动公共节点,需进入到源码的client目录下,执行命令:
    ./codepuppy -l codepuppy.log start -t <token>
    +
    • 如启动团队节点,需增加参数 org_sid:
    ./codepuppy -l codepuppy.log start -t <token> --org-sid <org_sid>
    +

    启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    管理节点

    常驻节点首次启动后,需要到节点管理页面管理节点状态:

    1. 设置节点状态: 进入 TCA 节点管理页面。管理入口-节点管理,可以看到当前在线的节点,节点状态默认为不可用,需将其设置为**活跃**才可用于接收和执行任务。 也可以按需修改节点名称、标签、负责人等信息。

    2. (按需可选)配置节点工具进程: 进入工具进程配置页面,对节点支持的工具进程进行管理(默认会全部勾选),未勾选的工具进程,将不会在该节点上执行。

    3. (按需可选)设置节点标签: 节点标签会与分析方案中的运行环境标签进行匹配,只有相同标签的任务才会下发到该机器节点上。

    + + + diff --git "a/zh/guide/\345\256\242\346\210\267\347\253\257/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html" "b/zh/guide/\345\256\242\346\210\267\347\253\257/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html" new file mode 100644 index 000000000..9cc161ffb --- /dev/null +++ "b/zh/guide/\345\256\242\346\210\267\347\253\257/\345\277\253\351\200\237\346\211\253\346\217\217\346\250\241\345\274\217.html" @@ -0,0 +1,45 @@ + + + + + + + + + 快速扫描模式 | 腾讯云代码分析 + + + + +

    快速扫描模式

    使用场景

    • 对本地代码目录下的临时代码(未关联scm仓库或未提交到scm仓库的本地代码)进行扫描,对某个目录或某些文件进行快速扫描,产出本地扫描结果。

    • 该模式不与scm代码仓库关联,只对给定的目录或文件进行扫描,不依据提交版本号做增量分析,也不定位问题责任人。

    使用步骤

    使用内置默认方案快速扫描

    提示

    客户端快扫模式已内置open_source_check(开源)、safety(基础安全)、sensitive(敏感信息)三种常用分析方案,快速启动内置方案:

    1. 初始化扫描需要的工具

    • 进入到客户端client目录下,运行codepuppy.py或codepuppy二进制,使用quickinit命令拉取指定分析方案模板所需要的分析工具:
    python3 codepuppy.py quickinit -l LABEL_NAME 
    +
    +# 如使用codepuppy二进制,可执行:./codepuppy quickinit -l LABEL_NAME
    +
    • 参数说明:
      • LABEL_NAME: 必选,内置分析方案标签名,从open_source_checksafetysensitive三者中选一。

    2. 执行快速扫描

    • 进入到客户端client目录下,执行命令:
    python3 codepuppy.py quickscan -l LABEL_NAME -s SOURCE_DIR --file FILE
    +
    +# 如使用codepuppy二进制,可执行:./codepuppy quickscan -l LABEL_NAME -s SOURCE_DIR --file FILE
    +
    • 参数说明:

      • LABEL_NAME: 必选,内置分析方案标签名,从open_source_checksafetysensitive三者中选一。
      • SOURCE_DIR: 必选,需要扫描的代码目录路径
      • FILE: 可选,指定文件扫描,格式为基于SOURCE_DIR的相对路径,多个文件用英文逗号(,)分隔。不指定文件,默认扫描整个代码目录。
      • 其他参数说明参考quickinit命令。
    • 扫描完成后,结果会默认输出到客户端client目录下的tca_quick_scan_report.json文件中。结果只保存在本地,不会上报到服务端展示。

    • 如需自行创建分析方案,参考以下步骤:

    使用自定义的分析方案快速扫描

    1. 在页面上创建分析方案模板

    • 由于该模式不与scm代码仓库绑定,因此不能直接使用分析方案(分析方案上归属于某个代码仓库下的),需要使用分析方案模板的配置来扫描。

    • 目前快速扫描模式只支持代码检查,暂不支持代码度量,请勿开启代码度量配置项(无法展示结果)。

    • 配置好方案模板后,从页面URL中获取到分析方案模板ID,分析方案模板页面URL格式:http://{域名}/t/{org_sid}/p/{team_name}/template/{分析方案模板ID}template后面的数字即分析方案模板ID。

    2. 初始化扫描需要的工具

    • 进入到客户端client目录下,使用quickinit命令拉取指定分析方案模板所需要的分析工具:
    python3 codepuppy.py quickinit -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID
    +
    +# 如使用codepuppy二进制,可执行:./codepuppy quickinit -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID
    +
    • 参数说明:
      • TOKEN: 必选,从TCA平台页面获取,前往[个人中心]-[个人令牌]-复制Token
      • SCHEME_TEMPLATE_ID: 必选,分析方案模板ID,从步骤1中获取
      • ORG_SID: 必选,团队编号,从TCA平台团队概览中获取“团队唯一标识”

    3. 执行快速扫描

    • 进入到客户端client目录下,执行命令:
    python3 codepuppy.py quickscan -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID -s SOURCE_DIR --file FILE 
    +
    +# 如使用codepuppy二进制,可执行:./codepuppy quickscan -t TOKEN --scheme-template-id SCHEME_TEMPLATE_ID --org-sid ORG_SID -s SOURCE_DIR --file FILE
    +
    • 参数说明:

      • SOURCE_DIR: 必选,需要扫描的代码目录路径
      • FILE: 可选,指定文件扫描,格式为基于SOURCE_DIR的相对路径,多个文件用英文逗号(,)分隔。不指定文件,默认扫描整个代码目录。
      • 其他参数说明参考quickinit命令。
    • 扫描完成后,结果会默认输出到客户端client目录下的tca_quick_scan_report.json文件中。结果只保存在本地,不会上报到服务端展示。

    + + + diff --git "a/zh/guide/\345\256\242\346\210\267\347\253\257/\346\234\254\345\234\260\345\210\206\346\236\220.html" "b/zh/guide/\345\256\242\346\210\267\347\253\257/\346\234\254\345\234\260\345\210\206\346\236\220.html" new file mode 100644 index 000000000..0061f295c --- /dev/null +++ "b/zh/guide/\345\256\242\346\210\267\347\253\257/\346\234\254\345\234\260\345\210\206\346\236\220.html" @@ -0,0 +1,40 @@ + + + + + + + + + 客户端本地分析 | 腾讯云代码分析 + + + + +

    客户端本地分析

    使用场景

    • 希望在本地随时分析。

    • 接入持续集成系统实现自动化分析。

    前置步骤

    1. 客户端运行环境机器配置推荐

    操作系统推荐配置
    Linux8核16G内存,硬盘空间256G(可用空间不低于100G)
    Mac8核16G内存,硬盘空间256G(可用空间不低于100G)
    Windows8核16G内存,硬盘空间256G(可用空间不低于100G)

    以上为推荐配置,实际情况需要考虑扫描对象代码库的大小,按实际情况增加磁盘空间。

    2. 本地需具备客户端

    下载开源版源码在新窗口打开。 或从开源版release在新窗口打开下载客户端以运行客户端二进制;

    3. 安装Python环境和第三方库(仅客户端源码启动分析需要)

    • 预装Python3.7、pip,支持 python3pip3 命令
    • 安装依赖:pip3 install -r CodeAnalysis/client/requirements/app_reqs.pip

    4. 安装第三方工具(docker下启动分析可跳过)

    • 在命令行(windows环境下可以启动git bash)中执行以下命令:
    bash ./scripts/base/install_bin.sh
    +
    • 进入到client/requirements目录
    • 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    分析配置

    配置客户端 config.ini 文件

    • <Server IP地址> 替换成实际的TCA平台IP(可包含端口号)

    配置客户端 codedog.ini 文件

    codedog.ini获取方法:

    • 方法一: 打开TCA源码CodeAnalysis/client/codedog.ini,填写配置信息

    • 方法二: 从开源版release在新窗口打开下载客户端包,解压后打开codedog.ini,填写配置信息。

    • 方法三: 在TCA平台平台上配置好对应信息后,下载配置文件到本地使用。

      下载配置文件

    codedog.ini中以下字段为必填项:

    字段名填写说明
    token从TCA平台页面获取,前往[个人中心]-[个人令牌]-复制Token
    org_sid(团队编号)从TCA平台项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile
    team_name(项目名称)同上
    source_dir本地代码目录路径

    其他字段按需填写。

    启动代码分析

    启动客户端分析有三种方式可选:客户端源码下启动分析客户端二进制启动分析docker下启动分析

    客户端源码下启动分析

    • 进入到客户端client目录下

    • 执行命令: 客户端源码:python3 codepuppy.py localscan

    客户端二进制启动分析

    • 进入到客户端client目录下

    • 执行命令: 客户端源码:./codepuppy localscan

    docker下启动分析

    1. 构建docker镜像

    在client目录下,执行以下命令:docker build -t tca-client .
    (需已安装Docker)

    2. 执行Docker容器

    注意

    注意:因为以下步骤会将代码目录挂载到容器中,需要先将codedog.ini里面的source_dir修改为/workspace/src,其他参数保持不变。

    执行Docker容器有以下两种方式:

    直接使用docker运行

    client目录下,执行以下命令:(注意:按照实际情况填写SOURCE_DIR环境变量值)

    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +

    使用docker内bash终端运行

    通过以下方式,进入容器内的bash终端后,通过命令行启动client代码:
    client目录下,执行以下命令:(注意:按照实际情况填写SOURCE_DIR环境变量值)

    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client bash
    +# 进入容器内终端,通过命令行执行扫描
    +python3 codepuppy.py localscan
    +
    + + + diff --git "a/zh/guide/\345\256\242\346\210\267\347\253\257/\351\205\215\347\275\256\350\257\264\346\230\216.html" "b/zh/guide/\345\256\242\346\210\267\347\253\257/\351\205\215\347\275\256\350\257\264\346\230\216.html" new file mode 100644 index 000000000..fa4122aa8 --- /dev/null +++ "b/zh/guide/\345\256\242\346\210\267\347\253\257/\351\205\215\347\275\256\350\257\264\346\230\216.html" @@ -0,0 +1,39 @@ + + + + + + + + + TCA Client | 腾讯云代码分析 + + + + +

    TCA Client

    一、基础配置

    1. 机器配置推荐

    操作系统推荐配置
    Linux8核16G内存,硬盘空间256G(可用空间不低于100G)
    Mac8核16G内存,硬盘空间256G(可用空间不低于100G)
    Windows8核16G内存,硬盘空间256G(可用空间不低于100G)

    以上为推荐配置,实际情况需要考虑扫描对象代码库的大小,按实际情况增加磁盘空间。

    2. 配置client/config.ini文件

    -(1)将<Server IP地址>替换成实际的serve ip(可包含端口号)。

    3. 配置client/codedog.ini文件(分布式节点模式无需配置)

    填写以下必填项:token,org_sid,team_name,source_dir

    字段名填写说明
    token从tca页面获取,前往[个人中心]-[个人令牌]-复制Token
    org_sid(团队编号)从tca项目概览页面URL中获取,项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile
    team_name(项目名称)同上
    source_dir本地代码目录路径

    其他可选项按需填写。

    二、使用docker环境快速体验

    提示

    适用于快速上手体验。使用docker运行,可以免去客户端环境依赖的安装,避免环境兼容性问题。

    但是由于环境受限于docker,会无法复用本地的编译环境,部分需要编译的工具无法使用。

    1. 下载和安装Docker

    参考Docker官方文档:Docker下载和安装在新窗口打开

    2. 构建docker镜像

    client目录下,执行以下命令:docker build -t tca-client .

    3. 执行docker容器,扫描代码,可选以下两种方式

    (1)直接使用docker运行

    • 在client目录下,执行以下命令:
    • (注意:按照实际情况填写SOURCE_DIR环境变量值)
    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +

    (2)使用docker内bash终端运行

    • 通过以下方式,进入容器内的bash终端后,通过命令行启动client代码:
    • 在client目录下,执行以下命令:
    • (注意:按照实际情况填写SOURCE_DIR环境变量值)
    export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client bash
    +# 进入容器内终端,通过命令行执行扫描
    +python3 codepuppy.py localscan
    +

    三、使用本地机器环境运行

    提示

    适用于深度体验,可以复用本地编译环境,使用编译型代码分析工具。

    可能会有系统环境兼容问题。

    1. 安装Python环境和第三方库

    • (1) 预装Python3.7、pip,支持 python3pip3 命令
    • (2) 安装依赖:pip3 install -r client/requirements/app_reqs.pip

    2. 安装第三方工具

    • (1) 进入到client/requirements目录
    • (2) 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    3. 启动代码分析

    • (1) 进入到client目录下
    • (2) 执行命令:python3 codepuppy.py localscan

    四、使用分布式节点模式执行客户端

    提示

    • CA客户端除了通过localscan命令启动单次的代码分析,也可以作为一个分布式分析节点启动,作为常驻进程,多个节点可以分布式并行执行服务端下发的任务,提高扫描效率。
    • 和本地执行任务一样,需要先安装环境和必要的工具,并配置好服务端地址。

    1. 安装Python环境和第三方库

    • (1) 预装Python3.7、pip,支持 python3pip3 命令
    • (2) 安装依赖:pip3 install -r client/requirements/app_reqs.pip

    2. 安装第三方工具

    • 进入到client/requirements目录
    • 在命令行中执行安装脚本install.sh(linux/mac环境)或install.bat(windows环境)

    3. 启动代码分析节点

    • (1)从tca页面个人中心-个人令牌-复制Token
    • (2)进入到client目录下,执行命令:python3 codepuppy.py -l codepuppy.log start -t <token>
    • (3)启动后,可以在命令行输出或codepuppy.log中查看运行日志,如果未报异常,且输出task loop is started.,表示节点已经正常启动。

    4. 配置节点

    • 从tca页面管理入口-节点管理,可以看到当前在线的节点,可以修改节点名称、标签、负责人等信息。
    • 可以进入工具进程配置页面,对节点支持的工具进程进行管理(默认会全部勾选),未勾选的工具进程,将不会在该节点上执行。
    • 节点所属标签会与分析方案中的运行环境标签进行匹配,只有相同标签的任务才会下发到该机器节点上。

    五、其他配置与用法

    1. 配置使用本地工具

    注意

    如果由于网络原因,执行时无法从github自动拉取工具,或拉取比较慢,可以参考基础配置腾讯工蜂工具地址,或使用以下方式预先下载好工具,配置使用本地工具目录。

    • (1)下载工具配置库 https://github.com/TCATools/puppy-tools-config.git ,存放到 tools目录下(如果未生成,可先创建该目录)。
    • (2)根据当前机器操作系统,查看puppy-tools-config目录下的linux_tools.inimac_tools.iniwindows_tools.ini文件,将[tool_url]中声明的所有工具下载到 tools目录下。
    • (3)填写client/config.ini中的配置:USE_LOCAL_TOOL=True,即可使用下载好的本地工具,不自动拉取和更新工具。

    2. 使用自建git server存放工具

    注意

    如果自己搭建了一套git server,可以将工具配置库 https://github.com/TCATools/puppy-tools-config.git 以及里面声明的工具仓库,存放到自建git serevr上。

    • (1)将工具配置库 https://github.com/TCATools/puppy-tools-config.git 上传到自建git仓库。
    • (2)按所需的操作系统,将puppy-tools-config仓库下的linux_tools.inimac_tools.iniwindows_tools.ini文件中[tool_url]声明的所有工具库,上传到自建git仓库。
    • (3)修改linux_tools.inimac_tools.iniwindows_tools.ini文件中[base_value]中的git_url为自建git server地址。
    • (4)修改client/config.ini中的TOOL_CONFIG_URL为自建git server的puppy-tools-config仓库地址。
    • (5)填写client/config.ini中的[TOOL_LOAD_ACCOUNT]配置,输入有拉取权限的用户名密码,即可使用自建git server拉取工具。

    3. git lfs带宽和存储配额不够问题

    • 如果git拉取工具时,出现git lfs拉取失败,可能是lfs带宽和存储配额不够,可以打开对应的工具github页面,通过Download ZIP的方式下载工具压缩包,再解压到tools目录下。
    + + + diff --git "a/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\345\210\227\350\241\250.html" "b/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\345\210\227\350\241\250.html" new file mode 100644 index 000000000..dab963a1c --- /dev/null +++ "b/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\345\210\227\350\241\250.html" @@ -0,0 +1,33 @@ + + + + + + + + + 工具列表 | 腾讯云代码分析 + + + + +

    工具列表

    目前 TCA 支持以下工具:

    官方工具第三方工具
    TCA-0Day_Checker(测试版)在新窗口打开androidlint
    clangwarningcheckstyle
    codecountclang
    customfilescancobra
    customscancpd
    fbrjscppcheck
    javawarningcpplint
    regexfilescandart_code_metrics
    regexscandartanalyzer
    TCA-Armory(测试版)在新窗口打开detekt
    TCA-Loong_Beta龙(测试版)在新窗口打开eslint
    unusedresourceeslint_typescript
    eslint_vue
    findbugs
    flake8
    flawfinder在新窗口打开
    flow
    golangcilint
    gometalinter
    htmlcs
    infer_cpp
    infer_java
    infer_objectivec
    ktlint在新窗口打开
    kunlun-M在新窗口打开
    lizard
    luacheck
    phpcs在新窗口打开
    pmd
    pylint
    rips在新窗口打开
    scalastyle
    semgrep在新窗口打开
    shellcheck在新窗口打开
    spotbugs在新窗口打开
    stylecop
    stylelint
    swiftlint
    sonarqube在新窗口打开
    sonarqube_java在新窗口打开
    sonarqube_cs在新窗口打开
    tca_plugin_sqlcheck在新窗口打开
    tscan_cpp在新窗口打开
    tscan_csharp在新窗口打开
    tscan_lua在新窗口打开
    include-what-you-use
    + + + diff --git "a/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html" "b/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html" new file mode 100644 index 000000000..fd78c1db2 --- /dev/null +++ "b/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\345\267\245\345\205\267\347\256\241\347\220\206\350\257\264\346\230\216.html" @@ -0,0 +1,33 @@ + + + + + + + + + 工具管理说明 | 腾讯云代码分析 + + + + +

    工具管理说明

    腾讯云代码分析平台目前已集成众多自研、知名开源工具,并采用分层分离的架构,可以快速对接企业内部团队研发的工具,并将其集成到平台内供企业内部团队使用,满足快速自助的管理工具。

    • 按工具来源划分,工具包含平台提供的工具,以及团队接入的工具。

      平台提供工具:由腾讯云代码分析平台提供的一系列自研、知名开源工具,此类工具都为公开工具,任何团队都可以使用此工具及工具规则进行代码分析。

      团队接入:由团队自行接入的工具,默认该工具仅能在团队内使用,如需跨团队使用或任何团队都可以使用需联系平台管理员进行配置。

    • 按工具使用划分,工具包含可自定义规则工具可使用工具两种。

      可自定义规则工具:该工具任何团队都可以使用,且该工具可以支持添加团队所需的自定义规则。如RegexScan工具,各个团队都可以使用该工具提供的规则,也可以自定义规则,此自定义规则团队隔离。

      可使用工具:该工具团队内可使用,但不能添加自定义规则

    提示

    目前开源版仅**RegexFileScanRegexScanTCA-Armory-R**等三款工具支持用户自定义规则

    需平台管理员在后台管理-工具管理中找到对应工具,并将其权限状态调整为支持自定义规则

    自定义工具

    工具白名单

    默认自定义工具只能当前团队内使用,添加 工具白名单 后可以让其他团队使用。

    使用场景说明

    提示

    添加工具、添加工具规则、添加自定义规则等均需团队内管理员可操作。分析。


    【用户 A1】【用户 A2】为【团队 O1】的管理员,【用户 A3】为【团队 O2】的普通成员。

    【用户 B1】【用户 B2】为【团队 O2】的管理员,【用户 A3】为【团队 O2】的普通成员。

    场景 1

    • 【用户 A1】在工具管理页面添加了【工具 T1】,该工具为团队内工具; -【用户 A1】【用户 A2】均可操作该工具,如修改工具信息、添加工具规则等,【用户 A3】仅可以使用该工具,如在规则配置页面添加该工具规则;

    • 由于【工具 T1】目前仅【团队 O1】可用,【团队 O2】中无法看到此工具,即【团队 O2】内的成员无法使用该工具。

    • 如需【工具 T1】也让【团队 O2】使用有两种解决方法:1. 【工具 T1】将【团队 O2】加入使用白名单;2. 向平台发起申请,由平台管理员将【工具 T1】调整为全部团队都可使用。

    场景 2

    • 【用户 A3】在工具管理页面发现了可自定义规则的工具,如正则工具 RegexScan,进入工具-自定义规则栏,发现没有添加规则的入口;
    • 由于【用户 A3】仅为普通成员权限,因此无法添加规则,此时需要【团队 O1】的管理员才能操作;
    • 添加【自定义规则 R1】完成后,团队内全部成员均可使用该自定义规则,如在规则配置页面添加该自定义规则;
    • 由于【自定义规则 R1】是团队隔离的,即【团队 O1】创建的自定义规则,在【团队 O2】中并看不到,且无法使用该规则;
    • 如需【自定义规则 R1】也让【团队 O2】使用,则仅能向工具方发起申请,由工具方将该自定义规则调整为工具规则。
    + + + diff --git "a/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html" "b/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html" new file mode 100644 index 000000000..ec2a8f1e0 --- /dev/null +++ "b/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267.html" @@ -0,0 +1,67 @@ + + + + + + + + + 自定义工具 | 腾讯云代码分析 + + + + +

    自定义工具

    腾讯云代码分析平台支持用户自助添加代码分析工具。

    适用场景:自定义规则无法满足团队业务复杂需求,需要更多的代码逻辑来匹配目标代码的情况。通常需要团队业务方自行实现对应代码分析工具。

    只需要几步操作:

    1. 编写代码,实现扫描工具逻辑
    2. 提交工具到 git 代码库
    3. 在页面创建新工具
    4. 为工具添加规则
    5. 将工具配置到执行节点
    6. 在项目分析方案中添加规则

    扩展集成工具免责声明

    被扩展集成进腾讯云代码分析系统的任何非官方工具,该类工具对于腾讯云代码分析系统等于黑盒,腾讯云代码分析系统不对该类工具负责,由该类工具方承担所有责任(包括但不限于分发被分析代码,产生代码以及相关信息泄漏)。

    自定义工具步骤说明

    第一步,编写代码,实现分析工具逻辑

    根据需要匹配的目标代码场景,编写对应的工具逻辑。 可以参考 Python 实现的 Demo 项目在新窗口打开

    必要:

    • 运行方式:支持命令行执行,比如 python run.py 或 run.exe,执行命令的工作目录为工具代码的根目录。

    • 运行环境说明

      • 建议将工具打包编译成可执行程序,拉取下来直接可以执行。
      • 如果工具需要在特定的环境中运行,比如python、java环境,平台提供了丰富的工具依赖包,可以在工具管理-工具依赖中查看,创建工具时可供选择,执行时会自动配置好依赖环境。
      • 如果现有的工具依赖包未支持所需依赖,也可以创建新的工具依赖使用。
    • 平台已提供的环境变量

      SOURCE_DIR:要扫描的代码目录路径
      +DIFF_FILES: 值为一个json文件路径,文件内容为增量扫描的文件列表(增量扫描时可用)
      +SCAN_FILES: 值为一个json文件路径,文件内容为需要扫描的文件列表(增量或全量扫描均可用)
      +TASK_REQUEST: 值为一个json文件路径,文件内容为当前扫描任务参数
      +RESULT_DIR: 结果result.json输出的结果目录路径
      +
    • 工具命令声明

      在工具仓库根目录下,添加一个tool.json文件,声明工具的检查和扫描命令,比如:

      {
      +  "check_cmd": "python src/main.py check",
      +  "run_cmd": "python src/main.py scan"
      +}
      +

      参数说明:

      • check_cmd
        • 功能:判断当前执行环境是否满足工具要求(如果不需要检查,也可以没有这个命令)。 比如某些工具只能在linux下执行,需要判断当前是否为linux环境。
        • 输出:将判断结果输出到check_result.json文件中,文件内容为{"usable": true}{"usable": false}
      • run_cmd
        • 功能:扫描代码,执行自定义检查器逻辑(该命令必须存在)。
        • 输出:按照指定格式,输出结果到结果目录下的result.json文件中。
    • 工具输出格式要求

      • 将扫描结果输出到RESULT_DIR环境变量指定的目录下的result.json文件中(Python 示例代码)
      import os
      +import json
      +result_dir = os.getenv("RESULT_DIR", os.getcwd())
      +result_path = os.path.join(result_dir, "result.json")
      +with open(result_path, "w") as fp:
      +    json.dump(result, fp, indent=2)
      +
      • result.json 文件格式如下:
      [
      +    {
      +        "path": "文件绝对路径",
      +        "line": "行号,int类型",
      +        "column": "列号, int类型,如果工具没有输出列号信息,可以用0代替",
      +        "msg": "提示信息",
      +        "rule": "规则名称,可以根据需要输出不同的规则名",
      +        "refs": [
      +            {
      +                "line": "回溯行号",
      +                "msg": "提示信息",
      +                "tag": "用一个词简要标记该行信息,比如uninit_member,member_decl等,如果没有也可以都写成一样的",
      +                "path": "回溯行所在文件绝对路径"
      +            },
      +            ...
      +        ]
      +    },
      +    ...
      +]
      +

      refs 字段说明:

      非必需项,可无。该字段记录问题回溯路径信息。比如当前行的代码问题,是经过上下文的三行代码执行路径而导致的,可以将这三行的位置及提示信息,按顺序添加到 refs 数组中。

    第二步,提交工具到 git 代码库

    • 创建代码库,将工具源代码或编译打包后的可执行文件,提交到代码仓库中(建议提交到master分支,TCA默认拉取的是master分支)。

    • 建议代码库中加入 README.md 文件,说明工具功能和维护人。

    • 后续需要修改工具实现逻辑,可以直接更新代码库,TCA 平台在执行该工具时,会自动拉取最新工具代码版本。

    第三步,在工具管理页面中创建工具

    • 进入工具管理页面,点击创建工具

      enter image description here

    • 填写工具信息

      enter image description here

      部分参数说明:

      • 工具仓库地址,即前述步骤中提交的工具 git 代码库地址,默认拉取的是master分支,如果是其他分支,需要在仓库地址后加上#分支名,比如:https://github.com/xxx/xxx.git#main

      • 工具认证,授权拉取工具仓库的权限

      • 执行命令,该命令会在工具根目录下执行

      • 环境变量,工具执行所需的环境变量

      • License,如果是开源工具,填写工具遵循的开源协议,或者填写自研共建

      • 是否为编译型工具,表示在使用该工具对用户代码进行分析时,是否要求代码需要编译或可执行编译

      • 注意:针对特殊扫描场景的工具(比如检查代码库下是否包含某些第三方依赖目录,结果不涉及单个代码文件的),无法对结果进行代码文件处理,可以通过设置以下环境变量,跳过一些通用的结果处理步骤,避免问题结果被过滤掉:

        • BLAME_TYPE=NO_BLAME,跳过对代码行/代码文件进行文件责任人定位(结果非单个文件/代码行时使用)
        • FILTER_TYPE=NO_VERSION_FILTER,跳过检查问题路径(path字段)是否为已提交到代码库中的文件(结果非单个文件/代码行时使用)
        • IGNORE_TYPE=NO_ISSUE_IGNORE,跳过注释忽略处理(结果非单个文件/代码行时使用)
    • 添加工具依赖

      enter image description here

      添加完成后,会展示已添加的依赖方案:

      enter image description here

    工具依赖说明:

    • 比如当前的demo工具,只需要依赖python3运行,而且支持在linux x86_64、linux arm64、mac和windows下执行,那么只需要配置一个依赖方案(如上图),并配置为默认方案。在不同的操作系统中,会自动加载对应操作系统的python环境。
    • 如果需要根据扫描项目设置的环境变量,加载不同的依赖配置,则可以配置不同的判断条件,使用多个依赖方案。

    第四步,为工具添加规则

    • 完成工具创建后,进入规则列表,为工具添加规则

      enter image description here

    • 填写规则信息

      部分参数说明:

      • 规则简介:简要描述规则发现的是什么问题,扫描结果中会作为问题标题展示

      • 详细描述:可详细描述规则,以及规则的解决方式,建议附上解决案例 demo

      • 解决方法:按照实际情况,说明该代码问题的解决方法,建议附上解决案例 demo

      • 规则参数:如果不需要通过规则参数传递信息,可留空

    第五步,将工具配置到执行节点

    提示

    需要联系平台管理员协助操作,在管理入口-节点管理中进入需要配置的机器节点的工具进程配置中,找到对应工具,勾选工具进程。

    完成节点配置工具进程后,才能在项目中采用该工具进行分析。

    enter image description here

    第六步,完成上述操作,在项目中使用工具规则

    • 进入到项目中,在分析方案-代码检查进行规则配置。

    • 点击添加规则,找到对应工具规则进行添加。

    • 添加完成后,启动分析,为了将规则应用到所有代码文件,建议启动一次全量分析(增量分析只会分析自上次扫描后变更的文件)。

    自定义工具权限说明

    • 默认自定义工具仅团队管理员可操作,团队内所有成员可使用。

      • 团队管理员才能创建工具,添加工具规则等,具备该工具全部权限

      • 团队内所有成员可使用该工具规则,如在规则配置中添加此工具规则,团队普通成员仅只读权限

    • 工具希望全平台使用?

      由于全平台使用的工具影响范围较大,建议团队先在团队内对工具进行充分测试,保障团队内工具的高有效性,如需全平台使用,需联系平台管理员进行申请

      平台管理员需对此工具进行审核,在确保工具的高有效性下可将此工具权限调整为全平台可使用

    + + + diff --git "a/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html" "b/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html" new file mode 100644 index 000000000..6ccc5e123 --- /dev/null +++ "b/zh/guide/\345\267\245\345\205\267\347\256\241\347\220\206/\350\207\252\345\256\232\344\271\211\350\247\204\345\210\231.html" @@ -0,0 +1,33 @@ + + + + + + + + + 自定义规则 | 腾讯云代码分析 + + + + +

    自定义规则

    自定义规则即由业务团队根据自身需求,由业务团队自行设计提供的规则。

    自定义规则权限说明

    • 工具需开放支持自定义规则权限,才可添加自定义规则。

      • 当前平台提供的工具中,仅TCA-Armory-RRegexFileScanRegexScan三款工具支持使用用户自定义规则。

      • 开放支持自定义规则权限,需平台管理员在管理入口-工具管理中找到对应工具,并将其权限状态调整为支持自定义规则

    • 自定义规则仅支持团队管理员添加,且默认仅团队内可见。

      • 满足不同团队自定义规则可能存在的差异和隐私性。
    • 如需将自定义规则加入工具默认规则,需联系工具提供方团队管理员添加。

    平台提供的正则工具 TCA-Armory-R 说明

    详见TCA-Armory-R使用手册

    平台提供的正则工具 RegexScan 说明

    正则工具 RegexScan 即为开放了自定义规则功能的工具,可进入工具管理页面,搜索工具名称RegexScan,查看该工具已存在的规则以及根据团队业务需求,添加自定义规则。

    适用场景:通过正则表达式,能够匹配到目标代码的情况。

    自定义规则步骤

    1. 根据团队业务需求设计正则表达式

      提示

      建议先测试好正则表达式是否正确,正则表达式测试网站推荐:http://tool.oschina.net/regex在新窗口打开

      规则示例:

      • 规则分析场景

        分析代码中的 usleep() 方法调用,如果参数小于 100 ,容易造成 CPU 使用率过高,造成性能浪费,判断为缺陷。

      • 正则表达式

        匹配 usleep() 字符串,括号中的内容为 1 位或 2 位整数,那么正则表达式可以写成 \busleep\s*\(\s*\d{1,2}\s*\),这里考虑了字符串中存在空格的情况。

    2. 进入正则工具添加自定义规则

      进入工具管理页面,找到正则工具RegexScan,并点击进入自定义规则列表页,点击添加规则按钮。

    3. 填写规则信息

      规则参数填写说明(必要):

      参数格式类似 ini 的格式, 也就是 key = value 的格式

      • 【必要】 regex 参数,用于指定分析的正则表达式, 例如: regex = \busleep\s*\(\s*\d{1,2}\s*\)

      • 【必要】 msg 参数,用于展现 issue 说明, 例如: msg = 函数方法%s 已经废弃,请使用 xxx 方法

        msg 中的“%s”使用 regex 中的 group(用“()"括起来的部分)一一匹配。

        如果 regex 没有定义 group,则 msg 最多有一个%s, 并由整个 regex 匹配的字符串替代

        如果 msg 里没有包含“%s”,则直接显示 msg

        如果 msg 没有提供,则默认为“发现不规范代码:%s”(不建议使用默认格式,太笼统)

      • 【可选填】 ignore_comment 参数,用于指定是否忽略注释代码,可选值:True、true、False、false 。例如 ignore_comment=True, 默认是 False

      • 【可选填】 include 参数,用于将指定分析文件匹配范围,使用 unix 的文件匹配格式,多项使用英文分号;隔开。例如 include = path/to/dir;path/to/\*.cpp

      • 【可选填】 exclude 参数,用于指定不分析的文件。格式参考 include 参数。

    4. 将自定义规则添加到项目分析方案中

      添加完成,可在分析方案-代码检查-规则配置中添加该自定义规则

    + + + diff --git "a/zh/guide/\345\277\253\351\200\237\345\205\245\351\227\250/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html" "b/zh/guide/\345\277\253\351\200\237\345\205\245\351\227\250/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html" new file mode 100644 index 000000000..20902ebbb --- /dev/null +++ "b/zh/guide/\345\277\253\351\200\237\345\205\245\351\227\250/\345\277\253\351\200\237\345\220\257\345\212\250\344\270\200\346\254\241\344\273\243\347\240\201\345\210\206\346\236\220.html" @@ -0,0 +1,33 @@ + + + + + + + + + 快速启动一次代码分析 | 腾讯云代码分析 + + + + +

    快速启动一次代码分析

    创建团队及项目

    • 创建团队
      点击了解团队管理

      创建团队

    • 为团队创建一个项目,或选择一个已有项目,并进入项目内

      创建项目

    登记代码库

    • 完成代码库登记,并点击进入代码分析

      代码库登记

      进入代码分析

    启动代码分析

    执行初始化创建

    开始分析

    提示

    1. 首次开启代码分析,用户可选择使用已有的分析方案模板,或创建分析方案的。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目,供用户启动代码分析。

    执行代码分析

    初始化创建项目后,可通过 在线分析客户端分析 来启动代码分析。

    代码分析

    在线分析

    在线分析即是通过Server端将分析任务注册到执行队列中,并将任务分配到平台配置的常驻分析节点上进行,分析完毕后将分析结果上报入库。

    提示

    使用在线分析要求平台具有常驻分析节点:

    • 如您的TCA平台是使用官方一键部署脚本完成的环境部署(Docker部署、Docker-Compose部署、源码部署三种),默认已启动一个分析节点(即客户端),可直接用于在线分析。可查看管理入口-节点管理确认该节点状态。

    • 您也可自行接入更多分析节点实现并行执行代码分析,接入节点操作请查阅常驻节点分析

    如无分析节点,在线分析任务将无法完成分配,未分配任务将于超时后自动注销

    客户端分析

    客户端分析即是本地分析,需要在本地有客户端,并配置好客户端配置文件 codedog.ini,详细操作参考:启动客户端分析。分析完毕后会将数据上报入库。

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 问题列表等。

    分支概览

    + + + diff --git "a/zh/guide/\346\217\222\344\273\266/Jenkins_Plugin.html" "b/zh/guide/\346\217\222\344\273\266/Jenkins_Plugin.html" new file mode 100644 index 000000000..79b2e4925 --- /dev/null +++ "b/zh/guide/\346\217\222\344\273\266/Jenkins_Plugin.html" @@ -0,0 +1,73 @@ + + + + + + + + + Jenkins插件使用说明 | 腾讯云代码分析 + + + + +

    Jenkins插件使用说明

    提示

    以下说明以 Jenkins 2.361.2 版本为例。

    使用前准备

    获取Jenkins插件

    Jenkins插件有以下两种获取方式:

    方式一:在 TCA 源码的plugin/jenkins_plugin目录下,执行命令mvn package -DskipTests,打包完成后进入target目录会看到tca_jenkins_plugin.hpi 的安装包。

    方式二:从TCA release 安装包中,获取jenkins_plugin.hpihttps://github.com/Tencent/CodeAnalysis/releases在新窗口打开

    在Jenkins安装插件

    在Jenkins中通过【Manage Plugin】-> 【Advanced】->【Deploy plugin】的方式选择 Jenkins_plugin.hpi文件上传安装,并重启Jenkins。

    最终在【Installed】里搜索出【TCA】代表插件安装成功。

    完善启动客户端的环境

    在CodeAnalysis目录下执行代码

    bash ./scripts/base/install_bin.sh
    +

    client目录下的config.ini文件中的<Server IP地址>替换为部署的开源版TCA的IP地址(可包含端口号)

    使用插件

    在 TCA 创建团队和项目

    如已创建后待使用的团队和项目,可跳过此步。

    进入已部署好的TCA页面,点击【创建团队】,成功后【创建项目】。

    配置Jenkins环境变量

    进入Jenkins设置界面,在【Manage Jenkins】->【Configure System】->【Global properties】中添加环境变量:
    Name:PYTHONPATH Value:xxxx(路径不包含python3)
    Value:GITPATH Value:xxxx(路径不包含git)

    配置 TCA 插件

    方式一:可视化界面配置 TCA 插件

    创建一个构建任务,配置代码库信息,进入Jenkins,通过【New Item】创建一个空白任务,在任务配置中【Source Code Management】配置待分析的代码库地址和凭证。
    Repository URL: 填入远端仓库地址
    Credentials: 添加仓库的用户名和密码作为凭证,如果是公开仓库,可以不设置仓库凭证

    在构建任务的【Build】中选择【TCA】插件并配置以下参数:

    CodeAnalysis目录绝对路径: 拉取到本地的CodeAnalysis开源仓库目录的绝对路径(例如:/data/CodeAnalysis/)
    团队ID: 在 TCA 中创建的团队的标识ID,可在TCA【团队概览】中获取“团队唯一标识”
    项目名称: 在 TCA 中创建的项目的标识ID,可在TCA【项目概览】中获取“项目唯一标识”
    Token: 在 TCA 的【个人中心】->【个人令牌】中获取
    分支名称: 需要扫描的代码分支名称
    语言类别: 项目需要扫描的语言
    分析方案模板ID: 需要使用的分析方案模板ID,在分析方案模板的“基础属性”中获取,将根据此模板创建分析方案(选填)
    分析方案名称: 指定创建出来的分析方案的名称(选填)
    全量扫描: 不勾选默认启动增量扫描
    质量门禁: 设置质量门禁值,配置和使用参考 设置质量门禁

    配置完成后点击【Save】保存。

    方式二:pipeline语法配置 TCA 插件

    在步骤中添加TCA插件参数配置语句,下面的配置语句可作为参考;注意:如果是release版本v1.11.0及之前的老版本(包含源代码构建生成和release获取)插件,语法参数略有差别,请参考issue1150在新窗口打开

    pipeline{
    +  agent any
    +
    +    stages{
    +      stage('Build'){
    +        steps{
    +            TCA(codeAnalysisPath: '/data/CodeAnalysis/', teamId: 'xxxx', projectName: 'demo', token: 'xxxxxxxxxxxx', branchName: 'master', languageType: 'Java', refSchemeID: '1', scanPlan: 'model', threshold: '90', total:true)
    +        }
    +      }
    +    }
    +}
    +
    +

    codeAnalysisPath: 拉取到本地的CodeAnalysis开源仓库目录的绝对路径(例如:/data/CodeAnalysis/)
    teamId:团队ID
    projectName: 项目名称
    token: 在 TCA 的【个人中心】->【个人令牌】中获取
    branchName: 需要扫描的代码分支名称
    languageType: 项目需要扫描的语言
    refSchemeID: 需要使用的分析方案模板ID,在分析方案模板的“基础属性”中获取,将根据此模板创建分析方案(选填)
    scanPlan: 指定创建出来的分析方案的名称(选填)
    threshold: 设置质量门禁值
    total: 是否全量扫描,填ture为全量扫描,不填或填false为增量扫描

    启动构建并查看结果

    点击【Build Now】启动构建。
    进入构建任务,在【Console Output】中查看执行过程。
    执行完成后,可在下方看到代码分析的结果链接,也可在【代码分析报告】中获取代码分析的json报告。

    设置质量门禁

    在上述 TCA 插件配置部分填写质量门禁参数,需要填写一个整数,即当前分支的扫描问题量大于该质量门禁值时,判断为不通过;否则为通过。完成后会将TCA结果状态(success|failure)输出到工作空间下的tca_threshold.txt文件中,供后续步骤判断和终止流水线。

    可视化界面使用质量门禁

    在TCA插件后增加shell命令步骤,输入以下脚本内容:

    tca_status=`cat tca_threshold.txt`
    +if [ "${tca_status}" == "success" ]; then
    +  echo ">> tca scan pass!"
    +else
    +  echo ">> tca scan fail! exit code 255"
    +  exit 255
    +fi
    +

    当质量门禁不通过时,会终止流水线(退出码:255)。

    pipeline脚本使用质量门禁

    以下是pipeline脚本使用质量门禁进行相应操作的示例,你可以在if和else部分写入你想要运行的脚本

    pipeline{
    +  agent any
    +
    +    stages{
    +      stage('Build'){
    +        steps{
    +            TCA(codeAnalysisPath: '/data/CodeAnalysis/', teamId: 'xxxx', projectName: 'demo', token: 'xxxxxxxxxxxx', branchName: 'master', languageType: 'Java', refSchemeID: '1', scanPlan: 'model', threshold: '90', total:true)
    +            script{
    +                def tca_status = readFile('tca_threshold.txt')
    +                if (tca_status == "success") {
    +                    echo ">> tca scan pass!"
    +                } else {
    +                    echo ">> tca scan fail! exit code 255"
    +                    error("TCA scan failed. Terminating pipeline.")
    +                }
    +            }
    +        }
    +      }
    +    }
    +}
    +
    + + + diff --git "a/zh/guide/\346\234\215\345\212\241\347\253\257/ScriptAPI_guide.html" "b/zh/guide/\346\234\215\345\212\241\347\253\257/ScriptAPI_guide.html" new file mode 100644 index 000000000..b47732830 --- /dev/null +++ "b/zh/guide/\346\234\215\345\212\241\347\253\257/ScriptAPI_guide.html" @@ -0,0 +1,54 @@ + + + + + + + + + API调用脚本使用指引 | 腾讯云代码分析 + + + + +

    API调用脚本使用指引

    操作步骤

    1. 修改脚本api_invoke.py的内部参数,填写个人令牌mytoken

    2. 部署代码分析服务

    3. 进入项目根目录

    4. 检查requests 模块是否安装,如未安装,可执行下列安装指令。

    pip install requests
    +

    5. 设置参数method,选择要执行的api接口,并根据接口添加所需参数。

    6. 执行脚本python ScriptsAPI.py

    方法总览

    method类型
    create_repository创建代码库
    update_scheme_settings设置指定代码库的指定方案的代码度量配置
    create_project创建分析项目
    create_scans启动任务
    get_scan_cons轮询任务结果
    get_overview获取分析概览
    get_issues查看扫描问题列表
    get_issue_detail查看问题详情
    get_ccissues查看指定项目的圈复杂度问题列表
    get_dupfiles查看指定项目的重复文件列表

    API详细信息

    一、创建代码库

    1. url请求

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,create_repository
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    scm_urlstr代码库地址
    scm_typestr填git或svn
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=create_repository --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --scm_url=${TCA_SCM_URL} --scm_type=${TCA_SCM_TYPE}
    +

    二、设置指定代码库的指定方案的代码度量配置

    1. url请求

    PUT /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/schemes/<scheme_id>/metricconf/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,update_scheme_settings
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    scheme_idstr扫描方案id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=update_scheme_settings --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --scheme_id=${TCA_SCHEME_ID}
    +

    三、创建分析项目

    1. url请求

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,create_repository
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    scan_scheme_idint和global_scheme_id二选一进行填写,当前代码库的扫描方案编号
    global_scheme_idint和scan_scheme_id二选一进行填写,扫描方案模板编号
    branchstr分支
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=create_project --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --scan_scheme_id=${TCA_SCAN_SCHEME_ID} --branch=${TCA_BRANCH}
    +

    四、启动任务

    1. url请求

    POST /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/scans/create/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,create_scans
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=create_scans --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}
    +

    五、轮询任务结果

    1. url请求

    GET /server/main/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/jobs/<job_id>/detail/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_scan_cons
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"
    sleeptimeint轮询间隔的时间

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_scan_cons --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID} --job_id=${TCA_JOB_ID}
    +

    六、获取分析概览

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/overview/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_overview
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_overview --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}
    +

    七、查看扫描问题列表

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_issues
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_issues --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}
    +

    八、查看问题详情

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codelint/issues/<issue_id>/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_issue_detail
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    issue_idstr问题id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_issue_detail --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID} --issue_id=${TCA_ISSUE_ID}
    +

    九、查看指定项目的圈复杂度问题列表

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/ccissues/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_ccissues
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_ccissues --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}
    +

    十、查看指定项目的重复文件列表

    1. url请求

    GET /server/analysis/api/orgs/<org_sid>/teams/<team_name>/repos/<repo_id>/projects/<project_id>/codemetric/dupfiles/
    +

    2. 参数说明

    脚本参数
    字段类型描述
    methodstr调用的方法名,get_dupfiles
    base_urlstr基础路径
    org_sidstr项目组名称
    team_namestr团队唯一标识
    repo_idstr代码库id
    project_idstr分析项目id
    脚本内部参数
    Key类型Value
    Authorizationstr"Token 当前user的token"

    3. 操作示例

    python ScriptsAPI.py --base_url=${TCA_BASE_URL} --method=get_dupfiles --org_sid=${TCA_ORG_SID} --team_name=${TCA_TEAM_NAME} --repo_id=${TCA_REPO_ID} --project_id=${TCA_PROJECT_ID}
    +
    + + + diff --git "a/zh/guide/\346\234\215\345\212\241\347\253\257/deploy_with_minio.html" "b/zh/guide/\346\234\215\345\212\241\347\253\257/deploy_with_minio.html" new file mode 100644 index 000000000..ab2c5828c --- /dev/null +++ "b/zh/guide/\346\234\215\345\212\241\347\253\257/deploy_with_minio.html" @@ -0,0 +1,53 @@ + + + + + + + + + 基于MinIO部署文件服务器 | 腾讯云代码分析 + + + + +

    基于MinIO部署文件服务器

    TCA的file服务支持对接MinIO作为底层存储,将文件转发到已部署的MinIO平台上进行持久化存储

    本地部署

    注意:如果之前已经使用本地进行存储,切换为MinIO后,之前已经上传的文件只能到服务部署的目录server/projects/file/data查看,不支持通过页面进行下载

    前置步骤

    获取MinIO平台登录的账号密码,用于上传文件

    配置步骤

    1. 调整file服务的配置

    修改server/configs/django/local_file.py文件,取消以下代码的注释

    # MINIO
    +STORAGE = {
    +    "CLIENT": os.environ.get("FILE_STORAGE_CLIENT", "MINIO"),  # 存储方式
    +    "OPTIONS": {
    +        "MINIO_ENTRYPOINT": os.environ.get("FILE_MINIO_ENTRYPOINT"),
    +        "MINIO_ACCESS_KEY": os.environ.get("FILE_MINIO_ACCESS_KEY"),
    +        "MINIO_SECRET_KEY": os.environ.get("FILE_MINIO_SECRET_KEY"),
    +    }
    +}
    +

    修改server/scripts/config.sh文件,填写MinIO的信息

    export FILE_MINIO_ENTRYPOINT=<MinIO平台的地址>
    +export FILE_MINIO_ACCESS_KEY=<MinIO平台的登录账号>
    +export FILE_MINIO_SECRET_KEY=<MinIO平台的登录密码>
    +

    修改完配置后,如果服务已经正在运行,则执行以下命令重启服务

    $ cd server
    +$ ./scripts/deploy.sh start
    +

    2. 修改nginx服务的配置文件

    删除nginx已有的文件服务器配置文件/etc/nginx/conf.d/tca_file_local.conf文件,然后执行

    rm /etc/nginx/conf.d/tca_file_local.conf
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_minio.conf /etc/nginx/conf.d/tca_file_local.conf
    +

    也可以修改server/scripts/init_config.sh

    # 注释这一行
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_local.conf /etc/nginx/conf.d/tca_file_local.conf
    +# 取消注释这一行
    +ln -s $CURRENT_PATH/configs/nginx/tca_file_minio.conf /etc/nginx/conf.d/tca_file_local.conf
    +

    修改完配置后,如果nginx已经正在运行,则执行nginx -s reload

    结尾

    以上两个步骤操作完成后,就可以通过MinIO存储文件了~

    + + + diff --git "a/zh/guide/\346\234\215\345\212\241\347\253\257/deploy_without_migrate.html" "b/zh/guide/\346\234\215\345\212\241\347\253\257/deploy_without_migrate.html" new file mode 100644 index 000000000..59533945e --- /dev/null +++ "b/zh/guide/\346\234\215\345\212\241\347\253\257/deploy_without_migrate.html" @@ -0,0 +1,33 @@ + + + + + + + + + 腾讯云代码分析 + + + + +

    在实际的生产环境的部署过程中,团队的MySQL的管理员可能不会给到应用账号create等比较敏感的权限,这种情况下,我们可以通过手动迁移数据的方式起到和等同Django migrate的效果。

    操作步骤:

    1. 进入Server服务工作目录后(假设工作目录为 /data/CodeAnalysis/server/,以下路径均为工作目录内的相对路径)
    2. 在开发环境一个有全部权限的MySQL地址,初始化数据(MySQL版本运行版本:5.7)
      • 执行vi ./scripts/config.sh:填写一个有全部权限的MySQL数据库地址和Redis信息以及根据需要调整配置信息,主要的工程配置已提供默认值,字段说明可以查看文档
      • 执行bash ./scripts/deploy.sh init:初始化DB、安装依赖和运行初始化脚本
      • 使用MySQLDump工具导出表结构与数据:mysqldump -u user -p –databases codedog_main codedog_analysis codedog_file codedog_login > codedog_all.sql
    3. 在生产环境建数据库,详情见:server/sql/init.sql
    4. 连接MySQL,导入数据:
      • 临时关闭外键检查: SET SESSION FOREIGN_KEY_CHECKS=0,否则会因为数据中有外键关联导致导入失败
      • 导入表结构与数据: source /youdir/codedog_all.sql;
      • 开启外键检查: SET SESSION FOREIGN_KEY_CHECKS=1
    5. 启动服务: 直接执行 bash ./scripts/deploy.sh start,无需执行 init方法,否则会导致数据重复写入
    + + + diff --git "a/zh/guide/\346\234\215\345\212\241\347\253\257/gitlab_oauth_guide.html" "b/zh/guide/\346\234\215\345\212\241\347\253\257/gitlab_oauth_guide.html" new file mode 100644 index 000000000..ad1c52ea0 --- /dev/null +++ "b/zh/guide/\346\234\215\345\212\241\347\253\257/gitlab_oauth_guide.html" @@ -0,0 +1,66 @@ + + + + + + + + + 私有化gitlab Oauth认证 | 腾讯云代码分析 + + + + +

    私有化gitlab Oauth认证

    一、操作步骤

    1、 本地gitlab 生成 application

    (1)进入Preferences模块

    (2)选择Application模块

    (3)添加新的application

    (4)填写name、Redirect url并勾选可用权限

    (5)保存application

    2、在项目配置文件中添加相关配置信息

    以下三种部署方式选择其中一项即可。

    (1)docker-compose 部署方式

    找到server/dockerconfs/ 目录下的 .env.local 文件,添加配置信息。

    #Oauth认证相关配置
    +GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行更新部署操作

    bash ./quick_install.sh docker-compose stop  #停止运行中的TCA容器
    +bash ./quick_install.sh docker-compose deploy  #重新部署TCA相关容器与初始化(或刷新数据)
    +

    (2)docker 部署方式

    在/.docker_temp/configs/config.sh 中添加以下配置 (首次部署无该文件夹)

    #Oauth认证相关配置
    +export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行更新部署操作

    bash ./quick_install.sh docker deploy
    +

    (3)源代码部署方式

    在/scripts/config.sh 中添加以下配置

    #Oauth认证相关配置
    +export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行重新启动操作

    bash ./quick_install.sh local start  #启动服务(会自动关闭之前的服务)
    +

    3、代码分析平台添加Oauth配置

    (1)进入后台管理

    (2)选择Oauth管理

    (3)创建配置,将application中的Application ID、Secret 和 Callback URL分别填入指定位置。

    (4)前往个人凭证管理,点击认证。

    (5)弹出私有化gitlab的页面,点击Authorize 进行授权。

    (6)授权成功

    二、详细操作过程说明

    1、 本地gitlab 生成 application

    (1)进入Preferences模块

    gitlab_application

    (2)选择Application模块

    gitlab_application

    (3)添加新的application

    填写重定向url,“http://<部署gitlab的ip地址>/cb_git_auth/gitlab”

    scopes尽量都勾选,以开启对私有化代码库的访问权限 gitlab_application

    保存application gitlab_application 这里的Application ID、Secret 和 Callback URL 之后需要填写到代码分析服务中。

    2、在项目配置文件中添加相关配置信息

    以下三种部署方式选择其中一项即可。

    (1)docker-compose 部署方式

    找到server/dockerconfs/ 目录下的 .env.local 文件,添加配置信息。

    #Oauth认证相关配置
    +GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行更新部署操作

    bash ./quick_install.sh docker-compose stop  #停止运行中的TCA容器
    +bash ./quick_install.sh docker-compose deploy  #重新部署TCA相关容器与初始化(或刷新数据)
    +

    (2)docker 部署方式

    在/.docker_temp/configs/config.sh 中添加以下配置 (首次部署无该文件夹)

    #Oauth认证相关配置
    +export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行更新部署操作

    bash ./quick_install.sh docker deploy
    +

    (3)源代码部署方式

    在/scripts/config.sh 中添加以下配置

    #Oauth认证相关配置
    +export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    在项目根目录下执行重新启动操作

    bash ./quick_install.sh local start  #启动服务(会自动关闭之前的服务)
    +

    3、代码分析平台添加Oauth配置

    (1)进入后台管理

    gitlab_oauth_disposition

    (2)进入Oauth管理

    gitlab_oauth_disposition

    (3)创建配置

    将application中的Application ID、Secret 和 Callback URL分别填入 gitlab_oauth_disposition

    (4)前往个人凭证管理,点击认证

    gitlab_oauth_dispositiongitlab_oauth_disposition

    (5)弹出私有化gitlab的页面,点击Authorize 进行授权。

    gitlab_oauth_disposition

    (6)授权成功

    gitlab_oauth_disposition

    三、常见问题

    1、使用Oauth登录的方式,认证时跳转页面失败

    gitlab_oauth_QA

    错误详情:

    An error has occurred

    Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.

    解决方案:

    gitlab_oauth_QA

    如图,GITLAB_OAUTH_URL没有配置,默认使用 https://gitlab.com/oauth/authorize 。

    需要根据项目部署方式,修改配置信息。

    (1)docker-compose 部署方式

    找到server/dockerconfs/ 目录下的 .env.local 文件,添加配置信息

    GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +

    (2)docker 部署方式

    在/.docker_temp/configs/config.sh 中添加以下配置 (首次部署无该文件夹)

    export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +

    (3)源代码部署方式

    在/scripts/config.sh 中添加以下配置

    export GITLAB_OAUTH_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/oauth/authorize/"
    +

    2、无法找到本地部署的服务对应的前端页面

    gitlab_oauth_QA

    错误详情:

    此站点的连接不安全,发送了无效的响应。

    ERR_SSL_PROTOCOL_ERROR

    解决方案:

    配置的url存在问题,可能使用了https协议,访问本地ip不能用https协议,修改成http。

    3、认证没有跳转到正确的页面,或直接跳回到代码分析平台登陆界面。

    解决方案:

    (1)检查配置url是否加端口号,默认80端口可能已经被占用,或已经分配给代码分析平台。 gitlab_oauth_QA

    (2)检查回调地址是否填写端口号 gitlab_oauth_QA

    4、OAuth授权失败

    gitlab_oauth_QA

    错误详情:

    oauth failed, err: 未知错误: <class 'Exception'>:{method: git_oauth, error_message: [400] 授权异常,请稍后再试,异常原因:{"error":"invalid_client","error_description":"Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."}}

    解决方案:

    client.py 中存在默认的GITLAB_URL,如果在配置文件中没有设置GITLAB_URL,那么TCA将默认访问https://gitlab.com

    GITLAB_URL = os.environ.get("GITLAB_URL") or "https://gitlab.com"
    +

    客户端调用的API都需要使用到GITLAB_URL作为前缀的路径,会发送post请求到 https://gitlab.com 路径下,因此需要对路径进行修改。

    gitlab_oauth_QA

    要连接私有化的gitlab,需要根据项目部署方式,修改配置信息。

    (1)docker-compose 部署方式

    找到server/dockerconfs/ 目录下的 .env.local 文件,添加配置信息

    GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    (2)docker 部署方式

    在/.docker_temp/configs/config.sh 中添加以下配置 (首次部署无该文件夹)

    export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +

    (3)源代码部署方式

    在/scripts/config.sh 中添加以下配置

    export GITLAB_URL="http://<部署gitlab的ip地址>:<gitlab 端口号>/"
    +
    + + + diff --git "a/zh/guide/\346\234\215\345\212\241\347\253\257/server.html" "b/zh/guide/\346\234\215\345\212\241\347\253\257/server.html" new file mode 100644 index 000000000..b7179bb53 --- /dev/null +++ "b/zh/guide/\346\234\215\345\212\241\347\253\257/server.html" @@ -0,0 +1,37 @@ + + + + + + + + + TCA Server | 腾讯云代码分析 + + + + +

    TCA Server

    工程结构

    TCA Server由Main、Analysis、Login、File、ScmProxy五个微服务组成,主要技术栈为Django+uwsgi+nginx

    配置说明

    注意:以下配置内容可以参考 config.sh在新窗口打开文件进行查阅,使用时主要关注 MySQL、Redis 的配置,其他配置均已提供默认值,可以根据需要进行调整

    Main服务

    框架配置:

    • MAIN_DEBUG_MODE: Main服务的Debug模式,true/false
    • MAIN_SECRET_KEY: Main服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Main服务DB配置:

    • MAIN_DB_NAME:Main服务的数据库名称
    • MAIN_DB_USER:Main服务的数据库用户名
    • MAIN_DB_PASSWORD:Main服务的数据库密码
    • MAIN_DB_HOST:Main服务的数据库地址
    • MAIN_DB_PORT:Main服务的数据库端口号

    Main服务Redis配置:

    • MAIN_REDIS_HOST:Main服务访问的Redis地址
    • MAIN_REDIS_PORT:Main服务访问的Redis端口号
    • MAIN_REDIS_PASSWD:Main服务访问的Redis密码
    • MAIN_REDIS_DBID:Main服务访问的Redis DB编号,默认为1(Analysis服务默认访问0号DB)

    服务交互配置:

    • MAIN_SENTRY_DSN:Main服务异常日志上报至sentry配置
    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token
    • FILE_SERVER_TOKEN:文件服务器访问Token
    • CODEDOG_TOKEN:CodeDog默认访问的Token

    Analysis服务

    框架配置:

    • ANALYSIS_DEBUG_MODE: Analysis服务的Debug模式,true/false
    • ANALYSIS_SECRET_KEY: Analysis服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Analysis服务DB配置:

    • ANALYSIS_DB_NAME:Analysis服务的数据库名称
    • ANALYSIS_DB_USER:Analysis服务的数据库用户名
    • ANALYSIS_DB_PASSWORD:Analysis服务的数据库密码
    • ANALYSIS_DB_HOST:Analysis服务的数据库地址
    • ANALYSIS_DB_PORT:Analysis服务的数据库端口号

    Analysis服务Redis配置:

    • ANALYSIS_REDIS_HOST:Analysis服务访问的Redis地址
    • ANALYSIS_REDIS_PORT:Analysis服务访问的Redis端口号
    • ANALYSIS_REDIS_PASSWD:Analysis服务访问的Redis密码
    • ANALYSIS_REDIS_DBID:Analysis服务访问的Redis DB编号,默认为0(Main服务默认访问1号DB)

    服务交互配置:

    • ANALYSIS_SENTRY_DSN:Analysis服务异常日志上报至sentry配置
    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    Login服务

    框架配置:

    • LOGIN_DEBUG_MODE: Login服务的Debug模式,true/false
    • LOGIN_SECRET_KEY: Login服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    Login服务DB配置:

    • LOGIN_DB_NAME:Login服务的数据库名称
    • LOGIN_DB_USER:Login服务的数据库用户名
    • LOGIN_DB_PASSWORD:Login服务的数据库密码
    • LOGIN_DB_HOST:Login服务的数据库地址
    • LOGIN_DB_PORT:Login服务的数据库端口号

    服务交互配置:

    • PASSWORD_KEY:数据加密密钥
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    注:配置文件中的pub_key与private_key生成方式可以参考以下方法:

    $ ssh-keygen -t rsa -b 1024 -m PEM -f tca_login.key
    +$ openssl rsa -in tca_login.key -pubout -outform PEM -out tca_login.key.pub
    +$ cat tca_login.key  # 作为private_key的内容
    +$ cat tca_login.key.pub  # 作为pub_key的内容
    +

    File服务

    框架配置:

    • FILE_DEBUG_MODE: File服务的Debug模式,true/false
    • FILE_SECRET_KEY: File服务的Secret Key配置,可以通过from django.core.management.utils import get_random_secret_key;get_random_secret_key()方法获取

    File服务DB配置:

    • FILE_DB_NAME:File服务的数据库名称
    • FILE_DB_USER:File服务的数据库用户名
    • FILE_DB_PASSWORD:File服务的数据库密码
    • FILE_DB_HOST:File服务的数据库地址
    • FILE_DB_PORT:File服务的数据库端口号

    服务交互配置:

    • FILE_SENTRY_DSN:File服务异常日志上报至sentry配置
    • API_TICKET_SALT:服务访问Token加密密钥
    • API_TICKET_TOKEN:服务访问Token

    File存储引擎配置

    • FILE_STORAGE_CLIENT: 文件存储引擎,可选项:LOCAL/MINIO/COS
      • 当配置引擎为LOCAL,可以指定FILE_STORAGE_DIR文件存放的路径
      • 当配置引擎为MINIO,可以指定以下变量:
        • FILE_MINIO_ENTRYPOINT:MINIO服务地址
        • FILE_MINIO_ACCESS_KEY:MINIO服务访问账号
        • MINIO_SECRET_KEY:MINIO服务访问密码
      • 当配置引擎为COS,可以指定以下变量
        • TENCENT_COS_APPID
        • TENCENT_COS_SECRETID
        • TENCENT_COS_SECRETKEY
        • TENCENT_COS_REGION
        • TENCENT_COS_ROOT_BUCKET:填写格式为bucket-appid

    ScmProxy

    服务配置:

    • SCMPROXY_HOST:ScmProxy服务的HOST,默认为0.0.0.0
    • SCMPROXY_PORT:ScmProxy服务监听端口,默认为8009
    • SCMPROXY_SENTRY_URL:ScmProxy服务异常日志上报至sentry配置
    • SCMPROXY: 通过本环境变量去指定其他服务调用ScmProxy服务的地址,默认值为127.0.0.1:8009
    + + + diff --git a/zh/index.html b/zh/index.html new file mode 100644 index 000000000..ecff792fc --- /dev/null +++ b/zh/index.html @@ -0,0 +1,33 @@ + + + + + + + + + 腾讯云代码分析 + + + + + + + + diff --git a/zh/quickStarted/FAQ.html b/zh/quickStarted/FAQ.html new file mode 100644 index 000000000..972141b87 --- /dev/null +++ b/zh/quickStarted/FAQ.html @@ -0,0 +1,96 @@ + + + + + + + + + FAQ | 腾讯云代码分析 + + + + +

    FAQ

    提示

    该Q&A文档会持续更新,非常欢迎您的建议与共建!

    如果您遇到任何未在此处列出的部署或使用问题,请在 GitHub issue 系统中进行搜索。如果仍未找到该错误消息,您可以通过社区提出问题,获得帮助。

    Server常见问题与处理方法

    1. 环境部署

    1.1 pypi下载超时或失败

    如果在执行pip install环节出现以下错误,可以调整一下镜像源:

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted. org', port=443): Read timed out.(read timeout=15)") '
    +

    该错误是访问官方pypi下载源时网络不通或者不稳定导致,可以通过以下方式调整:

    本地部署时,调整pypi下载源配置方式:

    mkdir ~/.pip/
    +echo "[global]\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf
    +

    Docker-Compose部署时,调整pypi下载源配置方式:

    vi server/dockerconfs/Dockerfile-common
    +

    调整文件中最后一行 RUN指令

    RUN mkdir -p log/ && \
    +    mkdir ~/.pip/ && \
    +    echo "[global]\nindex-url = https://mirrors.cloud.tencent.com/pypi/simple" >> ~/.pip/pip.conf && \
    +    pip install -U setuptools pip && \
    +    pip install -r requirements.txt
    +

    注:如果需要指定其他pypi下载源,可以将https://mirrors.cloud.tencent.com/pypi/simple进行替换

    如果出现以下错误:

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f6d4ac24910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
    +

    该错误是无法正常解析pypi访问域名,需要检查一下本地的dns配置是否正常

    1.2 Docker未安装或版本过低

    TCA Server使用Docker-Compose依赖的Docker版本需要是1.13.0及以上,可以执行以下命令查看Docker版本

    $ docker --version
    +Docker version 18.09.7, build 2d0083d
    +

    文档相关:

    1.3 Docker-Compose启动失败

    如果启动Docker-Compose输出以下错误:

    * Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +* Error response from daemon: Error processing tar file(exit status 1): unexpected EOF
    +

    问题原因:可能镜像构建目录权限不足,导致异常。 解决方案:

    1. 执行docker-compose build可以通过日志查看是哪个镜像构建异常
    2. 切换到具体目录执行docker build .可以看到详细错误信息,结合具体错误信息进行处理
    3. 收集常见的错误日志,整理相关解决方案(注:欢迎大家补充)

    文档相关:

    1.4 Docker镜像源下载超时或失败

    目前TCA基础镜像是使用python:3.7.12-slim,该镜像是基于debian bullseye(debian 11)版本构建的,对应的源需要选择 bullseye 版本的源。

    如果使用默认的下载源会报错或访问速度比较慢,可以调整server/dockerconfs/Dockerfile-common,指定其他国内下载源:

    # FROM python:3.7.12-slim
    +
    +# 增加一下内容用于指定下载源
    +RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
    +    echo 'deb http://mirrors.tencent.com/debian/ bullseye main non-free contrib' > /etc/apt/sources.list && \
    +    echo 'deb http://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib' >> /etc/apt/sources.list && \
    +    echo 'deb http://mirrors.tencent.com/debian-security bullseye-security main non-free contrib' >> /etc/apt/sources.list
    +
    +# ARG EXTRA_TOOLS=...
    +

    如果出现以下错误:E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages 可以做以下检查,确认是什么原因:

    1. 检查一下本地服务器的时间配置是否正常
    2. 调整下载源

    1.5 Python安装或执行失败

    使用Python执行时提示ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory,该如何处理

    1. 在本地安装Python的目录中查找该文件,比如Python的安装目录是/usr/local/python3,可以执行find /usr/local/python3 -name "libpython3.7m.so.1.0",确认本地是否存在该文件

    2. 如果本地存在该文件,则执行以下命令:(注:需要将/usr/local/python3调整为本地实际的Python3安装路径)

      # 链接构建产出的Python动态库
      +$ ln -s /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib/libpython3.7m.so.1.0
      +# 配置动态库
      +$ ldconfig
      +
    3. 如果本地不存在该文件,则可能需要重新安装Python3:(注:以下是将Python安装到/usr/local/python3,可以根据实际情况进行调整)

      # 编译前配置,注意重点:需要加上参数 --enable-shared
      +$ ./configure prefix=/usr/local/python3 --enable-shared
      +

    文档相关:

    1.6 执行compose_init.sh脚本的pip install提示sha256不匹配错误

    在构建镜像的pip install步骤提示以下报错时:

    ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    +    setuptools from https://mirrors.cloud.tencent.com/pypi/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8:
    +        Expected sha256 26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8
    +             Got        ddaacc49de5c08c09d744573240a9a49f24f65c5c72380e972433784caa68d98
    +

    可以执行export ORIGIN=normal,然后再执行./compose_init.sh

    注:执行export命令的作用是调整为pypi默认官方下载源进行pip install

    1.7 MacBook M1 使用 Docker-Compose报错

    在M1机器上使用默认配置启动docker-compose,会出现mysqlscmproxy服务启动失败,需要做以下两步调整

    1. 调整docker-compose.yml文件,修改MySQL的镜像版本:

      # 默认:
      +image: mysql:5.7.24
      +
      +# 调整后:
      +image: mariadb:10.5.8
      +
    2. 调整server/dockerconfs/Dockerfile-common文件,修改Python的镜像版本:

      # 默认:
      +FROM python:3.7.12-slim
      +
      +# 调整后:
      +FROM amd64/python:3.7.12-slim
      +

    1.8 celery、gunicorn命令找不到

    如果启动服务时,提示:celery could not be foundgunicorn could not be found,需要做以下检查

    1. 执行python -v检查输出,确认当前python版本是否为python3.7
    2. 执行pip install celerypip install gunicorn检查celery和gunicorn是否已经安装
    3. 如果已经安装,可以执行以下命令建立软链:(注:需要将/usr/local/python3调整为本地实际的Python3安装路径)
    ln -s /usr/local/python3/bin/gunicorn /usr/local/bin/gunicorn
    +ln -s /usr/local/python3/bin/celery /usr/local/bin/celery
    +

    1.9 脚本安装过程报错,出现格式问题

    使用docker方式部署项目时,提示

    fatal: 无法访问 'https://git.code.tencent.com/TCA/tca-tools/tca_lib.git/': URL using bad/illegal format or missing URL.
    +Download lib failed
    +

    该如何处理。

    出错原因可能是Windows系统、和macOs系统、linux系统的行分隔符不同,可以先查看当前文件的换行符是 CRLF 还是LF, 如果要部署在Windows系统系统上,行分隔符应该为CRLF格式,部署在linux和macOS系统预期是LF格式,如果不一致需要进行手动修改。

    修改方式可以选择: 1、使用pycharm打开项目,依次点击”File”->”Settings”->”Editor”->”Code Style”->”General” 在面板中,可以找到”Line separator”选项,根据要部署的系统选择行分隔符格式。 2、也可以使用dos2unix、unix2dos等转换命令,例如从Windows系统打包到Linux系统,当前行分隔符为CRLF,需要对脚本执行 dos2unix fileName指令进行转换 ,注意使用该指令前需要先进行安装。

    完成以上操作之后再对代码进行打包,即可部署运行。

    2. 服务启动与初始化

    2.1 服务占用端口异常

    TCA 本地部署启动后,会监听多个端口:

    • web服务:80
    • nginx服务:8000
    • main服务:8001
    • analysis服务:8002
    • login服务:8003
    • file-nginx服务:8004
    • file服务:8804
    • scmproxy服务:8009

    如果出现端口占用冲突,建议采用以下方式解决:

    1. 调整其他程序监听的端口号,避免跟上述TCA服务的端口号出现冲突
    2. 采用Docker-Compose方式启动TCA,仅监听80端口

    不推荐调整TCA指定服务的端口号,需要调整多处配置,以及可能会影响到后续服务的升级

    2.2 服务输出日志找不到

    本地部署输出的日志位置:

    1. main服务输出的日志目录:server/projects/main/log
      • 服务启动日志:server/projects/main/log/gunicorn_error.log
      • 服务接收请求日志:server/projects/main/log/gunicorn_access.log
      • Celery Worker启动日志(处理异步任务):server/projects/main/nohup_worker.out
      • Celery Beat启动日志(启动定时任务):server/projects/main/nohup_beat.out
      • 服务运行日志:server/projects/main/log/codedog.log
      • Celery Worker运行日志:server/projects/main/log/main_celery.log
      • Celery Beat运行日志:server/projects/main/log/main_beat.log
    2. analysis服务输出的日志目录:server/projects/analysis/log
      • 服务启动日志:server/projects/analysis/log/gunicorn_error.log
      • Celery Worker启动日志:server/projects/analysis/nohup.out
      • 服务接收请求日志:server/projects/analysis/log/gunicorn_access.log
      • 服务运行日志:server/projects/analysis/log/codedog.log
      • Celery Worker运行日志(处理结果入库):server/projects/analysis/log/celery.log
    3. login服务输出的日志目录:server/projects/login/log
      • 服务启动日志:server/projects/login/log/gunicorn_error.log
      • 服务接收请求日志:server/projects/login/log/gunicorn_access.log
      • 服务运行日志:server/projects/login/log/codedog.log
    4. file服务输出的日志目录:server/projects/file/log
      • 服务启动日志:server/projects/file/log/gunicorn_error.log
      • 服务接收请求日志:server/projects/file/log/gunicorn_access.log
      • 服务运行日志:server/projects/file/log/codedog_file.log
    5. scmproxy服务输出的日志目录:server/projects/scmproxy/logs
      • 服务启动日志:server/projects/scmproxy/nohup.out
      • 服务运行日志:server/projects/scmproxy/logs/scmproxy.log

    2.3 服务启动失败

    1. 启动服务报错 json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
      • 检查config.ini文件和codedog.ini文件是否按照json格式正确填写
      • 如果config.ini文件中的 【SERVER_URL】已正确填写,则检查codedog.ini文件中是否有填写codedog_env配置项。如果有填写,往往因为填写有误(比如URL缺少最后的/)导致报错。建议直接删除codedog.ini文件的codedog_env配置项(config.ini已配置【SERVER_URL】,无需重复配置),再尝试重启服务。

    3. 平台使用

    3.1 平台登录的默认账号密码是什么?

    默认账号: CodeDog,密码: admin

    3.2 平台默认的API Token是什么?

    默认Token是0712b895f30c5e958ec71a7c22e1b1a2ad1d5c6b

    如果在平台上刷新了CodeDog用户的Token,需要将刷新后的Token填写到以下文件中:

    1. server/scripts/config.sh文件
      • 更新CODEDOG_TOKENFILE_SERVER_TOKEN变量的值(3个位置)
    2. server/dockerconfs/.env.local文件
      • 更新CODEDOG_TOKENFILE_SERVER_TOKEN变量的值(3个位置)

    然后重启服务。

    1. 本地部署:

      cd server/
      +./scripts/deploy.sh start
      +
    2. docker-compose部署:

      $ docker-compose stop
      +# 稍等片刻
      +$ docker-compose up -d
      +

    3.3 代码库登记出错,出现代码库及账号不匹配

    该错误出现可能有以下几个原因:

    1. 账号密码不准确或登记的代码库地址不存在
    2. 登记github使用的密码需要使用personal access token在新窗口打开
    3. scmproxy服务启动失败
      • 本地部署:执行ps aux | grep proxyserver看看是否有python proxyserver.py执行进程,如果不存在可以看一下server/projects/scmproxy/nohup.out看看启动失败的原因
      • docker-compose部署:在项目根目录执行docker-compose ps看看scmproxy容器是否正常启动,如果没有启动,可以执行docker-compose logs scmproxy看看启动失败的原因
    4. scmproxy所在的机器/容器因为网络问题无法访问对应的代码库
      • 可以手动在机器/容器中执行git clone xxxx(xxx表示待登记的代码库),检查看看是否能够正常拉取
    5. scmproxy所在的机器git版本较低,出现unknown option `local` 错误
      • 可以升级机器上的git版本,目前工具支持最低的git版本为1.8.3.1

    3.3.2 代码库登记成功后,开启第一次代码分析时,出现代码库及账号不匹配

    该错误出现可能有以下几个原因:

    1. 代码仓库地址不支持https访问,但分析时请求的https访问
      • 修改 .docker_temp/configs/config.sh, 将HTTPS_CLONE_FLAG调整为false, 然后重启容器docker restart tca-services

    3.4 查看问题文件提示获取代码信息耗时较久,请稍后再试

    出现该提示的原因是,代码库偏大或clone代码库时间较长,可以稍等一会再刷新重试

    3.5 客户端访问文件服务器,提示method(upload_file) call fails on error: Expecting value: line 1 column 1 (char 0)

    出现这种错误,可能是本地配置异常或token配置有问题,检查方式如下:

    1. 检查客户端的config.ini文件配置的URL是否为当前Server部署的地址:(xxx需要调整为实际的路径)

      [SERVER_URL]
      +URL=http://xxx/server/main/
      +[FILE_SERVER]
      +URL=http:/xxx/server/files/
      +

      如果xxx不一致需要调整为一致

      注: xxx地址与在浏览器访问平台的xxx地址是一致的,不需要区分端口

    2. 检查客户端访问Server是否能通:

      curl -v http://xxx/server/main/
      +

      如果不通,则需要检查客户端机器访问Server机器是否有网络限制

    3. 检查当前在codedog.ini-[config]tokenconfig.ini文件配置的[FILE_SERVER]TOKEN是否一致,如果不一致需要调整为一致

    4. 检查用户CodeDogToken是否被刷新了然后没有更新到配置文件中

    3.6 客户端访问文件服务器,提示Connection timed out

    本地客户端执行过程提示method (upload file) call fails on error: <urlopen error [Errno 110] Connection timed out> 该如何处理? 一般情况下,这个问题是客户端与Server之间网络不通导致,可以检查一下是否有防火墙限制或者配置的URL是内部IP或地址,可以通过以下方式检查

    1. 检查客户端的config.ini文件配置的URL是否为当前Server部署的地址:(xxx需要调整为实际的路径)

      [SERVER_URL]
      +URL=http://xxx/server/main/
      +[FILE_SERVER]
      +URL=http:/xxx/server/files/
      +
    2. 检查客户端访问Server是否能通:

      curl -v http://xxx/server/main/
      +

      如果不通,则需要检查客户端机器访问Server机器是否有网络限制

    3.7 任务执行结果异常,提示第三方依赖文件服务器异常

    出现该错误提示,一般是访问文件器出错或文件服务器本身有问题,可以通过以下方式检查: 需要检查analysis-worker的日志(本地部署:server/projects/analysis/log/celery.log,docker-compose部署:docker-compose exec analysis-worker /bin/bash进入容器后访问log/celery.log查看具体错误原因

    如果提示no route to host可能是当前机器/容器无法访问当前宿主机的IP,可以检查一下当前防火墙的设置,是否限制了analysis-worker来源的访问

    3.8 客户端执行时提示工具(xxx)扫描进程为空,请联系管理员配置工具进程!

    出现该错误提示,一般是Server未进行初始化,可以通过执行以下命令初始化后再启动测试

    • 本地部署:cd server && ./scripts/deploy.sh init
    • docker-compose部署:./compose_init.sh

    CodeAnalysis仓库文件问题

    1. clone到本地时相关md文件内资源图片无法显示

    为防止国内用户访问CodeAnalysis Github首页时图片资源加载失败,目前各个md文件中的图片资源引用地址调整增加了URL前缀https://tencent.github.io/CodeAnalysis/

    用户下载代码库到本地后,发现无法访问资源文件时,请检查本地网络是否能够连通外网,如果无法连通外网,可以在文档引入资源地址中进行相对路径替换,调整各个资源文件的链接。

    • 对于根目录下的md文件,直接删除URL前缀即可:

      例如在https://tencent.github.io/CodeAnalysis/media/homepage.png这个链接可以调整为media/homepage.png

    • 对于其他目录下的md文件,删除URL前缀后,需调整文件相对路径链接:

      例如对于doc/client.md, 需将https://tencent.github.io/CodeAnalysis/media/clientConfigIni.png这个链接调整为../media/clientConfigIni.png

    + + + diff --git a/zh/quickStarted/codeDeploy.html b/zh/quickStarted/codeDeploy.html new file mode 100644 index 000000000..2b40a4b64 --- /dev/null +++ b/zh/quickStarted/codeDeploy.html @@ -0,0 +1,39 @@ + + + + + + + + + 源代码快速部署 | 腾讯云代码分析 + + + + +

    源代码快速部署

    TCA提供部署脚本,支持一键式快速部署Server、Web、Client。
    脚本共提供三种部署方式:Docker部署(平台体验首推)Docker-Compose部署、源码部署, 可根据您的具体使用场景任意选择其一进行部署。

    依赖环境

    • 系统环境

      • Linux
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备

      提示

      TCA 一键部署脚本已封装好 Python、Mariadb、Redis 与 Nginx 安装步骤,无需自行安装本地部署体验可按 操作说明 内容直接进行部署操作。

      注意:生产环境建议使用专业的 MySQL、Redis 等服务

      • Python 3.7

      • MySQL 服务(MySQL5.7.8 以上版本或 Mariadb 10.5 以上版本)

      • Redis 服务(4.0版本以上)

      • Nginx 服务

    • 权限准备

      • 环境权限:安装 Server 依赖软件(python、nginx、yum 等软件包)需要使用 ROOT 权限
        • 启动 Server 服务时可以使用非 ROOT 用户运行
      • 数据库权限:Server 服务执行数据库初始化需要依赖 CREATE、ALTER、INDEX、DELETE、LOCK TABLES、SELECT、INSERT、REFERENCES、UPDATE 权限
    • 端口使用:需要开放80端口的访问权限(80为TCA平台默认访问端口),或调整 Web 服务默认的访问端口地址

    操作说明

    首次启动操作
    1. 进入 CodeAnalysis 工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径

    2. 安装基础软件与部署 TCA(可根据脚本选项确定是否要安装 Python、MySQL、Redis、Nginx 相关基础软件),执行

    $ bash ./quick_install.sh local deploy
    +

    执行该命令会做以下四个步骤:

    • Install:检测本地 Python3.7、Mariadb/MySQL、Redis 与 Nginx,如果不存在会提示安装
    • Init:部署 TCA Server、Web与Client,并进行初始化
    • Start:启动 TCA Server、Web与Client
    • Check:检测 TCA 的运行状态

    注意:在运行过程中,脚本会检测本地是否安装了相关基础软件(Python3.7、MySQL/Mariadb、Redis、Nignx),如果未安装会输出以下类似提示语:

    Do you want to install [Redis] by this script?
    +Please enter:[Y/N]
    +

    如果确定通过脚本安装可以输入Y

    1. 执行完成,无其他报错,即可登录:

    提示

    至此,您已完成 TCA 平台部署,请在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可开启您的腾讯云代码分析。
    平台内操作指引请查看:快速启动一次代码分析

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    更新操作

    1. 更新代码

    2. 执行以下命令

    bash ./quick_install.sh local install tca  #更新相关配置
    +bash ./quick_install.sh local start  #启动服务(会自动关闭之前的服务)
    +bash ./quick_install.sh local check  #检查服务是否启动失败
    +

    注意:
    local install命令行参数说明:
    - base:安装 Python、Mariadb/MySQL、Redis 与 Nginx
    - tca:初始化或更新 TCA Server、Web、Client 相关配置和数据
    - server:初始化或更新 TCA Server 相关配置和数据
    - web:初始化或更新 TCA Web 相关配置和数据
    - client:初始化或更新 TCA Client 相关配置和数据
    - 不填参数,默认会执行basetca相关操作

    启动和停止服务
    • 启动所有服务:bash ./quick_install.sh local start

    • 启动Main相关服务:bash ./quick_install.sh local start main

      • local start支持启动指定服务,如上述的启动Main服务,还支持mysql/redis/analysis/file/login/scmproxy/nginx/client/all
    • 停止所有服务:bash ./quick_install.sh local stop

    • 停止Main相关服务:bash ./quick_install.sh local stop main

      • local stop支持停止指定服务,如上述的停止Main服务,还支持analysis/file/login/scmproxy/nginx/client/all

    注意:

    1. 启动时会自动关闭之前已经运行的服务

    2. mysqlredis默认会使用systemctl进行启动,如果systemctl无法使用,则会直接使用nohup方式运行相关服务

    检查服务运行状态

    检查服务运行状态:bash ./quick_install.sh local check

    • 目前支持检查 server 与 web,暂不支持 client
    获取服务输出日志

    打印 TCA Server 各个服务的日志路径: bash ./quick_install.sh local log

    + + + diff --git a/zh/quickStarted/deployClient.html b/zh/quickStarted/deployClient.html new file mode 100644 index 000000000..c1b237905 --- /dev/null +++ b/zh/quickStarted/deployClient.html @@ -0,0 +1,57 @@ + + + + + + + + + 部署与配置客户端 | 腾讯云代码分析 + + + + +

    部署与配置客户端

    通过源代码

    依赖环境

    • 系统环境

      • Linux,Windows或macOS
    • 环境准备

    使用步骤

    安装第三方库

    # 源码根目录下执行
    +pip3 install -r client/requirements/app_reqs.pip
    +

    安装第三方工具

    # 源码根目录
    +cd client/requirements
    +
    +# 执行安装脚本
    +# Linux/macOS环境
    +./install.sh
    +# Windows环境
    +./install.bat
    +

    配置客户端

    • 配置 client/config.ini 文件

      <Server IP地址> 替换成实际的serve ip(可包含端口号)。

      客户端执行环境配置

    • 配置 client/codedog.ini 文件

      必填项:tokenorg_sidteam_namesource_dir

      • 个人令牌 - token:从 TCA 页面获取,前往[个人中心]-[个人令牌]-复制Token

        personalToken

      • 团队编号 - org_sid:进入 TCA 项目概览页,从 URL 中获取

      • 项目名称 - team_name::进入 TCA 项目概览页,从 URL 中获取

        提示

        项目概览URL格式:http://{域名}/t/{org_sid}/p/{team_name}/profile

      • 分析路径 - source_dir: 本地代码目录路径

      提示

      • 如果项目代码为编译型语言(比如:C/C++,C#,Go,Java,Kotlin,Objective-C等),且使用的分析方案中配置了编译型工具(如图,使用了OC推荐规则包),需要填写build_cmd编译命令。

      • 其他可选项按需填写,不填写时按默认配置执行

    启动客户端

    # 源码根目录
    +cd client
    +
    +# 执行客户端脚本
    +python3 codepuppy.py localscan
    +

    注意

    Client 的实现及启动脚本均依赖 Python3 版本为 3.7,可执行 python3 --version 查看版本。若版本有误,可安装版本为3.7的python并软链接到python3命令。

    提示

    • codedog.ini 各项参数可由命令行传入,获取详细参数说明可运行 python3 codepuppy.py localscan -h

    • 使用localscan命令启动本地单次的代码分析,如需启动分布式并行分析任务,请参考使用分布式节点模式进行配置。

    通过Docker-Compose

    提示

    适用于快速上手体验。使用docker运行,可以免去客户端环境依赖的安装,避免环境兼容性问题。

    但是由于环境受限于docker,会无法复用本地的编译环境,部分需要编译的工具无法使用。

    使用步骤

    配置客户端

    • 配置 client/config.ini 文件

    • 配置 client/codedog.ini 文件

    提示

    同通过源代码使用-配置客户端

    构建镜像

    1. 安装Docker,安装教程:官方文档在新窗口打开

    2. 安装Docker-Compose,安装教程:官方文档在新窗口打开

    3. 进入client目录,构建docker镜像

    docker build -t tca-client .
    +

    启动客户端

    方案一:直接使用docker运行

    进入client目录,执行以下命令

    # 按照实际情况填写`SOURCE_DIR`环境变量值
    +export SOURCE_DIR=需要扫描的代码目录绝对路径
    +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src  --name tca-client tca-client
    +
    方案二:使用docker内bash终端运行
    1. 进入docker容器内的bash终端

      # 按照实际情况填写`SOURCE_DIR`环境变量值
      +export SOURCE_DIR=需要扫描的代码目录绝对路径
      +docker run -it --rm  -v $PWD:/workspace/client -v $SOURCE_DIR:/workspace/src --name tca-client tca-client bash
      +
    2. 通过命令行启动client代码

      python3 codepuppy.py localscan
      +

    通过可执行文件

    依赖环境

    • 系统环境

      • Linux,Windows或macOS

    使用步骤

    下载客户端

    1. 发布页面在新窗口打开下载与系统相对应的客户端压缩包到本地。

    2. 解压缩。

    配置客户端

    • 配置 client/config.ini 文件

    • 配置 client/codedog.ini 文件

    提示

    同通过源代码使用-配置客户端

    启动客户端

    进入到client目录下,执行客户端

    ./codepuppy localscan
    +
    + + + diff --git a/zh/quickStarted/deploySever.html b/zh/quickStarted/deploySever.html new file mode 100644 index 000000000..7981abc65 --- /dev/null +++ b/zh/quickStarted/deploySever.html @@ -0,0 +1,36 @@ + + + + + + + + + 部署 TCA | 腾讯云代码分析 + + + + +

    部署 TCA

    TCA提供部署脚本,支持一键式快速部署Server、Web、Client。
    脚本共提供三种部署方式:Docker部署(推荐)、Docker-Compose部署源码部署,可根据您的具体使用场景任意选择其一进行部署。

    Docker快速部署

    注意

    仅适用于Docker部署体验,生产环境建议使用专业的 MySQL、Redis 等服务

    依赖环境

    • 系统环境
      • Linux、macOS、Windows
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备
      • Docker
    • 权限准备
      • 需要开放80、8000端口的访问权限(80为TCA平台访问端口,8000为TCA Server访问端口)

    部署对象

    Server、Web 与 Client

    操作说明

    首次启动操作

    1. 进入CodeAnalysis工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径
    2. 执行命令:
      bash ./quick_install.sh docker deploy
      +

    提示

    1. 通过Docker部署默认会从DockerHub上拉取 tencenttca/tca:latest 镜像
    2. 通过Docker部署默认会在当前根目录下的挂载三个路径:
      • .docker_temp/logs:容器内的/var/log/tca/,存放TCA平台的日输出文件;
      • .docker_temp/data:容器内的/var/opt/tca/, 存放TCA平台的服务数据,主要是Mariadb、Redis;
      • .docker_temp/configs:容器内的/etc/tca,存放TCA平台的配置文件,主要是config.sh

    更新操作

    1. 更新代码
    2. 执行以下命令:
      • TCA_IMAGE_BUILD=true ./quick_install.sh docker deploy:重新构建并启动tca容器

    提示

    TCA_IMAGE_BUILD=true表示从本地构建TCA镜像运行

    运行容器

    如果已经在机器上执行过docker deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行TCA

    bash ./quick_install.sh docker start
    +

    停止容器

    如果容器正在运行,希望停止容器,可以运行

    bash ./quick_install.sh docker stop
    +

    使用TCA

    成功部署TCA后,请开始您的代码分析。

    进入平台页面

    在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可跳转到团队列表页

    提示

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    创建团队及项目

    • 完成团队创建

    • 完成项目创建

    登记代码库

    登记代码库,输入代码库地址以及凭证信息等,完成代码库登记。

    registerCodeRepo

    创建分析项目

    开始分析

    提示

    1. 用户可选择使用分析方案模板,或创建分析方案的方式,利用方案的分析配置进行代码分析。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目。

    分析方案说明

    • 分析方案是用于对代码库进行分析的一套配置集合。

    • 更多分析方案配置可查阅帮助文档-分析方案

    creataAnalysePlan

    提示

    本次部署会默认启动运行环境为「Codedog_Linux」的客户端,若需扩展更多运行环境,详见客户端常驻节点分析

    planPage

    执行代码分析

    初始化创建项目后,可通过 在线分析客户端分析 来启动代码分析。

    代码分析

    提示

    • TCA推荐使用在线分析,您可根据具体使用场景选择其一。
    • 在线分析表示配置代码库链接后,TCA客户端拉取代码后进行分析;客户端分析在配置本地待扫描代码路径后,无需代码拉取直接分析本地代码。
    • 在线分析客户端分析具体详情及配置参考TCA客户端配置详情

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 问题列表 等。

    分支概览

    + + + diff --git a/zh/quickStarted/dockerDeploy.html b/zh/quickStarted/dockerDeploy.html new file mode 100644 index 000000000..7bd8432eb --- /dev/null +++ b/zh/quickStarted/dockerDeploy.html @@ -0,0 +1,37 @@ + + + + + + + + + Docker快速部署(平台体验首推) | 腾讯云代码分析 + + + + +

    Docker快速部署(平台体验首推)

    注意

    Docker部署会包含Mariadb和Redis,如果需要更大规模使用,可以调整配置文件使用运维规范的 MySQL/Mariadb 和 Redis。

    依赖环境

    • 系统环境
      • Linux、macOS、Windows
      • 最低配置:2核4G内存、100G硬盘存储空间
    • 环境准备
      • Docker
    • 权限准备
      • 需要开放80、8000端口的访问权限(80为TCA平台访问端口,8000为TCA Server访问端口)

    部署对象

    Server、Web 与 Client

    操作说明

    首次启动操作
    1. 进入CodeAnalysis工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径
    2. 执行命令:
      bash ./quick_install.sh docker deploy
      +

    提示

    1. 通过Docker部署默认会从DockerHub上拉取tencenttca/tca:latest镜像
    2. 通过Docker部署默认会在当前根目录下的挂载三个路径:
      • .docker_temp/logs:容器内的/var/log/tca/,存放TCA平台的日输出文件;
      • .docker_temp/data:容器内的/var/opt/tca/, 存放TCA平台的服务数据,主要是Mariadb、Redis;
      • .docker_temp/configs:容器内的/etc/tca,存放TCA平台的配置文件,主要是config.sh
    更新操作
    1. 更新代码
    2. 执行以下命令:
    TCA_IMAGE_BUILD=true ./quick_install.sh docker deploy  #重新构建并启动tca容器
    +

    提示

    TCA_IMAGE_BUILD=true表示从本地构建TCA镜像运行

    运行容器

    如果已经在机器上执行过docker deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行TCA

    bash ./quick_install.sh docker start
    +
    停止容器

    如果容器正在运行,希望停止容器,可以运行

    bash ./quick_install.sh docker stop
    +

    使用TCA

    至此,您已完成第一个TCA平台部署,请在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可开启您的腾讯云代码分析。
    平台内操作指引请查看:快速启动一次代码分析

    提示

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    + + + diff --git a/zh/quickStarted/dockercomposeDeploy.html b/zh/quickStarted/dockercomposeDeploy.html new file mode 100644 index 000000000..bb7bd7725 --- /dev/null +++ b/zh/quickStarted/dockercomposeDeploy.html @@ -0,0 +1,40 @@ + + + + + + + + + Docker-Compose快速部署 | 腾讯云代码分析 + + + + +

    Docker-Compose快速部署

    TCA提供部署脚本,支持一键式快速部署 Server、Web、Client。
    脚本共提供三种部署方式:Docker部署(平台体验首推)、Docker-Compose部署、源码部署, 可根据您的具体使用场景任意选择其一进行部署。

    部署对象

    Server、Web 与 Client

    注意

    仅适用于 Docker-Compose 部署体验,生产环境建议使用专业的 MySQL、Redis 等服务

    操作说明

    首次启动操作
    1. 进入 CodeAnalysis 工作目录(例如~/CodeAnalysis),以下路径均为目录内的相对路径

    2. 执行命令:

    bash ./quick_install.sh docker-compose deploy #启动tca_server容器
    +

    注意:通过 Docker-Compose 部署默认会在当前根目录下的挂载三个路径:

    • .docker_data/logs:存放 TCA 平台的各个服务日志输出目录;
    • .docker_data/mysql:存放 TCA 平台的 MySQL 数据
    • .docker_data/redis:存放 TCA 平台的 Redis 数据
    • .docker_data/filedata:存放 TCA 平台文件服务器的文件

    提示

    完成 TCA 平台部署后,请在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可开启您的腾讯云代码分析。
    平台内操作指引请查看:快速启动一次代码分析

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    更新操作
    1. 更新代码

    2. 执行以下命令:

    bash ./quick_install.sh docker-compose build  #重新构建TCA相关镜像
    +bash ./quick_install.sh docker-compose stop  #停止运行中的TCA容器
    +bash ./quick_install.sh docker-compose deploy  #重新部署TCA相关容器与初始化(或刷新数据)
    +
    运行操作

    如果已经在机器上执行过docker-compose deploy,并保留容器数据的,可以执行以下命令启动容器,继续运行 TCA

    bash ./quick_install.sh docker-compose start
    +
    停止操作

    如果容器正在运行,希望停止容器,可以执行以下命令

    bash ./quick_install.sh docker-compose stop
    +
    构建镜像操作

    如果希望构建镜像,可以执行以下命令

    bash ./quick_install.sh docker-compose build
    +
    + + + diff --git a/zh/quickStarted/enhanceDeploy.html b/zh/quickStarted/enhanceDeploy.html new file mode 100644 index 000000000..62cdbb9bd --- /dev/null +++ b/zh/quickStarted/enhanceDeploy.html @@ -0,0 +1,64 @@ + + + + + + + + + 增强分析模块部署 | 腾讯云代码分析 + + + + +

    增强分析模块部署

    TCA 除开集成业界知名的分析工具之外,也有自主研发的独立工具,作为 TCA 的增强分析模块。

    TCA 增强分析模块,需要用户额外部署 License 鉴权微服务,并邮件申请 License 。

    提示

    1. License申请完全免费! 2. 优先企业或高校申请License。

    概念

    • 独立工具:TCA 自主研发的代码分析工具;
    • CLS(Common License Server): TCA 独立工具的 License 鉴权微服务。

    模块功能

    • 支持Objective-C/C++代码规范检查;
    • 支持分析项目的依赖组件;
    • 支持分析依赖组件是否存在漏洞等问题;
    • 支持Java/Kotlin API和函数调用链分析;
    • 支持代码安全、空指针检查、内存泄漏等规则。

    持续更新中……

    TCA 官网版增强能力申请

    如果用户平常使用的是 TCA 官网版公共服务在新窗口打开,并想在官网版上体验到增强分析模块的分析能力,可以按照这篇帮助文档在新窗口打开进行申请配置。

    TCA 私有化部署增强能力申请

    如果用户是在企业内网环境内使用 TCA,并想在内网体验 TCA 的增强分析模块能力,可以参考下面步骤申请。

    准备

    • 一台 CLS 微服务专属机器,CLS 微服务需要跟该机器绑定

    注意

    注意:不能随意删除CLS目录

    步骤

    1. 在 TCA 源码中server/cls在新窗口打开 目录下执行以下命令,获取 Server IDClient License

    注意

    注意:需要在 CLS 目录下执行命令

    # 安装 Git LFS
    +$ bash ./scripts/base/install_git_lfs.sh
    +# 如果在该目录下没有找到 cls 二进制文件,可以执行以下命令进行同步
    +$ bash ./scripts/base/install_bin.sh
    +$ cd server/cls
    +$ ./cls server
    +2022-04-13 18:35:29.356510559 +0800 CST [INFO] Version: 20220328.1
    +2022-04-13 18:35:29.44083463 +0800 CST [INFO] The client license is:
    +xxx
    +2022-04-13 18:35:29.454552966 +0800 CST [INFO] License Server ID: xxx
    +
    • Server ID: 机器码,用于向 TCA 团队申请 License 授权
    • Client License: 提供给 TCA Client,方便 TCA Client 进行工具鉴权(重要,建议备份留底)
    1. 在 TCA Client目录的 config.ini在新窗口打开 中配置 CLS 微服务信息,比如
    [LICENSE_CONFIG]
    +; [可选]使用独立工具时,需要填写,默认不需要
    +; License服务的域名和端口
    +URL=http://<IP或者域名>:<port>
    +BASE_PATH=
    +LICENSE=<Client License>
    +

    注意

    注意:URL对应值的最后不需要跟斜杆/.

    注意

    不同的部署方式可以根据下面方法修改config.ini配置

    • 源码部署:
      • 修改源码目录下的client/config.ini
      • 重启客户端:./quick_install.sh local start client
    • Docker部署:
      • 方式1: 修改源码目录下的.docker_temp/configs/client/config.ini,并重启tca-services容器
      • 方式2: 进入tca-service容器后,修改/CodeAnalysis/client/config.ini,并退出重启tca-services容器
      • 重启容器方式:docker restart tca-service
    • Docker-Compose部署:
      • 修改源码目录下的client/config.ini,并重启client容器
      • 重启容器方式:docker-compose restart client
    1. 在 TCA 云官网上提交私有云 License 申请
    • (1) 在 TCA 云官网在新窗口打开上注册或登录账号;
    • (2) 进入需要申请私有云 License 申请的团队(如果没有的话需要创建对应团队);
    • (3) 在团队页面上,依次进入【节点管理】->【私有云 License 配置】页面,然后点击右上角的【申请License】按钮,填写相关信息即可提交申请。具体的信息内容如下:
      • 申请人名称
      • 申请人所在组织名称
      • 申请人所在组织类型:公司/高校/个人
      • 申请人邮箱
      • 申请人手机号码
      • Server ID:步骤一中输出的Server ID,首次登记的机器码
      • Client License:步骤一中输出的Client License
      • 应用场景
    • (4) 然后等待申请License审核通过,即可拷贝出该私有云 License 继续进行下面第4步的操作。
    1. 在 CLS 目录下的 config.yaml在新窗口打开 文件中填写License

    注意

    注意:遵从 yaml 格式,比如:

    • 键值对中,冒号 : 后面跟一个空白字符,示例 key: value
    1. 执行以下命令启动 CLS
    ./cls server -d
    +
    1. 验证 CLS 进程正常启动
    # 查找是否存在CLS进程
    +ps aux|grep cls
    +

    注意

    注意:如果以上命令没有发现 CLS 的进程,则说明 CLS 没有正常启动。
    请尝试更改 config.yaml在新窗口打开 文件中的 port 为其他 port,比如8080,目前默认是80端口,然后重新执行步骤5的命令。

    1. 启动 TCA 分析任务 在 TCA 平台的分析方案里面勾选独立工具相关的规则包,比如依赖组件分析规则包,然后启动一次分析任务,执行正常则表明设置生效。

    CLS 运维

    自动重启

    # 查找CLS进程ID
    +ps aux|grep cls
    +# 重启微服务
    +kill -USR2 <pid>
    +

    网络异常

    如果以上部署步骤已经完成,但是增强功能还是出现 License check failed! Please check the license. License Server is not available! 异常。可以按照以下步骤进行排查:

    • 进入任务页面,点击异常工具,下载该工具的执行日志。如果日志中出现以下日志,则表明网络访问CLS异常;
    method(head) call fails on error: <urlopen error [Errno 111] Connection refused>
    +
    • 继续验证。如果是 Docker 或者 Docker-Compose 部署方式的话,进入 TCA Client 所在容器中。如果是源码部署,则来到 TCA Client 所在机器上。执行以下命令确认网络是否通路:
    ping <config.ini中填写的 CLS IP或者域名>
    +telnet <config.ini中填写的 CLS IP或者域名> <对应端口>
    +
    • 如果网络不通,请排查:
      • 防火墙是否开启对应端口;
      • CLS 对应域名是否在host中设置;
      • 是否IP设置错误。
    案例分享

    背景: 小明以 Docker 方式部署 TCA,并在相同宿主机上部署 CLS 服务,然后在 config.ini 中设置的 URL 中的 IP 为 127.0.0.1, 重启后启动增强功能任务遇到上述网络不通异常。
    原因: 原因是此时的 127.0.0.1 指向的是 TCA Client 容器自身,而不是部署在宿主机上的 CLS 服务。
    解决方案: 将 127.0.0.1 改成宿主机自身IP即可。

    CLS 更新

    1. 使用以下命令查找 cls 进程并杀掉进程
    # 查找CLS进程ID
    +ps aux|grep cls
    +# 重启微服务
    +kill -9 <pid>
    +
    1. 下载最新版的 cls 并覆盖掉其中的 cls 二进制文件

    注意

    注意:不能删除原来的 cls 目录,只需要替换其中的 cls 二进制文件即可。

    1. 使用以下命令重启 cls 服务
    ./cls server -d
    +
    + + + diff --git a/zh/quickStarted/index.html b/zh/quickStarted/index.html new file mode 100644 index 000000000..0bed40f2c --- /dev/null +++ b/zh/quickStarted/index.html @@ -0,0 +1,33 @@ + + + + + + + + + 腾讯云代码分析介绍 | 腾讯云代码分析 + + + + +

    腾讯云代码分析介绍

    腾讯云代码分析(Tencent Cloud Code Analysis,简称TCA,内部曾用研发代号 CodeDog )是集众多分析工具的云原生、分布式、高性能的代码综合分析跟踪平台,包含服务端、Web端、客户端三个组件,已集成一批自研工具,同时也支持动态集成业界各编程语言的分析工具。

    代码分析是通过词法分析、语法分析、控制流、数据流分析等技术对程序代码进行扫描,对代码进行综合分析,验证代码是否满足规范性、安全性、可靠性、可维护性等指标的一种代码分析技术。

    使用TCA可以帮助团队用代码分析技术查找代码中的规范性、结构性、安全漏洞等问题,持续监控项目代码质量并进行告警。同时TCA开放API,支持与上下游系统对接,从而集成代码分析能力,为代码质量提供保障,更有益于传承优良的团队代码文化。

    组件图

    流程图


    拉取 TCA 代码库在新窗口打开 后,首次体验推荐您使用 Docker 快速部署方式快速搭建和体验腾讯云代码分析平台。

    如您更多环境需求,也可通过以下两种方式部署腾讯云代码分析平台:

    + + + diff --git a/zh/quickStarted/initRepo.html b/zh/quickStarted/initRepo.html new file mode 100644 index 000000000..8ea11347f --- /dev/null +++ b/zh/quickStarted/initRepo.html @@ -0,0 +1,33 @@ + + + + + + + + + 创建代码分析项目 | 腾讯云代码分析 + + + + +

    创建代码分析项目

    成功部署并启动 Server 与 Web 服务后,通过以下步骤创建您的第一个代码分析项目。

    进入平台页面

    在浏览器输入http://部署机器IP/,点击立即体验,完成登录后即可跳转到团队列表页

    提示

    默认平台登录账号/密码:CodeDog/admin

    如部署过程中,已调整默认账号密码,请按照调整后的账号密码进行登录

    创建团队及项目

    • 完成团队创建

    • 完成项目创建

    登记代码库

    登记代码库,输入代码库地址以及凭证信息等,完成代码库登记。

    registerCodeRepo

    创建分析项目

    开始分析

    提示

    1. 用户可选择使用分析方案模板,或创建分析方案的方式,利用方案的分析配置进行代码分析。
    2. 点击确认时,平台会首先创建该代码库的分析方案,然后根据代码库分支、当前分析方案创建分析项目。

    分析方案说明

    • 分析方案是用于对代码库进行分析的一套配置集合。

    • 更多分析方案配置可查阅帮助文档-分析方案

    creataAnalysePlan

    planPage

    + + + diff --git a/zh/quickStarted/intro.html b/zh/quickStarted/intro.html new file mode 100644 index 000000000..194cd9daf --- /dev/null +++ b/zh/quickStarted/intro.html @@ -0,0 +1,33 @@ + + + + + + + + + 平台概述 | 腾讯云代码分析 + + + + +

    平台概述

    腾讯云代码分析(Tencent Cloud Code Analysis,简称TCA,内部曾用研发代号 CodeDog )是集众多分析工具的云原生、分布式、高性能的代码综合分析跟踪平台,包含服务端、Web端和客户端三个组件,已集成一批自研工具,同时也支持动态集成业界各编程语言的分析工具。

    使用TCA Action快速体验

    使用TCA Action,只需要在代码仓库中添加.github/workflows/tca.yml文件,就可以直接在GitHub工作流中快速体验代码分析。请参考:TCA-action指引在新窗口打开

    部署TCA

    拉取 代码库在新窗口打开 后,您可以通过以下三种方式部署腾讯云代码分析平台:

    创建首个代码分析项目

    成功部署并启动TCA后,您可以按照 指引 创建您的首个代码分析项目。

    提示

    默认平台登录账号/密码:CodeDog/admin

    快速扩展客户端

    TCA客户端支持通过可执行文件进行快速扩展部署,详见通过可执行文件

    提示

    客户端可在本地执行代码分析,也可以作为在线常驻节点进行在线分析。

    了解更多

    更多关于腾讯云代码分析平台的使用指南和配置说明,参见帮助文档

    + + + diff --git a/zh/quickStarted/runProject.html b/zh/quickStarted/runProject.html new file mode 100644 index 000000000..7ba376796 --- /dev/null +++ b/zh/quickStarted/runProject.html @@ -0,0 +1,33 @@ + + + + + + + + + 启动代码分析 | 腾讯云代码分析 + + + + +

    启动代码分析

    在完成 Server、Web 和 Client 相关部署和配置后,可通过平台执行代码分析。

    执行代码分析

    初始化创建项目后,可通过 在线分析客户端分析 来启动代码分析。

    代码分析

    注:

    • TCA推荐使用在线分析,您可根据具体使用场景选择其一。
    • 在线分析表示配置代码库链接后,TCA客户端拉取代码后进行分析;客户端分析在配置本地待扫描代码路径后,无需代码拉取直接分析本地代码。
    • 在线分析客户端分析具体详情及配置参考TCA客户端配置详情

    查看分析历史

    分析结束后,数据会上报到服务端。可进入分析历史页面查看分析记录以及分析结果。

    分析历史

    查看分析概览

    分析结束后,进入分支概览可以查看该分支指定分析方案的概览数据以及 问题列表 等。

    分支概览

    + + +