Posted on 2009-10-14 11:49
guanminglin@gmail.com 閱讀(28851)
評論(5) 編輯 收藏 所屬分類:
JavaSE 、
NetBeans
SQE 是 software quality enviroment 的縮寫, NetBeans 的SQE 插件 官方的介紹是這樣的:
SQE is an attempt at providing first class NetBeans
integration for different Software Quality Tools as
- Code Defect Analysis
- Metrics
- Dependency Analysis
我把它叫做軟件質量測試工具,它可以幫你找到你寫的代碼中潛在的問題 還會有一些建議。
PMD 的介紹:
PMD scans Java source code and looks for potential problems like:
* Possible bugs - empty try/catch/finally/switch statements
* Dead code - unused local variables, parameters and private methods
* Suboptimal code - wasteful String/StringBuffer usage
* Overcomplicated expressions - unnecessary if statements, for loops that could be while loops
* Duplicate code - copied/pasted code means copied/pasted bugs
NetBeans 的SQE 插件很早就有了,只是以前用過一次,所以也就沒有怎么去關心過它(因為以前對Java 都不是很熟悉,更別說netbeans有什么插件了),昨天無意間有人在論壇上發帖 問有沒有 findbug for NetBeans 的最新插件,于是我想起了很久以前用過的SQE插件,里面就有findbug 的插件模塊,于是到 https://sqe.dev.java.net/ 去下載了插件,沒找到下載鏈接,找到一個更新地址
https://sqe.dev.java.net/updatecenters/sqe/updates.xml 但是這個地址的SQE 插件與NetBeans 6.7.1 不兼容,所以又花了點時間找了另外一個插件更新地址:
http://deadlock.netbeans.org/hudson/job/sqe/lastStableBuild/artifact/build/full-sqe-updatecenter/updates.xml
這個插件更新地址的插件是最新的。項目的地址:
http://kenai.com/projects/sqe/
如果你想試一試這個插件 你可以按照下面的步驟來安裝這個插件
1、打開 工具->插件-> 設置

點擊添加,將 http://deadlock.netbeans.org/hudson/job/sqe/lastStableBuild/artifact/build/full-sqe-updatecenter/updates.xml
添加到URL 框中,點擊確定,NetBeans 就會自動去這個地址中找插件了。
找完后,你就可以在可用插件中看到新添加的4個插件了安裝好后就可以用了。
運行findbug:

可以看到運行findbug后的界面了,它會告訴你可能會出現的問題: