Eclipse插件checkstyle安装使用
2015-08-20 12:36
579 查看
方法一:
1.Eclipse中,选择Help->Software Updates->Find and Install
2.选择 Search for new features to install 选择Next
3.选择 New Remote Site
4.输入更新地址 http://eclipse-cs.sourceforge.net/update
5. 安装后重启即可
方法二:
1.下载eclipse插件
http://sourceforge.net/projects/eclipse-cs/
下载后,把里面的两个文件夹plugins和 features下面的文件分别拷贝到eclipse目录下面对应的plugins和features目录
2.如果你就这样直接启动eclipse 可能会出现ClassNotFoundExceptions 等错误,所以必须在启动eclipse的时候加上一个参数 -clean. 这样eclipse就可以更新它当前安装的许多插件信息
比如你得eclipse在d盘 那么就是 d:\eclipse\eclipse.exe -clean
checkStyle 使用
选中工程,右键选择checkstyle->check code with checkstyle,检查错误即可
Checkstyle的结果输出
序号 输出内容意义
1 Type is missing a javadoc commentClass 缺少类型说明
2“{” should be on the previous line “{” 应该位于前一行
3Methos is missing a javadoc comment方法前面缺少javadoc注释
4Expected @throws tag for “Exception”在注释中希望有@throws的说明
5“.” Is preceeded with whitespace “.” 前面不能有空格
6“.” Is followed by whitespace“.” 后面不能有空格
7“=” is not preceeded with whitespace“=” 前面缺少空格
8“=” is not followed with whitespace“=” 后面缺少空格
9“}” should be on the same line“}” 应该与下条语句位于同一行
10Unused @param tag for “unused”没有参数“unused”,不需注释
11Variable “CA” missing javadoc变量“CA”缺少javadoc注释
12Line longer than 80characters行长度超过80
13Line contains a tab character行含有”tab” 字符
14Redundant “Public” modifier冗余的“public” modifier
15Final modifier out of order with the JSL suggestionFinal modifier的顺序错误
16Avoid using the “.*” form of importImport格式避免使用“.*”
17Redundant import from the same package从同一个包中Import内容
18Unused import-java.util.listImport进来的java.util.list没有被使用
19Duplicate import to line 13重复Import同一个内容
20Import from illegal package从非法包中 Import内容
21“while” construct must use “{}”“while” 语句缺少“{}”
22Variable “sTest1” must be private and have accessor method变量“sTest1”应该是private的,并且有调用它的方法
23Variable “ABC” must match pattern “^[a-z][a-zA-Z0-9]*$”变量“ABC”不符合命名规则“^[a-z][a-zA-Z0-9]*$”
24“(” is followed by whitespace“(” 后面不能有空格 25“)” is proceeded by whitespace“)” 前面不能有空格
相关文章:
官网:http://sourceforge.net/projects/checkstyle/
相关工具:
FindBugs
PMD
nbCheckStyle
1.Eclipse中,选择Help->Software Updates->Find and Install
2.选择 Search for new features to install 选择Next
3.选择 New Remote Site
4.输入更新地址 http://eclipse-cs.sourceforge.net/update
5. 安装后重启即可
方法二:
1.下载eclipse插件
http://sourceforge.net/projects/eclipse-cs/
下载后,把里面的两个文件夹plugins和 features下面的文件分别拷贝到eclipse目录下面对应的plugins和features目录
2.如果你就这样直接启动eclipse 可能会出现ClassNotFoundExceptions 等错误,所以必须在启动eclipse的时候加上一个参数 -clean. 这样eclipse就可以更新它当前安装的许多插件信息
比如你得eclipse在d盘 那么就是 d:\eclipse\eclipse.exe -clean
checkStyle 使用
选中工程,右键选择checkstyle->check code with checkstyle,检查错误即可
Checkstyle的结果输出
序号 输出内容意义
1 Type is missing a javadoc commentClass 缺少类型说明
2“{” should be on the previous line “{” 应该位于前一行
3Methos is missing a javadoc comment方法前面缺少javadoc注释
4Expected @throws tag for “Exception”在注释中希望有@throws的说明
5“.” Is preceeded with whitespace “.” 前面不能有空格
6“.” Is followed by whitespace“.” 后面不能有空格
7“=” is not preceeded with whitespace“=” 前面缺少空格
8“=” is not followed with whitespace“=” 后面缺少空格
9“}” should be on the same line“}” 应该与下条语句位于同一行
10Unused @param tag for “unused”没有参数“unused”,不需注释
11Variable “CA” missing javadoc变量“CA”缺少javadoc注释
12Line longer than 80characters行长度超过80
13Line contains a tab character行含有”tab” 字符
14Redundant “Public” modifier冗余的“public” modifier
15Final modifier out of order with the JSL suggestionFinal modifier的顺序错误
16Avoid using the “.*” form of importImport格式避免使用“.*”
17Redundant import from the same package从同一个包中Import内容
18Unused import-java.util.listImport进来的java.util.list没有被使用
19Duplicate import to line 13重复Import同一个内容
20Import from illegal package从非法包中 Import内容
21“while” construct must use “{}”“while” 语句缺少“{}”
22Variable “sTest1” must be private and have accessor method变量“sTest1”应该是private的,并且有调用它的方法
23Variable “ABC” must match pattern “^[a-z][a-zA-Z0-9]*$”变量“ABC”不符合命名规则“^[a-z][a-zA-Z0-9]*$”
24“(” is followed by whitespace“(” 后面不能有空格 25“)” is proceeded by whitespace“)” 前面不能有空格
相关文章:
checkstyle使用介绍
http://wenku.baidu.com/link?url=AjrcXIcGH18_j5NTpy9D-oxbnsVNiATiCj-27FglrldVpoYCcymyTUPus_9mDixiZiumYVoJXDt60CBsQSDi-J7egJufIHTVoYH2JGtZrB7官网:http://sourceforge.net/projects/checkstyle/
相关工具:
FindBugs
PMD
nbCheckStyle
相关文章推荐
- JAVA中抽象类和接口之间的区别
- mac下打开多个Eclipse workplace
- 魅族手机不能连接mac pro的eclipse
- 设置Eclipse的workplace是否默认
- Ubuntu下Eclipse搭建ARM开发环境
- Java 服务提供框架
- Mac下Android的Eclipse开发环境的搭建
- Java的位运算符详解实例——与(&)、非(~)、或(|)、异或(^)
- java一般使用基础
- 浅谈java中 hashCode方法
- java的客户端可以连接CPlus的服务端
- android studio mac下需要jdk1.6
- Spring的注解配置与XML配置之间的比较
- Spring 3 MVC深入研究
- Spring MVC之@RequestBody, @ResponseBody 详解
- Spring MVC之@RequestParam @RequestBody @RequestHeader 等详解
- Myeclipse与eclipse搭建web开发环境
- 在eclipse配置hadoop开发环境
- Java性能优化(4):避免创建重复对象
- Java中的运行时堆栈