This document describes minor differences in the behavior of certain rules in PMD 7. Some of those items may be considered bugs that need to be fixed in pmd 7. Others are just reported here for documentation
AvoidReassigningLoopVariables:
Reported line ranges - [java] Inconsistent line range in RuleViolation for CognitiveComplexity rule between PMD 6.54.0 and 7.0.0-rc1 #4439
"ArrayIsStoredDirectly now reports on the assignment and not the formal parameter so line numbers will probably move." - [java] Update ArrayIsStoredDirectly and MethodReturnsInternalArray #3127
For the statistical rules (like NcssCount, ExcessivePackageBodyLineCount, ...)
the parameter "minimum" is now an integer and not a decimal anymore.
See [core] Remove statistical rule (final step) #2005,
[java] Remove java statistical rules #1772,
[apex] Remove apex statistical rules #1750.
topscore
and sigma
for the following rules:
violationSuppressXPath now requires XPath 2.0 or 3.1 - in PMD6 it was XPath 1.0. This is a breaking change. See also [core] Select XPath version in violationSuppressXPath #1676.
Changed/removed properties for rules - already documented in the release notes, but incomplete
minimum
removed (was deprecated with 6.0.0 already)cc_categories
, cc_remediation_points_multiplier
, cc_block_highlighting
checkNativeMethods
removed (deprecated since 6.3.0)reportLevel
removed (deprecated since 6.0.0)ignoredAnnotations
, see [java] ImmutableField: Remove deprecated property "ignoredAnnotations" #4489exceptionfile
removed (deprecated since 6.10.0)Other disabled test cases in PMD 7, that were enabled before in PMD 6.x
Check diff regression report:
bundle exec pmdtester --local-git-repo ../pmd --base-branch pmd_releases/6.55.0 --patch-branch master --config ../pmd/.ci/files/all-regression-rules.xml --list-of-project ../pmd/.ci/files/project-list.xml --mode online --error-recovery --baseline-download-url https://pmd-code.org/pmd-regression-tester/
//
or /*
or *
anymore... seems like. TODO, verify.
ignoreExpressions
which is by default true: So we have actually one fix for false positives (expressions are correctly now ignored) and one fix for false negatives for String literals, which weren't reported before PMD 7.AnnotationMethodDeclaration
to MethodDeclaration
- now these are considered methods and are reported@Override
annotations. See [java] Improve ASTMethodDeclaration::isOverridden #3757.i
is said to be unused in https://github.com/checkstyle/checkstyle/blob/checkstyle-9.1/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/InputMethodParamPad.java#L202 but it is read when assigning a new value to itself. Or do we ignore the expressions, if the left side also contains the variable? While this example is very contrived, I think, this is a false positive.
i++
, but otherwise don't use the vars.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4