eclipse plugin checkstyle installation and common errors

method one:
 
1. In Eclipse, select Help->Software Updates->Find and Install
 
2. Select Search for new features to install and select Next
 
3. Select New Remote Site
 
4. Enter the update address
http://eclipse-cs.sourceforge.net/update
 
5. Restart after installation
 
Method Two:
 
1. Download the eclipse plugin
 
 
After downloading, copy the files under the two folders plugins and features to the corresponding plugins and features directories under the eclipse directory respectively
 
2. If you start eclipse directly like this, errors such as ClassNotFoundExceptions may occur, so you must add a parameter -clean when starting eclipse. This way eclipse can update the information of many plug-ins currently installed.
For example, if you have eclipse on the d drive, then it is d:\eclipse\eclipse.exe -clean 
 
 
checkStyle use
 
Select the project, right-click and select checkstyle->check code with checkstyle to check for errors
 
Result output of Checkstyle
 
No. Meaning of output content
1 Type is missing a javadoc commentClass
2 "{" should be on the previous line "{" should be on the previous line
3Methods is missing a javadoc comment A javadoc comment is missing before the method
4Expected @throws tag for "Exception" in the comments expect @throws' description
5"." Is preceeded with whitespace "." cannot be preceded by a space
6"." Is followed by whitespace"." There can be no spaces after
7"=" is not preceeded with whitespace "=" is not preceded by whitespace
8"=" is not followed with whitespace"=" is not followed with whitespace
9"}" should be on the same line"}" should be on the same line as the next statement
10Unused @param tag for "unused" There is no parameter "unused", no need to comment
11Variable "CA" missing javadoc Variable "CA" is missing a javadoc comment
12Line longer than 80characters
13Line contains a tab character
14Redundant “Public” modifier Redundant “public” modifier
15Final modifier out of order with the JSL suggestionFinal modifier is out of order
16Avoid using the “.*” form of importImport
17Redundant import from the same package Import content from the same package
18Unused import-java.util.list Imported java.util.list is not used
19Duplicate import to line 13 Duplicate Import of the same content
20Import from illegal package Import content from illegal package
21 "while" construct must use "{}" "while" statement missing "{}"
22Variable "sTest1" must be private and have accessor method Variable "sTest1" should be private and have a method to call it
23Variable "ABC" must match pattern "^[az][a-zA-Z0-9]*$"Variable "ABC" does not match the naming rule "^[az][a-zA-Z0-9]*$"
24"(" is followed by whitespace"(" with no spaces after 25")" is proceeded by whitespace")" without spaces before
 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326995225&siteId=291194637
Recommended