我們在開發過程中都希望得到的代碼都是易維護的,這里將介紹幾個十分好用的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按鈕結束安裝。

在后續文章中將分別介紹這五個工具的簡單使用方法。