博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PMD Tutorial
阅读量:4986 次
发布时间:2019-06-12

本文共 1792 字,大约阅读时间需要 5 分钟。

In this tutorial I'll introduce another tool to help find possible problems in your code, PMD. It will check for empty blocks, unused variables or parameters, extremly complex expressions, etc.

Just like CheckStyle, it offers an command-line tool as well as many IDE plug-ins. In this article, the PMD Eclipse plug-in will be introduced.

 

1. First and foremost, if you intend to install the plug-in via the Eclipse market, DO NOT use the URL provided on its homepage because it has expired. Instead, you can visit that URL directly in your browser, and in that page there's the updated link for this plug-in.

 

 

2. As long as you have got the valid URL, it's pretty simple to install it in Eclipse. Just click Help -> Install new software. In the opened dialogue, click "Add". Type in the name ("PMD") and the URL. Click "OK" to proceed.

 

3. Then select "PMD" and click "Next".

 

4. Eclipse will begin downloading the software. Agree to any prompted licenses or user agreements to proceed.

 

5. To finish the installation, restart Eclipse.

 

6. Right-click the project, select "Properties" in the context menu. In the opened dialogue, search for "PMD" in the left column and click on it. Then select "Enable PMD" for this project.

 

7. Right-click the project again, then select PMD -> Check Code. PMD will then begin to check for possible inconformities in this project.

 

 8. When finshed, the PMD perspective will open, showing any violations it has found.

 

 9. Make changes accordingly, and save the file. Re-check the code using PMD to ensure that the violations has been properly edited.

 

OK. That's all for this simple tutorial. You can visit its website (http://pmd.sourceforge.net) for more information.

 

Feedbacks and suggestions are greatly appreciated.

 

转载于:https://www.cnblogs.com/tuhz/p/4520769.html

你可能感兴趣的文章
UICollectionViewController的简单使用及一些注意点(json)
查看>>
Vue.js 源码分析(十三) 基础篇 组件 props属性详解
查看>>
Ubuntu系统升级内核方法
查看>>
Spring Bean单例与线程安全
查看>>
EasyUI datagrid.getSelections 没有返回正确的选择行数
查看>>
分享一个随机重排函数(C#)
查看>>
Asp.Net Core在CentOS部署与注意
查看>>
自反+递归 实现评论的无限引用
查看>>
新闻发布系统
查看>>
NOIP提高组2016 D1T2 【天天爱跑步】
查看>>
数据结构基础(19) --堆与堆排序
查看>>
HTML基础
查看>>
Window通过cmd查看端口占用、相应进程、杀死进程
查看>>
Exp4 恶意代码分析 _20151220
查看>>
Webbrowser 取消下载提示框
查看>>
javascript 在线压缩工具
查看>>
BootStrap的栅格系统的基本写法(布局)
查看>>
移动端开发
查看>>
Excel如何取消显示分页虚线
查看>>
博弈论习题
查看>>