Detailed explanation of CICD (11) - detailed explanation of sonar

Today, I will continue to introduce the relevant knowledge of Linux operation and maintenance. The main content of this article is a detailed explanation of sonar.

1. Introduction to sonar

Sonar is an open source platform for code quality management. It is used to manage the quality of source code. It can support more than 20 mainstream programming languages ​​including java, C, C++, C#, JavaScript, etc. through plug-ins.
Sonar's official website is: https://www.sonarqube.org/ , and its main page is as follows:
insert image description here

2. Sonar function

Sonar can detect the following problems in the code:
1. Code complexity
refers to the complexity of files, classes, methods, etc.
2. Code repetition
refers to whether the code contains a lot of copy
and paste 3. Unit test coverage
4. Code standards
5. Too few or too many comments
6. Potential bugs
7. Good or bad design

Three, sonar architecture

Sonar platform architecture is as follows:
Sonar platform itself consists of server, database, plug-ins and scanners. There are two processes in the server, namely the web process and the search process, the plugin must be installed manually, and the scanner is used to scan the build project. When sonar is used for code quality inspection, the corresponding plug-in must be installed. For example, to detect java code, the plug-in for JAVA code inspection must be installed. Sonar's scanner interacts with the Server, and generates a report and submits it to the Server.

Guess you like

Origin blog.csdn.net/weixin_40228200/article/details/123883418