-
Notifications
You must be signed in to change notification settings - Fork 15
<doc> 静态代码扫描工具文档 #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
<doc> 静态代码扫描工具文档 #45
Conversation
WalkthroughThe new document introduces a guide for scanning third-party compatibility issues, crucial in multi-application models like koupleless. It covers common incompatibility patterns such as variable pollution and ClassLoader problems, suggesting solutions using a custom static code scanning tool built on SonarQube. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- content/zh-cn/docs/tutorials/module-development/thrid-party-scanner.md (1 hunks)
Additional context used
LanguageTool
content/zh-cn/docs/tutorials/module-development/thrid-party-scanner.md
[uncategorized] ~41-~41: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:正确"地"释放 (wb4)
Context: ...eless 的模式下,模块会被动态的安装和卸载。 如果在卸载的时候,模块没有正确的释放资源,比如 long running thread 就会导致资源泄露,甚至影...
Markdownlint
content/zh-cn/docs/tutorials/module-development/thrid-party-scanner.md
13-13: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
17-17: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
18-18: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
18-18: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
29-29: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
39-39: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
43-43: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
13-13: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document
21-21: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
25-25: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
34-34: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
48-48: null (MD047, single-trailing-newline)
Files should end with a single newline character
|
||
</div> | ||
|
||
# 为什么我们需要静态代码扫描工具? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a blank line below the heading for better readability and to comply with Markdown standards.
Tools
Markdownlint
13-13: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
13-13: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document
koupleless 打破了传统的单进程单应用模型,而采用了单进程多应用模型。 | ||
很多第三方库并不支持单进程多应用模型,这就需要我们对第三方库进行兼容性扫描,并进行问题的修复。 | ||
|
||
## 常见的中间件不兼容模式 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure that each section heading is surrounded by blank lines to enhance readability and maintain consistency with Markdown formatting standards.
Also applies to: 29-29, 39-39, 43-43
Tools
Markdownlint
17-17: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
很多第三方库并不支持单进程多应用模型,这就需要我们对第三方库进行兼容性扫描,并进行问题的修复。 | ||
|
||
## 常见的中间件不兼容模式 | ||
### 公共变量互相污染 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This heading should be surrounded by blank lines. Additionally, consider adding a space above to separate it from the text of the previous section.
Tools
Markdownlint
18-18: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
18-18: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
```java | ||
public class CommonVariable { | ||
public static String appName = null; | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fenced code blocks should be surrounded by blank lines to comply with Markdown formatting standards.
+ ```
21~
public class CommonVariable {
22~
public static String appName = null;
23~
}
24~
+ ```
...
33~
// Class.forName 默认查询 stack 中调用方的 ClassLoader,这很有可能是错误的。
Class.forName("someName");
37~
Also applies to: 34-37
<details>
<summary>Tools</summary>
<details>
<summary>Markdownlint</summary><blockquote>
21-21: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
---
25-25: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
在实现上,我们的静态代码扫描工具基于社区的开源静态代码扫描软件 sonarqube 开发, 并提供了自定义的插件。 | ||
对于已有 sonarqube 服务的用户,可以直接安装我们的插件,对模块代码进行扫描。 | ||
对于没有 sonarqube 服务的用户,我们提供了一个部署教程。 | ||
详情请参考 [静态代码扫描工具](https://github.com/koupleless/scanner) No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The document should end with a single newline character to comply with Markdown standards.
47~
48~
+
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
详情请参考 [静态代码扫描工具](https://github.com/koupleless/scanner) | |
详情请参考 [静态代码扫描工具](https://github.com/koupleless/scanner) | |
Tools
Markdownlint
48-48: null (MD047, single-trailing-newline)
Files should end with a single newline character
|
||
### 资源释放异常 | ||
在 koupleless 的模式下,模块会被动态的安装和卸载。 | ||
如果在卸载的时候,模块没有正确的释放资源,比如 long running thread 就会导致资源泄露,甚至影响业务。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider modifying the phrase to adhere to grammatical norms in Chinese: "正确地释放".
- 如果在卸载的时候,模块没有正确的释放资源
+ 如果在卸载的时候,模块没有正确地释放资源
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
如果在卸载的时候,模块没有正确的释放资源,比如 long running thread 就会导致资源泄露,甚至影响业务。 | |
如果在卸载的时候,模块没有正确地释放资源,比如 long running thread 就会导致资源泄露,甚至影响业务。 |
Tools
LanguageTool
[uncategorized] ~41-~41: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:正确"地"释放 (wb4)
Context: ...eless 的模式下,模块会被动态的安装和卸载。 如果在卸载的时候,模块没有正确的释放资源,比如 long running thread 就会导致资源泄露,甚至影...
Summary by CodeRabbit