@terafina/tffa-sfdx-plugin 2.2.0 → 2.2.3-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -10
- package/assets/index.css +5 -2
- package/bin/pmd/apex_ruleset.xml +309 -0
- package/bin/pmd/lib/animal-sniffer-annotations-1.14.jar +0 -0
- package/bin/pmd/lib/antlr-2.7.7.jar +0 -0
- package/bin/pmd/lib/antlr-runtime-3.5.2.jar +0 -0
- package/bin/pmd/lib/antlr4-runtime-4.7.2.jar +0 -0
- package/bin/pmd/lib/aopalliance-1.0.jar +0 -0
- package/bin/pmd/lib/asm-9.2.jar +0 -0
- package/bin/pmd/lib/cglib-3.3.0.jar +0 -0
- package/bin/pmd/lib/common_2.13-4.2.0.jar +0 -0
- package/bin/pmd/lib/commons-lang3-3.8.1.jar +0 -0
- package/bin/pmd/lib/error_prone_annotations-2.1.3.jar +0 -0
- package/bin/pmd/lib/gson-2.8.9.jar +0 -0
- package/bin/pmd/lib/j2objc-annotations-1.1.jar +0 -0
- package/bin/pmd/lib/javax.inject-1.jar +0 -0
- package/bin/pmd/lib/jcommander-1.48.jar +0 -0
- package/bin/pmd/lib/jol-core-0.4.jar +0 -0
- package/bin/pmd/lib/jsr305-3.0.2.jar +0 -0
- package/bin/pmd/lib/logback-classic-1.2.9.jar +0 -0
- package/bin/pmd/lib/logback-core-1.2.9.jar +0 -0
- package/bin/pmd/lib/pmd-apex-6.47.0.jar +0 -0
- package/bin/pmd/lib/pmd-apex-jorje-6.47.0-lib.jar +0 -0
- package/bin/pmd/lib/pmd-apex-jorje-6.47.0.pom +140 -0
- package/bin/pmd/lib/pmd-core-6.47.0.jar +0 -0
- package/bin/pmd/lib/rhino-1.7.14.jar +0 -0
- package/bin/pmd/lib/saxon-9.1.0.8-dom.jar +0 -0
- package/bin/pmd/lib/saxon-9.1.0.8.jar +0 -0
- package/bin/pmd/lib/slf4j-api-1.7.32.jar +0 -0
- package/bin/pmd/lib/snakeyaml-1.30.jar +0 -0
- package/bin/pmd/lib/stringtemplate-3.2.1.jar +0 -0
- package/bin/update.sh +49 -0
- package/lib/commands/tffa/lint.d.ts +2 -0
- package/lib/commands/tffa/lint.js +14 -1
- package/lib/commands/tffa/lint.js.map +1 -1
- package/lib/shared/lint/apex-class-lint.js +1 -1
- package/lib/shared/lint/apex-class-lint.js.map +1 -1
- package/lib/shared/lint/apex-pmd.d.ts +8 -0
- package/lib/shared/lint/apex-pmd.js +131 -0
- package/lib/shared/lint/apex-pmd.js.map +1 -0
- package/lib/shared/utils/jreSetupManager.d.ts +17 -0
- package/lib/shared/utils/jreSetupManager.js +135 -0
- package/lib/shared/utils/jreSetupManager.js.map +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +17 -15
package/README.md
CHANGED
|
@@ -6,6 +6,13 @@ tffa-sfdx-plugin is a SalesforceDX plugin from Terafina containing tools for sca
|
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
9
|
+
Before you get started, install the required software on your computer.
|
|
10
|
+
|
|
11
|
+
1. Install Java from [OpenJDK Runtime Environment 18.9 (build 11.0.2+9)](https://openjdk.java.net/install/) or via [brew](https://formulae.brew.sh/formula/openjdk@11) .Some features in Salesforce Extensions for VS Code depend upon the Java Platform.
|
|
12
|
+
2. Install [sfdx-cli](https://developer.salesforce.com/tools/sfdxcli) for osx using `npm install -g sfdx-cli`
|
|
13
|
+
|
|
14
|
+
For information about installing Salesforce CLI, see the Salesforce DX Setup Guide.
|
|
15
|
+
|
|
9
16
|
### **Install as a SalesforceDX Plugin**
|
|
10
17
|
|
|
11
18
|
```
|
|
@@ -34,7 +41,7 @@ $ npm install -g @terafina/tffa-sfdx-plugin
|
|
|
34
41
|
$ sfdx COMMAND
|
|
35
42
|
running command...
|
|
36
43
|
$ sfdx (--version|-v)
|
|
37
|
-
@terafina/tffa-sfdx-plugin/2.2.
|
|
44
|
+
@terafina/tffa-sfdx-plugin/2.2.3-rc.2 linux-x64 node-v16.13.1
|
|
38
45
|
$ sfdx --help [COMMAND]
|
|
39
46
|
USAGE
|
|
40
47
|
$ sfdx COMMAND
|
|
@@ -47,7 +54,7 @@ USAGE
|
|
|
47
54
|
<!-- commands -->
|
|
48
55
|
* [`sfdx help [COMMAND]`](#sfdx-help-command)
|
|
49
56
|
* [`sfdx tffa:apexdoc [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffaapexdoc--d-directory---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
50
|
-
* [`sfdx tffa:lint [-s <directory>] [-m <integer>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffalint--s-directory--m-integer--j---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
57
|
+
* [`sfdx tffa:lint [-s <directory>] [-m <integer>] [-p] [-r <filepath>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffalint--s-directory--m-integer--p--r-filepath--j---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
51
58
|
* [`sfdx tffa:meta [-s <directory>] [-d <directory>] [-c <directory>] [-o json|csv|human] [-f] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffameta--s-directory--d-directory--c-directory--o-jsoncsvhuman--f---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
52
59
|
* [`sfdx tffa:ping [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffaping---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
53
60
|
* [`sfdx version`](#sfdx-version)
|
|
@@ -95,21 +102,23 @@ EXAMPLES
|
|
|
95
102
|
Generate Apex API Documentation : $sfdx tffa:apexdoc
|
|
96
103
|
```
|
|
97
104
|
|
|
98
|
-
_See code: [src/commands/tffa/apexdoc.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v2.2.
|
|
105
|
+
_See code: [src/commands/tffa/apexdoc.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v2.2.3-rc.2/src/commands/tffa/apexdoc.ts)_
|
|
99
106
|
|
|
100
|
-
## `sfdx tffa:lint [-s <directory>] [-m <integer>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
107
|
+
## `sfdx tffa:lint [-s <directory>] [-m <integer>] [-p] [-r <filepath>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
101
108
|
|
|
102
109
|
scan a sfdx project and provide a violations report based on defined standards
|
|
103
110
|
|
|
104
111
|
```
|
|
105
112
|
USAGE
|
|
106
|
-
$ sfdx tffa:lint [-s <directory>] [-m <integer>] [-j] [--loglevel
|
|
113
|
+
$ sfdx tffa:lint [-s <directory>] [-m <integer>] [-p] [-r <filepath>] [-j] [--loglevel
|
|
107
114
|
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
108
115
|
|
|
109
116
|
FLAGS
|
|
110
117
|
-j, --json generate json output
|
|
111
118
|
-m, --minapi=<value> [default: 53] minimum api version to
|
|
112
119
|
use during quality checks
|
|
120
|
+
-p, --pmd generate pmd output
|
|
121
|
+
-r, --rulesetpath=<value> path to pmd ruleset
|
|
113
122
|
-s, --sourcefolder=<value> [default: .] directory containing
|
|
114
123
|
sfdx project
|
|
115
124
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
@@ -122,7 +131,7 @@ EXAMPLES
|
|
|
122
131
|
Scan a sfdx project and provide list of code violations : $sfdx tffa:scan
|
|
123
132
|
```
|
|
124
133
|
|
|
125
|
-
_See code: [src/commands/tffa/lint.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v2.2.
|
|
134
|
+
_See code: [src/commands/tffa/lint.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v2.2.3-rc.2/src/commands/tffa/lint.ts)_
|
|
126
135
|
|
|
127
136
|
## `sfdx tffa:meta [-s <directory>] [-d <directory>] [-c <directory>] [-o json|csv|human] [-f] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
128
137
|
|
|
@@ -151,7 +160,7 @@ EXAMPLES
|
|
|
151
160
|
scan a sfdx project for metadata : $sfdx tffa:meta
|
|
152
161
|
```
|
|
153
162
|
|
|
154
|
-
_See code: [src/commands/tffa/meta.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v2.2.
|
|
163
|
+
_See code: [src/commands/tffa/meta.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v2.2.3-rc.2/src/commands/tffa/meta.ts)_
|
|
155
164
|
|
|
156
165
|
## `sfdx tffa:ping [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
157
166
|
|
|
@@ -173,14 +182,25 @@ EXAMPLES
|
|
|
173
182
|
$ sfdx tffa:ping
|
|
174
183
|
```
|
|
175
184
|
|
|
176
|
-
_See code: [src/commands/tffa/ping.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v2.2.
|
|
185
|
+
_See code: [src/commands/tffa/ping.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v2.2.3-rc.2/src/commands/tffa/ping.ts)_
|
|
177
186
|
|
|
178
187
|
## `sfdx version`
|
|
179
188
|
|
|
180
189
|
```
|
|
181
190
|
USAGE
|
|
182
|
-
$ sfdx version
|
|
191
|
+
$ sfdx version [--json] [--verbose]
|
|
192
|
+
|
|
193
|
+
FLAGS
|
|
194
|
+
--verbose Show additional information about the CLI.
|
|
195
|
+
|
|
196
|
+
GLOBAL FLAGS
|
|
197
|
+
--json Format output as json.
|
|
198
|
+
|
|
199
|
+
FLAG DESCRIPTIONS
|
|
200
|
+
--verbose Show additional information about the CLI.
|
|
201
|
+
|
|
202
|
+
Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.
|
|
183
203
|
```
|
|
184
204
|
|
|
185
|
-
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v1.
|
|
205
|
+
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v1.1.1/src/commands/version.ts)_
|
|
186
206
|
<!-- commandsstop -->
|
package/assets/index.css
CHANGED
|
@@ -409,9 +409,9 @@ a.nav-header {
|
|
|
409
409
|
|
|
410
410
|
.nav-item {
|
|
411
411
|
cursor: pointer;
|
|
412
|
-
height: 25px;
|
|
412
|
+
/* height: 25px;
|
|
413
413
|
margin: 0;
|
|
414
|
-
padding: 6px 0 2px 40px
|
|
414
|
+
padding: 6px 0 2px 40px;*/
|
|
415
415
|
user-select: none;
|
|
416
416
|
}
|
|
417
417
|
|
|
@@ -445,6 +445,9 @@ a.nav-header {
|
|
|
445
445
|
|
|
446
446
|
.nav-item a {
|
|
447
447
|
text-decoration: none;
|
|
448
|
+
display: block;
|
|
449
|
+
line-height: 2rem;
|
|
450
|
+
padding-left: 2.5rem;
|
|
448
451
|
}
|
|
449
452
|
|
|
450
453
|
details summary::-webkit-details-marker {
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<ruleset
|
|
3
|
+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
5
|
+
name="Default ruleset used by the CodeClimate Engine for Salesforce.com Apex"
|
|
6
|
+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"
|
|
7
|
+
>
|
|
8
|
+
<description>Default ruleset used by the Code Climate Engine for Salesforce.com Apex</description>
|
|
9
|
+
<exclude-pattern>.*/.sfdx/.*</exclude-pattern>
|
|
10
|
+
<exclude-pattern>.*/data/.*</exclude-pattern>
|
|
11
|
+
<exclude-pattern>.*/design/.*</exclude-pattern>
|
|
12
|
+
<exclude-pattern>.*/mdapi-source/.*</exclude-pattern>
|
|
13
|
+
<exclude-pattern>.*/guides/.*</exclude-pattern>
|
|
14
|
+
<exclude-pattern>.*/dist/.*</exclude-pattern>
|
|
15
|
+
<exclude-pattern>.*/scripts/.*</exclude-pattern>
|
|
16
|
+
<exclude-pattern>.*/node_modules/.*</exclude-pattern>
|
|
17
|
+
<!-- BEST PRACTICES -->
|
|
18
|
+
<!-- <rule
|
|
19
|
+
ref="category/apex/bestpractices.xml/ApexAssertionsShouldIncludeMessage"
|
|
20
|
+
message="Apex test assert statement should make use of the message parameter."
|
|
21
|
+
>
|
|
22
|
+
<priority>3</priority>
|
|
23
|
+
<properties>
|
|
24
|
+
|
|
25
|
+
</properties>
|
|
26
|
+
</rule> -->
|
|
27
|
+
<rule ref="category/apex/bestpractices.xml/AvoidLogicInTrigger" message="Avoid logic in triggers">
|
|
28
|
+
<priority>3</priority>
|
|
29
|
+
<properties />
|
|
30
|
+
</rule>
|
|
31
|
+
<!--
|
|
32
|
+
<rule ref="category/apex/bestpractices.xml/UnusedLocalVariable" message="Variable ''{0}'' defined but not used">
|
|
33
|
+
<priority>3</priority>
|
|
34
|
+
<properties></properties>
|
|
35
|
+
</rule> -->
|
|
36
|
+
<rule
|
|
37
|
+
ref="category/apex/bestpractices.xml/ApexUnitTestClassShouldHaveAsserts"
|
|
38
|
+
message="Apex unit test classes should have at least one System.assert() or assertEquals() or AssertNotEquals() call"
|
|
39
|
+
>
|
|
40
|
+
<priority>3</priority>
|
|
41
|
+
<properties />
|
|
42
|
+
</rule>
|
|
43
|
+
<rule
|
|
44
|
+
ref="category/apex/bestpractices.xml/ApexUnitTestMethodShouldHaveIsTestAnnotation"
|
|
45
|
+
message="Apex test methods should have @isTest annotation."
|
|
46
|
+
>
|
|
47
|
+
<priority>3</priority>
|
|
48
|
+
<properties />
|
|
49
|
+
</rule>
|
|
50
|
+
<rule
|
|
51
|
+
ref="category/apex/bestpractices.xml/ApexUnitTestShouldNotUseSeeAllDataTrue"
|
|
52
|
+
message="@isTest(seeAllData=true) should not be used in Apex unit tests because it opens up the existing database data for unexpected modification by tests"
|
|
53
|
+
>
|
|
54
|
+
<priority>3</priority>
|
|
55
|
+
<properties />
|
|
56
|
+
</rule>
|
|
57
|
+
<!-- DESIGN -->
|
|
58
|
+
<rule ref="category/apex/design.xml/ExcessiveClassLength" message="Avoid really long classes (lines of code)">
|
|
59
|
+
<priority>3</priority>
|
|
60
|
+
<properties>
|
|
61
|
+
<property name="minimum" value="4000" />
|
|
62
|
+
</properties>
|
|
63
|
+
</rule>
|
|
64
|
+
<rule ref="category/apex/design.xml/ExcessiveParameterList" message="Avoid long parameter lists">
|
|
65
|
+
<priority>3</priority>
|
|
66
|
+
<properties>
|
|
67
|
+
<property name="minimum" value="10" />
|
|
68
|
+
</properties>
|
|
69
|
+
</rule>
|
|
70
|
+
<!-- <rule ref="category/apex/design.xml/ExcessivePublicCount" message="This class has too many public methods and attributes">
|
|
71
|
+
<priority>3</priority>
|
|
72
|
+
<properties>
|
|
73
|
+
<property name="minimum" value="1000" />
|
|
74
|
+
</properties>
|
|
75
|
+
</rule> -->
|
|
76
|
+
<rule ref="category/apex/design.xml/NcssConstructorCount" message="The constructor has an NCSS line count of {0}">
|
|
77
|
+
<priority>3</priority>
|
|
78
|
+
<properties>
|
|
79
|
+
<property name="minimum" value="40" />
|
|
80
|
+
</properties>
|
|
81
|
+
</rule>
|
|
82
|
+
<rule ref="category/apex/design.xml/NcssMethodCount" message="The method has an NCSS line count of {1}">
|
|
83
|
+
<priority>3</priority>
|
|
84
|
+
<properties>
|
|
85
|
+
<property name="minimum" value="200" />
|
|
86
|
+
</properties>
|
|
87
|
+
</rule>
|
|
88
|
+
<rule ref="category/apex/design.xml/NcssTypeCount" message="The type has an NCSS line count of {0}">
|
|
89
|
+
<priority>3</priority>
|
|
90
|
+
<properties>
|
|
91
|
+
<property name="minimum" value="1500" />
|
|
92
|
+
</properties>
|
|
93
|
+
</rule>
|
|
94
|
+
<rule ref="category/apex/design.xml/AvoidDeeplyNestedIfStmts" message="Deeply nested if..else statements are hard to read">
|
|
95
|
+
<priority>3</priority>
|
|
96
|
+
<properties>
|
|
97
|
+
<property name="problemDepth" value="10" />
|
|
98
|
+
</properties>
|
|
99
|
+
</rule>
|
|
100
|
+
<!-- <rule ref="category/apex/design.xml/CyclomaticComplexity">
|
|
101
|
+
<priority>3</priority>
|
|
102
|
+
<properties>
|
|
103
|
+
<property name="classReportLevel" value="800" />
|
|
104
|
+
<property name="methodReportLevel" value="100" />
|
|
105
|
+
</properties>
|
|
106
|
+
</rule>
|
|
107
|
+
<rule ref="category/apex/design.xml/CognitiveComplexity">
|
|
108
|
+
<priority>3</priority>
|
|
109
|
+
<properties>
|
|
110
|
+
<property name="classReportLevel" value="800" />
|
|
111
|
+
<property name="methodReportLevel" value="200" />
|
|
112
|
+
</properties>
|
|
113
|
+
</rule> -->
|
|
114
|
+
<!-- PERFORMANCE -->
|
|
115
|
+
<rule ref="category/apex/performance.xml/AvoidDebugStatements" message="Avoid System.debug statements use tffa.Logger instead">
|
|
116
|
+
<priority>3</priority>
|
|
117
|
+
<properties />
|
|
118
|
+
</rule>
|
|
119
|
+
<rule ref="category/apex/performance.xml/OperationWithLimitsInLoop" message="Avoid operations in loops that may hit governor limits">
|
|
120
|
+
<priority>3</priority>
|
|
121
|
+
<properties />
|
|
122
|
+
</rule>
|
|
123
|
+
<!-- <rule
|
|
124
|
+
ref="category/apex/performance.xml/EagerlyLoadedDescribeSObjectResult"
|
|
125
|
+
message="DescribeSObjectResult could be being loaded eagerly with all child relationships."
|
|
126
|
+
>
|
|
127
|
+
<priority>3</priority>
|
|
128
|
+
<properties>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
</properties>
|
|
133
|
+
</rule> -->
|
|
134
|
+
<!-- CODE STYLE -->
|
|
135
|
+
<rule ref="category/apex/codestyle.xml/OneDeclarationPerLine">
|
|
136
|
+
<priority>3</priority>
|
|
137
|
+
<properties />
|
|
138
|
+
</rule>
|
|
139
|
+
<rule ref="category/apex/codestyle.xml/ClassNamingConventions" message="Class names should begin with an uppercase character">
|
|
140
|
+
<priority>3</priority>
|
|
141
|
+
<properties />
|
|
142
|
+
</rule>
|
|
143
|
+
<rule ref="category/apex/codestyle.xml/WhileLoopsMustUseBraces" message="Avoid using 'while' statements without curly braces">
|
|
144
|
+
<priority>3</priority>
|
|
145
|
+
<properties />
|
|
146
|
+
</rule>
|
|
147
|
+
<rule ref="category/apex/codestyle.xml/ForLoopsMustUseBraces" message="Avoid using 'for' statements without curly braces">
|
|
148
|
+
<priority>3</priority>
|
|
149
|
+
<properties />
|
|
150
|
+
</rule>
|
|
151
|
+
<rule ref="category/apex/codestyle.xml/MethodNamingConventions" message="Method name does not begin with a lower case character.">
|
|
152
|
+
<priority>3</priority>
|
|
153
|
+
<properties>
|
|
154
|
+
<property name="testPattern" value="[a-zA-Z0-9_]*" />
|
|
155
|
+
<property name="staticPattern" value="[a-zA-Z0-9_]*" />
|
|
156
|
+
<property name="instancePattern" value="[a-zA-Z0-9_]*" />
|
|
157
|
+
</properties>
|
|
158
|
+
</rule>
|
|
159
|
+
<rule ref="category/apex/codestyle.xml/FieldNamingConventions" message="The {0} name doesn''t match ''{2}''">
|
|
160
|
+
<properties>
|
|
161
|
+
<property name="enumConstantPattern" value="[A-Z][a-zA-Z0-9_]*" />
|
|
162
|
+
<property name="constantPattern" value="[a-zA-Z0-9_]*" />
|
|
163
|
+
<property name="finalPattern" value="[a-zA-Z0-9_]*" />
|
|
164
|
+
<property name="staticPattern" value="[a-zA-Z0-9_]*" />
|
|
165
|
+
<property name="instancePattern" value="[a-zA-Z][a-zA-Z0-9_]*" />
|
|
166
|
+
</properties>
|
|
167
|
+
</rule>
|
|
168
|
+
<rule ref="category/apex/codestyle.xml/PropertyNamingConventions" message="The {0} name doesn''t match ''{2}''">
|
|
169
|
+
<properties>
|
|
170
|
+
<property name="staticPattern" value="[a-zA-Z][a-z_A-Z0-9]*" />
|
|
171
|
+
<property name="instancePattern" value="[a-zA-Z][a-z_A-Z0-9]*" />
|
|
172
|
+
</properties>
|
|
173
|
+
</rule>
|
|
174
|
+
<rule ref="category/apex/codestyle.xml/FormalParameterNamingConventions" message="The {0} name doesn''t match ''{2}''">
|
|
175
|
+
<properties>
|
|
176
|
+
<property name="finalMethodParameterPattern" value="[a-z][a-zA-Z0-9]*" />
|
|
177
|
+
<property name="methodParameterPattern" value="[a-z][a-zA-Z0-9_]*" />
|
|
178
|
+
</properties>
|
|
179
|
+
</rule>
|
|
180
|
+
<rule ref="category/apex/codestyle.xml/LocalVariableNamingConventions" message="The {0} name doesn''t match ''{2}''">
|
|
181
|
+
<properties>
|
|
182
|
+
<property name="finalLocalPattern" value="[a-z][a-zA-Z0-9]*" />
|
|
183
|
+
<property name="localPattern" value="[a-z][a-zA-Z0-9]*" />
|
|
184
|
+
</properties>
|
|
185
|
+
</rule>
|
|
186
|
+
<!-- SECURITY -->
|
|
187
|
+
<rule ref="category/apex/security.xml/ApexInsecureEndpoint" message="Apex callouts should use encrypted communication channels">
|
|
188
|
+
<priority>3</priority>
|
|
189
|
+
<properties />
|
|
190
|
+
</rule>
|
|
191
|
+
<rule
|
|
192
|
+
ref="category/apex/security.xml/ApexSharingViolations"
|
|
193
|
+
message="Apex classes should declare a sharing model if DML or SOQL/SOSL is used"
|
|
194
|
+
>
|
|
195
|
+
<priority>3</priority>
|
|
196
|
+
<properties />
|
|
197
|
+
</rule>
|
|
198
|
+
<!-- <rule ref="category/apex/security.xml/ApexOpenRedirect" message="Apex classes should safely redirect to a known location">
|
|
199
|
+
<priority>3</priority>
|
|
200
|
+
<properties />
|
|
201
|
+
</rule> -->
|
|
202
|
+
<rule ref="category/apex/security.xml/ApexSOQLInjection" message="Apex classes should escape variables merged in DML query">
|
|
203
|
+
<priority>3</priority>
|
|
204
|
+
<properties />
|
|
205
|
+
</rule>
|
|
206
|
+
<rule ref="category/apex/security.xml/ApexXSSFromURLParam" message="Apex classes should escape Strings obtained from URL parameters">
|
|
207
|
+
<priority>3</priority>
|
|
208
|
+
<properties />
|
|
209
|
+
</rule>
|
|
210
|
+
<rule ref="category/apex/security.xml/ApexXSSFromEscapeFalse" message="Apex classes should escape addError strings">
|
|
211
|
+
<priority>3</priority>
|
|
212
|
+
<properties />
|
|
213
|
+
</rule>
|
|
214
|
+
<rule ref="category/apex/security.xml/ApexBadCrypto" message="Apex Crypto should use random IV/key">
|
|
215
|
+
<priority>3</priority>
|
|
216
|
+
<properties />
|
|
217
|
+
</rule>
|
|
218
|
+
<rule ref="category/apex/security.xml/ApexCRUDViolation" message="Validate CRUD permission before SOQL/DML operation">
|
|
219
|
+
<priority>3</priority>
|
|
220
|
+
<properties />
|
|
221
|
+
</rule>
|
|
222
|
+
<rule ref="category/apex/security.xml/ApexDangerousMethods" message="Calling potentially dangerous method">
|
|
223
|
+
<priority>3</priority>
|
|
224
|
+
<properties />
|
|
225
|
+
</rule>
|
|
226
|
+
<!-- <rule ref="category/apex/security.xml/ApexSuggestUsingNamedCred" message="Consider using named credentials for authenticated callouts">
|
|
227
|
+
<priority>3</priority>
|
|
228
|
+
<properties />
|
|
229
|
+
</rule> -->
|
|
230
|
+
<!-- ERROR PRONE -->
|
|
231
|
+
|
|
232
|
+
<rule
|
|
233
|
+
ref="category/apex/errorprone.xml/MethodWithSameNameAsEnclosingClass"
|
|
234
|
+
message="Classes should not have non-constructor methods with the same name as the class"
|
|
235
|
+
>
|
|
236
|
+
<priority>3</priority>
|
|
237
|
+
<properties />
|
|
238
|
+
</rule>
|
|
239
|
+
<rule ref="category/apex/errorprone.xml/ApexCSRF" message="Avoid making DML operations in Apex class constructor/init method">
|
|
240
|
+
<priority>3</priority>
|
|
241
|
+
<properties />
|
|
242
|
+
</rule>
|
|
243
|
+
<rule ref="category/apex/errorprone.xml/EmptyCatchBlock" message="Avoid empty catch blocks">
|
|
244
|
+
<priority>3</priority>
|
|
245
|
+
<properties >
|
|
246
|
+
<property name="allowCommentedBlocks" value="true" />
|
|
247
|
+
<property name="allowExceptionNameRegex" value="^(ignored|expected)$" />
|
|
248
|
+
</properties>
|
|
249
|
+
</rule>
|
|
250
|
+
<rule ref="category/apex/errorprone.xml/EmptyIfStmt" message="Avoid empty 'if' statements">
|
|
251
|
+
<priority>3</priority>
|
|
252
|
+
<properties />
|
|
253
|
+
</rule>
|
|
254
|
+
<rule ref="category/apex/errorprone.xml/AvoidDirectAccessTriggerMap" message="Avoid directly accessing Trigger.old and Trigger.new">
|
|
255
|
+
<priority>3</priority>
|
|
256
|
+
<properties />
|
|
257
|
+
</rule>
|
|
258
|
+
<rule ref="category/apex/errorprone.xml/AvoidNonExistentAnnotations">
|
|
259
|
+
<properties />
|
|
260
|
+
</rule>
|
|
261
|
+
<rule ref="category/apex/errorprone.xml/AvoidHardcodingId" message="Avoid hardcoding ID's">
|
|
262
|
+
<priority>3</priority>
|
|
263
|
+
<properties />
|
|
264
|
+
</rule>
|
|
265
|
+
|
|
266
|
+
<rule ref="category/apex/errorprone.xml/EmptyWhileStmt" message="Avoid empty 'while' statements">
|
|
267
|
+
<priority>3</priority>
|
|
268
|
+
<properties />
|
|
269
|
+
</rule>
|
|
270
|
+
<rule ref="category/apex/errorprone.xml/EmptyTryOrFinallyBlock" message="Avoid empty try or finally blocks">
|
|
271
|
+
<priority>3</priority>
|
|
272
|
+
<properties />
|
|
273
|
+
</rule>
|
|
274
|
+
<rule
|
|
275
|
+
ref="category/apex/errorprone.xml/InaccessibleAuraEnabledGetter"
|
|
276
|
+
message="AuraEnabled getter must be public or global if is referenced in Lightning components"
|
|
277
|
+
>
|
|
278
|
+
<priority>3</priority>
|
|
279
|
+
<properties />
|
|
280
|
+
</rule>
|
|
281
|
+
<rule
|
|
282
|
+
ref="category/apex/errorprone.xml/MethodWithSameNameAsEnclosingClass"
|
|
283
|
+
message="Non-constructor methods should not have the same name as the enclosing class."
|
|
284
|
+
>
|
|
285
|
+
<priority>3</priority>
|
|
286
|
+
<properties />
|
|
287
|
+
</rule>
|
|
288
|
+
<rule ref="category/apex/errorprone.xml/OverrideBothEqualsAndHashcode" message="Ensure you override both equals() and hashCode()">
|
|
289
|
+
<priority>3</priority>
|
|
290
|
+
<properties />
|
|
291
|
+
</rule>
|
|
292
|
+
<rule ref="category/apex/errorprone.xml/TestMethodsMustBeInTestClasses" message="Test methods must be in test classes">
|
|
293
|
+
<priority>3</priority>
|
|
294
|
+
<properties />
|
|
295
|
+
</rule>
|
|
296
|
+
<!-- END ERROR PRONE -->
|
|
297
|
+
<!-- DOCUMENTATION -->
|
|
298
|
+
<!-- <rule ref="category/apex/documentation.xml/ApexDoc" message="ApexDoc comment is missing or incorrect">
|
|
299
|
+
<priority>3</priority>
|
|
300
|
+
<properties>
|
|
301
|
+
<property name="reportPrivate" value="false" />
|
|
302
|
+
<property name="reportProtected" value="false" />
|
|
303
|
+
<property name="reportMissingDescription" value="false" />
|
|
304
|
+
<property name="reportProperty" value="false" />
|
|
305
|
+
|
|
306
|
+
</properties>
|
|
307
|
+
</rule> -->
|
|
308
|
+
<!-- END DOCUMENTATION -->
|
|
309
|
+
</ruleset>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
3
|
+
<modelVersion>4.0.0</modelVersion>
|
|
4
|
+
<artifactId>pmd-apex-jorje</artifactId>
|
|
5
|
+
<name>PMD Apex Jorje Parser Library</name>
|
|
6
|
+
<packaging>pom</packaging>
|
|
7
|
+
|
|
8
|
+
<parent>
|
|
9
|
+
<groupId>net.sourceforge.pmd</groupId>
|
|
10
|
+
<artifactId>pmd</artifactId>
|
|
11
|
+
<version>6.47.0</version>
|
|
12
|
+
<relativePath>../pom.xml</relativePath>
|
|
13
|
+
</parent>
|
|
14
|
+
|
|
15
|
+
<properties>
|
|
16
|
+
<java.version>8</java.version>
|
|
17
|
+
<apex.jorje.version>2021-10-08-631b8c</apex.jorje.version>
|
|
18
|
+
</properties>
|
|
19
|
+
|
|
20
|
+
<build>
|
|
21
|
+
<plugins>
|
|
22
|
+
<plugin>
|
|
23
|
+
<groupId>org.codehaus.mojo</groupId>
|
|
24
|
+
<artifactId>build-helper-maven-plugin</artifactId>
|
|
25
|
+
<version>3.0.0</version>
|
|
26
|
+
<executions>
|
|
27
|
+
<execution>
|
|
28
|
+
<id>attach-apex-jorje</id>
|
|
29
|
+
<phase>package</phase>
|
|
30
|
+
<goals>
|
|
31
|
+
<goal>attach-artifact</goal>
|
|
32
|
+
</goals>
|
|
33
|
+
<configuration>
|
|
34
|
+
<artifacts>
|
|
35
|
+
<artifact>
|
|
36
|
+
<file>${basedir}/repo/apex/apex-jorje-lsp-minimized/${apex.jorje.version}/apex-jorje-lsp-minimized-${apex.jorje.version}.jar</file>
|
|
37
|
+
<type>jar</type>
|
|
38
|
+
<classifier>lib</classifier>
|
|
39
|
+
</artifact>
|
|
40
|
+
</artifacts>
|
|
41
|
+
</configuration>
|
|
42
|
+
</execution>
|
|
43
|
+
</executions>
|
|
44
|
+
</plugin>
|
|
45
|
+
</plugins>
|
|
46
|
+
</build>
|
|
47
|
+
<dependencies>
|
|
48
|
+
<!-- transitive dependencies of apex-jorje -->
|
|
49
|
+
<dependency>
|
|
50
|
+
<groupId>cglib</groupId>
|
|
51
|
+
<artifactId>cglib</artifactId>
|
|
52
|
+
<version>3.3.0</version> <!-- apex jorje actually depends on 3.2.0 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
53
|
+
</dependency>
|
|
54
|
+
<dependency>
|
|
55
|
+
<groupId>ch.qos.logback</groupId>
|
|
56
|
+
<artifactId>logback-classic</artifactId>
|
|
57
|
+
<version>1.2.9</version> <!-- apex jorje actually depends on 1.1.7 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
58
|
+
</dependency>
|
|
59
|
+
<dependency>
|
|
60
|
+
<groupId>ch.qos.logback</groupId>
|
|
61
|
+
<artifactId>logback-core</artifactId>
|
|
62
|
+
<version>1.2.9</version> <!-- apex jorje actually depends on 1.1.7 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
63
|
+
</dependency>
|
|
64
|
+
<dependency>
|
|
65
|
+
<groupId>com.google.code.findbugs</groupId>
|
|
66
|
+
<artifactId>jsr305</artifactId>
|
|
67
|
+
<version>3.0.2</version>
|
|
68
|
+
</dependency>
|
|
69
|
+
<dependency>
|
|
70
|
+
<groupId>com.google.code.gson</groupId>
|
|
71
|
+
<artifactId>gson</artifactId>
|
|
72
|
+
<!-- apex jorje actually depends on 2.7 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
73
|
+
</dependency>
|
|
74
|
+
<dependency>
|
|
75
|
+
<groupId>com.google.errorprone</groupId>
|
|
76
|
+
<artifactId>error_prone_annotations</artifactId>
|
|
77
|
+
<version>2.1.3</version>
|
|
78
|
+
</dependency>
|
|
79
|
+
<dependency>
|
|
80
|
+
<groupId>com.google.guava</groupId>
|
|
81
|
+
<artifactId>guava</artifactId>
|
|
82
|
+
<!-- apex jorje actually depends on 26.0-jre (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
83
|
+
</dependency>
|
|
84
|
+
<dependency>
|
|
85
|
+
<groupId>com.google.j2objc</groupId>
|
|
86
|
+
<artifactId>j2objc-annotations</artifactId>
|
|
87
|
+
<version>1.1</version>
|
|
88
|
+
</dependency>
|
|
89
|
+
<dependency>
|
|
90
|
+
<groupId>org.antlr</groupId>
|
|
91
|
+
<artifactId>antlr-runtime</artifactId>
|
|
92
|
+
</dependency>
|
|
93
|
+
<dependency>
|
|
94
|
+
<groupId>org.antlr</groupId>
|
|
95
|
+
<artifactId>stringtemplate</artifactId>
|
|
96
|
+
<version>3.2.1</version>
|
|
97
|
+
</dependency>
|
|
98
|
+
<dependency>
|
|
99
|
+
<groupId>org.apache.commons</groupId>
|
|
100
|
+
<artifactId>commons-lang3</artifactId>
|
|
101
|
+
<version>3.0</version>
|
|
102
|
+
</dependency>
|
|
103
|
+
<dependency>
|
|
104
|
+
<groupId>org.codehaus.mojo</groupId>
|
|
105
|
+
<artifactId>animal-sniffer-annotations</artifactId>
|
|
106
|
+
<version>1.14</version>
|
|
107
|
+
</dependency>
|
|
108
|
+
<dependency>
|
|
109
|
+
<groupId>org.openjdk.jol</groupId>
|
|
110
|
+
<artifactId>jol-core</artifactId>
|
|
111
|
+
<version>0.4</version>
|
|
112
|
+
</dependency>
|
|
113
|
+
<dependency>
|
|
114
|
+
<groupId>org.slf4j</groupId>
|
|
115
|
+
<artifactId>slf4j-api</artifactId>
|
|
116
|
+
<!-- apex jorje actually depends on 1.7.20 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
117
|
+
</dependency>
|
|
118
|
+
<dependency>
|
|
119
|
+
<groupId>org.yaml</groupId>
|
|
120
|
+
<artifactId>snakeyaml</artifactId>
|
|
121
|
+
<!-- apex jorje actually depends on 1.17 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
122
|
+
</dependency>
|
|
123
|
+
<dependency>
|
|
124
|
+
<groupId>aopalliance</groupId>
|
|
125
|
+
<artifactId>aopalliance</artifactId>
|
|
126
|
+
<version>1.0</version>
|
|
127
|
+
</dependency>
|
|
128
|
+
<dependency>
|
|
129
|
+
<groupId>javax.inject</groupId>
|
|
130
|
+
<artifactId>javax.inject</artifactId>
|
|
131
|
+
<version>1</version>
|
|
132
|
+
</dependency>
|
|
133
|
+
<dependency>
|
|
134
|
+
<groupId>org.ow2.asm</groupId>
|
|
135
|
+
<artifactId>asm</artifactId>
|
|
136
|
+
<version>5.0.3</version>
|
|
137
|
+
<scope>runtime</scope>
|
|
138
|
+
</dependency>
|
|
139
|
+
</dependencies>
|
|
140
|
+
</project>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|