You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
This test case is deactivated and was working before with PMD 6.x. It will only detect now the last two assignments (15,16) but not the two before (13,14):
⚠️ inconsistency: minimum is still a double, not an int here
while we calculate the ratio between number of statements and number of labels, we shouldn't pretend that this is an exact rule - it's anyway a best guess, that high switch density is a problem. I don't think, it makes a big difference between 10.2 and 10. You e.g. want to report, when the density is bigger than 10 or bigger then 5. We don't need to report level accuracy here.
Java: ImplicitySwitchFallthrough - now reports on the case statements rather than on the switch statement. This results in more violations (maybe multiple per switch). But it is more accurate that way.
behavior of the rule depends on the property 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.
actually, these new cases are correct. Yes, compound assignment don't count as usage anymore, so all the new cases do something like i++, but otherwise don't use the vars.
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:
pmd/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/AvoidReassigningLoopVariables.xml
Lines 676 to 704 in 9f13f12
pmd/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/AvoidReassigningLoopVariables.xml
Lines 580 to 607 in ef34553
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.
topscoreandsigmafor 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
minimumremoved (was deprecated with 6.0.0 already)cc_categories,cc_remediation_points_multiplier,cc_block_highlightingcheckNativeMethodsremoved (deprecated since 6.3.0)reportLevelremoved (deprecated since 6.0.0)ignoredAnnotations, see [java] ImmutableField: Remove deprecated property "ignoredAnnotations" #4489exceptionfileremoved (deprecated since 6.10.0)Other disabled test cases in PMD 7, that were enabled before in PMD 6.x
pmd/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryImport.xml
Lines 161 to 173 in 5eee9f6
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.ignoreExpressionswhich 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.AnnotationMethodDeclarationtoMethodDeclaration- now these are considered methods and are reported@Overrideannotations. See [java] Improve ASTMethodDeclaration::isOverridden #3757.iis 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.