PMD

PMD 6.2.0

PMD
開源軟體

PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, XML, XSL.

Available Plugins include:

  • Maven PMD.
  • Eclipse.
  • NetBeans.
  • JBuilder.
  • JDeveloper.
  • IntelliJ IDEA.

PMD additionally includes CPD, the copy-paste-detector. CPD finds duplicated code in Java, C, C++, C#, PHP, Ruby, Fortran, JavaScript, PLSQL, Apache Velocity, Scala, Objective C, Matlab, Python, Go.

軟體資訊
檔案版本 PMD 6.2.0
檔案名稱 pmd-bin-6.2.0.zip
檔案大小 41.04MB
系統 Windows (All Versions)
支援語系 Multiple languages
軟體類型 開源軟體
更新日期 2018-03-28
更新日誌

New and noteworthy:
Ecmascript (JavaScript).
Disable Incremental Analysis.
New Rules:
The new Java rule MissingOverride (category bestpractices) detects overridden and implemented methods, which are not marked with the @Override annotation. Annotating overridden methods with @Override ensures at compile time that the method really overrides one, which helps refactoring and clarifies intent.
The new Java rule UnnecessaryAnnotationValueElement (category codestyle) detects annotations with a single element (value) that explicitely names it. That is, doing @SuppressWarnings(value = "unchecked") would be flagged in favor of @SuppressWarnings("unchecked").
The new Java rule ControlStatementBraces (category codestyle) enforces the presence of braces on control statements where they are optional. Properties allow to customize which statements are required to have braces. This rule replaces the now deprecated rules WhileLoopMustUseBraces, ForLoopMustUseBraces, IfStmtMustUseBraces, and IfElseStmtMustUseBraces. More than covering the use cases of those rules, this rule also supports do ... while statements and case labels of switch statements (disabled by default).
Modified Rules:
The Java rule CommentContentRule (java-documentation) previously had the property wordsAreRegex. But this property never had been implemented and is removed now.
The Java rule UnusedPrivateField (java-bestpractices) now has a new ignoredAnnotations property that allows to configure annotations that imply the field should be ignored. By default @java.lang.Deprecated and @javafx.fxml.FXML are ignored.
The Java rule UnusedPrivateMethod (java-bestpractices) now has a new ignoredAnnotations property that allows to configure annotations that imply the method should be ignored. By default @java.lang.Deprecated is ignored.
The Java rule ImmutableField (java-design) now has a new ignoredAnnotations property that allows to configure annotations that imply the method should be ignored. By default several lombok annotations are ignored.
The Java rule SingularField (java-design) now has a new ignoredAnnotations property that allows to configure annotations that imply the method should be ignored. By default several lombok annotations are ignored.
Deprecated Rules:
The Java rules WhileLoopMustUseBraces, ForLoopMustUseBraces, IfStmtMustUseBraces, and IfElseStmtMustUseBraces are deprecated. They will be replaced by the new rule ControlStatementBraces, in the category codestyle.
Fixed Issues:
All -
[core] PMD build failure on Windows.
java-bestpracrtices -
[java] UnusedPrivateField false-positive with @FXML.
[java] ArrayIsStoredDirectly not triggered from variadic functions.
java-codestyle -
[java] Merge *StmtMustUseBraces rules.
[java] Detect annotations with single value element.
java-design -
[java] AvoidThrowingNullPointerException documentation suggestion.
[java] CFGs of declared but not called lambdas are treated as parts of an enclosing method’s CFG.
[java] SignatureDeclareThrowsException’s IgnoreJUnitCompletely property not honored for constructors.
[java] UseUtilityClassRule reports false positive with lombok NoArgsConstructor.
Documentation -
[core] Broken link in CONTRIBUTING.md.
[core] Include info about rule doc generation in “Writing Documentation” md page.
API Changes:
A new CLI switch, -no-cache, disables incremental analysis and the related suggestion. This overrides the -cache option. The corresponding Ant task parameter is noCache.
The static method PMDParameters.transformParametersIntoConfiguration(PMDParameters) is now deprecated, for removal in 7.0.0. The new instance method PMDParameters.toConfiguration() replaces it.
The method ASTConstructorDeclaration.getParameters() has been deprecated in favor of the new method getFormalParameters(). This method is available for both ASTConstructorDeclaration and ASTMethodDeclaration.

作者 PMD
官網 暫無資訊