Repository navigation
Expand file tree
/
Copy pathcode-analyzer.yml
More file actions
704 lines (693 loc) · 21.6 KB
/
Copy pathcode-analyzer.yml
File metadata and controls
704 lines (693 loc) · 21.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
# ======================================================================
# CODE ANALYZER CONFIGURATION
# To learn more about this configuration, visit:
# https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/config-custom.html
# ======================================================================
# The absolute folder path to which all other path values in this configuration may be relative to.
# If unspecified, or if specified as null, then the value is automatically chosen to be the parent folder of your Code Analyzer
# configuration file if it exists, or the current working directory otherwise.
config_root: null # Last calculated by the config command as: "/Users/dschach/Documents/VSCode/record-types"
# Folder where to store log files. May be an absolute path or a path relative to config_root.
# If unspecified, or if specified as null, then the value is automatically chosen to be your machine's default temporary directory.
log_folder: null # Last calculated by the config command as: "/var/folders/59/sdcp21jd4cj3q3_jjvfl7ydw0000gn/T"
# Level at which to log messages to log files.
# Possible values are:
# 1 or 'Error' - Includes only error messages in the log.
# 2 or 'Warn' - Includes warning and error messages in the log.
# 3 or 'Info' - Includes informative, warning, and error messages in the log.
# 4 or 'Debug' - Includes debug, informative, warning, and error messages in the log.
# 5 or 'Fine' - Includes fine detail, debug, informative, warning, and error messages in the log.
# If unspecified, or if specified as null, then the 'Debug' log level will be used.
log_level: 4
# Configuration for ignoring files during analysis.
# files: An array of glob patterns specifying files to exclude from scanning.
# ---- [Example usage]: ---------------------
# ignores:
# files:
# - "**/node_modules/**"
# - "**/*.test.js"
# -------------------------------------------
ignores:
files: []
# Configuration for inline and bulk suppressions.
# disable_suppressions: Boolean to disable processing of suppression markers.
# {file_path}: Array of bulk suppression rules for specific files or folders.
# ---- [Example usage]: ---------------------
# suppressions:
# disable_suppressions: false
# "src/legacy.js":
# - rule_selector: "eslint:no-console"
# max_suppressed_violations: 5
# -------------------------------------------
suppressions:
disable_suppressions: false
# Rule override settings of the format rules.{engine_name}.{rule_name}.{property_name} = {override_value} where:
# {engine_name} is the name of the engine containing the rule that you want to override.
# {rule_name} is the name of the rule that you want to override.
# {property_name} can either be:
# 'severity' - [Optional] The severity level value that you want to use to override the default severity level for the rule
# Possible values: 1 or 'Critical', 2 or 'High', 3 or 'Moderate', 4 or 'Low', 5 or 'Info'
# 'tags' - [Optional] The string array of tag values that you want to use to override the default tags for the rule
# 'disabled' - [Optional] Boolean value to disable the rule for all files. When set to true, the rule will not run during analysis
# ---- [Example usage]: ---------------------
# rules:
# eslint:
# sort-vars:
# severity: "Info"
# tags: ["Recommended", "Suggestion"]
# regex:
# NoTrailingWhiteSpace:
# disabled: true
# -------------------------------------------
rules:
# ======================================================================
# PMD ENGINE RULE OVERRIDES
# ======================================================================
pmd:
'AnnotationsNamingConventions':
severity: 3 # Modified from: 4
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'ApexAssertionsShouldIncludeMessage':
severity: 3
tags: # Modified from: ["BestPractices","Apex"]
- BestPractices
- Apex
- all-apex
'ApexBadCrypto':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexCRUDViolation':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexCSRF':
severity: 3 # Modified from: 1
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexDangerousMethods':
severity: 3
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexDoc':
severity: 3 # Modified from: 4
tags: # Modified from: ["Recommended","Documentation","Apex"]
- Recommended
- Documentation
- Apex
- all-apex
'ApexInsecureEndpoint':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexOpenRedirect':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexSharingViolations':
severity: 3
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexSOQLInjection':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexSuggestUsingNamedCred':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexUnitTestClassShouldHaveAsserts':
severity: 4 # Modified from: 3
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'ApexUnitTestClassShouldHaveRunAs':
disabled: true
severity: 3 # Modified from: 4
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'ApexUnitTestMethodShouldHaveIsTestAnnotation':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'ApexUnitTestShouldNotUseSeeAllDataTrue':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'ApexXSSFromEscapeFalse':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'ApexXSSFromURLParam':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Security","Apex"]
- Recommended
- Security
- Apex
- all-apex
'AvoidBooleanMethodParameters':
severity: 3
tags: # Modified from: ["Recommended","Design","Apex"]
- Recommended
- Design
- Apex
- all-apex
'AvoidChangeProtectionUnprotected':
severity: 1
tags:
- AppExchange
- Security
- Apex
'AvoidDebugStatements':
severity: 4
tags: # Modified from: ["Recommended","Performance","Apex"]
- Recommended
- Performance
- Apex
- all-apex
'AvoidDeeplyNestedIfStmts':
severity: 3
tags: # Modified from: ["Recommended","Design","Apex"]
- Recommended
- Design
- Apex
- all-apex
'AvoidDirectAccessTriggerMap':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'AvoidFutureAnnotation':
severity: 4
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'AvoidGetInstanceWithTaint':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidGlobalInstallUninstallHandlers':
severity: 1
tags:
- AppExchange
- Security
- Apex
'AvoidGlobalModifier':
severity: 3
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'AvoidHardcodedCredentialsInFieldDecls':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidHardcodedCredentialsInHttpHeader':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidHardcodedCredentialsInSetPassword':
severity: 1
tags:
- AppExchange
- Security
- Apex
'AvoidHardcodedCredentialsInVarAssign':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidHardcodedCredentialsInVarDecls':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidHardcodingId':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'AvoidInterfaceAsMapKey':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'AvoidInvalidCrudContentDistribution':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidLogicInTrigger':
severity: 3
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'AvoidNonExistentAnnotations':
severity: 3 # Modified from: 4
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'AvoidNonRestrictiveQueries':
severity: 3 # Modified from: 4
tags: # Modified from: ["Recommended","Performance","Apex"]
- Recommended
- Performance
- Apex
- all-apex
'AvoidSecurityEnforcedOldApiVersion':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidStatefulDatabaseResult':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'AvoidUnauthorizedApiSessionIdInApex':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidUnauthorizedGetSessionIdInApex':
severity: 3
tags:
- AppExchange
- Security
- Apex
'AvoidUnsafePasswordManagementUse':
severity: 1
tags:
- AppExchange
- Security
- Apex
'ClassNamingConventions':
severity: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'CognitiveComplexity':
disabled: true
severity: 3
tags:
- Recommended
- Design
- Apex
'CyclomaticComplexity':
severity: 3
tags: # Modified from: ["Recommended","Design","Apex"]
- Recommended
- Design
- Apex
- all-apex
'DebugsShouldUseLoggingLevel':
severity: 4
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'EagerlyLoadedDescribeSObjectResult':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","Performance","Apex"]
- Recommended
- Performance
- Apex
- all-apex
'EmptyCatchBlock':
severity: 3 # Modified from: 2
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'EmptyIfStmt':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'EmptyStatementBlock':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'EmptyTryOrFinallyBlock':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'EmptyWhileStmt':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'ExcessiveClassLength':
disabled: true
severity: 3
tags:
- Design
- Apex
'ExcessiveParameterList':
severity: 3
tags: # Modified from: ["Recommended","Design","Apex"]
- Recommended
- Design
- Apex
- all-apex
'ExcessivePublicCount':
severity: 3
tags: # Modified from: ["Recommended","Design","Apex"]
- Recommended
- Design
- Apex
- all-apex
'FieldDeclarationsShouldBeAtStart':
severity: 3
tags:
- Recommended
- CodeStyle
- Apex
'FieldNamingConventions':
severity: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'ForLoopsMustUseBraces':
severity: 2 # Modified from: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'FormalParameterNamingConventions':
severity: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'IfElseStmtsMustUseBraces':
severity: 2 # Modified from: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'IfStmtsMustUseBraces':
severity: 2 # Modified from: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'InaccessibleAuraEnabledGetter':
severity: 3
tags:
- Recommended
- ErrorProne
- Apex
'InvocableClassNoArgConstructor':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'LocalVariableNamingConventions':
severity: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'MethodNamingConventions':
severity: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'MethodWithSameNameAsEnclosingClass':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'NcssConstructorCount':
disabled: true
severity: 4
tags:
- Design
- Apex
'NcssCount':
severity: 3
tags: # Modified from: ["Recommended","Apex","Custom"]
- Recommended
- Apex
- Custom
- all-apex
'NcssMethodCount':
disabled: true
severity: 4
tags:
- Design
- Apex
'NcssTypeCount':
disabled: true
severity: 4
tags:
- Design
- Apex
'OneDeclarationPerLine':
severity: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'OperationWithHighCostInLoop':
severity: 3
tags: # Modified from: ["Recommended","Performance","Apex"]
- Recommended
- Performance
- Apex
- all-apex
'OperationWithLimitsInLoop':
severity: 2 # Modified from: 3
tags: # Modified from: ["Recommended","Performance","Apex"]
- Recommended
- Performance
- Apex
- all-apex
'OverrideBothEqualsAndHashcode':
severity: 2
tags:
- Recommended
- ErrorProne
- Apex
'PropertyNamingConventions':
severity: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
'QueueableWithoutFinalizer':
severity: 4
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'StdCyclomaticComplexity':
severity: 3
tags: # Modified from: ["Design","Apex"]
- Design
- Apex
- all-apex
'TestMethodsMustBeInTestClasses':
severity: 3
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'TooManyFields':
severity: 3
tags: # Modified from: ["Recommended","Design","Apex"]
- Recommended
- Design
- Apex
- all-apex
'TypeShadowsBuiltInNamespace':
severity: 2
tags: # Modified from: ["Recommended","ErrorProne","Apex"]
- Recommended
- ErrorProne
- Apex
- all-apex
'UnusedLocalVariable':
severity: 2 # Modified from: 3
tags: # Modified from: ["Recommended","BestPractices","Apex"]
- Recommended
- BestPractices
- Apex
- all-apex
'UnusedMethod':
severity: 3
tags: # Modified from: ["Recommended","Design","Apex"]
- Recommended
- Design
- Apex
- all-apex
'WhileLoopsMustUseBraces':
severity: 2 # Modified from: 3
tags: # Modified from: ["Recommended","CodeStyle","Apex"]
- Recommended
- CodeStyle
- Apex
- all-apex
# Engine specific custom configuration settings of the format engines.{engine_name}.{property_name} = {value} where:
# {engine_name} is the name of the engine containing the setting that you want to override.
# {property_name} is the name of a property that you would like to override.
# Each engine may have its own set of properties available to help customize that particular engine's behavior.
engines:
# ======================================================================
# PMD ENGINE CONFIGURATION
# To learn more about this configuration, visit:
# https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-pmd.html#pmd-configuration-reference
# ======================================================================
pmd:
# Whether to turn off the 'pmd' engine so that it is not included when running Code Analyzer commands.
disable_engine: false
# Indicates the specific 'java' command associated with the JRE or JDK to use for the 'pmd' engine.
# May be provided as the name of a command that exists on the path, or an absolute file path location.
# If unspecified, or specified as null, then an attempt will be made to automatically discover a 'java' command from your environment.
java_command: null # Last calculated by the config command as: "java"
# Specifies the list of file extensions to associate to each rule language.
# The rule(s) associated with a given language will run against all the files in your workspace containing one of
# the specified file extensions. Each file extension can only be associated to one language. If a specific language
# is not specified, then a set of default file extensions for that language will be used.
file_extensions:
apex:
- .cls
- .trigger
html:
- .html
- .htm
- .xhtml
- .xht
- .shtml
- .cmp
javascript:
- .js
- .cjs
- .mjs
typescript:
- .ts
visualforce:
- .page
- .component
xml:
- .xml
# List of jar files and/or folders to add the Java classpath when running PMD.
# Each entry may be given as an absolute path or a relative path to 'config_root'.
# This field is primarily used to supply custom Java based rule definitions to PMD.
# See https://pmd.github.io/pmd/pmd_userdocs_extending_writing_java_rules.html
java_classpath_entries: []
# List of xml ruleset files containing custom PMD rules to be made available for rule selection.
# Each ruleset must be an xml file that is either:
# - on disk (provided as an absolute path or a relative path to 'config_root')
# - or a relative resource found on the Java classpath.
# Not all custom rules can be fully defined within an xml ruleset file. For example, Java based rules may be defined in jar files.
# In these cases, you will need to also add your additional files to the Java classpath using the 'java_classpath_entries' field.
# See https://pmd.github.io/pmd/pmd_userdocs_making_rulesets.html to learn more about PMD rulesets.
custom_rulesets: # Modified from: []
- pmd/apexStandardRules.xml
# ======================================================================
# END OF CODE ANALYZER CONFIGURATION
# ======================================================================