30 January 2021
The PMD team is pleased to announce PMD 6.31.0.
This is a minor release.
PMD now supports the Static Analysis Results Interchange Format (SARIF)
as an additional report format. Just use the command line parameter
-format sarif to select it.
SARIF is an OASIS standard format for static analysis tools.
PMD creates SARIF JSON files in SARIF version 2.1.0.
An example report can be found in the documentation in Report formats for PMD.
--ignore-literal-sequences, which can be used to avoid detection of some uninteresting clones. This options has been introduced with PMD 6.30.0 for C# and is now available for C++ as well. See #2963.
The new Apex rule
OverrideBothEqualsAndHashcode brings the well known Java rule
to Apex. In Apex the same principle applies:
hashCode should always be overridden
together to ensure collection classes such as Maps and Sets work as expected.
The new Visualforce rule
VfHtmlStyleTagXss checks for potential XSS problems
<style> tags on Visualforce pages.
AvoidUsingShortType: arithmetic on shorts is not significantly slower than on ints, whereas using shorts may provide significant memory savings in arrays.
SimplifyStartsWith: the suggested code transformation has an insignificant performance impact, and decreases readability.
GenericToken#getKindhas been added as experimental. This unifies the token interface for both JavaCC and Antlr. The already existing method
AntlrToken#getKindis therefore experimental as well. The returned constant depends on the actual language and might change whenever the grammar of the language is changed.