Merge branch '7.0.x' into java-dfa-reaching-defs-unused-assignment-singular-field-that-kind-of-thing
This commit is contained in:
65 files changed
+971
-338
No files matched your search
+11
-9
@@ -119,7 +119,7 @@
|
||||
|
||||
<!-- design.xml -->
|
||||
|
||||
<!-- <rule ref="category/java/design.xml/AbstractClassWithoutAnyMethod"/> -->
|
||||
<rule ref="category/java/design.xml/AbstractClassWithoutAnyMethod"/>
|
||||
<!-- <rule ref="category/java/design.xml/AvoidCatchingGenericException"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts"/> -->
|
||||
<rule ref="category/java/design.xml/AvoidRethrowingException"/>
|
||||
@@ -128,17 +128,19 @@
|
||||
<!-- <rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/AvoidUncheckedExceptionsInSignatures"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"/> -->
|
||||
<rule ref="category/java/design.xml/CognitiveComplexity" />
|
||||
<!-- <rule ref="category/java/design.xml/CollapsibleIfStatements"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/CouplingBetweenObjects"/> -->
|
||||
<rule ref="category/java/design.xml/CognitiveComplexity"/>
|
||||
<rule ref="category/java/design.xml/CyclomaticComplexity"/>
|
||||
<rule ref="category/java/design.xml/DataClass"/>
|
||||
<!-- <rule ref="category/java/design.xml/DoNotExtendJavaLangError"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/ExceptionAsFlowControl"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/ExcessiveClassLength"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/ExcessiveImports"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/ExcessiveMethodLength"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/ExcessiveParameterList"/> -->
|
||||
<!-- <rule ref="category/java/design.xml/ExcessivePublicCount"/> -->
|
||||
<rule ref="category/java/design.xml/DoNotExtendJavaLangError"/>
|
||||
<rule ref="category/java/design.xml/ExceptionAsFlowControl"/>
|
||||
<rule ref="category/java/design.xml/ExcessiveClassLength"/>
|
||||
<rule ref="category/java/design.xml/ExcessiveImports"/>
|
||||
<rule ref="category/java/design.xml/ExcessiveMethodLength"/>
|
||||
<rule ref="category/java/design.xml/ExcessiveParameterList"/>
|
||||
<rule ref="category/java/design.xml/ExcessivePublicCount"/>
|
||||
<!-- <rule ref="category/java/design.xml/FinalFieldCouldBeStatic"/> -->
|
||||
<rule ref="category/java/design.xml/GodClass"/>
|
||||
<rule ref="category/java/design.xml/ImmutableField"/>
|
||||
@@ -189,7 +191,6 @@
|
||||
<!-- <rule ref="category/java/errorprone.xml/AvoidLosingExceptionInformation"/> -->
|
||||
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
|
||||
<!-- <rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/BadComparison"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/BeanMembersShouldSerialize"/> -->
|
||||
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
|
||||
<!-- <rule ref="category/java/errorprone.xml/CallSuperFirst"/> -->
|
||||
@@ -202,6 +203,7 @@
|
||||
<!-- <rule ref="category/java/errorprone.xml/CloneThrowsCloneNotSupportedException"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/CloseResource"/> -->
|
||||
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals"/>
|
||||
<!-- <rule ref="category/java/errorprone.xml/ComparisonWithNaN"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/DataflowAnomalyAnalysis"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/DetachedTestCase"/> -->
|
||||
|
||||
@@ -20,8 +20,8 @@ fi
|
||||
|
||||
set -e
|
||||
|
||||
mvn test-compile
|
||||
mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.txt
|
||||
mvn test-compile -B
|
||||
mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.txt -B
|
||||
]]></build-command>
|
||||
<auxclasspath-command>echo -n "$(pwd)/target/classes:$(pwd)/target/test-classes:"; cat classpath.txt</auxclasspath-command>
|
||||
</project>
|
||||
@@ -94,10 +94,11 @@ EOF
|
||||
<auxclasspath-command>cat classpath.txt</auxclasspath-command>
|
||||
</project>
|
||||
|
||||
<!---<project>
|
||||
<name>openjdk10</name>
|
||||
<type>hg</type>
|
||||
<connection>http://hg.openjdk.java.net/jdk10/jdk10/jdk</connection>
|
||||
<webview-url>http://hg.openjdk.java.net/jdk10/jdk10/jdk/file/777356696811</webview-url>
|
||||
</project> -->
|
||||
<project>
|
||||
<name>openjdk-11</name>
|
||||
<type>git</type>
|
||||
<connection>https://github.com/openjdk/jdk</connection>
|
||||
<tag>jdk-11+28</tag>
|
||||
<src-subpath>src/java.base</src-subpath>
|
||||
</project>
|
||||
</projectlist>
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
restore-keys: |
|
||||
v1-${{ runner.os }}-
|
||||
- name: Set up Ruby 2.7
|
||||
uses: actions/setup-ruby@v1
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
- name: Setup Environment
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/12/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/14/scripts" >> $GITHUB_ENV
|
||||
- name: Check Environment
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/12/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/14/scripts" >> $GITHUB_ENV
|
||||
- name: Sync
|
||||
run: .ci/git-repo-sync.sh
|
||||
shell: bash
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
restore-keys: |
|
||||
v1-${{ runner.os }}-
|
||||
- name: Set up Ruby 2.7
|
||||
uses: actions/setup-ruby@v1
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
- name: Setup Environment
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/12/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/14/scripts" >> $GITHUB_ENV
|
||||
- name: Check Environment
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
+9
-5
@@ -5,14 +5,14 @@ require 'fileutils'
|
||||
|
||||
@logger = Logger.new(STDOUT)
|
||||
|
||||
def get_args(base_branch)
|
||||
def get_args(base_branch, autogen = TRUE, patch_config = './pmd/.ci/files/all-java.xml')
|
||||
['--local-git-repo', './pmd',
|
||||
'--list-of-project', './pmd/.ci/files/project-list.xml',
|
||||
'--base-branch', base_branch,
|
||||
'--patch-branch', 'HEAD',
|
||||
'--patch-config', './pmd/.ci/files/all-java.xml',
|
||||
'--patch-config', patch_config,
|
||||
'--mode', 'online',
|
||||
'--auto-gen-config',
|
||||
autogen ? '--auto-gen-config' : '--filter-with-patch-config',
|
||||
'--keep-reports',
|
||||
'--error-recovery',
|
||||
'--baseline-download-url', 'https://pmd-code.org/pmd-regression-tester/',
|
||||
@@ -24,6 +24,7 @@ def run_pmdtester
|
||||
Dir.chdir('..') do
|
||||
begin
|
||||
@base_branch = ENV['PMD_CI_BRANCH']
|
||||
@logger.info "\n\n--------------------------------------"
|
||||
@logger.info "Run against PR base #{@base_branch}"
|
||||
@summary = PmdTester::Runner.new(get_args(@base_branch)).run
|
||||
|
||||
@@ -39,8 +40,9 @@ def run_pmdtester
|
||||
# run against master branch (if the PR is not already against master)
|
||||
unless ENV['PMD_CI_BRANCH'] == 'master'
|
||||
@base_branch = 'master'
|
||||
@logger.info "\n\n--------------------------------------"
|
||||
@logger.info "Run against #{@base_branch}"
|
||||
@summary = PmdTester::Runner.new(get_args(@base_branch)).run
|
||||
@summary = PmdTester::Runner.new(get_args(@base_branch, FALSE, 'target/diff1/patch_config.xml')).run
|
||||
|
||||
# move the generated report out of the way
|
||||
FileUtils.mv 'target/reports/diff', 'target/diff2'
|
||||
@@ -84,7 +86,9 @@ def upload_report
|
||||
Dir.chdir('target') do
|
||||
tar_filename = "pr-#{ENV['PMD_CI_PULL_REQUEST_NUMBER']}-diff-report-#{Time.now.strftime("%Y-%m-%dT%H-%M-%SZ")}.tar"
|
||||
|
||||
`tar -cf #{tar_filename} diff1/ diff2/`
|
||||
`tar czf #{tar_filename} diff1/ diff2/`
|
||||
tar_size = (10 * File.size(tar_filename) / 1024 / 1024)/10.0
|
||||
@logger.info "Uploading file #{tar_filename} (#{tar_size}mb) now..."
|
||||
report_url = `curl -u #{ENV['PMD_CI_CHUNK_TOKEN']} -T #{tar_filename} https://chunk.io`
|
||||
if $?.success?
|
||||
report_url.chomp!
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
source 'https://rubygems.org/'
|
||||
|
||||
# bleeding edge from git
|
||||
#gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git'
|
||||
#gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git', branch: 'master'
|
||||
|
||||
gem 'pmdtester', '~> 1'
|
||||
gem 'danger', '~> 5.6', '>= 5.6'
|
||||
|
||||
+6
-6
@@ -9,7 +9,7 @@ GEM
|
||||
nap
|
||||
open4 (~> 1.3)
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.8)
|
||||
concurrent-ruby (1.1.9)
|
||||
cork (0.3.0)
|
||||
colored2 (~> 3.1)
|
||||
danger (5.16.1)
|
||||
@@ -31,7 +31,7 @@ GEM
|
||||
multipart-post (>= 1.2, < 3)
|
||||
faraday-http-cache (1.3.1)
|
||||
faraday (~> 0.8)
|
||||
fugit (1.4.5)
|
||||
fugit (1.5.0)
|
||||
et-orbi (~> 1.1, >= 1.1.8)
|
||||
raabro (~> 1.4)
|
||||
git (1.8.1)
|
||||
@@ -39,18 +39,18 @@ GEM
|
||||
kramdown (1.17.0)
|
||||
liquid (5.0.1)
|
||||
logger-colors (1.0.0)
|
||||
mini_portile2 (2.5.1)
|
||||
mini_portile2 (2.5.3)
|
||||
multipart-post (2.1.1)
|
||||
nap (1.1.0)
|
||||
no_proxy_fix (0.1.2)
|
||||
nokogiri (1.11.5)
|
||||
nokogiri (1.11.7)
|
||||
mini_portile2 (~> 2.5.0)
|
||||
racc (~> 1.4)
|
||||
octokit (4.21.0)
|
||||
faraday (>= 0.9)
|
||||
sawyer (~> 0.8.0, >= 0.5.3)
|
||||
open4 (1.3.4)
|
||||
pmdtester (1.1.2)
|
||||
pmdtester (1.2.0)
|
||||
differ (~> 0.1)
|
||||
liquid (>= 4.0)
|
||||
logger-colors (~> 1.0)
|
||||
@@ -68,7 +68,7 @@ GEM
|
||||
sawyer (0.8.2)
|
||||
addressable (>= 2.3.5)
|
||||
faraday (> 0.8, < 2.0)
|
||||
slop (4.9.0)
|
||||
slop (4.9.1)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
tzinfo (2.0.4)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ repository: pmd/pmd
|
||||
|
||||
pmd:
|
||||
version: 7.0.0-SNAPSHOT
|
||||
previous_version: 6.34.0
|
||||
previous_version: 6.35.0
|
||||
date: ??-?????-2021
|
||||
release_type: major
|
||||
|
||||
|
||||
@@ -246,6 +246,19 @@ the breaking API changes will be performed in 7.0.0.
|
||||
an API is tagged as `@Deprecated` or not in the latest minor release. During the development of 7.0.0,
|
||||
we may decide to remove some APIs that were not tagged as deprecated, though we'll try to avoid it." %}
|
||||
|
||||
#### 6.35.0
|
||||
|
||||
##### Deprecated API
|
||||
|
||||
* {% jdoc !!core::PMD#doPMD(net.sourceforge.pmd.PMDConfiguration) %} is deprecated.
|
||||
Use {% jdoc !!core::PMD#runPMD(net.sourceforge.pmd.PMDConfiguration) %} instead.
|
||||
* {% jdoc !!core::PMD#run(java.lang.String[]) %} is deprecated.
|
||||
Use {% jdoc !!core::PMD#runPMD(java.lang.String...) %} instead.
|
||||
* {% jdoc core::ThreadSafeReportListener %} and the methods to use them in {% jdoc core::Report %}
|
||||
({% jdoc core::Report#addListener(net.sourceforge.pmd.ThreadSafeReportListener) %},
|
||||
{% jdoc core::Report#getListeners() %}, {% jdoc core::Report#addListeners(java.util.List) %})
|
||||
are deprecated. This functionality will be replaced by another TBD mechanism in PMD 7.
|
||||
|
||||
#### 6.34.0
|
||||
|
||||
No changes.
|
||||
@@ -1306,3 +1319,10 @@ large projects, with many duplications, it was causing `OutOfMemoryError`s (see
|
||||
* The Java rule [`DataflowAnomalyAnalysis`](https://pmd.github.io/pmd-6.27.0/pmd_rules_java_errorprone.html#dataflowanomalyanalysis) (`java-errorprone`)
|
||||
is deprecated in favour of {% rule "java/bestpractices/UnusedAssignment" %} (`java-bestpractices`),
|
||||
which was introduced in PMD 6.26.0.
|
||||
|
||||
* The java rule {% rule "java/codestyle/DefaultPackage" %} has been deprecated in favor of
|
||||
{% rule "java/codestyle/CommentDefaultAccessModifier" %}.
|
||||
|
||||
* The Java rule {% rule "java/errorprone/CloneThrowsCloneNotSupportedException" %} has been deprecated without
|
||||
replacement.
|
||||
|
||||
+29
-111
@@ -19,137 +19,55 @@ This is a {{ site.pmd.release_type }} release.
|
||||
|
||||
### New and noteworthy
|
||||
|
||||
#### Javascript module now requires at least Java 8
|
||||
|
||||
The latest version of [Rhino](https://github.com/mozilla/rhino), the implementation of JavaScript we use
|
||||
for parsing JavaScript code, requires at least Java 8. Therefore we decided to upgrade the pmd-javascript
|
||||
module to Java 8 as well. This means that from now on, a Java 8 or later runtime is required in order
|
||||
to analyze JavaScript code. Note that PMD core still only requires Java 7.
|
||||
|
||||
#### New rules
|
||||
|
||||
This release ships with 3 new Java rules.
|
||||
|
||||
* {% rule "java/bestpractices/JUnit5TestShouldBePackagePrivate" %}
|
||||
enforces the convention that JUnit 5 tests should have minimal visibility.
|
||||
* The new Apex rule {% rule apex/performance/AvoidDebugStatements %} finds usages of `System.debug` calls.
|
||||
Debug statements contribute to longer transactions and consume Apex CPU time even when debug logs are not
|
||||
being captured.
|
||||
You can try out this rule like so:
|
||||
|
||||
```xml
|
||||
<rule ref="category/java/bestpractices.xml/JUnit5TestShouldBePackagePrivate" />
|
||||
<rule ref="category/apex/performance.xml/AvoidDebugStatements" />
|
||||
```
|
||||
|
||||
* {% rule "java/design/CognitiveComplexity" %} uses the cognitive complexity
|
||||
metric to find overly complex code. This metric improves on the similar cyclomatic complexity
|
||||
in several ways, for instance, it incentivizes using clearly readable shorthands and idioms.
|
||||
See the rule documentation for more details. You can try out this rule like so:
|
||||
* The new Apex rule {% rule "apex/errorprone/InaccessibleAuraEnabledGetter" %} checks that an `AuraEnabled`
|
||||
getter is public or global. This is necessary if it is referenced in Lightning components.
|
||||
You can try out this rule like so:
|
||||
|
||||
```xml
|
||||
<rule ref="category/java/design.xml/CognitiveComplexity" />
|
||||
<rule ref="category/apex/errorprone.xml/InaccessibleAuraEnabledGetter" />
|
||||
```
|
||||
|
||||
* {% rule "java/design/MutableStaticState" %} finds non-private static fields
|
||||
that are not final. These fields break encapsulation since these fields can be modified from anywhere
|
||||
within the program. You can try out this rule like so:
|
||||
```xml
|
||||
<rule ref="category/java/design.xml/MutableStaticState" />
|
||||
```
|
||||
#### Renamed rules
|
||||
|
||||
#### Modified rules
|
||||
|
||||
* The Java rule {% rule "java/errorprone/CompareObjectsWithEquals" %} has now a new property
|
||||
`typesThatCompareByReference`. With that property, you can configure types, that should be whitelisted
|
||||
for comparison by reference. By default, `java.lang.Enum` and `java.lang.Class` are allowed, but
|
||||
you could add custom types here.
|
||||
Additionally comparisons against constants are allowed now. This makes the rule less noisy when two constants
|
||||
are compared. Constants are identified by looking for an all-caps identifier.
|
||||
|
||||
#### Deprecated rules
|
||||
|
||||
* The java rule {% rule "java/codestyle/DefaultPackage" %} has been deprecated in favor of
|
||||
{% rule "java/codestyle/CommentDefaultAccessModifier" %}.
|
||||
|
||||
The rule "DefaultPackage" assumes that any usage of package-access is accidental,
|
||||
and by doing so, prohibits using a really fundamental and useful feature of the language.
|
||||
|
||||
To satisfy the rule, you have to make the member public even if it doesn't need to, or make it protected,
|
||||
which muddies your intent even more if you don't intend the class to be extended, and may be at odds with
|
||||
other rules like {% rule "java/codestyle/AvoidProtectedFieldInFinalClass" %}.
|
||||
|
||||
The rule {% rule "java/codestyle/CommentDefaultAccessModifier" %} should be used instead.
|
||||
It flags the same thing, but has an escape hatch.
|
||||
|
||||
* The Java rule {% rule "java/errorprone/CloneThrowsCloneNotSupportedException" %} has been deprecated without
|
||||
replacement.
|
||||
|
||||
The rule has no real value as `CloneNotSupportedException` is a
|
||||
checked exception and therefore you need to deal with it while implementing the `clone()` method. You either
|
||||
need to declare the exception or catch it. If you catch it, then subclasses can't throw it themselves explicitly.
|
||||
However, `Object.clone()` will still throw this exception if the `Cloneable` interface is not implemented.
|
||||
|
||||
Note, this rule has also been removed from the Quickstart Ruleset (`rulesets/java/quickstart.xml`).
|
||||
* The Java rule {% rule "java/errorprone/BadComparison" %} has been renamed to
|
||||
{% rule "java/errorprone/ComparisonWithNaN" %} to better reflect what the rule actually detects.
|
||||
It now considers usages of `Double.NaN` or `Float.NaN` in more cases and fixes false negatives.
|
||||
|
||||
### Fixed Issues
|
||||
|
||||
* apex
|
||||
* [#3183](https://github.com/pmd/pmd/issues/3183): \[apex] ApexUnitTestMethodShouldHaveIsTestAnnotation false positive with helper method
|
||||
* [#3243](https://github.com/pmd/pmd/pull/3243): \[apex] Correct findBoundary when traversing AST
|
||||
* [#3307](https://github.com/pmd/pmd/issues/3307): \[apex] Avoid debug statements since it impact performance
|
||||
* [#3321](https://github.com/pmd/pmd/issues/3321): \[apex] New rule to detect inaccessible AuraEnabled getters (summer '21 security update)
|
||||
* core
|
||||
* [#2639](https://github.com/pmd/pmd/issues/2639): \[core] PMD CLI output file is not created if directory or directories in path don't exist
|
||||
* [#3196](https://github.com/pmd/pmd/issues/3196): \[core] Deprecate ThreadSafeReportListener
|
||||
* doc
|
||||
* [#3230](https://github.com/pmd/pmd/issues/3230): \[doc] Remove "Edit me" button for language index pages
|
||||
* dist
|
||||
* [#2466](https://github.com/pmd/pmd/issues/2466): \[dist] Distribution archive doesn't include all batch scripts
|
||||
* java
|
||||
* [#3269](https://github.com/pmd/pmd/pull/3269): \[java] Fix NPE in MethodTypeResolution
|
||||
* java-bestpractices
|
||||
* [#1175](https://github.com/pmd/pmd/issues/1175): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource
|
||||
* [#2219](https://github.com/pmd/pmd/issues/2219): \[java] Document Reasons to Avoid Reassigning Parameters
|
||||
* [#2737](https://github.com/pmd/pmd/issues/2737): \[java] Fix misleading rule message on rule SwitchStmtsShouldHaveDefault with non-exhaustive enum switch
|
||||
* [#3236](https://github.com/pmd/pmd/issues/3236): \[java] LiteralsFirstInComparisons should consider constant fields (cont'd)
|
||||
* [#3239](https://github.com/pmd/pmd/issues/3239): \[java] PMD could enforce non-public methods for Junit5 / Jupiter test methods
|
||||
* [#3254](https://github.com/pmd/pmd/issues/3254): \[java] AvoidReassigningParameters reports violations on wrong line numbers
|
||||
* [#3323](https://github.com/pmd/pmd/pull/3323): \[core] Adds fullDescription and tags in SARIF report
|
||||
* java-codestyle
|
||||
* [#2655](https://github.com/pmd/pmd/issues/2655): \[java] UnnecessaryImport false positive for on-demand imports
|
||||
* [#3206](https://github.com/pmd/pmd/issues/3206): \[java] Deprecate rule DefaultPackage
|
||||
* [#3262](https://github.com/pmd/pmd/pull/3262): \[java] FieldDeclarationsShouldBeAtStartOfClass: false negative with anon classes
|
||||
* [#3265](https://github.com/pmd/pmd/pull/3265): \[java] MethodArgumentCouldBeFinal: false negatives with interfaces and inner classes
|
||||
* [#3266](https://github.com/pmd/pmd/pull/3266): \[java] LocalVariableCouldBeFinal: false negatives with interfaces, anon classes
|
||||
* [#3274](https://github.com/pmd/pmd/pull/3274): \[java] OnlyOneReturn: false negative with anonymous class
|
||||
* [#3275](https://github.com/pmd/pmd/pull/3275): \[java] UnnecessaryLocalBeforeReturn: false negatives with lambda and anon class
|
||||
* java-design
|
||||
* [#2780](https://github.com/pmd/pmd/issues/2780): \[java] DataClass example from documentation results in false-negative
|
||||
* [#2987](https://github.com/pmd/pmd/issues/2987): \[java] New Rule: Public and protected static fields must be final
|
||||
* [#2329](https://github.com/pmd/pmd/issues/2329): \[java] Cognitive complexity rule for Java
|
||||
* [#3317](https://github.com/pmd/pmd/pull/3317): \[java] Update UnnecessaryImport to recognize usage of imported types in javadoc's `@exception` tag
|
||||
* java-errorprone
|
||||
* [#3110](https://github.com/pmd/pmd/issues/3110): \[java] Enhance CompareObjectsWithEquals with list of exceptions
|
||||
* [#3112](https://github.com/pmd/pmd/issues/3112): \[java] Deprecate rule CloneThrowsCloneNotSupportedException
|
||||
* [#3205](https://github.com/pmd/pmd/issues/3205): \[java] Make CompareObjectWithEquals allow comparing against constants
|
||||
* [#3248](https://github.com/pmd/pmd/issues/3248): \[java] Documentation is wrong for SingletonClassReturningNewInstance rule
|
||||
* [#3249](https://github.com/pmd/pmd/pull/3249): \[java] AvoidFieldNameMatchingTypeName: False negative with interfaces
|
||||
* [#3268](https://github.com/pmd/pmd/pull/3268): \[java] ConstructorCallsOverridableMethod: IndexOutOfBoundsException with annotations
|
||||
* java-performance
|
||||
* [#1438](https://github.com/pmd/pmd/issues/1438): \[java] InsufficientStringBufferDeclaration false positive for initial calculated StringBuilder size
|
||||
* javascript
|
||||
* [#699](https://github.com/pmd/pmd/issues/699): \[javascript] Update Rhino library to 1.7.13
|
||||
* [#2081](https://github.com/pmd/pmd/issues/2081): \[javascript] Failing with OutOfMemoryError parsing a Javascript file
|
||||
* [#2895](https://github.com/pmd/pmd/issues/2895): \[java] Improve BadComparison and rename to ComparisonWithNaN
|
||||
* [#3304](https://github.com/pmd/pmd/issues/3304): \[java] NPE in MoreThanOneLoggerRule on a java 16 record
|
||||
|
||||
### API Changes
|
||||
|
||||
#### Deprecated API
|
||||
|
||||
* {% jdoc !!core::PMD#doPMD(net.sourceforge.pmd.PMDConfiguration) %} is deprecated.
|
||||
Use {% jdoc !!core::PMD#runPMD(net.sourceforge.pmd.PMDConfiguration) %} instead.
|
||||
* {% jdoc !!core::PMD#run(java.lang.String[]) %} is deprecated.
|
||||
Use {% jdoc !!core::PMD#runPMD(java.lang.String...) %} instead.
|
||||
* {% jdoc core::ThreadSafeReportListener %} and the methods to use them in {% jdoc core::Report %}
|
||||
({% jdoc core::Report#addListener(net.sourceforge.pmd.ThreadSafeReportListener) %},
|
||||
{% jdoc core::Report#getListeners() %}, {% jdoc core::Report#addListeners(java.util.List) %})
|
||||
are deprecated. This functionality will be replaced by another TBD mechanism in PMD 7.
|
||||
|
||||
### External Contributions
|
||||
* [#3272](https://github.com/pmd/pmd/pull/3272): \[apex] correction for ApexUnitTestMethodShouldHaveIsTestAnnotation false positives - [William Brockhus](https://github.com/YodaDaCoda)
|
||||
* [#3246](https://github.com/pmd/pmd/pull/3246): \[java] New Rule: MutableStaticState - [Vsevolod Zholobov](https://github.com/vszholobov)
|
||||
* [#3247](https://github.com/pmd/pmd/pull/3247): \[java] New rule: JUnit5TestShouldBePackagePrivate - [Arnaud Jeansen](https://github.com/ajeans)
|
||||
* [#3293](https://github.com/pmd/pmd/pull/3293): \[java] Cognitive Complexity Metric - [Denis Borovikov](https://github.com/borovikovd)
|
||||
* [pmd.github.io#12](https://github.com/pmd/pmd.github.io/pull/12): Update quickstart.html - [Igor Lyadov](https://github.com/devigo)
|
||||
|
||||
* [#3276](https://github.com/pmd/pmd/pull/3276): \[apex] Update ApexCRUDViolation and OperationWithLimitsInLoop docs - [Jonathan Wiesel](https://github.com/jonathanwiesel)
|
||||
* [#3306](https://github.com/pmd/pmd/pull/3306): \[java] More than one logger rule test null pointer exception - [Arnaud Jeansen](https://github.com/ajeans)
|
||||
* [#3317](https://github.com/pmd/pmd/pull/3317): \[java] Update UnnecessaryImport to recognize usage of imported types in javadoc's `@exception` tag - [Piotrek Żygieło](https://github.com/pzygielo)
|
||||
* [#3319](https://github.com/pmd/pmd/pull/3319): \[apex] New AvoidDebugStatements rule to mitigate performance impact - [Jonathan Wiesel](https://github.com/jonathanwiesel)
|
||||
* [#3320](https://github.com/pmd/pmd/pull/3320): \[java] Fix incorrect increment for "else if" branch in Cognitive Complexity docs - [Denis Borovikov](https://github.com/borovikovd)
|
||||
* [#3322](https://github.com/pmd/pmd/pull/3322): \[apex] added rule to detect inaccessible AuraEnabled getters - [Philippe Ozil](https://github.com/pozil)
|
||||
* [#3323](https://github.com/pmd/pmd/pull/3323): \[core] Adds fullDescription and tags in SARIF report - [Clint Chester](https://github.com/Clint-Chester)
|
||||
|
||||
{% endtocmaker %}
|
||||
|
||||
@@ -5,6 +5,165 @@ permalink: pmd_release_notes_old.html
|
||||
|
||||
Previous versions of PMD can be downloaded here: https://github.com/pmd/pmd/releases
|
||||
|
||||
## 29-May-2021 - 6.35.0
|
||||
|
||||
The PMD team is pleased to announce PMD 6.35.0.
|
||||
|
||||
This is a minor release.
|
||||
|
||||
### Table Of Contents
|
||||
|
||||
* [New and noteworthy](#new-and-noteworthy)
|
||||
* [Javascript module now requires at least Java 8](#javascript-module-now-requires-at-least-java-8)
|
||||
* [New rules](#new-rules)
|
||||
* [Modified rules](#modified-rules)
|
||||
* [Deprecated rules](#deprecated-rules)
|
||||
* [Fixed Issues](#fixed-issues)
|
||||
* [API Changes](#api-changes)
|
||||
* [Deprecated API](#deprecated-api)
|
||||
* [External Contributions](#external-contributions)
|
||||
* [Stats](#stats)
|
||||
|
||||
### New and noteworthy
|
||||
|
||||
#### Javascript module now requires at least Java 8
|
||||
|
||||
The latest version of [Rhino](https://github.com/mozilla/rhino), the implementation of JavaScript we use
|
||||
for parsing JavaScript code, requires at least Java 8. Therefore we decided to upgrade the pmd-javascript
|
||||
module to Java 8 as well. This means that from now on, a Java 8 or later runtime is required in order
|
||||
to analyze JavaScript code. Note that PMD core still only requires Java 7.
|
||||
|
||||
#### New rules
|
||||
|
||||
This release ships with 3 new Java rules.
|
||||
|
||||
* [`JUnit5TestShouldBePackagePrivate`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_bestpractices.html#junit5testshouldbepackageprivate)
|
||||
enforces the convention that JUnit 5 tests should have minimal visibility.
|
||||
You can try out this rule like so:
|
||||
```xml
|
||||
<rule ref="category/java/bestpractices.xml/JUnit5TestShouldBePackagePrivate" />
|
||||
```
|
||||
|
||||
* [`CognitiveComplexity`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_design.html#cognitivecomplexity) uses the cognitive complexity
|
||||
metric to find overly complex code. This metric improves on the similar cyclomatic complexity
|
||||
in several ways, for instance, it incentivizes using clearly readable shorthands and idioms.
|
||||
See the rule documentation for more details. You can try out this rule like so:
|
||||
```xml
|
||||
<rule ref="category/java/design.xml/CognitiveComplexity" />
|
||||
```
|
||||
|
||||
* [`MutableStaticState`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_design.html#mutablestaticstate) finds non-private static fields
|
||||
that are not final. These fields break encapsulation since these fields can be modified from anywhere
|
||||
within the program. You can try out this rule like so:
|
||||
```xml
|
||||
<rule ref="category/java/design.xml/MutableStaticState" />
|
||||
```
|
||||
|
||||
#### Modified rules
|
||||
|
||||
* The Java rule [`CompareObjectsWithEquals`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_errorprone.html#compareobjectswithequals) has now a new property
|
||||
`typesThatCompareByReference`. With that property, you can configure types, that should be whitelisted
|
||||
for comparison by reference. By default, `java.lang.Enum` and `java.lang.Class` are allowed, but
|
||||
you could add custom types here.
|
||||
Additionally comparisons against constants are allowed now. This makes the rule less noisy when two constants
|
||||
are compared. Constants are identified by looking for an all-caps identifier.
|
||||
|
||||
#### Deprecated rules
|
||||
|
||||
* The java rule [`DefaultPackage`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_codestyle.html#defaultpackage) has been deprecated in favor of
|
||||
[`CommentDefaultAccessModifier`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_codestyle.html#commentdefaultaccessmodifier).
|
||||
|
||||
The rule "DefaultPackage" assumes that any usage of package-access is accidental,
|
||||
and by doing so, prohibits using a really fundamental and useful feature of the language.
|
||||
|
||||
To satisfy the rule, you have to make the member public even if it doesn't need to, or make it protected,
|
||||
which muddies your intent even more if you don't intend the class to be extended, and may be at odds with
|
||||
other rules like [`AvoidProtectedFieldInFinalClass`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_codestyle.html#avoidprotectedfieldinfinalclass).
|
||||
|
||||
The rule [`CommentDefaultAccessModifier`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_codestyle.html#commentdefaultaccessmodifier) should be used instead.
|
||||
It flags the same thing, but has an escape hatch.
|
||||
|
||||
* The Java rule [`CloneThrowsCloneNotSupportedException`](https://pmd.github.io/pmd-6.35.0/pmd_rules_java_errorprone.html#clonethrowsclonenotsupportedexception) has been deprecated without
|
||||
replacement.
|
||||
|
||||
The rule has no real value as `CloneNotSupportedException` is a
|
||||
checked exception and therefore you need to deal with it while implementing the `clone()` method. You either
|
||||
need to declare the exception or catch it. If you catch it, then subclasses can't throw it themselves explicitly.
|
||||
However, `Object.clone()` will still throw this exception if the `Cloneable` interface is not implemented.
|
||||
|
||||
Note, this rule has also been removed from the Quickstart Ruleset (`rulesets/java/quickstart.xml`).
|
||||
|
||||
### Fixed Issues
|
||||
|
||||
* apex
|
||||
* [#3183](https://github.com/pmd/pmd/issues/3183): \[apex] ApexUnitTestMethodShouldHaveIsTestAnnotation false positive with helper method
|
||||
* [#3243](https://github.com/pmd/pmd/pull/3243): \[apex] Correct findBoundary when traversing AST
|
||||
* core
|
||||
* [#2639](https://github.com/pmd/pmd/issues/2639): \[core] PMD CLI output file is not created if directory or directories in path don't exist
|
||||
* [#3196](https://github.com/pmd/pmd/issues/3196): \[core] Deprecate ThreadSafeReportListener
|
||||
* doc
|
||||
* [#3230](https://github.com/pmd/pmd/issues/3230): \[doc] Remove "Edit me" button for language index pages
|
||||
* dist
|
||||
* [#2466](https://github.com/pmd/pmd/issues/2466): \[dist] Distribution archive doesn't include all batch scripts
|
||||
* java
|
||||
* [#3269](https://github.com/pmd/pmd/pull/3269): \[java] Fix NPE in MethodTypeResolution
|
||||
* java-bestpractices
|
||||
* [#1175](https://github.com/pmd/pmd/issues/1175): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource
|
||||
* [#2219](https://github.com/pmd/pmd/issues/2219): \[java] Document Reasons to Avoid Reassigning Parameters
|
||||
* [#2737](https://github.com/pmd/pmd/issues/2737): \[java] Fix misleading rule message on rule SwitchStmtsShouldHaveDefault with non-exhaustive enum switch
|
||||
* [#3236](https://github.com/pmd/pmd/issues/3236): \[java] LiteralsFirstInComparisons should consider constant fields (cont'd)
|
||||
* [#3239](https://github.com/pmd/pmd/issues/3239): \[java] PMD could enforce non-public methods for Junit5 / Jupiter test methods
|
||||
* [#3254](https://github.com/pmd/pmd/issues/3254): \[java] AvoidReassigningParameters reports violations on wrong line numbers
|
||||
* java-codestyle
|
||||
* [#2655](https://github.com/pmd/pmd/issues/2655): \[java] UnnecessaryImport false positive for on-demand imports
|
||||
* [#3206](https://github.com/pmd/pmd/issues/3206): \[java] Deprecate rule DefaultPackage
|
||||
* [#3262](https://github.com/pmd/pmd/pull/3262): \[java] FieldDeclarationsShouldBeAtStartOfClass: false negative with anon classes
|
||||
* [#3265](https://github.com/pmd/pmd/pull/3265): \[java] MethodArgumentCouldBeFinal: false negatives with interfaces and inner classes
|
||||
* [#3266](https://github.com/pmd/pmd/pull/3266): \[java] LocalVariableCouldBeFinal: false negatives with interfaces, anon classes
|
||||
* [#3274](https://github.com/pmd/pmd/pull/3274): \[java] OnlyOneReturn: false negative with anonymous class
|
||||
* [#3275](https://github.com/pmd/pmd/pull/3275): \[java] UnnecessaryLocalBeforeReturn: false negatives with lambda and anon class
|
||||
* java-design
|
||||
* [#2780](https://github.com/pmd/pmd/issues/2780): \[java] DataClass example from documentation results in false-negative
|
||||
* [#2987](https://github.com/pmd/pmd/issues/2987): \[java] New Rule: Public and protected static fields must be final
|
||||
* [#2329](https://github.com/pmd/pmd/issues/2329): \[java] Cognitive complexity rule for Java
|
||||
* java-errorprone
|
||||
* [#3110](https://github.com/pmd/pmd/issues/3110): \[java] Enhance CompareObjectsWithEquals with list of exceptions
|
||||
* [#3112](https://github.com/pmd/pmd/issues/3112): \[java] Deprecate rule CloneThrowsCloneNotSupportedException
|
||||
* [#3205](https://github.com/pmd/pmd/issues/3205): \[java] Make CompareObjectWithEquals allow comparing against constants
|
||||
* [#3248](https://github.com/pmd/pmd/issues/3248): \[java] Documentation is wrong for SingletonClassReturningNewInstance rule
|
||||
* [#3249](https://github.com/pmd/pmd/pull/3249): \[java] AvoidFieldNameMatchingTypeName: False negative with interfaces
|
||||
* [#3268](https://github.com/pmd/pmd/pull/3268): \[java] ConstructorCallsOverridableMethod: IndexOutOfBoundsException with annotations
|
||||
* java-performance
|
||||
* [#1438](https://github.com/pmd/pmd/issues/1438): \[java] InsufficientStringBufferDeclaration false positive for initial calculated StringBuilder size
|
||||
* javascript
|
||||
* [#699](https://github.com/pmd/pmd/issues/699): \[javascript] Update Rhino library to 1.7.13
|
||||
* [#2081](https://github.com/pmd/pmd/issues/2081): \[javascript] Failing with OutOfMemoryError parsing a Javascript file
|
||||
|
||||
### API Changes
|
||||
|
||||
#### Deprecated API
|
||||
|
||||
* <a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/PMD.html#doPMD(net.sourceforge.pmd.PMDConfiguration)"><code>PMD#doPMD</code></a> is deprecated.
|
||||
Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/PMD.html#runPMD(net.sourceforge.pmd.PMDConfiguration)"><code>PMD#runPMD</code></a> instead.
|
||||
* <a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/PMD.html#run(java.lang.String[])"><code>PMD#run</code></a> is deprecated.
|
||||
Use <a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/PMD.html#runPMD(java.lang.String...)"><code>PMD#runPMD</code></a> instead.
|
||||
* <a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/ThreadSafeReportListener.html#"><code>ThreadSafeReportListener</code></a> and the methods to use them in <a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/Report.html#"><code>Report</code></a>
|
||||
(<a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/Report.html#addListener(net.sourceforge.pmd.ThreadSafeReportListener)"><code>addListener</code></a>,
|
||||
<a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/Report.html#getListeners()"><code>getListeners</code></a>, <a href="https://docs.pmd-code.org/apidocs/pmd-core/6.35.0/net/sourceforge/pmd/Report.html#addListeners(java.util.List)"><code>addListeners</code></a>)
|
||||
are deprecated. This functionality will be replaced by another TBD mechanism in PMD 7.
|
||||
|
||||
### External Contributions
|
||||
* [#3272](https://github.com/pmd/pmd/pull/3272): \[apex] correction for ApexUnitTestMethodShouldHaveIsTestAnnotation false positives - [William Brockhus](https://github.com/YodaDaCoda)
|
||||
* [#3246](https://github.com/pmd/pmd/pull/3246): \[java] New Rule: MutableStaticState - [Vsevolod Zholobov](https://github.com/vszholobov)
|
||||
* [#3247](https://github.com/pmd/pmd/pull/3247): \[java] New rule: JUnit5TestShouldBePackagePrivate - [Arnaud Jeansen](https://github.com/ajeans)
|
||||
* [#3293](https://github.com/pmd/pmd/pull/3293): \[java] Cognitive Complexity Metric - [Denis Borovikov](https://github.com/borovikovd)
|
||||
* [pmd.github.io#12](https://github.com/pmd/pmd.github.io/pull/12): Update quickstart.html - [Igor Lyadov](https://github.com/devigo)
|
||||
|
||||
### Stats
|
||||
* 143 commits
|
||||
* 53 closed tickets & PRs
|
||||
* Days since last release: 34
|
||||
|
||||
## 24-April-2021 - 6.34.0
|
||||
|
||||
The PMD team is pleased to announce PMD 6.34.0.
|
||||
|
||||
@@ -14,10 +14,19 @@
|
||||
"shortDescription": {
|
||||
"text": "Apex classes should declare a sharing model if DML or SOQL/SOSL is used"
|
||||
},
|
||||
"fullDescription": {
|
||||
"text": "Detect classes declared without explicit sharing mode if DML methods are used. This forces the developer to take access restrictions into account before modifying objects."
|
||||
},
|
||||
"helpUri": "https://pmd.github.io/pmd/pmd_rules_apex_security.html#apexsharingviolations",
|
||||
"help": {
|
||||
"text": "Detect classes declared without explicit sharing mode if DML methods are used. This forces the developer to take access restrictions into account before modifying objects."
|
||||
},
|
||||
"properties": {
|
||||
"ruleset": "Security",
|
||||
"priority": 3
|
||||
"priority": 3,
|
||||
"tags":[
|
||||
"Security"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -25,10 +34,19 @@
|
||||
"shortDescription": {
|
||||
"text": "Missing ApexDoc comment"
|
||||
},
|
||||
"fullDescription": {
|
||||
"text": "This rule validates that: ApexDoc comments are present for classes, methods, and properties that are public or global, excluding overrides and test classes (as well as the contents of test classes)."
|
||||
},
|
||||
"helpUri": "https://pmd.github.io/pmd/pmd_rules_apex_documentation.html#apexdoc",
|
||||
"help": {
|
||||
"text": "This rule validates that: ApexDoc comments are present for classes, methods, and properties that are public or global, excluding overrides and test classes (as well as the contents of test classes)."
|
||||
},
|
||||
"properties": {
|
||||
"ruleset": "Documentation",
|
||||
"priority": 3
|
||||
"priority": 3,
|
||||
"tags": [
|
||||
"Documentation"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public class FieldDeclarationsShouldBeAtStartRule extends AbstractApexRule {
|
||||
// <clinit> method doesn't contain location information, however the containing ASTBlockStatements do,
|
||||
// so we fetch them for that method only.
|
||||
return node.findChildrenOfType(ASTMethod.class).stream()
|
||||
.<ApexNode<?>>flatMap(method -> method.getImage().equals(STATIC_INITIALIZER_METHOD_NAME)
|
||||
.<ApexNode<?>>flatMap(method -> STATIC_INITIALIZER_METHOD_NAME.equals(method.getImage())
|
||||
? method.findChildrenOfType(ASTBlockStatement.class).stream() : Stream.of(method))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.apex.rule.errorprone;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.pmd.lang.apex.ast.ASTAnnotation;
|
||||
import net.sourceforge.pmd.lang.apex.ast.ASTMethod;
|
||||
import net.sourceforge.pmd.lang.apex.ast.ASTModifierNode;
|
||||
import net.sourceforge.pmd.lang.apex.ast.ASTProperty;
|
||||
import net.sourceforge.pmd.lang.apex.rule.AbstractApexRule;
|
||||
|
||||
/**
|
||||
* In the Summer '21 release, a mandatory security update enforces access
|
||||
* modifiers on Apex properties in Lightning component markup. The update
|
||||
* prevents access to private or protected Apex getters from Aura and Lightning
|
||||
* Web Components.
|
||||
*
|
||||
* @author p.ozil
|
||||
*/
|
||||
public class InaccessibleAuraEnabledGetterRule extends AbstractApexRule {
|
||||
|
||||
public InaccessibleAuraEnabledGetterRule() {
|
||||
addRuleChainVisit(ASTProperty.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object visit(ASTProperty node, Object data) {
|
||||
// Find @AuraEnabled property
|
||||
ASTModifierNode propModifiers = node.getModifiers();
|
||||
if (hasAuraEnabledAnnotation(propModifiers)) {
|
||||
// Find getters/setters if any
|
||||
List<ASTMethod> methods = node.findChildrenOfType(ASTMethod.class);
|
||||
for (ASTMethod method : methods) {
|
||||
// Find getter method
|
||||
if (!"void".equals(method.getReturnType())) {
|
||||
// Ensure getter is not private or protected
|
||||
ASTModifierNode methodModifiers = method.getModifiers();
|
||||
if (isPrivate(methodModifiers) || isProtected(methodModifiers)) {
|
||||
addViolation(data, node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
private boolean isPrivate(ASTModifierNode modifierNode) {
|
||||
return modifierNode != null && modifierNode.isPrivate();
|
||||
}
|
||||
|
||||
private boolean isProtected(ASTModifierNode modifierNode) {
|
||||
return modifierNode != null && modifierNode.isProtected();
|
||||
}
|
||||
|
||||
private boolean hasAuraEnabledAnnotation(ASTModifierNode modifierNode) {
|
||||
List<ASTAnnotation> annotations = modifierNode.findChildrenOfType(ASTAnnotation.class);
|
||||
for (ASTAnnotation annotation : annotations) {
|
||||
if (annotation.hasImageEqualTo("AuraEnabled")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -437,7 +437,7 @@ public class ApexCRUDViolationRule extends AbstractApexRule {
|
||||
private boolean isProperESAPICheckForDML(final String typeToCheck, final String dmlOperation) {
|
||||
final boolean hasMapping = checkedTypeToDMLOperationViaESAPI.containsKey(typeToCheck.toString());
|
||||
if (hasMapping) {
|
||||
if (dmlOperation.equals(ANY)) {
|
||||
if (ANY.equals(dmlOperation)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ public class ApexCRUDViolationRule extends AbstractApexRule {
|
||||
properChecksHappened = true;
|
||||
break;
|
||||
}
|
||||
if (crudMethod.equals(ANY)) {
|
||||
if (ANY.equals(crudMethod)) {
|
||||
properChecksHappened = true;
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ public class ApexSuggestUsingNamedCredRule extends AbstractApexRule {
|
||||
private boolean isAuthorizationLiteral(final ASTLiteralExpression literal) {
|
||||
if (literal.isString()) {
|
||||
String lit = literal.getImage();
|
||||
if (lit.equalsIgnoreCase(AUTHORIZATION)) {
|
||||
if (AUTHORIZATION.equalsIgnoreCase(lit)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,6 +313,68 @@ public void bar(Integer a, Integer b) {
|
||||
</example>
|
||||
</rule>
|
||||
|
||||
<rule name="InaccessibleAuraEnabledGetter"
|
||||
language="apex"
|
||||
since="6.36.0"
|
||||
message="AuraEnabled getter must be public or global if is referenced in Lightning components"
|
||||
class="net.sourceforge.pmd.lang.apex.rule.errorprone.InaccessibleAuraEnabledGetterRule"
|
||||
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_apex_errorprone.html#inaccessibleauraenabledgetter">
|
||||
<description>
|
||||
In the Summer '21 release, a mandatory security update enforces access modifiers on Apex properties in
|
||||
Lightning component markup. The update prevents access to private or protected Apex getters from Aura
|
||||
and Lightning Web Components.
|
||||
</description>
|
||||
<priority>3</priority>
|
||||
<example>
|
||||
<![CDATA[
|
||||
public class Foo {
|
||||
@AuraEnabled
|
||||
public Integer counter { private get; set; } // Violating - Private getter is inaccessible to Lightning components
|
||||
|
||||
@AuraEnabled
|
||||
public static Foo bar()
|
||||
{
|
||||
Foo foo = new Foo();
|
||||
foo.counter = 2;
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
<example>
|
||||
<![CDATA[
|
||||
public class Foo {
|
||||
@AuraEnabled
|
||||
public Integer counter { protected get; set; } // Violating - Protected getter is inaccessible to Lightning components
|
||||
|
||||
@AuraEnabled
|
||||
public static Foo bar()
|
||||
{
|
||||
Foo foo = new Foo();
|
||||
foo.counter = 2;
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
<example>
|
||||
<![CDATA[
|
||||
public class Foo {
|
||||
@AuraEnabled
|
||||
public Integer counter { get; set; } // Compliant - Public getter is accessible to Lightning components
|
||||
|
||||
@AuraEnabled
|
||||
public static Foo bar()
|
||||
{
|
||||
Foo foo = new Foo();
|
||||
foo.counter = 2;
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
</rule>
|
||||
|
||||
<rule name="MethodWithSameNameAsEnclosingClass"
|
||||
language="apex"
|
||||
since="5.5.0"
|
||||
|
||||
@@ -9,6 +9,51 @@
|
||||
Rules that flag suboptimal code.
|
||||
</description>
|
||||
|
||||
<rule name="AvoidDebugStatements"
|
||||
language="apex"
|
||||
since="6.36.0"
|
||||
message="Avoid debug statements since they impact on performance"
|
||||
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
||||
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_apex_performance.html#avoiddebugstatements">
|
||||
<description>
|
||||
Debug statements contribute to longer transactions and consume Apex CPU time even when debug logs are not being captured.
|
||||
|
||||
When possible make use of other debugging techniques such as the Apex Replay Debugger and Checkpoints that could cover *most* use cases.
|
||||
|
||||
For other valid use cases that the statement is in fact valid make use of the `@SuppressWarnings` annotation or the `//NOPMD` comment.
|
||||
</description>
|
||||
<priority>3</priority>
|
||||
<properties>
|
||||
<property name="version" value="2.0"/>
|
||||
<property name="xpath">
|
||||
<value>
|
||||
<![CDATA[
|
||||
//MethodCallExpression[lower-case(@FullMethodName)='system.debug']
|
||||
]]>
|
||||
</value>
|
||||
</property>
|
||||
</properties>
|
||||
<example>
|
||||
<![CDATA[
|
||||
public class Foo {
|
||||
public void bar() {
|
||||
Account acc = [SELECT Name, Owner.Name FROM Account LIMIT 1];
|
||||
System.debug(accs); // will get reported
|
||||
}
|
||||
|
||||
@SuppressWarnings('PMD.AvoidDebugStatements')
|
||||
public void baz() {
|
||||
try {
|
||||
Account myAccount = bar();
|
||||
} catch (Exception e) {
|
||||
System.debug(LoggingLevel.ERROR, e.getMessage()); // good to go
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
</rule>
|
||||
|
||||
<rule name="AvoidDmlStatementsInLoops"
|
||||
language="apex"
|
||||
since="5.5.0"
|
||||
@@ -99,7 +144,7 @@ public class Something {
|
||||
class="net.sourceforge.pmd.lang.apex.rule.performance.OperationWithLimitsInLoopRule"
|
||||
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_apex_performance.html#operationwithlimitsinloop">
|
||||
<description>
|
||||
Database class methods, DML operations, SOQL queries, or SOSL queries within loops can cause governor limit exceptions. Instead, try to batch up the data into a list and invoke the operation once on that list of data outside the loop.
|
||||
Database class methods, DML operations, SOQL queries, SOSL queries, Approval class methods, Email sending, async scheduling or queueing within loops can cause governor limit exceptions. Instead, try to batch up the data into a list and invoke the operation once on that list of data outside the loop.
|
||||
</description>
|
||||
<priority>3</priority>
|
||||
<example>
|
||||
@@ -130,6 +175,32 @@ public class Something {
|
||||
List<List<SObject>> searchList = [FIND 'map*' IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead];
|
||||
}
|
||||
}
|
||||
|
||||
public void messageInsideOfLoop() {
|
||||
for (Integer i = 0; i < 10; i++) {
|
||||
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
|
||||
Messaging.sendEmail(new Messaging.SingleEmailMessage[]{email});
|
||||
}
|
||||
}
|
||||
|
||||
public void approvalInsideOfLoop(Account[] accs) {
|
||||
for (Integer i = 0; i < 10; i++) {
|
||||
Account acc = accs[i];
|
||||
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
|
||||
req.setObjectId(acc.Id);
|
||||
Approval.process(req);
|
||||
Approval.lock(acc);
|
||||
Approval.unlock(acc);
|
||||
}
|
||||
}
|
||||
|
||||
public void asyncInsideOfLoop() {
|
||||
for (Integer i = 0; i < 10; i++) {
|
||||
System.enqueueJob(new MyQueueable());
|
||||
System.schedule('x', '0 0 0 1 1 ?', new MySchedule());
|
||||
System.scheduleBatch(new MyBatch(), 'x', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
|
||||
@@ -53,7 +53,9 @@ should be [suppressed](pmd_userdocs_suppressing_warnings.html).
|
||||
<![CDATA[
|
||||
public class Foo {
|
||||
public Contact foo(String status, String ID) {
|
||||
Contact c = [SELECT Status__c FROM Contact WHERE Id=:ID];
|
||||
|
||||
// validate you can actually query what you intend to retrieve
|
||||
Contact c = [SELECT Status__c FROM Contact WHERE Id=:ID WITH SECURITY_ENFORCED];
|
||||
|
||||
// Make sure we can update the database before even trying
|
||||
if (!Schema.sObjectType.Contact.fields.Name.isUpdateable()) {
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
<rule ref="category/apex/errorprone.xml/AvoidHardcodingId" message="Avoid hardcoding ID's">
|
||||
<priority>3</priority>
|
||||
</rule>
|
||||
<!-- <rule ref="category/apex/performance.xml/AvoidDebugStatements" /> -->
|
||||
|
||||
<!-- NAMING -->
|
||||
<rule ref="category/apex/codestyle.xml/ClassNamingConventions" message="Class names should begin with an uppercase character">
|
||||
@@ -203,5 +204,6 @@
|
||||
</rule>
|
||||
<!-- <rule ref="category/apex/bestpractices.xml/UnusedLocalVariable"/> -->
|
||||
<!-- <rule ref="category/apex/errorprone.xml/OverrideBothEqualsAndHashcode" /> -->
|
||||
<!-- <rule ref="category/apex/errorprone.xml/InaccessibleAuraEnabledGetter" /> -->
|
||||
|
||||
</ruleset>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.apex.rule.errorprone;
|
||||
|
||||
import net.sourceforge.pmd.testframework.PmdRuleTst;
|
||||
|
||||
public class InaccessibleAuraEnabledGetterTest extends PmdRuleTst {
|
||||
// no additional unit tests
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.apex.rule.performance;
|
||||
|
||||
import net.sourceforge.pmd.testframework.PmdRuleTst;
|
||||
|
||||
public class AvoidDebugStatementsTest extends PmdRuleTst {
|
||||
// no additional unit tests
|
||||
}
|
||||
+17
-14
@@ -5,31 +5,34 @@
|
||||
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
|
||||
|
||||
<test-code>
|
||||
<description>comparison to Double.NaN</description>
|
||||
<description>Failure Case: Inaccessible private AuraEnabled getter</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
boolean x = (y == Double.NaN);
|
||||
@AuraEnabled
|
||||
public Integer counter { private get; set; } // Violating - Private getter is inaccessible to Lightning components
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>ok equality comparison</description>
|
||||
<description>Failure Case: Inaccessible protected AuraEnabled getter</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
@AuraEnabled
|
||||
public Integer counter { protected get; set; } // Violating - Protected getter is inaccessible to Lightning components
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>Success Case: Inaccessible AuraEnabled getter</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
boolean x = (y == z);
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>comparison to Float.NaN</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
boolean x = (y == Float.NaN);
|
||||
@AuraEnabled
|
||||
public Integer counter { get; set; } // Compliant - Public getter is accessible to Lightning components
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<test-data
|
||||
xmlns="http://pmd.sourceforge.net/rule-tests"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
|
||||
|
||||
<test-code>
|
||||
<description>No debug statements</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
public static void bar() {
|
||||
System.enqueueJob(new MayQueueable());
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>Debug statements with a purpose</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
@SuppressWarnings('PMD.AvoidDebugStatements') //logging classes may need the debugs
|
||||
public class LoggingManager {
|
||||
public static void log(LoggingLevel leve, Object data) {
|
||||
System.debug(level, data);
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>Unnecesary debug statements</description>
|
||||
<expected-problems>2</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
public static void bar() {
|
||||
System.debug(LoggingLevel.INFO, 'Testing ' + new List<Account>{new Account(Name = 'Test')});
|
||||
system.debug('simple');
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
</test-data>
|
||||
@@ -65,6 +65,7 @@ public final class PMDVersion {
|
||||
* Checks if the current version is unknown.
|
||||
* @return True if an unknown version, false otherwise
|
||||
*/
|
||||
@SuppressWarnings("PMD.LiteralsFirstInComparisons")
|
||||
public static boolean isUnknown() {
|
||||
return UNKNOWN_VERSION.equals(VERSION);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
package net.sourceforge.pmd.renderers.internal.sarif;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@@ -549,11 +550,16 @@ public class SarifLog {
|
||||
* The pmd priority of the rule.
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* A set of distinct strings that provide additional information. This is SARIF 2.1.0 Schema.
|
||||
*/
|
||||
private Set<String> tags;
|
||||
|
||||
@java.lang.SuppressWarnings("all")
|
||||
PropertyBag(final String ruleset, final Integer priority) {
|
||||
PropertyBag(final String ruleset, final Integer priority, final Set<String> tags) {
|
||||
this.ruleset = ruleset;
|
||||
this.priority = priority;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
||||
@@ -563,6 +569,8 @@ public class SarifLog {
|
||||
private String ruleset;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Integer priority;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Set<String> tags;
|
||||
|
||||
@java.lang.SuppressWarnings("all")
|
||||
PropertyBagBuilder() {
|
||||
@@ -588,15 +596,25 @@ public class SarifLog {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A set of distinct strings that provide additional information. This is SARIF 2.1.0 Schema.
|
||||
* @return {@code this}.
|
||||
*/
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public SarifLog.PropertyBag.PropertyBagBuilder tags(final Set<String> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public SarifLog.PropertyBag build() {
|
||||
return new SarifLog.PropertyBag(this.ruleset, this.priority);
|
||||
return new SarifLog.PropertyBag(this.ruleset, this.priority, this.tags);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public java.lang.String toString() {
|
||||
return "SarifLog.PropertyBag.PropertyBagBuilder(ruleset=" + this.ruleset + ", priority=" + this.priority + ")";
|
||||
return "SarifLog.PropertyBag.PropertyBagBuilder(ruleset=" + this.ruleset + ", priority=" + this.priority + ", tags=" + this.tags + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -621,6 +639,14 @@ public class SarifLog {
|
||||
return this.priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* A set of distinct strings that provide additional information. This is SARIF 2.1.0 Schema.
|
||||
*/
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public Set<String> getTags() {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the rule set.
|
||||
* @return {@code this}.
|
||||
@@ -641,6 +667,16 @@ public class SarifLog {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The set of distinct strings that provide additional information. This is SARIF 2.1.0 Schema.
|
||||
* @return {@code this}.
|
||||
*/
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public SarifLog.PropertyBag setTags(final Set<String> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public boolean equals(final java.lang.Object o) {
|
||||
@@ -664,6 +700,11 @@ public class SarifLog {
|
||||
if (this$priority == null ? other$priority != null : !this$priority.equals(other$priority)) {
|
||||
return false;
|
||||
}
|
||||
final java.lang.Object this$tags = this.getTags();
|
||||
final java.lang.Object other$tags = other.getTags();
|
||||
if (this$tags == null ? other$tags != null : !this$tags.equals(other$tags)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -681,13 +722,15 @@ public class SarifLog {
|
||||
result = result * PRIME + ($ruleset == null ? 43 : $ruleset.hashCode());
|
||||
final java.lang.Object $priority = this.getPriority();
|
||||
result = result * PRIME + ($priority == null ? 43 : $priority.hashCode());
|
||||
final java.lang.Object $tags = this.getTags();
|
||||
result = result * PRIME + ($tags == null ? 43 : $tags.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public java.lang.String toString() {
|
||||
return "SarifLog.PropertyBag(ruleset=" + this.getRuleset() + ", priority=" + this.getPriority() + ")";
|
||||
return "SarifLog.PropertyBag(ruleset=" + this.getRuleset() + ", priority=" + this.getPriority() + ", tags=" + this.getTags() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -23,8 +23,10 @@ import static net.sourceforge.pmd.renderers.internal.sarif.SarifLog.ToolConfigur
|
||||
import static net.sourceforge.pmd.renderers.internal.sarif.SarifLog.ToolExecutionNotification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -176,7 +178,9 @@ public class SarifLogBuilder {
|
||||
return ReportingDescriptor.builder()
|
||||
.id(rv.getRule().getName())
|
||||
.shortDescription(new MultiformatMessage(rv.getDescription()))
|
||||
.fullDescription(new MultiformatMessage(rv.getRule().getDescription()))
|
||||
.helpUri(rv.getRule().getExternalInfoUrl())
|
||||
.help(new MultiformatMessage(rv.getRule().getDescription()))
|
||||
.properties(getRuleProperties(rv))
|
||||
.build();
|
||||
}
|
||||
@@ -185,6 +189,7 @@ public class SarifLogBuilder {
|
||||
return PropertyBag.builder()
|
||||
.ruleset(rv.getRule().getRuleSetName())
|
||||
.priority(rv.getRule().getPriority().getPriority())
|
||||
.tags(new HashSet<String>(Arrays.asList(rv.getRule().getRuleSetName())))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ This ruleset contains links to rules that are new in PMD v6.35.0
|
||||
</description>
|
||||
|
||||
<rule ref="category/java/bestpractices.xml/JUnit5TestShouldBePackagePrivate" />
|
||||
<rule ref="category/java/design.xml/CognitiveComplexity" />
|
||||
<rule ref="category/java/design.xml/MutableStaticState" />
|
||||
|
||||
</ruleset>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<ruleset name="6360"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
|
||||
<description>
|
||||
This ruleset contains links to rules that are new in PMD v6.36.0
|
||||
</description>
|
||||
|
||||
<rule ref="category/apex/performance.xml/AvoidDebugStatements" />
|
||||
<rule ref="category/apex/errorprone.xml/InaccessibleAuraEnabledGetter" />
|
||||
|
||||
</ruleset>
|
||||
Loaded 30 of 65 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user