Skip to content

Commit fa9af05

Browse files
CHANGE(pmd): @W-17349577@ Upgrade to PMD 7.8.0 (#139)
1 parent f8f4f3b commit fa9af05

File tree

6 files changed

+45
-6
lines changed

6 files changed

+45
-6
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/code-analyzer-pmd-engine/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
gson = "2.11.0"
1010
hamcrest = "2.2"
1111
junit-jupiter = "5.10.2"
12-
pmd = "7.7.0" # !!! IMPORTANT !!! KEEP THIS IN SYNC WITH PMD_VERSION INSIDE OF: src/constants.ts
12+
pmd = "7.8.0" # !!! IMPORTANT !!! KEEP THIS IN SYNC WITH PMD_VERSION INSIDE OF: src/constants.ts
1313
slf4j-nop = "2.0.13" # For now, we throw slf4j logs away (using this no-op module). We might use an actual logger in the future.
1414

1515
[libraries]

packages/code-analyzer-pmd-engine/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// !!! IMPORTANT !!! KEEP THIS IN SYNC WITH gradle/libs.versions.toml
2-
export const PMD_VERSION: string = '7.7.0';
2+
export const PMD_VERSION: string = '7.8.0';
33

44
export const PMD_ENGINE_NAME: string = "pmd";
55
export const CPD_ENGINE_NAME: string = "cpd";

packages/code-analyzer-pmd-engine/test/test-data/pmdGoldfiles/rules_allLanguages.goldfile.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,19 @@
922922
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_codestyle.html#propertynamingconventions"
923923
]
924924
},
925+
{
926+
"name": "QueueableWithoutFinalizer",
927+
"severityLevel": 4,
928+
"tags": [
929+
"Recommended",
930+
"BestPractices",
931+
"apexLanguage"
932+
],
933+
"description": "Detects when the Queueable interface is used but a Finalizer is not attached. It is best practice to call the `System.attachFinalizer(Finalizer f)` method within the `execute` method of a class which implements the `Queueable` interface. Without attaching a Finalizer, there is no way of designing error recovery actions should the Queueable action fail.",
934+
"resourceUrls": [
935+
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_bestpractices.html#queueablewithoutfinalizer"
936+
]
937+
},
925938
{
926939
"name": "ScopeForInVariable",
927940
"severityLevel": 2,
@@ -1047,7 +1060,7 @@
10471060
"Design",
10481061
"apexLanguage"
10491062
],
1050-
"description": "Avoid having unused methods since they make understanding and maintaining code harder. This rule finds not only unused private methods, but public methods as well. ApexLink is used to make this possible and this needs additional configuration. The environment variable `PMD_APEX_ROOT_DIRECTORY` needs to be set prior to executing PMD. With this variable the root directory of the Salesforce metadata,... Learn more: https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod",
1063+
"description": "Avoid having unused methods since they make understanding and maintaining code harder. This rule finds not only unused private methods, but public methods as well, as long as the class itself is not entirely unused. A class is considered used, if it contains at least one other method/variable declaration that is used, as shown in the test project file Foo.cls. ApexLink is used to make this possible and... Learn more: https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod",
10511064
"resourceUrls": [
10521065
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod"
10531066
]

packages/code-analyzer-pmd-engine/test/test-data/pmdGoldfiles/rules_apexAndVisualforce.goldfile.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,19 @@
727727
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_codestyle.html#propertynamingconventions"
728728
]
729729
},
730+
{
731+
"name": "QueueableWithoutFinalizer",
732+
"severityLevel": 4,
733+
"tags": [
734+
"Recommended",
735+
"BestPractices",
736+
"apexLanguage"
737+
],
738+
"description": "Detects when the Queueable interface is used but a Finalizer is not attached. It is best practice to call the `System.attachFinalizer(Finalizer f)` method within the `execute` method of a class which implements the `Queueable` interface. Without attaching a Finalizer, there is no way of designing error recovery actions should the Queueable action fail.",
739+
"resourceUrls": [
740+
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_bestpractices.html#queueablewithoutfinalizer"
741+
]
742+
},
730743
{
731744
"name": "StdCyclomaticComplexity",
732745
"severityLevel": 3,
@@ -787,7 +800,7 @@
787800
"Design",
788801
"apexLanguage"
789802
],
790-
"description": "Avoid having unused methods since they make understanding and maintaining code harder. This rule finds not only unused private methods, but public methods as well. ApexLink is used to make this possible and this needs additional configuration. The environment variable `PMD_APEX_ROOT_DIRECTORY` needs to be set prior to executing PMD. With this variable the root directory of the Salesforce metadata,... Learn more: https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod",
803+
"description": "Avoid having unused methods since they make understanding and maintaining code harder. This rule finds not only unused private methods, but public methods as well, as long as the class itself is not entirely unused. A class is considered used, if it contains at least one other method/variable declaration that is used, as shown in the test project file Foo.cls. ApexLink is used to make this possible and... Learn more: https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod",
791804
"resourceUrls": [
792805
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod"
793806
]

packages/code-analyzer-pmd-engine/test/test-data/pmdGoldfiles/rules_apexOnly.goldfile.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,19 @@
727727
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_codestyle.html#propertynamingconventions"
728728
]
729729
},
730+
{
731+
"name": "QueueableWithoutFinalizer",
732+
"severityLevel": 4,
733+
"tags": [
734+
"Recommended",
735+
"BestPractices",
736+
"apexLanguage"
737+
],
738+
"description": "Detects when the Queueable interface is used but a Finalizer is not attached. It is best practice to call the `System.attachFinalizer(Finalizer f)` method within the `execute` method of a class which implements the `Queueable` interface. Without attaching a Finalizer, there is no way of designing error recovery actions should the Queueable action fail.",
739+
"resourceUrls": [
740+
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_bestpractices.html#queueablewithoutfinalizer"
741+
]
742+
},
730743
{
731744
"name": "StdCyclomaticComplexity",
732745
"severityLevel": 3,
@@ -787,7 +800,7 @@
787800
"Design",
788801
"apexLanguage"
789802
],
790-
"description": "Avoid having unused methods since they make understanding and maintaining code harder. This rule finds not only unused private methods, but public methods as well. ApexLink is used to make this possible and this needs additional configuration. The environment variable `PMD_APEX_ROOT_DIRECTORY` needs to be set prior to executing PMD. With this variable the root directory of the Salesforce metadata,... Learn more: https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod",
803+
"description": "Avoid having unused methods since they make understanding and maintaining code harder. This rule finds not only unused private methods, but public methods as well, as long as the class itself is not entirely unused. A class is considered used, if it contains at least one other method/variable declaration that is used, as shown in the test project file Foo.cls. ApexLink is used to make this possible and... Learn more: https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod",
791804
"resourceUrls": [
792805
"https://docs.pmd-code.org/pmd-doc-{{PMD_VERSION}}/pmd_rules_apex_design.html#unusedmethod"
793806
]

0 commit comments

Comments
 (0)