Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Sonar6.0 application 3: integrated Eclipse real-time code quality analysis (with Eclipse initialization)

Shulou Source: shulou.com Published: 2022-06-03 05:31:02 09月30日 Update

Sonar integrates with Eclipse in the form of plug-ins, which can realize real-time code quality analysis, as long as the sonar server is working normally.

Start eclipse, download and install the sonar plug-in

Restart eclipse after installing the plug-in, and right-click the project that requires code quality check after opening it again.

Configure the address, login name, password, etc. of the sonar server.

You can search for the project name that has been built on the sonar server to join

Second, configure the command window in eclipse to facilitate real-time code quality check.

Find SonarLint and check its three components

You can start to analyze the quality of the source code.

Error description

-- Segmentation Line: add the initialization configuration of eclipse by the way-

I. Eclipse initialization configuration

Configure compiler background according to personal preference, etc.

Comments on the code (mainly javadoc) and the specification of spaces

Jave annotation specification, which can be defined one by one or imported

Reformulate the rules of formatter

(import specification is attached)

Install the running environment.

II. Installation of plug-ins

1. Install decompilation tools

Copy the net.sf.jadclipse_3.3.0.jar file to eclipse's eclipse\ plugins directory and restart eclipse.

This appears after restarting eclipse. Edit the decompilation path.

2. Install ERMaster

Copy the org.insightech.er_1.0.0.v20150619-0219.jar file to the eclipse\ plugins directory and restart eclipse and open perference

Update the database connection tool when it is needed

3. Install log for eclipse

Help- > install new software

Then Next all the way or agree only until the installation is complete.

Put the file log4e-profiles.xml under Workspace/.metadata/.plugins/de.jayefem.log4e to replace the file, and restart eclipse.

After startup, change the following image style to: my Log4j 2

The log printing of the method parameters can be carried out normally when the eclipse is set up according to the above picture.

4. Import jdk source code

Window-> perference

You can view the source code.

Attachment: http://down.51cto.com/data/2368271

Tags: Configuration code quality plug-ins files servers services compilation real-time analysis tools comments source code directories attachments project check three above below Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Microsoft OPPO Reno MySQL MariaDB