我们在开发过程中都希望得到的代码都是易维护的,这里将介绍几个十分好用的Eclipse插件,用于规范和分析您的代码。
本文引自:
http://www-128.ibm.com/developerworks/java/library/j-ap01117/index.html衷心感谢
Paul Duvall (
paul.duvall@stelligent.com)大师!
大师向我们介绍了五个工具:
CheckStyle: 规范代码式样和格式。
PMD's CPD: 检查代码是否重复。
Coverlipse: 验证测试代码的覆盖率。
JDepend: 提供代码包的依赖性分析。
Eclipse Metrics plugin: 控制代码的复杂度。它们的下载地址如下:
Tool | Purpose | URL for Eclipse plugin |
---|
CheckStyle | Coding standard analysis | http://eclipse-cs.sourceforge.net/update/ |
Coverlipse | Test code coverage | http://coverlipse.sf.net/update |
CPD | Copy/Paste detection | http://pmd.sourceforge.net/eclipse/ |
JDepend | Package dependency analysis | http://andrei.gmxhome.de/eclipse/ |
Metrics | Complexity monitoring | http://metrics.sourceforge.net/update |
下载方法:
1、选择Eclipse的
Help | Software Updates | Find and Install

2、选择
Search for new features to install3、选择
New Remote Site按钮,并输入地址

4、选择
Finish按钮结束安装。

在后续文章中将分别介绍这五个工具的简单使用方法。