发布于 2016-05-30 00:23:31 | 166 次阅读 | 评论: 0 | 来源: 网友投递
PMD Java代码检查工具
PMD是一种开源分析Java代码错误的工具。与其他分析工具不同的是,PMD通过静态分析获知代码错误。也就是说,在不运行Java程序的情况下报告错误。PMD附带了许多可以直接使用的规则,利用这些规则可以找出Java源程序的许多问题。此外,用户还可以自己定义规则,检查Java代码是否符合某些特定的编码规范。
PMD 5.4.2 发布了,该版本一些提升:
A JSON-renderer for PMD which is compatible with CodeClimate. See PR#83.
#1360: Provide backwards compatibility for PMD configuration file
CPD supports now Swift (see PR#33).
java-design/UseVargs: public static void main method is ignored now and so are methods, that are annotated with Override. See PR#79.
CLI 改进:
CPD: If a complete filename is specified, the language dependent filename filter is not applied. This allows to scan files, that are not using the standard file extension. If a directory is specified, the filename filter is still applied and only those files with the correct file extension of the language are scanned.
CPD: If no problems found, an empty report will be output instead of nothing. See also #1481
New command line parameter for PMD: -norulesetcompatibility
- this disables the ruleset factory compatibility filter and fails, if e.g. an old rule name is used in the ruleset. See also #1360. This option is also available for the ant task: <noRuleSetCompatibility>true</noRuleSetCompatibility>
.
PMD支持的编辑器包括:
JDeveloper、 Eclipse、JEdit、JBuilder、BlueJ、CodeGuide、NetBeans/Sun Java Studio Enterprise/Creator、IntelliJ IDEA、TextPad、Maven、Ant,、Gel、JCreator和Emacs。
下载地址:https://github.com/pmd/pmd/releases/tag/pmd_releases%2F5.4.2