CheckStyle for Eclipse installation and use

Source: Internet
Author: User
Tags modifier naming convention checkstyle

1. Download the SourceForge pluginhttp://sourceforge.net/projects/eclipse-cs/

2. Installing Checkstyle

1. Open Eclipse

2. Select Install software in Help

3, add select Just Net.sf.eclipsecs-updatesite_6.5.0.201504121610-bin.zip

4. Click Next

5. Re-start

3. Open Eclipse, select Window->preferences-> in the left navigation bar Checkstyle, if Checkstyle instructions appear that you installed successfully

Use of 4.checkstyle

Select the project, right-click Checkstyle->check code with Checkstyle, check for errors

5.result output of Checkstyle

Serial number Output content Meaning
1.Type is missing a Javadoc commentclass Missing type description
2. "{" Should is on the previous line ' {' should be on the previous line
3.Methos is missing a Javadoc comment Missing Javadoc comment in front of method
4.Expected @throws tag for "Exception" Note that you want to have @throws in the comments
5. "." is preceeded with whitespace "." Cannot precede a space
6. "." is followed by whitespace "." Cannot have spaces after
7. "=" is not a preceeded with whitespace Missing space in front of "="
8. "=" is not a followed with whitespace Missing space after ' = '
9. "}" should be on the same line '} ' should be on the same line as the next statement
10.Unused @param tag for "Unused "No parameter" unused ", no comment required
11.Variable "CA" Missing Javadoc Variable "CA" missing Javadoc comment
12.Line longer than 80characters Line length more than 80
13.Line contains a tab character Line contains "tab" character
14.Redundant "public" modifier Redundant "public" modifier
15.Final modifier out of order with the JSL suggestion Final modifier in the wrong order
16.Avoid using the ". *" Form of Importimport Format avoids using ". *"
17.Redundant import from the same package Import content from the same package
18.Unused import-java.util.list Import Java.util.list is not in use
19.Duplicate Import to Line 13 Duplicate Import Same content
20.Import from Illegal package Import content from an illegal package
"While" construct must use "{}" "While" statement is missing "{}"
22.Variable "STest1" must be private and has accessor method The variable "STest1" should be private, and there is a way to call it
23.Variable "ABC" must match pattern "^[a-z][a-za-z0-9]*$" Variable "ABC" does not conform to the naming convention "^[a-z][a-za-z0-9]*$"
"(" is followed by whitespace "(" Cannot have spaces after
")" is proceeded by whitespace ")" must not be preceded by a space

  

CheckStyle for Eclipse installation and use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.