@codacy/tools-checkstyle-13 0.22.0

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/dist/index.js ADDED
@@ -0,0 +1,4748 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ default: () => index_default
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+ var import_tooling2 = require("@codacy/tooling");
37
+
38
+ // src/adapter.ts
39
+ var import_tooling = require("@codacy/tooling");
40
+ var import_fast_xml_parser = require("fast-xml-parser");
41
+ var import_path = __toESM(require("path"));
42
+ var import_promises = __toESM(require("fs/promises"));
43
+
44
+ // src/patterns.json
45
+ var patterns_default = [
46
+ {
47
+ id: "Checkstyle_AbbreviationAsWordInName",
48
+ category: "CodeStyle",
49
+ severityLevel: "Info",
50
+ title: "Enforce Abbreviation Length in Identifier Names",
51
+ enabled: false,
52
+ languages: ["Java"],
53
+ parameters: [
54
+ {
55
+ name: "allowedAbbreviationLength",
56
+ default: "3",
57
+ description: "Indicate the number of consecutive capital letters allowed in targeted identifiers (abbreviations in the classes, interfaces, variables and methods names, ... )."
58
+ },
59
+ {
60
+ name: "allowedAbbreviations",
61
+ default: "",
62
+ description: "Specify abbreviations that must be skipped for checking."
63
+ },
64
+ {
65
+ name: "ignoreFinal",
66
+ default: "true",
67
+ description: "Allow to skip variables with final modifier."
68
+ },
69
+ {
70
+ name: "ignoreOverriddenMethods",
71
+ default: "true",
72
+ description: "Allow to ignore methods tagged with @Override annotation (that usually mean inherited name)."
73
+ },
74
+ {
75
+ name: "ignoreStatic",
76
+ default: "true",
77
+ description: "Allow to skip variables with static modifier."
78
+ },
79
+ {
80
+ name: "ignoreStaticFinal",
81
+ default: "true",
82
+ description: "Allow to skip variables with both static and final modifiers."
83
+ },
84
+ {
85
+ name: "tokens",
86
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF, RECORD_COMPONENT_DEF",
87
+ description: "tokens to check"
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ id: "Checkstyle_AbstractClassName",
93
+ category: "BestPractice",
94
+ severityLevel: "Info",
95
+ title: "Enforce Abstract Class Naming Convention",
96
+ enabled: false,
97
+ languages: ["Java"],
98
+ parameters: [
99
+ {
100
+ name: "format",
101
+ default: "^Abstract.+$",
102
+ description: "Specify valid identifiers."
103
+ },
104
+ {
105
+ name: "ignoreModifier",
106
+ default: "false",
107
+ description: "Control whether to ignore checking for the abstract modifier on classes that match the name."
108
+ },
109
+ {
110
+ name: "ignoreName",
111
+ default: "false",
112
+ description: "Control whether to ignore checking the name. Realistically only useful if using the check to identify that match name and do not have the abstract modifier."
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ id: "Checkstyle_AnnotatedDeclarationVisibility",
118
+ category: "BestPractice",
119
+ severityLevel: "Warning",
120
+ title: "Enforce annotated declaration visibility",
121
+ enabled: false,
122
+ languages: ["Java"],
123
+ parameters: [
124
+ {
125
+ name: "annotations",
126
+ default: "com.google.common.annotations.VisibleForTesting",
127
+ description: "Setter for annotation canonical names."
128
+ },
129
+ {
130
+ name: "tokens",
131
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, RECORD_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, ANNOTATION_DEF",
132
+ description: "tokens to check"
133
+ },
134
+ {
135
+ name: "visibility",
136
+ default: "protected, package",
137
+ description: "Setter for allowed visibility modifiers. Allowed values: public, protected, package, private."
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ id: "Checkstyle_AnnotationLocation",
143
+ category: "CodeStyle",
144
+ severityLevel: "Info",
145
+ title: "Enforce Annotation Location",
146
+ enabled: false,
147
+ languages: ["Java"],
148
+ parameters: [
149
+ {
150
+ name: "allowSamelineMultipleAnnotations",
151
+ default: "false",
152
+ description: "Allow annotation(s) to be located on the same line as target element."
153
+ },
154
+ {
155
+ name: "allowSamelineParameterizedAnnotation",
156
+ default: "false",
157
+ description: "Allow one and only parameterized annotation to be located on the same line as target element."
158
+ },
159
+ {
160
+ name: "allowSamelineSingleParameterlessAnnotation",
161
+ default: "true",
162
+ description: "Allow single parameterless annotation to be located on the same line as target element."
163
+ },
164
+ {
165
+ name: "tokens",
166
+ default: "CLASS_DEF, INTERFACE_DEF, PACKAGE_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF",
167
+ description: "tokens to check"
168
+ }
169
+ ]
170
+ },
171
+ {
172
+ id: "Checkstyle_AnnotationOnSameLine",
173
+ category: "CodeStyle",
174
+ severityLevel: "Info",
175
+ title: "Enforce Annotation On Same Line",
176
+ enabled: false,
177
+ languages: ["Java"],
178
+ parameters: [
179
+ {
180
+ name: "tokens",
181
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF",
182
+ description: "tokens to check"
183
+ }
184
+ ]
185
+ },
186
+ {
187
+ id: "Checkstyle_AnnotationUseStyle",
188
+ category: "CodeStyle",
189
+ severityLevel: "Info",
190
+ title: "Enforce Annotation Element Style",
191
+ enabled: false,
192
+ languages: ["Java"],
193
+ parameters: [
194
+ {
195
+ name: "closingParens",
196
+ default: "never",
197
+ description: "Define the policy for ending parenthesis."
198
+ },
199
+ {
200
+ name: "elementStyle",
201
+ default: "compact_no_array",
202
+ description: "Define the annotation element styles."
203
+ },
204
+ {
205
+ name: "trailingArrayComma",
206
+ default: "never",
207
+ description: "Define the policy for trailing comma in arrays."
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ id: "Checkstyle_AnonInnerLength",
213
+ category: "Complexity",
214
+ severityLevel: "Warning",
215
+ title: "Avoid Long Anonymous Inner Classes",
216
+ enabled: false,
217
+ languages: ["Java"],
218
+ parameters: [
219
+ {
220
+ name: "max",
221
+ default: "20",
222
+ description: "Specify the maximum number of lines allowed."
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ id: "Checkstyle_ArrayTrailingComma",
228
+ category: "CodeStyle",
229
+ severityLevel: "Info",
230
+ title: "Enforce Array Trailing Comma",
231
+ enabled: false,
232
+ languages: ["Java"],
233
+ parameters: [
234
+ {
235
+ name: "alwaysDemandTrailingComma",
236
+ default: "false",
237
+ description: "Control whether to always check for a trailing comma, even when an array is inline."
238
+ }
239
+ ]
240
+ },
241
+ {
242
+ id: "Checkstyle_ArrayTypeStyle",
243
+ category: "CodeStyle",
244
+ severityLevel: "Info",
245
+ title: "Enforce Java Style Array Type Declarations",
246
+ enabled: false,
247
+ languages: ["Java"],
248
+ parameters: [
249
+ {
250
+ name: "javaStyle",
251
+ default: "true",
252
+ description: "Control whether to enforce Java style (true) or C style (false)."
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ id: "Checkstyle_AtclauseOrder",
258
+ category: "Documentation",
259
+ severityLevel: "Info",
260
+ title: "Enforce Javadoc At-Clause Order",
261
+ enabled: false,
262
+ languages: ["Java"],
263
+ parameters: [
264
+ {
265
+ name: "tagOrder",
266
+ default: "@author, @version, @param, @return, @throws, @exception, @see, @since, @serial, @serialField, @serialData, @deprecated",
267
+ description: "Specify the order by tags."
268
+ },
269
+ {
270
+ name: "target",
271
+ default: "CLASS_DEF, COMPACT_CTOR_DEF, CTOR_DEF, ENUM_DEF, INTERFACE_DEF, METHOD_DEF, RECORD_DEF, VARIABLE_DEF",
272
+ description: "Specify block tags targeted."
273
+ },
274
+ {
275
+ name: "violateExecutionOnNonTightHtml",
276
+ default: "false",
277
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
278
+ }
279
+ ]
280
+ },
281
+ {
282
+ id: "Checkstyle_AvoidDoubleBraceInitialization",
283
+ category: "BestPractice",
284
+ severityLevel: "Warning",
285
+ title: "Avoid Double Brace Initialization",
286
+ enabled: false,
287
+ languages: ["Java"],
288
+ parameters: []
289
+ },
290
+ {
291
+ id: "Checkstyle_AvoidEscapedUnicodeCharacters",
292
+ category: "CodeStyle",
293
+ severityLevel: "Info",
294
+ title: "Avoid Using Escaped Unicode Characters",
295
+ enabled: false,
296
+ languages: ["Java"],
297
+ parameters: [
298
+ {
299
+ name: "allowByTailComment",
300
+ default: "false",
301
+ description: "Allow use escapes if trail comment is present."
302
+ },
303
+ {
304
+ name: "allowEscapesForControlCharacters",
305
+ default: "false",
306
+ description: "Allow use escapes for non-printable, control characters."
307
+ },
308
+ {
309
+ name: "allowIfAllCharactersEscaped",
310
+ default: "false",
311
+ description: "Allow if all characters in literal are escaped."
312
+ },
313
+ {
314
+ name: "allowNonPrintableEscapes",
315
+ default: "false",
316
+ description: "Allow use escapes for non-printable, whitespace characters."
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ id: "Checkstyle_AvoidInlineConditionals",
322
+ category: "CodeStyle",
323
+ severityLevel: "Info",
324
+ title: "Avoid Inline Conditionals",
325
+ enabled: false,
326
+ languages: ["Java"],
327
+ parameters: []
328
+ },
329
+ {
330
+ id: "Checkstyle_AvoidNestedBlocks",
331
+ category: "CodeStyle",
332
+ severityLevel: "Info",
333
+ title: "Avoid Nested Blocks",
334
+ enabled: false,
335
+ languages: ["Java"],
336
+ parameters: [
337
+ {
338
+ name: "allowInSwitchCase",
339
+ default: "false",
340
+ description: "Allow nested blocks if they are the only child of a switch case."
341
+ }
342
+ ]
343
+ },
344
+ {
345
+ id: "Checkstyle_AvoidNoArgumentSuperConstructorCall",
346
+ category: "CodeStyle",
347
+ severityLevel: "Info",
348
+ title: "Avoid No-Argument Superclass Constructor Call",
349
+ enabled: false,
350
+ languages: ["Java"],
351
+ parameters: []
352
+ },
353
+ {
354
+ id: "Checkstyle_AvoidStarImport",
355
+ category: "BestPractice",
356
+ severityLevel: "Warning",
357
+ title: "Avoid Star Imports",
358
+ enabled: true,
359
+ languages: ["Java"],
360
+ parameters: [
361
+ {
362
+ name: "allowClassImports",
363
+ default: "false",
364
+ description: "Control whether to allow starred class imports like import java.util.*;."
365
+ },
366
+ {
367
+ name: "allowStaticMemberImports",
368
+ default: "false",
369
+ description: "Control whether to allow starred static member imports like import static org.junit.Assert.*;."
370
+ },
371
+ {
372
+ name: "excludes",
373
+ default: "",
374
+ description: "Specify packages where starred class imports are allowed and classes where starred static member imports are allowed."
375
+ },
376
+ {
377
+ name: "maxAllowedStarImports",
378
+ default: "0",
379
+ description: "Control how many star imports are allowed."
380
+ }
381
+ ]
382
+ },
383
+ {
384
+ id: "Checkstyle_AvoidStaticImport",
385
+ category: "CodeStyle",
386
+ severityLevel: "Info",
387
+ title: "Avoid Static Import",
388
+ enabled: false,
389
+ languages: ["Java"],
390
+ parameters: [
391
+ {
392
+ name: "excludes",
393
+ default: "",
394
+ description: "excludes"
395
+ }
396
+ ]
397
+ },
398
+ {
399
+ id: "Checkstyle_BooleanExpressionComplexity",
400
+ category: "Complexity",
401
+ severityLevel: "Warning",
402
+ title: "Restrict Boolean Expression Complexity",
403
+ enabled: false,
404
+ languages: ["Java"],
405
+ parameters: [
406
+ {
407
+ name: "max",
408
+ default: "3",
409
+ description: "Specify the maximum number of boolean operations allowed in one expression."
410
+ },
411
+ {
412
+ name: "tokens",
413
+ default: "LAND, BAND, LOR, BOR, BXOR",
414
+ description: "tokens to check"
415
+ }
416
+ ]
417
+ },
418
+ {
419
+ id: "Checkstyle_CatchParameterName",
420
+ category: "CodeStyle",
421
+ severityLevel: "Info",
422
+ title: "Enforce Catch Parameter Name Pattern",
423
+ enabled: false,
424
+ languages: ["Java"],
425
+ parameters: [
426
+ {
427
+ name: "format",
428
+ default: "^(e|t|ex|[a-z][a-z][a-zA-Z]+|_)$",
429
+ description: "Sets the pattern to match valid identifiers."
430
+ }
431
+ ]
432
+ },
433
+ {
434
+ id: "Checkstyle_ClassDataAbstractionCoupling",
435
+ category: "Complexity",
436
+ severityLevel: "Warning",
437
+ title: "Enforce Class Data Abstraction Coupling Limit",
438
+ enabled: false,
439
+ languages: ["Java"],
440
+ parameters: [
441
+ {
442
+ name: "excludeClassesRegexps",
443
+ default: "^$",
444
+ description: "Specify user-configured regular expressions to ignore classes."
445
+ },
446
+ {
447
+ name: "excludedClasses",
448
+ default: "ArrayIndexOutOfBoundsException, ArrayList, Boolean, Byte, Character, Class, Collection, Deprecated, Deque, Double, DoubleStream, EnumSet, Exception, Float, FunctionalInterface, HashMap, HashSet, IllegalArgumentException, IllegalStateException, IndexOutOfBoundsException, IntStream, Integer, LinkedHashMap, LinkedHashSet, LinkedList, List, Long, LongStream, Map, NullPointerException, Object, Optional, OptionalDouble, OptionalInt, OptionalLong, Override, Queue, RuntimeException, SafeVarargs, SecurityException, Set, Short, SortedMap, SortedSet, Stream, String, StringBuffer, StringBuilder, SuppressWarnings, Throwable, TreeMap, TreeSet, UnsupportedOperationException, Void, boolean, byte, char, double, float, int, long, short, var, void",
449
+ description: "Specify user-configured class names to ignore."
450
+ },
451
+ {
452
+ name: "excludedPackages",
453
+ default: "",
454
+ description: "Specify user-configured packages to ignore."
455
+ },
456
+ {
457
+ name: "max",
458
+ default: "7",
459
+ description: "Specify the maximum threshold allowed."
460
+ }
461
+ ]
462
+ },
463
+ {
464
+ id: "Checkstyle_ClassFanOutComplexity",
465
+ category: "Complexity",
466
+ severityLevel: "Warning",
467
+ title: "Enforce Class Fan-Out Complexity Limits",
468
+ enabled: false,
469
+ languages: ["Java"],
470
+ parameters: [
471
+ {
472
+ name: "excludeClassesRegexps",
473
+ default: "^$",
474
+ description: "Specify user-configured regular expressions to ignore classes."
475
+ },
476
+ {
477
+ name: "excludedClasses",
478
+ default: "ArrayIndexOutOfBoundsException, ArrayList, Boolean, Byte, Character, Class, Collection, Deprecated, Deque, Double, DoubleStream, EnumSet, Exception, Float, FunctionalInterface, HashMap, HashSet, IllegalArgumentException, IllegalStateException, IndexOutOfBoundsException, IntStream, Integer, LinkedHashMap, LinkedHashSet, LinkedList, List, Long, LongStream, Map, NullPointerException, Object, Optional, OptionalDouble, OptionalInt, OptionalLong, Override, Queue, RuntimeException, SafeVarargs, SecurityException, Set, Short, SortedMap, SortedSet, Stream, String, StringBuffer, StringBuilder, SuppressWarnings, Throwable, TreeMap, TreeSet, UnsupportedOperationException, Void, boolean, byte, char, double, float, int, long, short, var, void",
479
+ description: "Specify user-configured class names to ignore."
480
+ },
481
+ {
482
+ name: "excludedPackages",
483
+ default: "",
484
+ description: "Specify user-configured packages to ignore."
485
+ },
486
+ {
487
+ name: "max",
488
+ default: "20",
489
+ description: "Specify the maximum threshold allowed."
490
+ }
491
+ ]
492
+ },
493
+ {
494
+ id: "Checkstyle_ClassMemberImpliedModifier",
495
+ category: "CodeStyle",
496
+ severityLevel: "Info",
497
+ title: "EnforceExplicitStaticModifierOnNestedTypes",
498
+ enabled: false,
499
+ languages: ["Java"],
500
+ parameters: [
501
+ {
502
+ name: "violateImpliedStaticOnNestedEnum",
503
+ default: "true",
504
+ description: "Control whether to enforce that static is explicitly coded on nested enums in classes and records."
505
+ },
506
+ {
507
+ name: "violateImpliedStaticOnNestedInterface",
508
+ default: "true",
509
+ description: "Control whether to enforce that static is explicitly coded on nested interfaces in classes and records."
510
+ },
511
+ {
512
+ name: "violateImpliedStaticOnNestedRecord",
513
+ default: "true",
514
+ description: "Control whether to enforce that static is explicitly coded on nested records in classes and records."
515
+ }
516
+ ]
517
+ },
518
+ {
519
+ id: "Checkstyle_ClassTypeParameterName",
520
+ category: "CodeStyle",
521
+ severityLevel: "Info",
522
+ title: "Enforce Class Type Parameter Name Pattern",
523
+ enabled: false,
524
+ languages: ["Java"],
525
+ parameters: [
526
+ {
527
+ name: "format",
528
+ default: "^[A-Z]$",
529
+ description: "Sets the pattern to match valid identifiers."
530
+ }
531
+ ]
532
+ },
533
+ {
534
+ id: "Checkstyle_CommentsIndentation",
535
+ category: "CodeStyle",
536
+ severityLevel: "Info",
537
+ title: "Enforce Comments Indentation",
538
+ enabled: true,
539
+ languages: ["Java"],
540
+ parameters: [
541
+ {
542
+ name: "tokens",
543
+ default: "SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN",
544
+ description: "tokens to check"
545
+ }
546
+ ]
547
+ },
548
+ {
549
+ id: "Checkstyle_ConstantName",
550
+ category: "CodeStyle",
551
+ severityLevel: "Info",
552
+ title: "Enforce Constant Naming Conventions",
553
+ enabled: false,
554
+ languages: ["Java"],
555
+ parameters: [
556
+ {
557
+ name: "applyToPackage",
558
+ default: "true",
559
+ description: "Control if check should apply to package-private members."
560
+ },
561
+ {
562
+ name: "applyToPrivate",
563
+ default: "true",
564
+ description: "Control if check should apply to private members."
565
+ },
566
+ {
567
+ name: "applyToProtected",
568
+ default: "true",
569
+ description: "Control if check should apply to protected members."
570
+ },
571
+ {
572
+ name: "applyToPublic",
573
+ default: "true",
574
+ description: "Control if check should apply to public members."
575
+ },
576
+ {
577
+ name: "format",
578
+ default: "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$",
579
+ description: "Sets the pattern to match valid identifiers."
580
+ }
581
+ ]
582
+ },
583
+ {
584
+ id: "Checkstyle_ConstructorsDeclarationGrouping",
585
+ category: "CodeStyle",
586
+ severityLevel: "Info",
587
+ title: "Enforce Constructors Declaration Grouping",
588
+ enabled: false,
589
+ languages: ["Java"],
590
+ parameters: [
591
+ {
592
+ name: "orderByIncreasingParameterCount",
593
+ default: "false",
594
+ description: "Control whether to enforce order by increasing parameter count (arity) or not."
595
+ }
596
+ ]
597
+ },
598
+ {
599
+ id: "Checkstyle_CovariantEquals",
600
+ category: "ErrorProne",
601
+ severityLevel: "High",
602
+ title: "Avoid Covariant Equals Method Without Overriding equals(Object)",
603
+ enabled: false,
604
+ languages: ["Java"],
605
+ parameters: []
606
+ },
607
+ {
608
+ id: "Checkstyle_CustomImportOrder",
609
+ category: "CodeStyle",
610
+ severityLevel: "Info",
611
+ title: "Enforce Custom Import Order",
612
+ enabled: false,
613
+ languages: ["Java"],
614
+ parameters: [
615
+ {
616
+ name: "customImportOrderRules",
617
+ default: "",
618
+ description: "Specify ordered list of import groups."
619
+ },
620
+ {
621
+ name: "separateLineBetweenGroups",
622
+ default: "true",
623
+ description: "Force empty line separator between import groups."
624
+ },
625
+ {
626
+ name: "sortImportsInGroupAlphabetically",
627
+ default: "false",
628
+ description: "Force grouping alphabetically, in ASCII sort order."
629
+ },
630
+ {
631
+ name: "specialImportsRegExp",
632
+ default: "^$",
633
+ description: "Specify RegExp for SPECIAL_IMPORTS group imports."
634
+ },
635
+ {
636
+ name: "standardPackageRegExp",
637
+ default: "^(java|javax)\\.",
638
+ description: "Specify RegExp for STANDARD_JAVA_PACKAGE group imports."
639
+ },
640
+ {
641
+ name: "thirdPartyPackageRegExp",
642
+ default: ".*",
643
+ description: "Specify RegExp for THIRD_PARTY_PACKAGE group imports."
644
+ }
645
+ ]
646
+ },
647
+ {
648
+ id: "Checkstyle_CyclomaticComplexity",
649
+ category: "Complexity",
650
+ severityLevel: "Warning",
651
+ title: "Enforce Cyclomatic Complexity Limit",
652
+ enabled: false,
653
+ languages: ["Java"],
654
+ parameters: [
655
+ {
656
+ name: "max",
657
+ default: "10",
658
+ description: "Specify the maximum threshold allowed."
659
+ },
660
+ {
661
+ name: "switchBlockAsSingleDecisionPoint",
662
+ default: "false",
663
+ description: "Control whether to treat the whole switch block as a single decision point."
664
+ },
665
+ {
666
+ name: "tokens",
667
+ default: "LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_CASE, LITERAL_CATCH, QUESTION, LAND, LOR, LITERAL_WHEN",
668
+ description: "tokens to check"
669
+ }
670
+ ]
671
+ },
672
+ {
673
+ id: "Checkstyle_DeclarationOrder",
674
+ category: "CodeStyle",
675
+ severityLevel: "Info",
676
+ title: "Enforce Declaration Order",
677
+ enabled: false,
678
+ languages: ["Java"],
679
+ parameters: [
680
+ {
681
+ name: "ignoreConstructors",
682
+ default: "false",
683
+ description: "Control whether to ignore constructors."
684
+ },
685
+ {
686
+ name: "ignoreModifiers",
687
+ default: "false",
688
+ description: "Control whether to ignore modifiers (fields, ...)."
689
+ }
690
+ ]
691
+ },
692
+ {
693
+ id: "Checkstyle_DefaultComesLast",
694
+ category: "CodeStyle",
695
+ severityLevel: "Info",
696
+ title: "Enforce Default Case Last in Switch Statements",
697
+ enabled: false,
698
+ languages: ["Java"],
699
+ parameters: [
700
+ {
701
+ name: "skipIfLastAndSharedWithCase",
702
+ default: "false",
703
+ description: "Control whether to allow default along with case if they are not last."
704
+ }
705
+ ]
706
+ },
707
+ {
708
+ id: "Checkstyle_DescendantToken",
709
+ category: "CodeStyle",
710
+ severityLevel: "Info",
711
+ title: "Enforce Restrictions on Descendant Tokens",
712
+ enabled: false,
713
+ languages: ["Java"],
714
+ parameters: [
715
+ {
716
+ name: "limitedTokens",
717
+ default: "",
718
+ description: "Specify set of tokens with limited occurrences as descendants."
719
+ },
720
+ {
721
+ name: "maximumDepth",
722
+ default: "2147483647",
723
+ description: "Specify the maximum depth for descendant counts."
724
+ },
725
+ {
726
+ name: "maximumMessage",
727
+ default: "null",
728
+ description: "Define the violation message when the maximum count is exceeded."
729
+ },
730
+ {
731
+ name: "maximumNumber",
732
+ default: "2147483647",
733
+ description: "Specify a maximum count for descendants."
734
+ },
735
+ {
736
+ name: "minimumDepth",
737
+ default: "0",
738
+ description: "Specify the minimum depth for descendant counts."
739
+ },
740
+ {
741
+ name: "minimumMessage",
742
+ default: "null",
743
+ description: "Define the violation message when the minimum count is not reached."
744
+ },
745
+ {
746
+ name: "minimumNumber",
747
+ default: "0",
748
+ description: "Specify a minimum count for descendants."
749
+ },
750
+ {
751
+ name: "sumTokenCounts",
752
+ default: "false",
753
+ description: "Control whether the number of tokens found should be calculated from the sum of the individual token counts."
754
+ },
755
+ {
756
+ name: "tokens",
757
+ default: "null",
758
+ description: "tokens to check"
759
+ }
760
+ ]
761
+ },
762
+ {
763
+ id: "Checkstyle_DesignForExtension",
764
+ category: "BestPractice",
765
+ severityLevel: "Warning",
766
+ title: "Detect Classes Designed for Extension",
767
+ enabled: false,
768
+ languages: ["Java"],
769
+ parameters: [
770
+ {
771
+ name: "ignoredAnnotations",
772
+ default: "After, AfterClass, Before, BeforeClass, Test",
773
+ description: "Specify annotations which allow the check to skip the method from validation."
774
+ },
775
+ {
776
+ name: "requiredJavadocPhrase",
777
+ default: ".*",
778
+ description: "Specify the comment text pattern which qualifies a method as designed for extension. Supports multi-line regex."
779
+ }
780
+ ]
781
+ },
782
+ {
783
+ id: "Checkstyle_EmptyBlock",
784
+ category: "CodeStyle",
785
+ severityLevel: "Info",
786
+ title: "Avoid Empty Blocks",
787
+ enabled: true,
788
+ languages: ["Java"],
789
+ parameters: [
790
+ {
791
+ name: "option",
792
+ default: "statement",
793
+ description: "Specify the policy on block contents."
794
+ },
795
+ {
796
+ name: "tokens",
797
+ default: "LITERAL_WHILE, LITERAL_TRY, LITERAL_FINALLY, LITERAL_DO, LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, INSTANCE_INIT, STATIC_INIT, LITERAL_SWITCH, LITERAL_SYNCHRONIZED",
798
+ description: "tokens to check"
799
+ }
800
+ ]
801
+ },
802
+ {
803
+ id: "Checkstyle_EmptyCatchBlock",
804
+ category: "ErrorProne",
805
+ severityLevel: "High",
806
+ title: "Avoid Empty Catch Blocks",
807
+ enabled: true,
808
+ languages: ["Java"],
809
+ parameters: [
810
+ {
811
+ name: "commentFormat",
812
+ default: ".*",
813
+ description: "Specify the RegExp for the first comment inside empty catch block. If check meets comment inside empty catch block matching specified format - empty block is suppressed. If it is multi-line comment - only its first line is analyzed."
814
+ },
815
+ {
816
+ name: "exceptionVariableName",
817
+ default: "^$",
818
+ description: "Specify the RegExp for the name of the variable associated with exception. If check meets variable name matching specified value - empty block is suppressed."
819
+ }
820
+ ]
821
+ },
822
+ {
823
+ id: "Checkstyle_EmptyForInitializerPad",
824
+ category: "CodeStyle",
825
+ severityLevel: "Info",
826
+ title: "Enforce Padding for Empty For Loop Initializer",
827
+ enabled: false,
828
+ languages: ["Java"],
829
+ parameters: [
830
+ {
831
+ name: "option",
832
+ default: "nospace",
833
+ description: "Specify policy on how to pad an empty for iterator."
834
+ }
835
+ ]
836
+ },
837
+ {
838
+ id: "Checkstyle_EmptyForIteratorPad",
839
+ category: "CodeStyle",
840
+ severityLevel: "Info",
841
+ title: "Enforce Padding on Empty For Loop Iterator",
842
+ enabled: false,
843
+ languages: ["Java"],
844
+ parameters: [
845
+ {
846
+ name: "option",
847
+ default: "nospace",
848
+ description: "Specify policy on how to pad an empty for iterator."
849
+ }
850
+ ]
851
+ },
852
+ {
853
+ id: "Checkstyle_EmptyLineSeparator",
854
+ category: "CodeStyle",
855
+ severityLevel: "Info",
856
+ title: "Enforce Empty Line Separators",
857
+ enabled: true,
858
+ languages: ["Java"],
859
+ parameters: [
860
+ {
861
+ name: "allowMultipleEmptyLines",
862
+ default: "true",
863
+ description: "Allow multiple empty lines between class members."
864
+ },
865
+ {
866
+ name: "allowMultipleEmptyLinesInsideClassMembers",
867
+ default: "true",
868
+ description: "Allow multiple empty lines inside class members."
869
+ },
870
+ {
871
+ name: "allowNoEmptyLineBetweenFields",
872
+ default: "false",
873
+ description: "Allow no empty line between fields."
874
+ },
875
+ {
876
+ name: "tokens",
877
+ default: "PACKAGE_DEF, IMPORT, STATIC_IMPORT, MODULE_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF",
878
+ description: "tokens to check"
879
+ }
880
+ ]
881
+ },
882
+ {
883
+ id: "Checkstyle_EmptyStatement",
884
+ category: "ErrorProne",
885
+ severityLevel: "Warning",
886
+ title: "Avoid Empty Statements",
887
+ enabled: false,
888
+ languages: ["Java"],
889
+ parameters: []
890
+ },
891
+ {
892
+ id: "Checkstyle_EqualsAvoidNull",
893
+ category: "ErrorProne",
894
+ severityLevel: "High",
895
+ title: "Enforce String Literal on Left Side of equals() to Avoid NullPointerException",
896
+ enabled: false,
897
+ languages: ["Java"],
898
+ parameters: [
899
+ {
900
+ name: "ignoreEqualsIgnoreCase",
901
+ default: "false",
902
+ description: "Control whether to ignore String.equalsIgnoreCase(String) invocations."
903
+ }
904
+ ]
905
+ },
906
+ {
907
+ id: "Checkstyle_EqualsHashCode",
908
+ category: "ErrorProne",
909
+ severityLevel: "High",
910
+ title: "Enforce Overriding Both equals() and hashCode()",
911
+ enabled: false,
912
+ languages: ["Java"],
913
+ parameters: []
914
+ },
915
+ {
916
+ id: "Checkstyle_ExecutableStatementCount",
917
+ category: "Complexity",
918
+ severityLevel: "Warning",
919
+ title: "Enforce Executable Statement Count Limit",
920
+ enabled: false,
921
+ languages: ["Java"],
922
+ parameters: [
923
+ {
924
+ name: "max",
925
+ default: "30",
926
+ description: "Specify the maximum threshold allowed."
927
+ },
928
+ {
929
+ name: "tokens",
930
+ default: "CTOR_DEF, METHOD_DEF, INSTANCE_INIT, STATIC_INIT, COMPACT_CTOR_DEF, LAMBDA",
931
+ description: "tokens to check"
932
+ }
933
+ ]
934
+ },
935
+ {
936
+ id: "Checkstyle_ExplicitInitialization",
937
+ category: "Performance",
938
+ severityLevel: "Info",
939
+ title: "Avoid Explicit Initialization to Default Values",
940
+ enabled: false,
941
+ languages: ["Java"],
942
+ parameters: [
943
+ {
944
+ name: "onlyObjectReferences",
945
+ default: "false",
946
+ description: "Control whether only explicit initializations made to null for objects should be checked."
947
+ }
948
+ ]
949
+ },
950
+ {
951
+ id: "Checkstyle_FallThrough",
952
+ category: "ErrorProne",
953
+ severityLevel: "High",
954
+ title: "Avoid Fall-Through in Switch Statements",
955
+ enabled: false,
956
+ languages: ["Java"],
957
+ parameters: [
958
+ {
959
+ name: "checkLastCaseGroup",
960
+ default: "false",
961
+ description: "Control whether the last case group must be checked."
962
+ },
963
+ {
964
+ name: "reliefPattern",
965
+ default: "falls?[ -]?thr(u|ough)",
966
+ description: "Define the RegExp to match the relief comment that suppresses the warning about a fall through."
967
+ }
968
+ ]
969
+ },
970
+ {
971
+ id: "Checkstyle_FileLength",
972
+ category: "Complexity",
973
+ severityLevel: "Warning",
974
+ title: "Avoid Excessive File Length",
975
+ enabled: false,
976
+ languages: ["Java"],
977
+ parameters: [
978
+ {
979
+ name: "fileExtensions",
980
+ default: "",
981
+ description: "Specify the file extensions of the files to process."
982
+ },
983
+ {
984
+ name: "max",
985
+ default: "2000",
986
+ description: "Specify the maximum number of lines allowed."
987
+ }
988
+ ]
989
+ },
990
+ {
991
+ id: "Checkstyle_FileTabCharacter",
992
+ category: "CodeStyle",
993
+ severityLevel: "Info",
994
+ title: "Avoid Tab Characters in Source Code",
995
+ enabled: true,
996
+ languages: ["Java"],
997
+ parameters: [
998
+ {
999
+ name: "eachLine",
1000
+ default: "false",
1001
+ description: "Control whether to report on each line containing a tab, or just the first instance."
1002
+ },
1003
+ {
1004
+ name: "fileExtensions",
1005
+ default: "",
1006
+ description: "Specify the file extensions of the files to process."
1007
+ }
1008
+ ]
1009
+ },
1010
+ {
1011
+ id: "Checkstyle_FinalClass",
1012
+ category: "BestPractice",
1013
+ severityLevel: "Info",
1014
+ title: "Enforce Final Modifier on Applicable Classes",
1015
+ enabled: false,
1016
+ languages: ["Java"],
1017
+ parameters: []
1018
+ },
1019
+ {
1020
+ id: "Checkstyle_FinalLocalVariable",
1021
+ category: "BestPractice",
1022
+ severityLevel: "Info",
1023
+ title: "Enforce Final Declaration for Unchanged Local Variables",
1024
+ enabled: false,
1025
+ languages: ["Java"],
1026
+ parameters: [
1027
+ {
1028
+ name: "tokens",
1029
+ default: "VARIABLE_DEF",
1030
+ description: "tokens to check"
1031
+ },
1032
+ {
1033
+ name: "validateEnhancedForLoopVariable",
1034
+ default: "false",
1035
+ description: "Control whether to check enhanced for-loop variable."
1036
+ },
1037
+ {
1038
+ name: "validateUnnamedVariables",
1039
+ default: "false",
1040
+ description: "Control whether to check unnamed variables."
1041
+ }
1042
+ ]
1043
+ },
1044
+ {
1045
+ id: "Checkstyle_FinalParameters",
1046
+ category: "BestPractice",
1047
+ severityLevel: "Info",
1048
+ title: "EnforceFinalParameters",
1049
+ enabled: false,
1050
+ languages: ["Java"],
1051
+ parameters: [
1052
+ {
1053
+ name: "ignorePrimitiveTypes",
1054
+ default: "false",
1055
+ description: "Ignore primitive types as parameters."
1056
+ },
1057
+ {
1058
+ name: "ignoreUnnamedParameters",
1059
+ default: "true",
1060
+ description: "Ignore unnamed parameters."
1061
+ },
1062
+ {
1063
+ name: "tokens",
1064
+ default: "METHOD_DEF, CTOR_DEF",
1065
+ description: "tokens to check"
1066
+ }
1067
+ ]
1068
+ },
1069
+ {
1070
+ id: "Checkstyle_GenericWhitespace",
1071
+ category: "CodeStyle",
1072
+ severityLevel: "Info",
1073
+ title: "Enforce Correct Whitespace Around Generic Angle Brackets",
1074
+ enabled: false,
1075
+ languages: ["Java"],
1076
+ parameters: []
1077
+ },
1078
+ {
1079
+ id: "Checkstyle_GoogleNonConstantFieldName",
1080
+ category: "CodeStyle",
1081
+ severityLevel: "Info",
1082
+ title: "Enforce Google non-constant field naming",
1083
+ enabled: false,
1084
+ languages: ["Java"],
1085
+ parameters: []
1086
+ },
1087
+ {
1088
+ id: "Checkstyle_Header",
1089
+ category: "CodeStyle",
1090
+ severityLevel: "Info",
1091
+ title: "Enforce Source File Header",
1092
+ enabled: false,
1093
+ languages: ["Java"],
1094
+ parameters: [
1095
+ {
1096
+ name: "fileExtensions",
1097
+ default: "",
1098
+ description: "Specify the file extensions of the files to process."
1099
+ },
1100
+ {
1101
+ name: "header",
1102
+ default: "null",
1103
+ description: 'Specify the required header specified inline. Individual header lines must be separated by the string "\\n"(even on platforms with a different line separator).'
1104
+ },
1105
+ {
1106
+ name: "headerFile",
1107
+ default: "null",
1108
+ description: "Specify the name of the file containing the required header."
1109
+ },
1110
+ {
1111
+ name: "ignoreLines",
1112
+ default: "",
1113
+ description: "Specifies the line numbers to ignore when matching lines in a content of headerFile."
1114
+ }
1115
+ ]
1116
+ },
1117
+ {
1118
+ id: "Checkstyle_HexLiteralCase",
1119
+ category: "CodeStyle",
1120
+ severityLevel: "Info",
1121
+ title: "EnforceHexLiteralCase",
1122
+ enabled: false,
1123
+ languages: ["Java"],
1124
+ parameters: []
1125
+ },
1126
+ {
1127
+ id: "Checkstyle_HiddenField",
1128
+ category: "ErrorProne",
1129
+ severityLevel: "High",
1130
+ title: "Avoid Hidden Fields",
1131
+ enabled: false,
1132
+ languages: ["Java"],
1133
+ parameters: [
1134
+ {
1135
+ name: "ignoreAbstractMethods",
1136
+ default: "false",
1137
+ description: "Control whether to ignore parameters of abstract methods."
1138
+ },
1139
+ {
1140
+ name: "ignoreConstructorParameter",
1141
+ default: "false",
1142
+ description: "Control whether to ignore constructor parameters."
1143
+ },
1144
+ {
1145
+ name: "ignoreFormat",
1146
+ default: "null",
1147
+ description: "Define the RegExp for names of variables and parameters to ignore."
1148
+ },
1149
+ {
1150
+ name: "ignoreSetter",
1151
+ default: "false",
1152
+ description: "Allow to ignore the parameter of a property setter method."
1153
+ },
1154
+ {
1155
+ name: "setterCanReturnItsClass",
1156
+ default: "false",
1157
+ description: "Allow to expand the definition of a setter method to include methods that return the class' instance."
1158
+ },
1159
+ {
1160
+ name: "tokens",
1161
+ default: "VARIABLE_DEF, PARAMETER_DEF, PATTERN_VARIABLE_DEF, LAMBDA, RECORD_COMPONENT_DEF",
1162
+ description: "tokens to check"
1163
+ }
1164
+ ]
1165
+ },
1166
+ {
1167
+ id: "Checkstyle_HideUtilityClassConstructor",
1168
+ category: "BestPractice",
1169
+ severityLevel: "Warning",
1170
+ title: "Hide Utility Class Constructor",
1171
+ enabled: false,
1172
+ languages: ["Java"],
1173
+ parameters: [
1174
+ {
1175
+ name: "ignoreAnnotatedBy",
1176
+ default: "",
1177
+ description: "ignoreAnnotatedBy"
1178
+ }
1179
+ ]
1180
+ },
1181
+ {
1182
+ id: "Checkstyle_IllegalCatch",
1183
+ category: "ErrorProne",
1184
+ severityLevel: "High",
1185
+ title: "Avoid Catching Generic Exceptions",
1186
+ enabled: false,
1187
+ languages: ["Java"],
1188
+ parameters: [
1189
+ {
1190
+ name: "illegalClassNames",
1191
+ default: "Error, Exception, RuntimeException, Throwable, java.lang.Error, java.lang.Exception, java.lang.RuntimeException, java.lang.Throwable",
1192
+ description: "Specify exception class names to reject."
1193
+ }
1194
+ ]
1195
+ },
1196
+ {
1197
+ id: "Checkstyle_IllegalIdentifierName",
1198
+ category: "ErrorProne",
1199
+ severityLevel: "High",
1200
+ title: "Avoid Illegal Identifier Names",
1201
+ enabled: false,
1202
+ languages: ["Java"],
1203
+ parameters: [
1204
+ {
1205
+ name: "format",
1206
+ default: "^(?!var$|\\S*\\$)\\S+$",
1207
+ description: "Sets the pattern to match valid identifiers."
1208
+ },
1209
+ {
1210
+ name: "tokens",
1211
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, ENUM_CONSTANT_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF, RECORD_COMPONENT_DEF, LAMBDA",
1212
+ description: "tokens to check"
1213
+ }
1214
+ ]
1215
+ },
1216
+ {
1217
+ id: "Checkstyle_IllegalImport",
1218
+ category: "Compatibility",
1219
+ severityLevel: "Warning",
1220
+ title: "Avoid Illegal Imports",
1221
+ enabled: false,
1222
+ languages: ["Java"],
1223
+ parameters: [
1224
+ {
1225
+ name: "illegalClasses",
1226
+ default: "",
1227
+ description: "Specify class names to reject, if regexp property is not set, checks if import equals class name. If regexp property is set, then list of class names will be interpreted as regular expressions. Note, all properties for match will be used."
1228
+ },
1229
+ {
1230
+ name: "illegalModules",
1231
+ default: "",
1232
+ description: "Specify module names to reject, if regexp property is not set, checks if import equals module name. If regexp property is set, then list of module names will be interpreted as regular expressions. Note, all properties for match will be used."
1233
+ },
1234
+ {
1235
+ name: "illegalPkgs",
1236
+ default: "sun",
1237
+ description: "Specify packages to reject, if regexp property is not set, checks if import is the part of package. If regexp property is set, then list of packages will be interpreted as regular expressions. Note, all properties for match will be used."
1238
+ },
1239
+ {
1240
+ name: "regexp",
1241
+ default: "false",
1242
+ description: "Control whether the illegalPkgs, illegalClasses and illegalModules should be interpreted as regular expressions."
1243
+ }
1244
+ ]
1245
+ },
1246
+ {
1247
+ id: "Checkstyle_IllegalInstantiation",
1248
+ category: "Performance",
1249
+ severityLevel: "Warning",
1250
+ title: "Avoid Illegal Instantiation - Use Factory Methods",
1251
+ enabled: false,
1252
+ languages: ["Java"],
1253
+ parameters: [
1254
+ {
1255
+ name: "classes",
1256
+ default: "",
1257
+ description: "Specify fully qualified class names that should not be instantiated."
1258
+ }
1259
+ ]
1260
+ },
1261
+ {
1262
+ id: "Checkstyle_IllegalSymbol",
1263
+ category: "CodeStyle",
1264
+ severityLevel: "Info",
1265
+ title: "Disallow illegal Unicode symbols",
1266
+ enabled: false,
1267
+ languages: ["Java"],
1268
+ parameters: [
1269
+ {
1270
+ name: "symbolCodes",
1271
+ default: "0x2190-0x27BF, 0x1F600-0x1F64F, 0x1F680-0x1F6FF, 0x1F700-0x10FFFF",
1272
+ description: "Specify the symbols to check for."
1273
+ },
1274
+ {
1275
+ name: "tokens",
1276
+ default: "COMMENT_CONTENT",
1277
+ description: "tokens to check"
1278
+ }
1279
+ ]
1280
+ },
1281
+ {
1282
+ id: "Checkstyle_IllegalThrows",
1283
+ category: "ErrorProne",
1284
+ severityLevel: "High",
1285
+ title: "Avoid Declaring Illegal Throws",
1286
+ enabled: false,
1287
+ languages: ["Java"],
1288
+ parameters: [
1289
+ {
1290
+ name: "ignoredMethodNames",
1291
+ default: "finalize",
1292
+ description: "Specify names of methods to ignore."
1293
+ },
1294
+ {
1295
+ name: "ignoreOverriddenMethods",
1296
+ default: "true",
1297
+ description: "Allow to ignore checking overridden methods (marked with Override or java.lang.Override annotation)."
1298
+ },
1299
+ {
1300
+ name: "illegalClassNames",
1301
+ default: "Error, RuntimeException, Throwable, java.lang.Error, java.lang.RuntimeException, java.lang.Throwable",
1302
+ description: "Specify throw class names to reject."
1303
+ }
1304
+ ]
1305
+ },
1306
+ {
1307
+ id: "Checkstyle_IllegalToken",
1308
+ category: "BestPractice",
1309
+ severityLevel: "Warning",
1310
+ title: "Avoid Illegal Tokens",
1311
+ enabled: false,
1312
+ languages: ["Java"],
1313
+ parameters: [
1314
+ {
1315
+ name: "tokens",
1316
+ default: "LABELED_STAT",
1317
+ description: "tokens to check"
1318
+ }
1319
+ ]
1320
+ },
1321
+ {
1322
+ id: "Checkstyle_IllegalTokenText",
1323
+ category: "ErrorProne",
1324
+ severityLevel: "Warning",
1325
+ title: "Detect Illegal Token Text",
1326
+ enabled: false,
1327
+ languages: ["Java"],
1328
+ parameters: [
1329
+ {
1330
+ name: "format",
1331
+ default: "^$",
1332
+ description: "Define the RegExp for illegal pattern."
1333
+ },
1334
+ {
1335
+ name: "ignoreCase",
1336
+ default: "false",
1337
+ description: "Control whether to ignore case when matching."
1338
+ },
1339
+ {
1340
+ name: "message",
1341
+ default: "",
1342
+ description: "Define the message which is used to notify about violations; if empty then the default message is used."
1343
+ },
1344
+ {
1345
+ name: "tokens",
1346
+ default: "null",
1347
+ description: "tokens to check"
1348
+ }
1349
+ ]
1350
+ },
1351
+ {
1352
+ id: "Checkstyle_IllegalType",
1353
+ category: "BestPractice",
1354
+ severityLevel: "Warning",
1355
+ title: "Avoid Usage of Illegal Types",
1356
+ enabled: false,
1357
+ languages: ["Java"],
1358
+ parameters: [
1359
+ {
1360
+ name: "ignoredMethodNames",
1361
+ default: "getEnvironment, getInitialContext",
1362
+ description: "Specify methods that should not be checked."
1363
+ },
1364
+ {
1365
+ name: "illegalAbstractClassNameFormat",
1366
+ default: "^(.*[.])?Abstract.*$",
1367
+ description: "Specify RegExp for illegal abstract class names."
1368
+ },
1369
+ {
1370
+ name: "illegalClassNames",
1371
+ default: "HashMap, HashSet, LinkedHashMap, LinkedHashSet, TreeMap, TreeSet, java.util.HashMap, java.util.HashSet, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeMap, java.util.TreeSet",
1372
+ description: "Specify classes that should not be used as types in variable declarations, return values or parameters."
1373
+ },
1374
+ {
1375
+ name: "legalAbstractClassNames",
1376
+ default: "",
1377
+ description: "Define abstract classes that may be used as types."
1378
+ },
1379
+ {
1380
+ name: "memberModifiers",
1381
+ default: "",
1382
+ description: "Control whether to check only methods and fields with any of the specified modifiers. This property does not affect method calls nor method references nor record components."
1383
+ },
1384
+ {
1385
+ name: "tokens",
1386
+ default: "ANNOTATION_FIELD_DEF, CLASS_DEF, INTERFACE_DEF, METHOD_CALL, METHOD_DEF, METHOD_REF, PARAMETER_DEF, VARIABLE_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF, RECORD_COMPONENT_DEF, RECORD_PATTERN_DEF",
1387
+ description: "tokens to check"
1388
+ },
1389
+ {
1390
+ name: "validateAbstractClassNames",
1391
+ default: "false",
1392
+ description: "Control whether to validate abstract class names."
1393
+ }
1394
+ ]
1395
+ },
1396
+ {
1397
+ id: "Checkstyle_ImportControl",
1398
+ category: "BestPractice",
1399
+ severityLevel: "Warning",
1400
+ title: "Enforce Import Control",
1401
+ enabled: false,
1402
+ languages: ["Java"],
1403
+ parameters: [
1404
+ {
1405
+ name: "file",
1406
+ default: "null",
1407
+ description: "Specify the location of the file containing the import control configuration. It can be a regular file, URL or resource path. It will try loading the path as a URL first, then as a file, and finally as a resource."
1408
+ },
1409
+ {
1410
+ name: "path",
1411
+ default: ".*",
1412
+ description: "Specify the regular expression of file paths to which this check should apply. Files that don't match the pattern will not be checked. The pattern will be matched against the full absolute file path."
1413
+ }
1414
+ ]
1415
+ },
1416
+ {
1417
+ id: "Checkstyle_ImportOrder",
1418
+ category: "CodeStyle",
1419
+ severityLevel: "Info",
1420
+ title: "Enforce Import Order",
1421
+ enabled: false,
1422
+ languages: ["Java"],
1423
+ parameters: [
1424
+ {
1425
+ name: "caseSensitive",
1426
+ default: "true",
1427
+ description: "Control whether string comparison should be case-sensitive or not. Case-sensitive sorting is in ASCII sort order. It affects both type imports and static imports."
1428
+ },
1429
+ {
1430
+ name: "groups",
1431
+ default: "",
1432
+ description: "groups"
1433
+ },
1434
+ {
1435
+ name: "option",
1436
+ default: "under",
1437
+ description: "Specify policy on the relative order between type imports and static imports."
1438
+ },
1439
+ {
1440
+ name: "ordered",
1441
+ default: "true",
1442
+ description: "Control whether type imports within each group should be sorted. It doesn't affect sorting for static imports."
1443
+ },
1444
+ {
1445
+ name: "separated",
1446
+ default: "false",
1447
+ description: "Control whether type import groups should be separated by, at least, one blank line or comment and aren't separated internally. It doesn't affect separations for static imports."
1448
+ },
1449
+ {
1450
+ name: "separatedStaticGroups",
1451
+ default: "false",
1452
+ description: "separatedStaticGroups"
1453
+ },
1454
+ {
1455
+ name: "sortStaticImportsAlphabetically",
1456
+ default: "false",
1457
+ description: "Control whether static imports located at top or bottom are sorted within the group."
1458
+ },
1459
+ {
1460
+ name: "staticGroups",
1461
+ default: "",
1462
+ description: "staticGroups"
1463
+ },
1464
+ {
1465
+ name: "useContainerOrderingForStatic",
1466
+ default: "false",
1467
+ description: "Control whether to use container ordering (Eclipse IDE term) for static imports or not."
1468
+ }
1469
+ ]
1470
+ },
1471
+ {
1472
+ id: "Checkstyle_Indentation",
1473
+ category: "CodeStyle",
1474
+ severityLevel: "Info",
1475
+ title: "Enforce Correct Indentation",
1476
+ enabled: false,
1477
+ languages: ["Java"],
1478
+ parameters: [
1479
+ {
1480
+ name: "arrayInitIndent",
1481
+ default: "4",
1482
+ description: "Specify how far an array initialization should be indented when on next line."
1483
+ },
1484
+ {
1485
+ name: "basicOffset",
1486
+ default: "4",
1487
+ description: "Specify how far new indentation level should be indented when on the next line."
1488
+ },
1489
+ {
1490
+ name: "braceAdjustment",
1491
+ default: "0",
1492
+ description: "Specify how far a braces should be indented when on the next line."
1493
+ },
1494
+ {
1495
+ name: "caseIndent",
1496
+ default: "4",
1497
+ description: "Specify how far a case label should be indented when on next line."
1498
+ },
1499
+ {
1500
+ name: "forceStrictCondition",
1501
+ default: "false",
1502
+ description: "Force strict indent level in line wrapping case. If value is true, line wrap indent have to be same as lineWrappingIndentation parameter. If value is false, line wrap indent could be bigger on any value user would like."
1503
+ },
1504
+ {
1505
+ name: "lineWrappingIndentation",
1506
+ default: "4",
1507
+ description: "Specify how far continuation line should be indented when line-wrapping is present."
1508
+ },
1509
+ {
1510
+ name: "throwsIndent",
1511
+ default: "4",
1512
+ description: "Specify how far a throws clause should be indented when on next line."
1513
+ }
1514
+ ]
1515
+ },
1516
+ {
1517
+ id: "Checkstyle_InnerAssignment",
1518
+ category: "CodeStyle",
1519
+ severityLevel: "Info",
1520
+ title: "Avoid Inner Assignments",
1521
+ enabled: false,
1522
+ languages: ["Java"],
1523
+ parameters: []
1524
+ },
1525
+ {
1526
+ id: "Checkstyle_InnerTypeLast",
1527
+ category: "CodeStyle",
1528
+ severityLevel: "Info",
1529
+ title: "Enforce Inner Types Declared Last",
1530
+ enabled: false,
1531
+ languages: ["Java"],
1532
+ parameters: []
1533
+ },
1534
+ {
1535
+ id: "Checkstyle_InterfaceIsType",
1536
+ category: "BestPractice",
1537
+ severityLevel: "Warning",
1538
+ title: "Enforce Interfaces to Define Types",
1539
+ enabled: false,
1540
+ languages: ["Java"],
1541
+ parameters: [
1542
+ {
1543
+ name: "allowMarkerInterfaces",
1544
+ default: "true",
1545
+ description: "Control whether marker interfaces like Serializable are allowed."
1546
+ }
1547
+ ]
1548
+ },
1549
+ {
1550
+ id: "Checkstyle_InterfaceMemberImpliedModifier",
1551
+ category: "CodeStyle",
1552
+ severityLevel: "Info",
1553
+ title: "Enforce Explicit Modifiers on Interface Members",
1554
+ enabled: false,
1555
+ languages: ["Java"],
1556
+ parameters: [
1557
+ {
1558
+ name: "violateImpliedAbstractMethod",
1559
+ default: "true",
1560
+ description: "Control whether to enforce that abstract is explicitly coded on interface methods."
1561
+ },
1562
+ {
1563
+ name: "violateImpliedFinalField",
1564
+ default: "true",
1565
+ description: "Control whether to enforce that final is explicitly coded on interface fields."
1566
+ },
1567
+ {
1568
+ name: "violateImpliedPublicField",
1569
+ default: "true",
1570
+ description: "Control whether to enforce that public is explicitly coded on interface fields."
1571
+ },
1572
+ {
1573
+ name: "violateImpliedPublicMethod",
1574
+ default: "true",
1575
+ description: "Control whether to enforce that public is explicitly coded on interface methods."
1576
+ },
1577
+ {
1578
+ name: "violateImpliedPublicNested",
1579
+ default: "true",
1580
+ description: "Control whether to enforce that public is explicitly coded on interface nested types."
1581
+ },
1582
+ {
1583
+ name: "violateImpliedStaticField",
1584
+ default: "true",
1585
+ description: "Control whether to enforce that static is explicitly coded on interface fields."
1586
+ },
1587
+ {
1588
+ name: "violateImpliedStaticNested",
1589
+ default: "true",
1590
+ description: "Control whether to enforce that static is explicitly coded on interface nested types."
1591
+ }
1592
+ ]
1593
+ },
1594
+ {
1595
+ id: "Checkstyle_InterfaceTypeParameterName",
1596
+ category: "CodeStyle",
1597
+ severityLevel: "Info",
1598
+ title: "Enforce Interface Type Parameter Name Pattern",
1599
+ enabled: false,
1600
+ languages: ["Java"],
1601
+ parameters: [
1602
+ {
1603
+ name: "format",
1604
+ default: "^[A-Z]$",
1605
+ description: "Sets the pattern to match valid identifiers."
1606
+ }
1607
+ ]
1608
+ },
1609
+ {
1610
+ id: "Checkstyle_InvalidJavadocPosition",
1611
+ category: "Documentation",
1612
+ severityLevel: "Info",
1613
+ title: "Enforce Correct Javadoc Position",
1614
+ enabled: false,
1615
+ languages: ["Java"],
1616
+ parameters: []
1617
+ },
1618
+ {
1619
+ id: "Checkstyle_JavadocBlockTagLocation",
1620
+ category: "Documentation",
1621
+ severityLevel: "Info",
1622
+ title: "EnforceJavadocBlockTagLocation",
1623
+ enabled: false,
1624
+ languages: ["Java"],
1625
+ parameters: [
1626
+ {
1627
+ name: "tags",
1628
+ default: "author, deprecated, exception, hidden, param, provides, return, see, serial, serialData, serialField, since, throws, uses, version",
1629
+ description: "Specify the javadoc tags to process."
1630
+ },
1631
+ {
1632
+ name: "violateExecutionOnNonTightHtml",
1633
+ default: "false",
1634
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
1635
+ }
1636
+ ]
1637
+ },
1638
+ {
1639
+ id: "Checkstyle_JavadocContentLocation",
1640
+ category: "CodeStyle",
1641
+ severityLevel: "Info",
1642
+ title: "Enforce Consistent Javadoc Content Location",
1643
+ enabled: false,
1644
+ languages: ["Java"],
1645
+ parameters: [
1646
+ {
1647
+ name: "location",
1648
+ default: "second_line",
1649
+ description: "Specify the policy on placement of the Javadoc content."
1650
+ }
1651
+ ]
1652
+ },
1653
+ {
1654
+ id: "Checkstyle_JavadocLeadingAsteriskAlign",
1655
+ category: "CodeStyle",
1656
+ severityLevel: "Info",
1657
+ title: "Enforce Alignment of Leading Asterisks in Javadoc Comments",
1658
+ enabled: false,
1659
+ languages: ["Java"],
1660
+ parameters: [
1661
+ {
1662
+ name: "violateExecutionOnNonTightHtml",
1663
+ default: "false",
1664
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
1665
+ }
1666
+ ]
1667
+ },
1668
+ {
1669
+ id: "Checkstyle_JavadocMethod",
1670
+ category: "Documentation",
1671
+ severityLevel: "Info",
1672
+ title: "Enforce Javadoc Comments on Methods and Constructors",
1673
+ enabled: false,
1674
+ languages: ["Java"],
1675
+ parameters: [
1676
+ {
1677
+ name: "accessModifiers",
1678
+ default: "public, protected, package, private",
1679
+ description: "Specify the access modifiers where Javadoc comments are checked."
1680
+ },
1681
+ {
1682
+ name: "allowedAnnotations",
1683
+ default: "Override",
1684
+ description: "Specify annotations that allow missed documentation."
1685
+ },
1686
+ {
1687
+ name: "allowInlineReturn",
1688
+ default: "false",
1689
+ description: "Control whether to allow inline return tags."
1690
+ },
1691
+ {
1692
+ name: "allowMissingParamTags",
1693
+ default: "false",
1694
+ description: "Control whether to ignore violations when a method has parameters but does not have matching param tags in the javadoc."
1695
+ },
1696
+ {
1697
+ name: "allowMissingReturnTag",
1698
+ default: "false",
1699
+ description: "Control whether to ignore violations when a method returns non-void type and does not have a return tag in the javadoc."
1700
+ },
1701
+ {
1702
+ name: "tokens",
1703
+ default: "METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF",
1704
+ description: "tokens to check"
1705
+ },
1706
+ {
1707
+ name: "validateThrows",
1708
+ default: "false",
1709
+ description: "Control whether to validate throws tags."
1710
+ },
1711
+ {
1712
+ name: "violateExecutionOnNonTightHtml",
1713
+ default: "false",
1714
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
1715
+ }
1716
+ ]
1717
+ },
1718
+ {
1719
+ id: "Checkstyle_JavadocMissingLeadingAsterisk",
1720
+ category: "Documentation",
1721
+ severityLevel: "Info",
1722
+ title: "Enforce Leading Asterisks in Javadoc",
1723
+ enabled: false,
1724
+ languages: ["Java"],
1725
+ parameters: [
1726
+ {
1727
+ name: "violateExecutionOnNonTightHtml",
1728
+ default: "false",
1729
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
1730
+ }
1731
+ ]
1732
+ },
1733
+ {
1734
+ id: "Checkstyle_JavadocMissingWhitespaceAfterAsterisk",
1735
+ category: "Documentation",
1736
+ severityLevel: "Info",
1737
+ title: "Enforce Whitespace After Asterisk in Javadoc Comments",
1738
+ enabled: false,
1739
+ languages: ["Java"],
1740
+ parameters: [
1741
+ {
1742
+ name: "violateExecutionOnNonTightHtml",
1743
+ default: "false",
1744
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
1745
+ }
1746
+ ]
1747
+ },
1748
+ {
1749
+ id: "Checkstyle_JavadocPackage",
1750
+ category: "Documentation",
1751
+ severityLevel: "Info",
1752
+ title: "Enforce Javadoc Package Comment Presence",
1753
+ enabled: false,
1754
+ languages: ["Java"],
1755
+ parameters: [
1756
+ {
1757
+ name: "allowLegacy",
1758
+ default: "false",
1759
+ description: "Allow legacy package.html file to be used."
1760
+ },
1761
+ {
1762
+ name: "fileExtensions",
1763
+ default: ".java",
1764
+ description: "Specify the file extensions of the files to process."
1765
+ }
1766
+ ]
1767
+ },
1768
+ {
1769
+ id: "Checkstyle_JavadocParagraph",
1770
+ category: "Documentation",
1771
+ severityLevel: "Info",
1772
+ title: "Enforce Javadoc Paragraph Formatting",
1773
+ enabled: false,
1774
+ languages: ["Java"],
1775
+ parameters: [
1776
+ {
1777
+ name: "allowNewlineParagraph",
1778
+ default: "true",
1779
+ description: "Control whether the <p> tag should be placed immediately before the first word."
1780
+ },
1781
+ {
1782
+ name: "violateExecutionOnNonTightHtml",
1783
+ default: "false",
1784
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
1785
+ }
1786
+ ]
1787
+ },
1788
+ {
1789
+ id: "Checkstyle_JavadocTagContinuationIndentation",
1790
+ category: "Documentation",
1791
+ severityLevel: "Info",
1792
+ title: "Enforce Javadoc Tag Continuation Indentation",
1793
+ enabled: false,
1794
+ languages: ["Java"],
1795
+ parameters: [
1796
+ {
1797
+ name: "offset",
1798
+ default: "4",
1799
+ description: "Specify how many spaces to use for new indentation level."
1800
+ },
1801
+ {
1802
+ name: "violateExecutionOnNonTightHtml",
1803
+ default: "false",
1804
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
1805
+ }
1806
+ ]
1807
+ },
1808
+ {
1809
+ id: "Checkstyle_JavadocType",
1810
+ category: "Documentation",
1811
+ severityLevel: "Info",
1812
+ title: "Enforce Javadoc Comments on Type Definitions",
1813
+ enabled: false,
1814
+ languages: ["Java"],
1815
+ parameters: [
1816
+ {
1817
+ name: "allowedAnnotations",
1818
+ default: "Generated",
1819
+ description: "Specify annotations that allow skipping validation at all. Only short names are allowed, e.g. Generated."
1820
+ },
1821
+ {
1822
+ name: "allowMissingParamTags",
1823
+ default: "false",
1824
+ description: "Control whether to ignore violations when a class has type parameters but does not have matching param tags in the Javadoc."
1825
+ },
1826
+ {
1827
+ name: "allowUnknownTags",
1828
+ default: "false",
1829
+ description: "Control whether to ignore violations when a Javadoc tag is not recognised."
1830
+ },
1831
+ {
1832
+ name: "authorFormat",
1833
+ default: "null",
1834
+ description: "Specify the pattern for @author tag."
1835
+ },
1836
+ {
1837
+ name: "excludeScope",
1838
+ default: "null",
1839
+ description: "Specify the visibility scope where Javadoc comments are not checked."
1840
+ },
1841
+ {
1842
+ name: "scope",
1843
+ default: "private",
1844
+ description: "Specify the visibility scope where Javadoc comments are checked."
1845
+ },
1846
+ {
1847
+ name: "tokens",
1848
+ default: "INTERFACE_DEF, CLASS_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF",
1849
+ description: "tokens to check"
1850
+ },
1851
+ {
1852
+ name: "versionFormat",
1853
+ default: "null",
1854
+ description: "Specify the pattern for @version tag."
1855
+ },
1856
+ {
1857
+ name: "violateExecutionOnNonTightHtml",
1858
+ default: "false",
1859
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
1860
+ }
1861
+ ]
1862
+ },
1863
+ {
1864
+ id: "Checkstyle_JavadocVariable",
1865
+ category: "Documentation",
1866
+ severityLevel: "Info",
1867
+ title: "Enforce Javadoc Comment on Variables",
1868
+ enabled: false,
1869
+ languages: ["Java"],
1870
+ parameters: [
1871
+ {
1872
+ name: "accessModifiers",
1873
+ default: "public, protected, package, private",
1874
+ description: "accessModifiers"
1875
+ },
1876
+ {
1877
+ name: "excludeScope",
1878
+ default: "null",
1879
+ description: "Specify the visibility scope where Javadoc comments are not checked."
1880
+ },
1881
+ {
1882
+ name: "ignoreNamePattern",
1883
+ default: "null",
1884
+ description: "Specify the regexp to define variable names to ignore."
1885
+ },
1886
+ {
1887
+ name: "scope",
1888
+ default: "private",
1889
+ description: "Specify the visibility scope where Javadoc comments are checked."
1890
+ },
1891
+ {
1892
+ name: "tokens",
1893
+ default: "ENUM_CONSTANT_DEF",
1894
+ description: "tokens to check"
1895
+ }
1896
+ ]
1897
+ },
1898
+ {
1899
+ id: "Checkstyle_JavaNCSS",
1900
+ category: "Complexity",
1901
+ severityLevel: "Warning",
1902
+ title: "Enforce JavaNCSS Complexity Limits",
1903
+ enabled: false,
1904
+ languages: ["Java"],
1905
+ parameters: [
1906
+ {
1907
+ name: "classMaximum",
1908
+ default: "1500",
1909
+ description: "Specify the maximum allowed number of non commenting lines in a class."
1910
+ },
1911
+ {
1912
+ name: "fileMaximum",
1913
+ default: "2000",
1914
+ description: "Specify the maximum allowed number of non commenting lines in a file including all top level and nested classes."
1915
+ },
1916
+ {
1917
+ name: "methodMaximum",
1918
+ default: "50",
1919
+ description: "Specify the maximum allowed number of non commenting lines in a method."
1920
+ },
1921
+ {
1922
+ name: "recordMaximum",
1923
+ default: "150",
1924
+ description: "Specify the maximum allowed number of non commenting lines in a record."
1925
+ }
1926
+ ]
1927
+ },
1928
+ {
1929
+ id: "Checkstyle_LambdaBodyLength",
1930
+ category: "Complexity",
1931
+ severityLevel: "Info",
1932
+ title: "Enforce Lambda Body Length Limit",
1933
+ enabled: false,
1934
+ languages: ["Java"],
1935
+ parameters: [
1936
+ {
1937
+ name: "max",
1938
+ default: "10",
1939
+ description: "Specify the maximum number of lines allowed."
1940
+ }
1941
+ ]
1942
+ },
1943
+ {
1944
+ id: "Checkstyle_LambdaParameterName",
1945
+ category: "CodeStyle",
1946
+ severityLevel: "Info",
1947
+ title: "Enforce Lambda Parameter Naming Conventions",
1948
+ enabled: false,
1949
+ languages: ["Java"],
1950
+ parameters: [
1951
+ {
1952
+ name: "format",
1953
+ default: "^([a-z][a-zA-Z0-9]*|_)$",
1954
+ description: "Sets the pattern to match valid identifiers."
1955
+ }
1956
+ ]
1957
+ },
1958
+ {
1959
+ id: "Checkstyle_LeftCurly",
1960
+ category: "CodeStyle",
1961
+ severityLevel: "Info",
1962
+ title: "Enforce Left Curly Brace Placement",
1963
+ enabled: false,
1964
+ languages: ["Java"],
1965
+ parameters: [
1966
+ {
1967
+ name: "ignoreEnums",
1968
+ default: "true",
1969
+ description: "Allow to ignore enums when left curly brace policy is EOL."
1970
+ },
1971
+ {
1972
+ name: "option",
1973
+ default: "eol",
1974
+ description: "Specify the policy on placement of a left curly brace ('{')."
1975
+ },
1976
+ {
1977
+ name: "tokens",
1978
+ default: "ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, LAMBDA, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF, OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF, SWITCH_RULE",
1979
+ description: "tokens to check"
1980
+ }
1981
+ ]
1982
+ },
1983
+ {
1984
+ id: "Checkstyle_LineEnding",
1985
+ category: "CodeStyle",
1986
+ severityLevel: "Info",
1987
+ title: "Enforce configured file line endings",
1988
+ enabled: false,
1989
+ languages: ["Java"],
1990
+ parameters: [
1991
+ {
1992
+ name: "fileExtensions",
1993
+ default: "",
1994
+ description: "Specify the file extensions of the files to process."
1995
+ },
1996
+ {
1997
+ name: "lineEnding",
1998
+ default: "lf",
1999
+ description: "Set lineEnding."
2000
+ }
2001
+ ]
2002
+ },
2003
+ {
2004
+ id: "Checkstyle_LineLength",
2005
+ category: "CodeStyle",
2006
+ severityLevel: "Info",
2007
+ title: "Enforce Line Length Limit",
2008
+ enabled: true,
2009
+ languages: ["Java"],
2010
+ parameters: [
2011
+ {
2012
+ name: "fileExtensions",
2013
+ default: "",
2014
+ description: "Specify the file extensions of the files to process."
2015
+ },
2016
+ {
2017
+ name: "ignorePattern",
2018
+ default: "^(package|import) .*",
2019
+ description: "Specify pattern for lines to ignore."
2020
+ },
2021
+ {
2022
+ name: "max",
2023
+ default: "80",
2024
+ description: "Specify the maximum line length allowed."
2025
+ }
2026
+ ]
2027
+ },
2028
+ {
2029
+ id: "Checkstyle_LocalFinalVariableName",
2030
+ category: "CodeStyle",
2031
+ severityLevel: "Info",
2032
+ title: "Enforce Local Final Variable Naming Convention",
2033
+ enabled: false,
2034
+ languages: ["Java"],
2035
+ parameters: [
2036
+ {
2037
+ name: "format",
2038
+ default: "^([a-z][a-zA-Z0-9]*|_)$",
2039
+ description: "Sets the pattern to match valid identifiers."
2040
+ },
2041
+ {
2042
+ name: "tokens",
2043
+ default: "VARIABLE_DEF, PARAMETER_DEF, RESOURCE",
2044
+ description: "tokens to check"
2045
+ }
2046
+ ]
2047
+ },
2048
+ {
2049
+ id: "Checkstyle_LocalVariableName",
2050
+ category: "CodeStyle",
2051
+ severityLevel: "Info",
2052
+ title: "Enforce Local Variable Naming Convention",
2053
+ enabled: false,
2054
+ languages: ["Java"],
2055
+ parameters: [
2056
+ {
2057
+ name: "allowOneCharVarInForLoop",
2058
+ default: "false",
2059
+ description: "Allow one character variable name in initialization expressions in FOR loop if one char variable name is prohibited by format regexp."
2060
+ },
2061
+ {
2062
+ name: "format",
2063
+ default: "^([a-z][a-zA-Z0-9]*|_)$",
2064
+ description: "Sets the pattern to match valid identifiers."
2065
+ }
2066
+ ]
2067
+ },
2068
+ {
2069
+ id: "Checkstyle_MagicNumber",
2070
+ category: "BestPractice",
2071
+ severityLevel: "Info",
2072
+ title: "Avoid Magic Numbers",
2073
+ enabled: false,
2074
+ languages: ["Java"],
2075
+ parameters: [
2076
+ {
2077
+ name: "constantWaiverParentToken",
2078
+ default: "ARRAY_INIT, ASSIGN, BAND, BNOT, BOR, BSR, BXOR, COLON, DIV, ELIST, EQUAL, EXPR, GE, GT, LE, LITERAL_NEW, LT, METHOD_CALL, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, TYPECAST, UNARY_MINUS, UNARY_PLUS",
2079
+ description: "Specify tokens that are allowed in the AST path from the number literal to the enclosing constant definition."
2080
+ },
2081
+ {
2082
+ name: "ignoreAnnotation",
2083
+ default: "false",
2084
+ description: "Ignore magic numbers in annotation declarations."
2085
+ },
2086
+ {
2087
+ name: "ignoreAnnotationElementDefaults",
2088
+ default: "true",
2089
+ description: "Ignore magic numbers in annotation elements defaults."
2090
+ },
2091
+ {
2092
+ name: "ignoreFieldDeclaration",
2093
+ default: "false",
2094
+ description: "Ignore magic numbers in field declarations."
2095
+ },
2096
+ {
2097
+ name: "ignoreHashCodeMethod",
2098
+ default: "false",
2099
+ description: "Ignore magic numbers in hashCode methods."
2100
+ },
2101
+ {
2102
+ name: "ignoreNumbers",
2103
+ default: "-1, 0, 1, 2",
2104
+ description: "Specify non-magic numbers."
2105
+ },
2106
+ {
2107
+ name: "tokens",
2108
+ default: "NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG",
2109
+ description: "tokens to check"
2110
+ }
2111
+ ]
2112
+ },
2113
+ {
2114
+ id: "Checkstyle_MatchXpath",
2115
+ category: "BestPractice",
2116
+ severityLevel: "Info",
2117
+ title: "Enforce Custom Checks Using MatchXpath",
2118
+ enabled: false,
2119
+ languages: ["Java"],
2120
+ parameters: [
2121
+ {
2122
+ name: "query",
2123
+ default: "",
2124
+ description: "Specify Xpath query."
2125
+ }
2126
+ ]
2127
+ },
2128
+ {
2129
+ id: "Checkstyle_MemberName",
2130
+ category: "CodeStyle",
2131
+ severityLevel: "Info",
2132
+ title: "Enforce Instance Variable Naming Convention",
2133
+ enabled: false,
2134
+ languages: ["Java"],
2135
+ parameters: [
2136
+ {
2137
+ name: "applyToPackage",
2138
+ default: "true",
2139
+ description: "Control if check should apply to package-private members."
2140
+ },
2141
+ {
2142
+ name: "applyToPrivate",
2143
+ default: "true",
2144
+ description: "Control if check should apply to private members."
2145
+ },
2146
+ {
2147
+ name: "applyToProtected",
2148
+ default: "true",
2149
+ description: "Control if check should apply to protected members."
2150
+ },
2151
+ {
2152
+ name: "applyToPublic",
2153
+ default: "true",
2154
+ description: "Control if check should apply to public members."
2155
+ },
2156
+ {
2157
+ name: "format",
2158
+ default: "^[a-z][a-zA-Z0-9]*$",
2159
+ description: "Sets the pattern to match valid identifiers."
2160
+ }
2161
+ ]
2162
+ },
2163
+ {
2164
+ id: "Checkstyle_MethodCount",
2165
+ category: "Complexity",
2166
+ severityLevel: "Warning",
2167
+ title: "Enforce Maximum Number of Methods per Class",
2168
+ enabled: false,
2169
+ languages: ["Java"],
2170
+ parameters: [
2171
+ {
2172
+ name: "maxPackage",
2173
+ default: "100",
2174
+ description: "Specify the maximum number of package methods allowed."
2175
+ },
2176
+ {
2177
+ name: "maxPrivate",
2178
+ default: "100",
2179
+ description: "Specify the maximum number of private methods allowed."
2180
+ },
2181
+ {
2182
+ name: "maxProtected",
2183
+ default: "100",
2184
+ description: "Specify the maximum number of protected methods allowed."
2185
+ },
2186
+ {
2187
+ name: "maxPublic",
2188
+ default: "100",
2189
+ description: "Specify the maximum number of public methods allowed."
2190
+ },
2191
+ {
2192
+ name: "maxTotal",
2193
+ default: "100",
2194
+ description: "Specify the maximum number of methods allowed at all scope levels."
2195
+ },
2196
+ {
2197
+ name: "tokens",
2198
+ default: "CLASS_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, ANNOTATION_DEF, RECORD_DEF, COMPACT_COMPILATION_UNIT",
2199
+ description: "tokens to check"
2200
+ }
2201
+ ]
2202
+ },
2203
+ {
2204
+ id: "Checkstyle_MethodLength",
2205
+ category: "Complexity",
2206
+ severityLevel: "Warning",
2207
+ title: "Avoid Long Methods",
2208
+ enabled: false,
2209
+ languages: ["Java"],
2210
+ parameters: [
2211
+ {
2212
+ name: "countEmpty",
2213
+ default: "true",
2214
+ description: "Control whether to count empty lines and comments."
2215
+ },
2216
+ {
2217
+ name: "max",
2218
+ default: "150",
2219
+ description: "Specify the maximum number of lines allowed."
2220
+ },
2221
+ {
2222
+ name: "tokens",
2223
+ default: "METHOD_DEF, CTOR_DEF, COMPACT_CTOR_DEF",
2224
+ description: "tokens to check"
2225
+ }
2226
+ ]
2227
+ },
2228
+ {
2229
+ id: "Checkstyle_MethodName",
2230
+ category: "CodeStyle",
2231
+ severityLevel: "Info",
2232
+ title: "Enforce Method Name Pattern",
2233
+ enabled: false,
2234
+ languages: ["Java"],
2235
+ parameters: [
2236
+ {
2237
+ name: "allowClassName",
2238
+ default: "false",
2239
+ description: "Control whether to allow a method name to have the same name as the enclosing class name. Setting this property false helps to avoid confusion between constructors and methods."
2240
+ },
2241
+ {
2242
+ name: "applyToPackage",
2243
+ default: "true",
2244
+ description: "Control if check should apply to package-private members."
2245
+ },
2246
+ {
2247
+ name: "applyToPrivate",
2248
+ default: "true",
2249
+ description: "Control if check should apply to private members."
2250
+ },
2251
+ {
2252
+ name: "applyToProtected",
2253
+ default: "true",
2254
+ description: "Control if check should apply to protected members."
2255
+ },
2256
+ {
2257
+ name: "applyToPublic",
2258
+ default: "true",
2259
+ description: "Control if check should apply to public members."
2260
+ },
2261
+ {
2262
+ name: "format",
2263
+ default: "^[a-z][a-zA-Z0-9]*$",
2264
+ description: "Sets the pattern to match valid identifiers."
2265
+ }
2266
+ ]
2267
+ },
2268
+ {
2269
+ id: "Checkstyle_MethodParamPad",
2270
+ category: "CodeStyle",
2271
+ severityLevel: "Info",
2272
+ title: "Enforce Method Parameter Padding",
2273
+ enabled: false,
2274
+ languages: ["Java"],
2275
+ parameters: [
2276
+ {
2277
+ name: "allowLineBreaks",
2278
+ default: "false",
2279
+ description: "Allow a line break between the identifier and left parenthesis."
2280
+ },
2281
+ {
2282
+ name: "option",
2283
+ default: "nospace",
2284
+ description: "Specify policy on how to pad method parameter."
2285
+ },
2286
+ {
2287
+ name: "tokens",
2288
+ default: "CTOR_DEF, CTOR_CALL, LITERAL_NEW, METHOD_CALL, METHOD_DEF, SUPER_CTOR_CALL, ENUM_CONSTANT_DEF, RECORD_DEF, RECORD_PATTERN_DEF",
2289
+ description: "tokens to check"
2290
+ }
2291
+ ]
2292
+ },
2293
+ {
2294
+ id: "Checkstyle_MethodTypeParameterName",
2295
+ category: "CodeStyle",
2296
+ severityLevel: "Info",
2297
+ title: "Enforce Method Type Parameter Naming Convention",
2298
+ enabled: false,
2299
+ languages: ["Java"],
2300
+ parameters: [
2301
+ {
2302
+ name: "format",
2303
+ default: "^[A-Z]$",
2304
+ description: "Sets the pattern to match valid identifiers."
2305
+ }
2306
+ ]
2307
+ },
2308
+ {
2309
+ id: "Checkstyle_MissingCtor",
2310
+ category: "BestPractice",
2311
+ severityLevel: "Info",
2312
+ title: "Enforce Explicit Constructor Definition",
2313
+ enabled: false,
2314
+ languages: ["Java"],
2315
+ parameters: []
2316
+ },
2317
+ {
2318
+ id: "Checkstyle_MissingDeprecated",
2319
+ category: "Documentation",
2320
+ severityLevel: "Info",
2321
+ title: "EnforcePresenceOfBothDeprecatedAnnotationAndJavadocTag",
2322
+ enabled: false,
2323
+ languages: ["Java"],
2324
+ parameters: [
2325
+ {
2326
+ name: "violateExecutionOnNonTightHtml",
2327
+ default: "false",
2328
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
2329
+ }
2330
+ ]
2331
+ },
2332
+ {
2333
+ id: "Checkstyle_MissingJavadocMethod",
2334
+ category: "Documentation",
2335
+ severityLevel: "Info",
2336
+ title: "Enforce Javadoc Comments on Methods",
2337
+ enabled: false,
2338
+ languages: ["Java"],
2339
+ parameters: [
2340
+ {
2341
+ name: "allowedAnnotations",
2342
+ default: "Override",
2343
+ description: "Configure annotations that allow missed documentation."
2344
+ },
2345
+ {
2346
+ name: "allowMissingPropertyJavadoc",
2347
+ default: "false",
2348
+ description: "Control whether to allow missing Javadoc on accessor methods for properties (setters and getters)."
2349
+ },
2350
+ {
2351
+ name: "excludeScope",
2352
+ default: "null",
2353
+ description: "Specify the visibility scope where Javadoc comments are not checked."
2354
+ },
2355
+ {
2356
+ name: "ignoreMethodNamesRegex",
2357
+ default: "null",
2358
+ description: "Ignore method whose names are matching specified regex."
2359
+ },
2360
+ {
2361
+ name: "minLineCount",
2362
+ default: "-1",
2363
+ description: "Control the minimal amount of lines in method to allow no documentation."
2364
+ },
2365
+ {
2366
+ name: "scope",
2367
+ default: "public",
2368
+ description: "Specify the visibility scope where Javadoc comments are checked."
2369
+ },
2370
+ {
2371
+ name: "tokens",
2372
+ default: "METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF",
2373
+ description: "tokens to check"
2374
+ }
2375
+ ]
2376
+ },
2377
+ {
2378
+ id: "Checkstyle_MissingJavadocPackage",
2379
+ category: "Documentation",
2380
+ severityLevel: "Info",
2381
+ title: "Enforce Javadoc for Package Definitions in package-info.java",
2382
+ enabled: false,
2383
+ languages: ["Java"],
2384
+ parameters: []
2385
+ },
2386
+ {
2387
+ id: "Checkstyle_MissingJavadocType",
2388
+ category: "Documentation",
2389
+ severityLevel: "Info",
2390
+ title: "Enforce Javadoc Comments on Types",
2391
+ enabled: false,
2392
+ languages: ["Java"],
2393
+ parameters: [
2394
+ {
2395
+ name: "excludeScope",
2396
+ default: "null",
2397
+ description: "Specify the visibility scope where Javadoc comments are not checked."
2398
+ },
2399
+ {
2400
+ name: "scope",
2401
+ default: "public",
2402
+ description: "Specify the visibility scope where Javadoc comments are checked."
2403
+ },
2404
+ {
2405
+ name: "skipAnnotations",
2406
+ default: "Generated",
2407
+ description: "Specify annotations that allow missed documentation. If annotation is present in target sources in multiple forms of qualified name, all forms should be listed in this property."
2408
+ },
2409
+ {
2410
+ name: "tokens",
2411
+ default: "INTERFACE_DEF, CLASS_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF",
2412
+ description: "tokens to check"
2413
+ },
2414
+ {
2415
+ name: "violateExecutionOnNonTightHtml",
2416
+ default: "false",
2417
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
2418
+ }
2419
+ ]
2420
+ },
2421
+ {
2422
+ id: "Checkstyle_MissingNullCaseInSwitch",
2423
+ category: "ErrorProne",
2424
+ severityLevel: "High",
2425
+ title: "EnforceNullCaseInSwitch",
2426
+ enabled: false,
2427
+ languages: ["Java"],
2428
+ parameters: []
2429
+ },
2430
+ {
2431
+ id: "Checkstyle_MissingOverride",
2432
+ category: "ErrorProne",
2433
+ severityLevel: "Warning",
2434
+ title: "Enforce @Override Annotation with @inheritDoc",
2435
+ enabled: false,
2436
+ languages: ["Java"],
2437
+ parameters: [
2438
+ {
2439
+ name: "javaFiveCompatibility",
2440
+ default: "false",
2441
+ description: "Enable java 5 compatibility mode."
2442
+ }
2443
+ ]
2444
+ },
2445
+ {
2446
+ id: "Checkstyle_MissingOverrideOnRecordAccessor",
2447
+ category: "CodeStyle",
2448
+ severityLevel: "Info",
2449
+ title: "Require @Override on Record Accessor",
2450
+ enabled: false,
2451
+ languages: ["Java"],
2452
+ parameters: []
2453
+ },
2454
+ {
2455
+ id: "Checkstyle_MissingSwitchDefault",
2456
+ category: "BestPractice",
2457
+ severityLevel: "Warning",
2458
+ title: "EnforceSwitchDefaultClause",
2459
+ enabled: false,
2460
+ languages: ["Java"],
2461
+ parameters: []
2462
+ },
2463
+ {
2464
+ id: "Checkstyle_ModifiedControlVariable",
2465
+ category: "CodeStyle",
2466
+ severityLevel: "Info",
2467
+ title: "Avoid Modifying For Loop Control Variable Inside Loop",
2468
+ enabled: false,
2469
+ languages: ["Java"],
2470
+ parameters: [
2471
+ {
2472
+ name: "skipEnhancedForLoopVariable",
2473
+ default: "false",
2474
+ description: "Control whether to check enhanced for-loop variable."
2475
+ }
2476
+ ]
2477
+ },
2478
+ {
2479
+ id: "Checkstyle_ModifierOrder",
2480
+ category: "CodeStyle",
2481
+ severityLevel: "Info",
2482
+ title: "Enforce Modifier Order",
2483
+ enabled: false,
2484
+ languages: ["Java"],
2485
+ parameters: []
2486
+ },
2487
+ {
2488
+ id: "Checkstyle_MultiFileRegexpHeader",
2489
+ category: "CodeStyle",
2490
+ severityLevel: "Info",
2491
+ title: "Enforce Multi-File Regular Expression Header",
2492
+ enabled: false,
2493
+ languages: ["Java"],
2494
+ parameters: [
2495
+ {
2496
+ name: "fileExtensions",
2497
+ default: "",
2498
+ description: "Specify the file extensions of the files to process."
2499
+ },
2500
+ {
2501
+ name: "headerFiles",
2502
+ default: "null",
2503
+ description: "Specify a comma-separated list of files containing the required headers. If a file's header matches none, the violation references the first file in this list. Users can order files to set a preferred header for such reporting."
2504
+ }
2505
+ ]
2506
+ },
2507
+ {
2508
+ id: "Checkstyle_MultilineCommentLeadingAsteriskPresence",
2509
+ category: "CodeStyle",
2510
+ severityLevel: "Info",
2511
+ title: "Require leading asterisk on each line of multi-line comments",
2512
+ enabled: false,
2513
+ languages: ["Java"],
2514
+ parameters: []
2515
+ },
2516
+ {
2517
+ id: "Checkstyle_MultipleStringLiterals",
2518
+ category: "BestPractice",
2519
+ severityLevel: "Warning",
2520
+ title: "Avoid Multiple Occurrences of the Same String Literal",
2521
+ enabled: false,
2522
+ languages: ["Java"],
2523
+ parameters: [
2524
+ {
2525
+ name: "allowedDuplicates",
2526
+ default: "1",
2527
+ description: "Specify the maximum number of occurrences to allow without generating a warning."
2528
+ },
2529
+ {
2530
+ name: "ignoreOccurrenceContext",
2531
+ default: "ANNOTATION",
2532
+ description: "Specify token type names where duplicate strings are ignored even if they don't match ignoredStringsRegexp. This allows you to exclude syntactical contexts like annotations or static initializers from the check."
2533
+ },
2534
+ {
2535
+ name: "ignoreStringsRegexp",
2536
+ default: '^""$',
2537
+ description: "Specify RegExp for ignored strings (with quotation marks)."
2538
+ }
2539
+ ]
2540
+ },
2541
+ {
2542
+ id: "Checkstyle_MultipleVariableDeclarations",
2543
+ category: "CodeStyle",
2544
+ severityLevel: "Info",
2545
+ title: "Enforce Single Variable Declaration Per Statement",
2546
+ enabled: false,
2547
+ languages: ["Java"],
2548
+ parameters: []
2549
+ },
2550
+ {
2551
+ id: "Checkstyle_MutableException",
2552
+ category: "BestPractice",
2553
+ severityLevel: "Warning",
2554
+ title: "Enforce Immutability of Exception Classes",
2555
+ enabled: false,
2556
+ languages: ["Java"],
2557
+ parameters: [
2558
+ {
2559
+ name: "extendedClassNameFormat",
2560
+ default: "^.*Exception$|^.*Error$|^.*Throwable$",
2561
+ description: "Specify pattern for extended class names."
2562
+ },
2563
+ {
2564
+ name: "format",
2565
+ default: "^.*Exception$|^.*Error$|^.*Throwable$",
2566
+ description: "Specify pattern for exception class names."
2567
+ }
2568
+ ]
2569
+ },
2570
+ {
2571
+ id: "Checkstyle_NeedBraces",
2572
+ category: "CodeStyle",
2573
+ severityLevel: "Info",
2574
+ title: "Enforce Braces Around Code Blocks",
2575
+ enabled: false,
2576
+ languages: ["Java"],
2577
+ parameters: [
2578
+ {
2579
+ name: "allowEmptyLoopBody",
2580
+ default: "false",
2581
+ description: "Allow loops with empty bodies."
2582
+ },
2583
+ {
2584
+ name: "allowSingleLineStatement",
2585
+ default: "false",
2586
+ description: "Allow single-line statements without braces."
2587
+ },
2588
+ {
2589
+ name: "tokens",
2590
+ default: "LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF, LITERAL_WHILE",
2591
+ description: "tokens to check"
2592
+ }
2593
+ ]
2594
+ },
2595
+ {
2596
+ id: "Checkstyle_NestedForDepth",
2597
+ category: "Complexity",
2598
+ severityLevel: "Warning",
2599
+ title: "Restrict Nested For Loop Depth",
2600
+ enabled: false,
2601
+ languages: ["Java"],
2602
+ parameters: [
2603
+ {
2604
+ name: "max",
2605
+ default: "1",
2606
+ description: "Specify maximum allowed nesting depth."
2607
+ }
2608
+ ]
2609
+ },
2610
+ {
2611
+ id: "Checkstyle_NestedIfDepth",
2612
+ category: "Complexity",
2613
+ severityLevel: "Warning",
2614
+ title: "Restrict Nested If-Else Depth",
2615
+ enabled: false,
2616
+ languages: ["Java"],
2617
+ parameters: [
2618
+ {
2619
+ name: "max",
2620
+ default: "1",
2621
+ description: "Specify maximum allowed nesting depth."
2622
+ }
2623
+ ]
2624
+ },
2625
+ {
2626
+ id: "Checkstyle_NestedTryDepth",
2627
+ category: "Complexity",
2628
+ severityLevel: "Warning",
2629
+ title: "Restrict Nested Try-Catch-Finally Depth",
2630
+ enabled: false,
2631
+ languages: ["Java"],
2632
+ parameters: [
2633
+ {
2634
+ name: "max",
2635
+ default: "1",
2636
+ description: "Specify maximum allowed nesting depth."
2637
+ }
2638
+ ]
2639
+ },
2640
+ {
2641
+ id: "Checkstyle_NewlineAtEndOfFile",
2642
+ category: "CodeStyle",
2643
+ severityLevel: "Info",
2644
+ title: "Enforce Newline at End of File",
2645
+ enabled: false,
2646
+ languages: ["Java"],
2647
+ parameters: [
2648
+ {
2649
+ name: "fileExtensions",
2650
+ default: "",
2651
+ description: "Specify the file extensions of the files to process."
2652
+ },
2653
+ {
2654
+ name: "lineSeparator",
2655
+ default: "lf_cr_crlf",
2656
+ description: "Specify the type of line separator."
2657
+ }
2658
+ ]
2659
+ },
2660
+ {
2661
+ id: "Checkstyle_NoArrayTrailingComma",
2662
+ category: "CodeStyle",
2663
+ severityLevel: "Info",
2664
+ title: "Disallow Trailing Commas in Array Initializations",
2665
+ enabled: false,
2666
+ languages: ["Java"],
2667
+ parameters: []
2668
+ },
2669
+ {
2670
+ id: "Checkstyle_NoClone",
2671
+ category: "BestPractice",
2672
+ severityLevel: "Warning",
2673
+ title: "Avoid Overriding clone Method",
2674
+ enabled: false,
2675
+ languages: ["Java"],
2676
+ parameters: []
2677
+ },
2678
+ {
2679
+ id: "Checkstyle_NoCodeInFile",
2680
+ category: "UnusedCode",
2681
+ severityLevel: "Warning",
2682
+ title: "Avoid Files Without Code",
2683
+ enabled: false,
2684
+ languages: ["Java"],
2685
+ parameters: []
2686
+ },
2687
+ {
2688
+ id: "Checkstyle_NoEnumTrailingComma",
2689
+ category: "CodeStyle",
2690
+ severityLevel: "Info",
2691
+ title: "Disallow Trailing Comma in Enum Definitions",
2692
+ enabled: false,
2693
+ languages: ["Java"],
2694
+ parameters: []
2695
+ },
2696
+ {
2697
+ id: "Checkstyle_NoFinalizer",
2698
+ category: "BestPractice",
2699
+ severityLevel: "Warning",
2700
+ title: "Avoid Finalize Method",
2701
+ enabled: false,
2702
+ languages: ["Java"],
2703
+ parameters: []
2704
+ },
2705
+ {
2706
+ id: "Checkstyle_NoLineWrap",
2707
+ category: "CodeStyle",
2708
+ severityLevel: "Info",
2709
+ title: "Disallow Line Wrapping in Statements",
2710
+ enabled: true,
2711
+ languages: ["Java"],
2712
+ parameters: [
2713
+ {
2714
+ name: "skipAnnotations",
2715
+ default: "true",
2716
+ description: "Specify whether to skip annotations to be part of target token."
2717
+ },
2718
+ {
2719
+ name: "tokens",
2720
+ default: "PACKAGE_DEF, IMPORT, STATIC_IMPORT, MODULE_IMPORT",
2721
+ description: "tokens to check"
2722
+ }
2723
+ ]
2724
+ },
2725
+ {
2726
+ id: "Checkstyle_NonEmptyAtclauseDescription",
2727
+ category: "Documentation",
2728
+ severityLevel: "Info",
2729
+ title: "Enforce Non-Empty @-Clause Description in Javadoc",
2730
+ enabled: false,
2731
+ languages: ["Java"],
2732
+ parameters: [
2733
+ {
2734
+ name: "javadocTokens",
2735
+ default: "PARAM_BLOCK_TAG, RETURN_BLOCK_TAG, THROWS_BLOCK_TAG, EXCEPTION_BLOCK_TAG, DEPRECATED_BLOCK_TAG",
2736
+ description: "javadoc tokens to check"
2737
+ },
2738
+ {
2739
+ name: "violateExecutionOnNonTightHtml",
2740
+ default: "false",
2741
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
2742
+ }
2743
+ ]
2744
+ },
2745
+ {
2746
+ id: "Checkstyle_NoWhitespaceAfter",
2747
+ category: "CodeStyle",
2748
+ severityLevel: "Info",
2749
+ title: "Enforce No Whitespace After Token",
2750
+ enabled: false,
2751
+ languages: ["Java"],
2752
+ parameters: [
2753
+ {
2754
+ name: "allowLineBreaks",
2755
+ default: "true",
2756
+ description: "Control whether whitespace is allowed if the token is at a linebreak."
2757
+ },
2758
+ {
2759
+ name: "tokens",
2760
+ default: "ARRAY_INIT, AT, INC, DEC, UNARY_MINUS, UNARY_PLUS, BNOT, LNOT, DOT, ARRAY_DECLARATOR, INDEX_OP",
2761
+ description: "tokens to check"
2762
+ }
2763
+ ]
2764
+ },
2765
+ {
2766
+ id: "Checkstyle_NoWhitespaceBefore",
2767
+ category: "CodeStyle",
2768
+ severityLevel: "Info",
2769
+ title: "Disallow Whitespace Before Tokens",
2770
+ enabled: false,
2771
+ languages: ["Java"],
2772
+ parameters: [
2773
+ {
2774
+ name: "allowLineBreaks",
2775
+ default: "false",
2776
+ description: "Control whether whitespace is allowed if the token is at a linebreak."
2777
+ },
2778
+ {
2779
+ name: "tokens",
2780
+ default: "COMMA, SEMI, POST_INC, POST_DEC, ELLIPSIS, LABELED_STAT",
2781
+ description: "tokens to check"
2782
+ }
2783
+ ]
2784
+ },
2785
+ {
2786
+ id: "Checkstyle_NoWhitespaceBeforeCaseDefaultColon",
2787
+ category: "CodeStyle",
2788
+ severityLevel: "Info",
2789
+ title: "EnforceNoWhitespaceBeforeCaseDefaultColon",
2790
+ enabled: false,
2791
+ languages: ["Java"],
2792
+ parameters: []
2793
+ },
2794
+ {
2795
+ id: "Checkstyle_NPathComplexity",
2796
+ category: "Complexity",
2797
+ severityLevel: "Warning",
2798
+ title: "Enforce NPath Complexity Limit",
2799
+ enabled: false,
2800
+ languages: ["Java"],
2801
+ parameters: [
2802
+ {
2803
+ name: "max",
2804
+ default: "200",
2805
+ description: "Specify the maximum threshold allowed."
2806
+ }
2807
+ ]
2808
+ },
2809
+ {
2810
+ id: "Checkstyle_NumericalPrefixesInfixesSuffixesCharacterCase",
2811
+ category: "CodeStyle",
2812
+ severityLevel: "Info",
2813
+ title: "Enforce lowercase in numerical literal prefixes, infixes, and suffixes",
2814
+ enabled: false,
2815
+ languages: ["Java"],
2816
+ parameters: []
2817
+ },
2818
+ {
2819
+ id: "Checkstyle_OneStatementPerLine",
2820
+ category: "CodeStyle",
2821
+ severityLevel: "Info",
2822
+ title: "Enforce One Statement Per Line",
2823
+ enabled: false,
2824
+ languages: ["Java"],
2825
+ parameters: [
2826
+ {
2827
+ name: "treatTryResourcesAsStatement",
2828
+ default: "false",
2829
+ description: "Enable resources processing."
2830
+ }
2831
+ ]
2832
+ },
2833
+ {
2834
+ id: "Checkstyle_OneTopLevelClass",
2835
+ category: "BestPractice",
2836
+ severityLevel: "Warning",
2837
+ title: "Enforce One Top-Level Class per Source File",
2838
+ enabled: true,
2839
+ languages: ["Java"],
2840
+ parameters: []
2841
+ },
2842
+ {
2843
+ id: "Checkstyle_OpenjdkAnnotationLocation",
2844
+ category: "CodeStyle",
2845
+ severityLevel: "Info",
2846
+ title: "Enforce OpenJDK annotation placement",
2847
+ enabled: false,
2848
+ languages: ["Java"],
2849
+ parameters: [
2850
+ {
2851
+ name: "tokens",
2852
+ default: "CLASS_DEF, INTERFACE_DEF, PACKAGE_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, RECORD_DEF, COMPACT_CTOR_DEF",
2853
+ description: "tokens to check"
2854
+ }
2855
+ ]
2856
+ },
2857
+ {
2858
+ id: "Checkstyle_OperatorWrap",
2859
+ category: "CodeStyle",
2860
+ severityLevel: "Info",
2861
+ title: "Enforce Operator Line Wrapping",
2862
+ enabled: false,
2863
+ languages: ["Java"],
2864
+ parameters: [
2865
+ {
2866
+ name: "option",
2867
+ default: "nl",
2868
+ description: "Specify policy on how to wrap lines."
2869
+ },
2870
+ {
2871
+ name: "tokens",
2872
+ default: "QUESTION, COLON, EQUAL, NOT_EQUAL, DIV, PLUS, MINUS, STAR, MOD, SR, BSR, GE, GT, SL, LE, LT, BXOR, BOR, LOR, BAND, LAND, TYPE_EXTENSION_AND, LITERAL_INSTANCEOF",
2873
+ description: "tokens to check"
2874
+ }
2875
+ ]
2876
+ },
2877
+ {
2878
+ id: "Checkstyle_OrderedProperties",
2879
+ category: "BestPractice",
2880
+ severityLevel: "Info",
2881
+ title: "Enforce Ordered Properties in Properties Files",
2882
+ enabled: false,
2883
+ languages: ["Java"],
2884
+ parameters: [
2885
+ {
2886
+ name: "fileExtensions",
2887
+ default: ".properties",
2888
+ description: "Specify the file extensions of the files to process."
2889
+ }
2890
+ ]
2891
+ },
2892
+ {
2893
+ id: "Checkstyle_OuterTypeFilename",
2894
+ category: "CodeStyle",
2895
+ severityLevel: "Info",
2896
+ title: "Enforce Outer Type Name Matches File Name",
2897
+ enabled: false,
2898
+ languages: ["Java"],
2899
+ parameters: []
2900
+ },
2901
+ {
2902
+ id: "Checkstyle_OuterTypeNumber",
2903
+ category: "BestPractice",
2904
+ severityLevel: "Info",
2905
+ title: "Enforce Single Outer Type per File",
2906
+ enabled: false,
2907
+ languages: ["Java"],
2908
+ parameters: [
2909
+ {
2910
+ name: "max",
2911
+ default: "1",
2912
+ description: "Specify the maximum number of outer types allowed."
2913
+ }
2914
+ ]
2915
+ },
2916
+ {
2917
+ id: "Checkstyle_OverloadMethodsDeclarationOrder",
2918
+ category: "CodeStyle",
2919
+ severityLevel: "Info",
2920
+ title: "Enforce Overloaded Methods Declaration Order",
2921
+ enabled: false,
2922
+ languages: ["Java"],
2923
+ parameters: [
2924
+ {
2925
+ name: "orderByIncreasingParameterCount",
2926
+ default: "false",
2927
+ description: "Control whether to enforce order by increasing parameter count (arity) or not."
2928
+ }
2929
+ ]
2930
+ },
2931
+ {
2932
+ id: "Checkstyle_PackageAnnotation",
2933
+ category: "BestPractice",
2934
+ severityLevel: "Info",
2935
+ title: "Enforce Package Annotations in package-info.java",
2936
+ enabled: false,
2937
+ languages: ["Java"],
2938
+ parameters: []
2939
+ },
2940
+ {
2941
+ id: "Checkstyle_PackageDeclaration",
2942
+ category: "BestPractice",
2943
+ severityLevel: "Warning",
2944
+ title: "Enforce Package Declaration",
2945
+ enabled: false,
2946
+ languages: ["Java"],
2947
+ parameters: [
2948
+ {
2949
+ name: "matchDirectoryStructure",
2950
+ default: "true",
2951
+ description: "Control whether to check for directory and package name match."
2952
+ }
2953
+ ]
2954
+ },
2955
+ {
2956
+ id: "Checkstyle_PackageName",
2957
+ category: "CodeStyle",
2958
+ severityLevel: "Info",
2959
+ title: "Enforce Package Name Pattern",
2960
+ enabled: false,
2961
+ languages: ["Java"],
2962
+ parameters: [
2963
+ {
2964
+ name: "format",
2965
+ default: "^[a-z]+(\\.[a-zA-Z_]\\w*)*$",
2966
+ description: "Control the pattern to match valid identifiers."
2967
+ }
2968
+ ]
2969
+ },
2970
+ {
2971
+ id: "Checkstyle_ParameterAssignment",
2972
+ category: "BestPractice",
2973
+ severityLevel: "Warning",
2974
+ title: "Disallow Parameter Assignment",
2975
+ enabled: false,
2976
+ languages: ["Java"],
2977
+ parameters: []
2978
+ },
2979
+ {
2980
+ id: "Checkstyle_ParameterName",
2981
+ category: "CodeStyle",
2982
+ severityLevel: "Info",
2983
+ title: "Enforce Parameter Name Pattern",
2984
+ enabled: false,
2985
+ languages: ["Java"],
2986
+ parameters: [
2987
+ {
2988
+ name: "accessModifiers",
2989
+ default: "public, protected, package, private",
2990
+ description: "Access modifiers of methods where parameters are checked."
2991
+ },
2992
+ {
2993
+ name: "format",
2994
+ default: "^[a-z][a-zA-Z0-9]*$",
2995
+ description: "Sets the pattern to match valid identifiers."
2996
+ },
2997
+ {
2998
+ name: "ignoreOverridden",
2999
+ default: "false",
3000
+ description: "Allows to skip methods with Override annotation from validation."
3001
+ }
3002
+ ]
3003
+ },
3004
+ {
3005
+ id: "Checkstyle_ParameterNumber",
3006
+ category: "Complexity",
3007
+ severityLevel: "Warning",
3008
+ title: "Limit Number of Parameters",
3009
+ enabled: false,
3010
+ languages: ["Java"],
3011
+ parameters: [
3012
+ {
3013
+ name: "ignoreAnnotatedBy",
3014
+ default: "",
3015
+ description: "Ignore methods and constructors annotated with the specified annotation(s)."
3016
+ },
3017
+ {
3018
+ name: "ignoreOverriddenMethods",
3019
+ default: "false",
3020
+ description: "Ignore number of parameters for methods with @Override annotation."
3021
+ },
3022
+ {
3023
+ name: "max",
3024
+ default: "7",
3025
+ description: "Specify the maximum number of parameters allowed."
3026
+ },
3027
+ {
3028
+ name: "tokens",
3029
+ default: "METHOD_DEF, CTOR_DEF",
3030
+ description: "tokens to check"
3031
+ }
3032
+ ]
3033
+ },
3034
+ {
3035
+ id: "Checkstyle_ParenPad",
3036
+ category: "CodeStyle",
3037
+ severityLevel: "Info",
3038
+ title: "Enforce Parentheses Padding",
3039
+ enabled: false,
3040
+ languages: ["Java"],
3041
+ parameters: [
3042
+ {
3043
+ name: "option",
3044
+ default: "nospace",
3045
+ description: "Specify policy on how to pad parentheses."
3046
+ },
3047
+ {
3048
+ name: "tokens",
3049
+ default: "ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF, EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL, METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA, RECORD_DEF, RECORD_PATTERN_DEF",
3050
+ description: "tokens to check"
3051
+ }
3052
+ ]
3053
+ },
3054
+ {
3055
+ id: "Checkstyle_PatternVariableAssignment",
3056
+ category: "BestPractice",
3057
+ severityLevel: "Warning",
3058
+ title: "Avoid Pattern Variable Assignment",
3059
+ enabled: false,
3060
+ languages: ["Java"],
3061
+ parameters: []
3062
+ },
3063
+ {
3064
+ id: "Checkstyle_PatternVariableName",
3065
+ category: "CodeStyle",
3066
+ severityLevel: "Info",
3067
+ title: "Enforce Pattern for Variable Names",
3068
+ enabled: false,
3069
+ languages: ["Java"],
3070
+ parameters: [
3071
+ {
3072
+ name: "format",
3073
+ default: "^([a-z][a-zA-Z0-9]*|_)$",
3074
+ description: "Sets the pattern to match valid identifiers."
3075
+ }
3076
+ ]
3077
+ },
3078
+ {
3079
+ id: "Checkstyle_RecordComponentName",
3080
+ category: "CodeStyle",
3081
+ severityLevel: "Info",
3082
+ title: "Enforce Record Component Name Pattern",
3083
+ enabled: false,
3084
+ languages: ["Java"],
3085
+ parameters: [
3086
+ {
3087
+ name: "format",
3088
+ default: "^[a-z][a-zA-Z0-9]*$",
3089
+ description: "Sets the pattern to match valid identifiers."
3090
+ }
3091
+ ]
3092
+ },
3093
+ {
3094
+ id: "Checkstyle_RecordComponentNumber",
3095
+ category: "CodeStyle",
3096
+ severityLevel: "Info",
3097
+ title: "Enforce Maximum Number of Record Components",
3098
+ enabled: false,
3099
+ languages: ["Java"],
3100
+ parameters: [
3101
+ {
3102
+ name: "accessModifiers",
3103
+ default: "public, protected, package, private",
3104
+ description: "Access modifiers of record definitions where the number of record components should be checked."
3105
+ },
3106
+ {
3107
+ name: "max",
3108
+ default: "8",
3109
+ description: "Specify the maximum number of components allowed in the header of a record definition."
3110
+ }
3111
+ ]
3112
+ },
3113
+ {
3114
+ id: "Checkstyle_RecordTypeParameterName",
3115
+ category: "CodeStyle",
3116
+ severityLevel: "Info",
3117
+ title: "Enforce Record Type Parameter Name Pattern",
3118
+ enabled: false,
3119
+ languages: ["Java"],
3120
+ parameters: [
3121
+ {
3122
+ name: "format",
3123
+ default: "^[A-Z]$",
3124
+ description: "Sets the pattern to match valid identifiers."
3125
+ }
3126
+ ]
3127
+ },
3128
+ {
3129
+ id: "Checkstyle_RedundantImport",
3130
+ category: "CodeStyle",
3131
+ severityLevel: "Info",
3132
+ title: "Avoid Redundant Imports",
3133
+ enabled: false,
3134
+ languages: ["Java"],
3135
+ parameters: []
3136
+ },
3137
+ {
3138
+ id: "Checkstyle_RedundantModifier",
3139
+ category: "CodeStyle",
3140
+ severityLevel: "Info",
3141
+ title: "Avoid Redundant Modifiers",
3142
+ enabled: false,
3143
+ languages: ["Java"],
3144
+ parameters: [
3145
+ {
3146
+ name: "jdkVersion",
3147
+ default: "22",
3148
+ description: "jdkVersion"
3149
+ },
3150
+ {
3151
+ name: "tokens",
3152
+ default: "METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CTOR_DEF, CLASS_DEF, ENUM_DEF, RESOURCE, ANNOTATION_DEF, RECORD_DEF, PATTERN_VARIABLE_DEF, LITERAL_CATCH, LAMBDA",
3153
+ description: "tokens to check"
3154
+ }
3155
+ ]
3156
+ },
3157
+ {
3158
+ id: "Checkstyle_Regexp",
3159
+ category: "BestPractice",
3160
+ severityLevel: "Info",
3161
+ title: "Enforce Regular Expression Pattern Matching in Files",
3162
+ enabled: false,
3163
+ languages: ["Java"],
3164
+ parameters: [
3165
+ {
3166
+ name: "duplicateLimit",
3167
+ default: "0",
3168
+ description: "Control whether to check for duplicates of a required pattern, any negative value means no checking for duplicates, any positive value is used as the maximum number of allowed duplicates, if the limit is exceeded violations will be logged."
3169
+ },
3170
+ {
3171
+ name: "errorLimit",
3172
+ default: "100",
3173
+ description: "Specify the maximum number of violations before the check will abort."
3174
+ },
3175
+ {
3176
+ name: "format",
3177
+ default: "^$",
3178
+ description: "Specify the pattern to match against."
3179
+ },
3180
+ {
3181
+ name: "ignoreComments",
3182
+ default: "false",
3183
+ description: "Control whether to ignore matches found within comments."
3184
+ },
3185
+ {
3186
+ name: "illegalPattern",
3187
+ default: "false",
3188
+ description: "Control whether the pattern is required or illegal."
3189
+ },
3190
+ {
3191
+ name: "message",
3192
+ default: "null",
3193
+ description: "Specify message which is used to notify about violations, if empty then the default (hard-coded) message is used."
3194
+ }
3195
+ ]
3196
+ },
3197
+ {
3198
+ id: "Checkstyle_RegexpHeader",
3199
+ category: "CodeStyle",
3200
+ severityLevel: "Info",
3201
+ title: "Enforce Source File Header Pattern",
3202
+ enabled: false,
3203
+ languages: ["Java"],
3204
+ parameters: [
3205
+ {
3206
+ name: "fileExtensions",
3207
+ default: "",
3208
+ description: "Specify the file extensions of the files to process."
3209
+ },
3210
+ {
3211
+ name: "header",
3212
+ default: "null",
3213
+ description: "header"
3214
+ },
3215
+ {
3216
+ name: "headerFile",
3217
+ default: "null",
3218
+ description: "Specify the name of the file containing the required header."
3219
+ },
3220
+ {
3221
+ name: "multiLines",
3222
+ default: "",
3223
+ description: "Specify the line numbers to repeat (zero or more times)."
3224
+ }
3225
+ ]
3226
+ },
3227
+ {
3228
+ id: "Checkstyle_RegexpMultiline",
3229
+ category: "ErrorProne",
3230
+ severityLevel: "Warning",
3231
+ title: "Enforce Multiline Regular Expression Matching",
3232
+ enabled: false,
3233
+ languages: ["Java"],
3234
+ parameters: [
3235
+ {
3236
+ name: "fileExtensions",
3237
+ default: "",
3238
+ description: "Specify the file extensions of the files to process."
3239
+ },
3240
+ {
3241
+ name: "format",
3242
+ default: "$.",
3243
+ description: "Specify the format of the regular expression to match."
3244
+ },
3245
+ {
3246
+ name: "ignoreCase",
3247
+ default: "false",
3248
+ description: "Control whether to ignore case when searching."
3249
+ },
3250
+ {
3251
+ name: "matchAcrossLines",
3252
+ default: "false",
3253
+ description: "Control whether to match expressions across multiple lines."
3254
+ },
3255
+ {
3256
+ name: "maximum",
3257
+ default: "0",
3258
+ description: "Specify the maximum number of matches required in each file."
3259
+ },
3260
+ {
3261
+ name: "message",
3262
+ default: "null",
3263
+ description: "Specify the message which is used to notify about violations, if empty then default (hard-coded) message is used."
3264
+ },
3265
+ {
3266
+ name: "minimum",
3267
+ default: "0",
3268
+ description: "Specify the minimum number of matches required in each file."
3269
+ }
3270
+ ]
3271
+ },
3272
+ {
3273
+ id: "Checkstyle_RegexpOnFilename",
3274
+ category: "CodeStyle",
3275
+ severityLevel: "Info",
3276
+ title: "Enforce Filename Pattern Matching",
3277
+ enabled: false,
3278
+ languages: ["Java"],
3279
+ parameters: [
3280
+ {
3281
+ name: "fileExtensions",
3282
+ default: "",
3283
+ description: "Specify the file extensions of the files to process."
3284
+ },
3285
+ {
3286
+ name: "fileNamePattern",
3287
+ default: "null",
3288
+ description: "Specify the regular expression to match the file name against."
3289
+ },
3290
+ {
3291
+ name: "folderPattern",
3292
+ default: "null",
3293
+ description: "Specify the regular expression to match the folder path against."
3294
+ },
3295
+ {
3296
+ name: "ignoreFileNameExtensions",
3297
+ default: "false",
3298
+ description: "Control whether to ignore the file extension for the file name match."
3299
+ },
3300
+ {
3301
+ name: "match",
3302
+ default: "true",
3303
+ description: "Control whether to look for a match or mismatch on the file name, if the fileNamePattern is supplied, otherwise it is applied on the folderPattern."
3304
+ }
3305
+ ]
3306
+ },
3307
+ {
3308
+ id: "Checkstyle_RegexpSingleline",
3309
+ category: "BestPractice",
3310
+ severityLevel: "Warning",
3311
+ title: "Enforce Single-Line Pattern Matching",
3312
+ enabled: false,
3313
+ languages: ["Java"],
3314
+ parameters: [
3315
+ {
3316
+ name: "fileExtensions",
3317
+ default: "",
3318
+ description: "Specify the file extensions of the files to process."
3319
+ },
3320
+ {
3321
+ name: "format",
3322
+ default: "$.",
3323
+ description: "Specify the format of the regular expression to match."
3324
+ },
3325
+ {
3326
+ name: "ignoreCase",
3327
+ default: "false",
3328
+ description: "Control whether to ignore case when searching."
3329
+ },
3330
+ {
3331
+ name: "maximum",
3332
+ default: "0",
3333
+ description: "Specify the maximum number of matches required in each file."
3334
+ },
3335
+ {
3336
+ name: "message",
3337
+ default: "null",
3338
+ description: "Specify the message which is used to notify about violations, if empty then default (hard-coded) message is used."
3339
+ },
3340
+ {
3341
+ name: "minimum",
3342
+ default: "0",
3343
+ description: "Specify the minimum number of matches required in each file."
3344
+ }
3345
+ ]
3346
+ },
3347
+ {
3348
+ id: "Checkstyle_RegexpSinglelineJava",
3349
+ category: "BestPractice",
3350
+ severityLevel: "Info",
3351
+ title: "Detect Pattern Matches in Single Lines of Java Code",
3352
+ enabled: false,
3353
+ languages: ["Java"],
3354
+ parameters: [
3355
+ {
3356
+ name: "format",
3357
+ default: "$.",
3358
+ description: "Specify the format of the regular expression to match."
3359
+ },
3360
+ {
3361
+ name: "ignoreCase",
3362
+ default: "false",
3363
+ description: "Control whether to ignore case when searching."
3364
+ },
3365
+ {
3366
+ name: "ignoreComments",
3367
+ default: "false",
3368
+ description: "Control whether to ignore text in comments when searching."
3369
+ },
3370
+ {
3371
+ name: "maximum",
3372
+ default: "0",
3373
+ description: "Specify the maximum number of matches required in each file."
3374
+ },
3375
+ {
3376
+ name: "message",
3377
+ default: "null",
3378
+ description: "Specify the message which is used to notify about violations, if empty then default (hard-coded) message is used."
3379
+ },
3380
+ {
3381
+ name: "minimum",
3382
+ default: "0",
3383
+ description: "Specify the minimum number of matches required in each file."
3384
+ }
3385
+ ]
3386
+ },
3387
+ {
3388
+ id: "Checkstyle_RequireEmptyLineBeforeBlockTagGroup",
3389
+ category: "Documentation",
3390
+ severityLevel: "Info",
3391
+ title: "Require Empty Line Before Javadoc Block Tag Group",
3392
+ enabled: false,
3393
+ languages: ["Java"],
3394
+ parameters: [
3395
+ {
3396
+ name: "violateExecutionOnNonTightHtml",
3397
+ default: "false",
3398
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
3399
+ }
3400
+ ]
3401
+ },
3402
+ {
3403
+ id: "Checkstyle_RequireThis",
3404
+ category: "CodeStyle",
3405
+ severityLevel: "Info",
3406
+ title: "EnforceExplicitThisReference",
3407
+ enabled: false,
3408
+ languages: ["Java"],
3409
+ parameters: [
3410
+ {
3411
+ name: "checkFields",
3412
+ default: "true",
3413
+ description: "Control whether to check references to fields."
3414
+ },
3415
+ {
3416
+ name: "checkMethods",
3417
+ default: "true",
3418
+ description: "Control whether to check references to methods."
3419
+ },
3420
+ {
3421
+ name: "validateOnlyOverlapping",
3422
+ default: "true",
3423
+ description: "Control whether to check only overlapping by variables or arguments."
3424
+ }
3425
+ ]
3426
+ },
3427
+ {
3428
+ id: "Checkstyle_ReturnCount",
3429
+ category: "Complexity",
3430
+ severityLevel: "Warning",
3431
+ title: "Restrict Number of Return Statements",
3432
+ enabled: false,
3433
+ languages: ["Java"],
3434
+ parameters: [
3435
+ {
3436
+ name: "format",
3437
+ default: "^equals$",
3438
+ description: "Specify method names to ignore."
3439
+ },
3440
+ {
3441
+ name: "max",
3442
+ default: "2",
3443
+ description: "Specify maximum allowed number of return statements in non-void methods/lambdas."
3444
+ },
3445
+ {
3446
+ name: "maxForVoid",
3447
+ default: "1",
3448
+ description: "Specify maximum allowed number of return statements in void methods/constructors/lambdas."
3449
+ },
3450
+ {
3451
+ name: "tokens",
3452
+ default: "CTOR_DEF, METHOD_DEF, LAMBDA",
3453
+ description: "tokens to check"
3454
+ }
3455
+ ]
3456
+ },
3457
+ {
3458
+ id: "Checkstyle_RightCurly",
3459
+ category: "CodeStyle",
3460
+ severityLevel: "Info",
3461
+ title: "Enforce Right Curly Brace Placement",
3462
+ enabled: false,
3463
+ languages: ["Java"],
3464
+ parameters: [
3465
+ {
3466
+ name: "option",
3467
+ default: "same",
3468
+ description: "Specify the policy on placement of a right curly brace ('}')."
3469
+ },
3470
+ {
3471
+ name: "tokens",
3472
+ default: "LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE",
3473
+ description: "tokens to check"
3474
+ }
3475
+ ]
3476
+ },
3477
+ {
3478
+ id: "Checkstyle_SealedShouldHavePermitsList",
3479
+ category: "BestPractice",
3480
+ severityLevel: "Warning",
3481
+ title: "Enforce Sealed Classes to Have Permits List",
3482
+ enabled: false,
3483
+ languages: ["Java"],
3484
+ parameters: []
3485
+ },
3486
+ {
3487
+ id: "Checkstyle_SeparatorWrap",
3488
+ category: "CodeStyle",
3489
+ severityLevel: "Info",
3490
+ title: "Enforce Separator Line Wrapping",
3491
+ enabled: false,
3492
+ languages: ["Java"],
3493
+ parameters: [
3494
+ {
3495
+ name: "option",
3496
+ default: "eol",
3497
+ description: "Specify policy on how to wrap lines."
3498
+ },
3499
+ {
3500
+ name: "tokens",
3501
+ default: "DOT, COMMA",
3502
+ description: "tokens to check"
3503
+ }
3504
+ ]
3505
+ },
3506
+ {
3507
+ id: "Checkstyle_SimplifyBooleanExpression",
3508
+ category: "Comprehensibility",
3509
+ severityLevel: "Info",
3510
+ title: "Simplify Boolean Expression",
3511
+ enabled: false,
3512
+ languages: ["Java"],
3513
+ parameters: []
3514
+ },
3515
+ {
3516
+ id: "Checkstyle_SimplifyBooleanReturn",
3517
+ category: "CodeStyle",
3518
+ severityLevel: "Info",
3519
+ title: "Simplify Boolean Return Statements",
3520
+ enabled: false,
3521
+ languages: ["Java"],
3522
+ parameters: []
3523
+ },
3524
+ {
3525
+ id: "Checkstyle_SingleLineJavadoc",
3526
+ category: "Documentation",
3527
+ severityLevel: "Info",
3528
+ title: "Enforce Single-Line Javadoc Comments Without Block Tags",
3529
+ enabled: false,
3530
+ languages: ["Java"],
3531
+ parameters: [
3532
+ {
3533
+ name: "ignoredTags",
3534
+ default: "",
3535
+ description: "Specify block tags which are ignored by the check."
3536
+ },
3537
+ {
3538
+ name: "ignoreInlineTags",
3539
+ default: "true",
3540
+ description: "Control whether inline tags must be ignored."
3541
+ },
3542
+ {
3543
+ name: "violateExecutionOnNonTightHtml",
3544
+ default: "false",
3545
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
3546
+ }
3547
+ ]
3548
+ },
3549
+ {
3550
+ id: "Checkstyle_SingleSpaceSeparator",
3551
+ category: "CodeStyle",
3552
+ severityLevel: "Info",
3553
+ title: "Enforce Single Space Separator Between Non-Whitespace Characters",
3554
+ enabled: false,
3555
+ languages: ["Java"],
3556
+ parameters: [
3557
+ {
3558
+ name: "validateComments",
3559
+ default: "false",
3560
+ description: "Control whether to validate whitespaces surrounding comments."
3561
+ }
3562
+ ]
3563
+ },
3564
+ {
3565
+ id: "Checkstyle_StaticVariableName",
3566
+ category: "CodeStyle",
3567
+ severityLevel: "Info",
3568
+ title: "Enforce Static Variable Naming Conventions",
3569
+ enabled: false,
3570
+ languages: ["Java"],
3571
+ parameters: [
3572
+ {
3573
+ name: "applyToPackage",
3574
+ default: "true",
3575
+ description: "Control if check should apply to package-private members."
3576
+ },
3577
+ {
3578
+ name: "applyToPrivate",
3579
+ default: "true",
3580
+ description: "Control if check should apply to private members."
3581
+ },
3582
+ {
3583
+ name: "applyToProtected",
3584
+ default: "true",
3585
+ description: "Control if check should apply to protected members."
3586
+ },
3587
+ {
3588
+ name: "applyToPublic",
3589
+ default: "true",
3590
+ description: "Control if check should apply to public members."
3591
+ },
3592
+ {
3593
+ name: "format",
3594
+ default: "^[a-z][a-zA-Z0-9]*$",
3595
+ description: "Sets the pattern to match valid identifiers."
3596
+ }
3597
+ ]
3598
+ },
3599
+ {
3600
+ id: "Checkstyle_StringLiteralEquality",
3601
+ category: "ErrorProne",
3602
+ severityLevel: "High",
3603
+ title: "Avoid Using == or != for String Literal Equality",
3604
+ enabled: false,
3605
+ languages: ["Java"],
3606
+ parameters: []
3607
+ },
3608
+ {
3609
+ id: "Checkstyle_SummaryJavadoc",
3610
+ category: "Documentation",
3611
+ severityLevel: "Info",
3612
+ title: "Avoid Non-Recommended Phrases in Javadoc Summary",
3613
+ enabled: false,
3614
+ languages: ["Java"],
3615
+ parameters: [
3616
+ {
3617
+ name: "forbiddenSummaryFragments",
3618
+ default: "^$",
3619
+ description: "Specify the regexp for forbidden summary fragments."
3620
+ },
3621
+ {
3622
+ name: "period",
3623
+ default: ".",
3624
+ description: "period"
3625
+ },
3626
+ {
3627
+ name: "violateExecutionOnNonTightHtml",
3628
+ default: "false",
3629
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
3630
+ }
3631
+ ]
3632
+ },
3633
+ {
3634
+ id: "Checkstyle_SuperClone",
3635
+ category: "ErrorProne",
3636
+ severityLevel: "High",
3637
+ title: "Enforce Super Clone Invocation in Overriding clone() Method",
3638
+ enabled: false,
3639
+ languages: ["Java"],
3640
+ parameters: []
3641
+ },
3642
+ {
3643
+ id: "Checkstyle_SuperFinalize",
3644
+ category: "ErrorProne",
3645
+ severityLevel: "High",
3646
+ title: "Enforce Calling super.finalize() in Overriding finalize() Methods",
3647
+ enabled: false,
3648
+ languages: ["Java"],
3649
+ parameters: []
3650
+ },
3651
+ {
3652
+ id: "Checkstyle_SuppressWarnings",
3653
+ category: "BestPractice",
3654
+ severityLevel: "Warning",
3655
+ title: "Disallow Suppression of Specified Warnings",
3656
+ enabled: false,
3657
+ languages: ["Java"],
3658
+ parameters: [
3659
+ {
3660
+ name: "format",
3661
+ default: "^\\s*+$",
3662
+ description: "Specify the RegExp to match against warnings. Any warning being suppressed matching this pattern will be flagged."
3663
+ },
3664
+ {
3665
+ name: "tokens",
3666
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, ENUM_CONSTANT_DEF, PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, CTOR_DEF, COMPACT_CTOR_DEF, RECORD_DEF, PATTERN_VARIABLE_DEF",
3667
+ description: "tokens to check"
3668
+ }
3669
+ ]
3670
+ },
3671
+ {
3672
+ id: "Checkstyle_SuppressWarningsHolder",
3673
+ category: "BestPractice",
3674
+ severityLevel: "Info",
3675
+ title: "Manage SuppressWarnings Annotations",
3676
+ enabled: false,
3677
+ languages: ["Java"],
3678
+ parameters: [
3679
+ {
3680
+ name: "aliasList",
3681
+ default: "",
3682
+ description: "Specify aliases for check names that can be used in code within SuppressWarnings in a format of comma separated attribute=value entries. The attribute is the fully qualified name of the Check and value is its alias."
3683
+ }
3684
+ ]
3685
+ },
3686
+ {
3687
+ id: "Checkstyle_TextBlockGoogleStyleFormatting",
3688
+ category: "CodeStyle",
3689
+ severityLevel: "Info",
3690
+ title: "Enforce Google-style Java Text Block Formatting",
3691
+ enabled: false,
3692
+ languages: ["Java"],
3693
+ parameters: []
3694
+ },
3695
+ {
3696
+ id: "Checkstyle_ThrowsCount",
3697
+ category: "BestPractice",
3698
+ severityLevel: "Warning",
3699
+ title: "Restrict Throws Count in Method Declarations",
3700
+ enabled: false,
3701
+ languages: ["Java"],
3702
+ parameters: [
3703
+ {
3704
+ name: "ignorePrivateMethods",
3705
+ default: "true",
3706
+ description: "Allow private methods to be ignored."
3707
+ },
3708
+ {
3709
+ name: "max",
3710
+ default: "4",
3711
+ description: "Specify maximum allowed number of throws statements."
3712
+ }
3713
+ ]
3714
+ },
3715
+ {
3716
+ id: "Checkstyle_TodoComment",
3717
+ category: "BestPractice",
3718
+ severityLevel: "Warning",
3719
+ title: "Detect TODO Comments",
3720
+ enabled: false,
3721
+ languages: ["Java"],
3722
+ parameters: [
3723
+ {
3724
+ name: "format",
3725
+ default: "TODO:",
3726
+ description: "Specify pattern to match comments against."
3727
+ }
3728
+ ]
3729
+ },
3730
+ {
3731
+ id: "Checkstyle_TrailingComment",
3732
+ category: "CodeStyle",
3733
+ severityLevel: "Info",
3734
+ title: "AvoidTrailingEndOfLineComments",
3735
+ enabled: false,
3736
+ languages: ["Java"],
3737
+ parameters: [
3738
+ {
3739
+ name: "format",
3740
+ default: "^[\\s});]*$",
3741
+ description: "Specify pattern for strings allowed before the comment."
3742
+ },
3743
+ {
3744
+ name: "legalComment",
3745
+ default: "null",
3746
+ description: "Define pattern for text allowed in trailing comments. This pattern will not be applied to multiline comments."
3747
+ }
3748
+ ]
3749
+ },
3750
+ {
3751
+ id: "Checkstyle_Translation",
3752
+ category: "BestPractice",
3753
+ severityLevel: "Warning",
3754
+ title: "Enforce Consistent Translation Keys in Property Files",
3755
+ enabled: false,
3756
+ languages: ["Java"],
3757
+ parameters: [
3758
+ {
3759
+ name: "baseName",
3760
+ default: "^messages.*$",
3761
+ description: "Specify Base name of resource bundles which contain message resources. It helps the check to distinguish config and localization resources."
3762
+ },
3763
+ {
3764
+ name: "fileExtensions",
3765
+ default: ".properties",
3766
+ description: "Specify the file extensions of the files to process."
3767
+ },
3768
+ {
3769
+ name: "requiredTranslations",
3770
+ default: "",
3771
+ description: "Specify language codes of required translations which must exist in project."
3772
+ }
3773
+ ]
3774
+ },
3775
+ {
3776
+ id: "Checkstyle_TypeBodyPadding",
3777
+ category: "CodeStyle",
3778
+ severityLevel: "Info",
3779
+ title: "EnforceTypeBodyPadding",
3780
+ enabled: false,
3781
+ languages: ["Java"],
3782
+ parameters: [
3783
+ {
3784
+ name: "allowEmpty",
3785
+ default: "true",
3786
+ description: "Allow empty type bodies to omit blank line padding."
3787
+ },
3788
+ {
3789
+ name: "atEndOfBody",
3790
+ default: "true",
3791
+ description: "Require a blank line before the type body closing brace."
3792
+ },
3793
+ {
3794
+ name: "atStartOfBody",
3795
+ default: "true",
3796
+ description: "Require a blank line after the type body opening brace."
3797
+ },
3798
+ {
3799
+ name: "skipInner",
3800
+ default: "true",
3801
+ description: "Control whether to skip checking of inner types."
3802
+ },
3803
+ {
3804
+ name: "skipLocal",
3805
+ default: "true",
3806
+ description: "Control whether to skip checking of local types."
3807
+ },
3808
+ {
3809
+ name: "tokens",
3810
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, RECORD_DEF, ANNOTATION_DEF",
3811
+ description: "tokens to check"
3812
+ }
3813
+ ]
3814
+ },
3815
+ {
3816
+ id: "Checkstyle_TypecastParenPad",
3817
+ category: "CodeStyle",
3818
+ severityLevel: "Info",
3819
+ title: "Enforce Typecast Parentheses Padding",
3820
+ enabled: false,
3821
+ languages: ["Java"],
3822
+ parameters: [
3823
+ {
3824
+ name: "option",
3825
+ default: "nospace",
3826
+ description: "Specify policy on how to pad parentheses."
3827
+ }
3828
+ ]
3829
+ },
3830
+ {
3831
+ id: "Checkstyle_TypeName",
3832
+ category: "CodeStyle",
3833
+ severityLevel: "Info",
3834
+ title: "Enforce Type Name Pattern",
3835
+ enabled: false,
3836
+ languages: ["Java"],
3837
+ parameters: [
3838
+ {
3839
+ name: "applyToPackage",
3840
+ default: "true",
3841
+ description: "Control if check should apply to package-private members."
3842
+ },
3843
+ {
3844
+ name: "applyToPrivate",
3845
+ default: "true",
3846
+ description: "Control if check should apply to private members."
3847
+ },
3848
+ {
3849
+ name: "applyToProtected",
3850
+ default: "true",
3851
+ description: "Control if check should apply to protected members."
3852
+ },
3853
+ {
3854
+ name: "applyToPublic",
3855
+ default: "true",
3856
+ description: "Control if check should apply to public members."
3857
+ },
3858
+ {
3859
+ name: "format",
3860
+ default: "^[A-Z][a-zA-Z0-9]*$",
3861
+ description: "Sets the pattern to match valid identifiers."
3862
+ },
3863
+ {
3864
+ name: "tokens",
3865
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF",
3866
+ description: "tokens to check"
3867
+ }
3868
+ ]
3869
+ },
3870
+ {
3871
+ id: "Checkstyle_UncommentedMain",
3872
+ category: "BestPractice",
3873
+ severityLevel: "Warning",
3874
+ title: "Avoid Uncommented Main Methods",
3875
+ enabled: false,
3876
+ languages: ["Java"],
3877
+ parameters: [
3878
+ {
3879
+ name: "excludedClasses",
3880
+ default: "^$",
3881
+ description: "Specify pattern for qualified names of classes which are allowed to have a main method."
3882
+ }
3883
+ ]
3884
+ },
3885
+ {
3886
+ id: "Checkstyle_UniqueProperties",
3887
+ category: "ErrorProne",
3888
+ severityLevel: "Warning",
3889
+ title: "Detect Duplicate Keys in Properties Files",
3890
+ enabled: false,
3891
+ languages: ["Java"],
3892
+ parameters: [
3893
+ {
3894
+ name: "fileExtensions",
3895
+ default: ".properties",
3896
+ description: "Specify the file extensions of the files to process."
3897
+ }
3898
+ ]
3899
+ },
3900
+ {
3901
+ id: "Checkstyle_UnnecessaryNullCheckWithInstanceOf",
3902
+ category: "CodeStyle",
3903
+ severityLevel: "Info",
3904
+ title: "Avoid Unnecessary Null Check with instanceof",
3905
+ enabled: false,
3906
+ languages: ["Java"],
3907
+ parameters: []
3908
+ },
3909
+ {
3910
+ id: "Checkstyle_UnnecessaryParentheses",
3911
+ category: "CodeStyle",
3912
+ severityLevel: "Info",
3913
+ title: "Avoid Unnecessary Parentheses",
3914
+ enabled: false,
3915
+ languages: ["Java"],
3916
+ parameters: [
3917
+ {
3918
+ name: "tokens",
3919
+ default: "EXPR, IDENT, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, STRING_LITERAL, LITERAL_NULL, LITERAL_FALSE, LITERAL_TRUE, ASSIGN, BAND_ASSIGN, BOR_ASSIGN, BSR_ASSIGN, BXOR_ASSIGN, DIV_ASSIGN, MINUS_ASSIGN, MOD_ASSIGN, PLUS_ASSIGN, SL_ASSIGN, SR_ASSIGN, STAR_ASSIGN, LAMBDA, TEXT_BLOCK_LITERAL_BEGIN, LAND, LOR, LITERAL_INSTANCEOF, GT, LT, GE, LE, EQUAL, NOT_EQUAL, UNARY_MINUS, UNARY_PLUS, INC, DEC, LNOT, BNOT, POST_INC, POST_DEC, INDEX_OP, DOT",
3920
+ description: "tokens to check"
3921
+ }
3922
+ ]
3923
+ },
3924
+ {
3925
+ id: "Checkstyle_UnnecessarySemicolonAfterOuterTypeDeclaration",
3926
+ category: "CodeStyle",
3927
+ severityLevel: "Info",
3928
+ title: "Avoid Unnecessary Semicolon After Outer Type Declaration",
3929
+ enabled: false,
3930
+ languages: ["Java"],
3931
+ parameters: [
3932
+ {
3933
+ name: "tokens",
3934
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF",
3935
+ description: "tokens to check"
3936
+ }
3937
+ ]
3938
+ },
3939
+ {
3940
+ id: "Checkstyle_UnnecessarySemicolonAfterTypeMemberDeclaration",
3941
+ category: "CodeStyle",
3942
+ severityLevel: "Info",
3943
+ title: "Avoid Unnecessary Semicolon After Type Member Declaration",
3944
+ enabled: false,
3945
+ languages: ["Java"],
3946
+ parameters: [
3947
+ {
3948
+ name: "tokens",
3949
+ default: "CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, STATIC_INIT, INSTANCE_INIT, CTOR_DEF, METHOD_DEF, ENUM_CONSTANT_DEF, COMPACT_CTOR_DEF, RECORD_DEF",
3950
+ description: "tokens to check"
3951
+ }
3952
+ ]
3953
+ },
3954
+ {
3955
+ id: "Checkstyle_UnnecessarySemicolonInEnumeration",
3956
+ category: "CodeStyle",
3957
+ severityLevel: "Info",
3958
+ title: "Avoid Unnecessary Semicolon in Enumeration",
3959
+ enabled: false,
3960
+ languages: ["Java"],
3961
+ parameters: []
3962
+ },
3963
+ {
3964
+ id: "Checkstyle_UnnecessarySemicolonInTryWithResources",
3965
+ category: "CodeStyle",
3966
+ severityLevel: "Info",
3967
+ title: "Avoid Unnecessary Semicolon in Try-With-Resources",
3968
+ enabled: false,
3969
+ languages: ["Java"],
3970
+ parameters: [
3971
+ {
3972
+ name: "allowWhenNoBraceAfterSemicolon",
3973
+ default: "true",
3974
+ description: "Allow unnecessary semicolon if closing parenthesis is not on the same line."
3975
+ }
3976
+ ]
3977
+ },
3978
+ {
3979
+ id: "Checkstyle_UnnecessaryTypeArgumentsWithRecordPattern",
3980
+ category: "CodeStyle",
3981
+ severityLevel: "Info",
3982
+ title: "Avoid unnecessary explicit type arguments in record patterns",
3983
+ enabled: false,
3984
+ languages: ["Java"],
3985
+ parameters: []
3986
+ },
3987
+ {
3988
+ id: "Checkstyle_UnusedCatchParameterShouldBeUnnamed",
3989
+ category: "CodeStyle",
3990
+ severityLevel: "Info",
3991
+ title: "Enforce Unnamed Catch Parameters for Unused Variables",
3992
+ enabled: false,
3993
+ languages: ["Java"],
3994
+ parameters: []
3995
+ },
3996
+ {
3997
+ id: "Checkstyle_UnusedImports",
3998
+ category: "UnusedCode",
3999
+ severityLevel: "Warning",
4000
+ title: "Avoid Unused Imports",
4001
+ enabled: true,
4002
+ languages: ["Java"],
4003
+ parameters: [
4004
+ {
4005
+ name: "processJavadoc",
4006
+ default: "true",
4007
+ description: "Control whether to process Javadoc comments."
4008
+ },
4009
+ {
4010
+ name: "violateExecutionOnNonTightHtml",
4011
+ default: "false",
4012
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
4013
+ }
4014
+ ]
4015
+ },
4016
+ {
4017
+ id: "Checkstyle_UnusedLambdaParameterShouldBeUnnamed",
4018
+ category: "BestPractice",
4019
+ severityLevel: "Info",
4020
+ title: "Enforce Unnamed Lambda Parameters for Unused Parameters",
4021
+ enabled: false,
4022
+ languages: ["Java"],
4023
+ parameters: []
4024
+ },
4025
+ {
4026
+ id: "Checkstyle_UnusedLocalVariable",
4027
+ category: "UnusedCode",
4028
+ severityLevel: "Info",
4029
+ title: "Avoid Unused Local Variables",
4030
+ enabled: false,
4031
+ languages: ["Java"],
4032
+ parameters: [
4033
+ {
4034
+ name: "allowUnnamedVariables",
4035
+ default: "true",
4036
+ description: "Allow variables named with a single underscore (known as unnamed variables in Java 21+)."
4037
+ },
4038
+ {
4039
+ name: "jdkVersion",
4040
+ default: "22",
4041
+ description: "jdkVersion"
4042
+ }
4043
+ ]
4044
+ },
4045
+ {
4046
+ id: "Checkstyle_UnusedTryResourceShouldBeUnnamed",
4047
+ category: "BestPractice",
4048
+ severityLevel: "Warning",
4049
+ title: "Enforce unused try-with-resources be unnamed",
4050
+ enabled: false,
4051
+ languages: ["Java"],
4052
+ parameters: []
4053
+ },
4054
+ {
4055
+ id: "Checkstyle_UpperEll",
4056
+ category: "CodeStyle",
4057
+ severityLevel: "Info",
4058
+ title: "Enforce Uppercase 'L' for Long Constants",
4059
+ enabled: false,
4060
+ languages: ["Java"],
4061
+ parameters: []
4062
+ },
4063
+ {
4064
+ id: "Checkstyle_UseEnhancedSwitch",
4065
+ category: "BestPractice",
4066
+ severityLevel: "Info",
4067
+ title: "Use Enhanced Switch",
4068
+ enabled: false,
4069
+ languages: ["Java"],
4070
+ parameters: []
4071
+ },
4072
+ {
4073
+ id: "Checkstyle_VariableDeclarationUsageDistance",
4074
+ category: "Comprehensibility",
4075
+ severityLevel: "Info",
4076
+ title: "Enforce Variable Declaration Usage Proximity",
4077
+ enabled: false,
4078
+ languages: ["Java"],
4079
+ parameters: [
4080
+ {
4081
+ name: "allowedDistance",
4082
+ default: "3",
4083
+ description: "Specify the maximum distance between a variable's declaration and its first usage. Value should be greater than 0."
4084
+ },
4085
+ {
4086
+ name: "ignoreFinal",
4087
+ default: "true",
4088
+ description: "Allow to ignore variables with a 'final' modifier."
4089
+ },
4090
+ {
4091
+ name: "ignoreVariablePattern",
4092
+ default: "",
4093
+ description: "Define RegExp to ignore distance calculation for variables listed in this pattern."
4094
+ },
4095
+ {
4096
+ name: "validateBetweenScopes",
4097
+ default: "false",
4098
+ description: "Allow to calculate the distance between a variable's declaration and its first usage across different scopes."
4099
+ }
4100
+ ]
4101
+ },
4102
+ {
4103
+ id: "Checkstyle_VisibilityModifier",
4104
+ category: "BestPractice",
4105
+ severityLevel: "Warning",
4106
+ title: "Enforce Visibility Modifiers for Class Members",
4107
+ enabled: false,
4108
+ languages: ["Java"],
4109
+ parameters: [
4110
+ {
4111
+ name: "allowPublicFinalFields",
4112
+ default: "false",
4113
+ description: "Allow final fields to be declared as public."
4114
+ },
4115
+ {
4116
+ name: "allowPublicImmutableFields",
4117
+ default: "false",
4118
+ description: "Allow immutable fields to be declared as public if defined in final class."
4119
+ },
4120
+ {
4121
+ name: "ignoreAnnotationCanonicalNames",
4122
+ default: "com.google.common.annotations.VisibleForTesting, org.junit.ClassRule, org.junit.Rule",
4123
+ description: "Specify annotations canonical names which ignore variables in consideration."
4124
+ },
4125
+ {
4126
+ name: "immutableClassCanonicalNames",
4127
+ default: "java.io.File, java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short, java.lang.StackTraceElement, java.lang.String, java.math.BigDecimal, java.math.BigInteger, java.net.Inet4Address, java.net.Inet6Address, java.net.InetSocketAddress, java.net.URI, java.net.URL, java.util.Locale, java.util.UUID",
4128
+ description: "Specify immutable classes canonical names."
4129
+ },
4130
+ {
4131
+ name: "packageAllowed",
4132
+ default: "false",
4133
+ description: "Control whether package visible members are allowed."
4134
+ },
4135
+ {
4136
+ name: "protectedAllowed",
4137
+ default: "false",
4138
+ description: "Control whether protected members are allowed."
4139
+ },
4140
+ {
4141
+ name: "publicMemberPattern",
4142
+ default: "^serialVersionUID$",
4143
+ description: "Specify pattern for public members that should be ignored."
4144
+ }
4145
+ ]
4146
+ },
4147
+ {
4148
+ id: "Checkstyle_WhenShouldBeUsed",
4149
+ category: "BestPractice",
4150
+ severityLevel: "Info",
4151
+ title: "EnforceUseOfWhenInSwitchCase",
4152
+ enabled: false,
4153
+ languages: ["Java"],
4154
+ parameters: []
4155
+ },
4156
+ {
4157
+ id: "Checkstyle_WhitespaceAfter",
4158
+ category: "CodeStyle",
4159
+ severityLevel: "Info",
4160
+ title: "Enforce Whitespace After Tokens",
4161
+ enabled: false,
4162
+ languages: ["Java"],
4163
+ parameters: [
4164
+ {
4165
+ name: "tokens",
4166
+ default: "COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, LITERAL_FINALLY, LITERAL_RETURN, LITERAL_YIELD, LITERAL_CATCH, DO_WHILE, ELLIPSIS, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_CASE, LAMBDA, LITERAL_WHEN",
4167
+ description: "tokens to check"
4168
+ }
4169
+ ]
4170
+ },
4171
+ {
4172
+ id: "Checkstyle_WhitespaceAround",
4173
+ category: "CodeStyle",
4174
+ severityLevel: "Info",
4175
+ title: "Enforce Whitespace Around Tokens",
4176
+ enabled: false,
4177
+ languages: ["Java"],
4178
+ parameters: [
4179
+ {
4180
+ name: "allowEmptyCatches",
4181
+ default: "false",
4182
+ description: "Allow empty catch bodies."
4183
+ },
4184
+ {
4185
+ name: "allowEmptyConstructors",
4186
+ default: "false",
4187
+ description: "Allow empty constructor bodies."
4188
+ },
4189
+ {
4190
+ name: "allowEmptyLambdas",
4191
+ default: "false",
4192
+ description: "Allow empty lambda bodies."
4193
+ },
4194
+ {
4195
+ name: "allowEmptyLoops",
4196
+ default: "false",
4197
+ description: "Allow empty loop bodies."
4198
+ },
4199
+ {
4200
+ name: "allowEmptyMethods",
4201
+ default: "false",
4202
+ description: "Allow empty method bodies."
4203
+ },
4204
+ {
4205
+ name: "allowEmptySwitchBlockStatements",
4206
+ default: "false",
4207
+ description: "Allow empty switch blocks and block statements."
4208
+ },
4209
+ {
4210
+ name: "allowEmptyTypes",
4211
+ default: "false",
4212
+ description: "Allow empty class, interface and enum bodies."
4213
+ },
4214
+ {
4215
+ name: "ignoreEnhancedForColon",
4216
+ default: "true",
4217
+ description: "Ignore whitespace around colon in enhanced for loop."
4218
+ },
4219
+ {
4220
+ name: "tokens",
4221
+ default: "ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND, LITERAL_WHEN",
4222
+ description: "tokens to check"
4223
+ }
4224
+ ]
4225
+ },
4226
+ {
4227
+ id: "Checkstyle_WhitespaceBeforeEmptyBody",
4228
+ category: "CodeStyle",
4229
+ severityLevel: "Info",
4230
+ title: "Require whitespace before opening brace of empty body",
4231
+ enabled: false,
4232
+ languages: ["Java"],
4233
+ parameters: [
4234
+ {
4235
+ name: "tokens",
4236
+ default: "METHOD_DEF, CTOR_DEF, COMPACT_CTOR_DEF, CLASS_DEF, INTERFACE_DEF, RECORD_DEF, ENUM_DEF, ANNOTATION_DEF, LITERAL_NEW, LITERAL_DO, LITERAL_WHILE, LITERAL_FOR, LITERAL_IF, LITERAL_ELSE, STATIC_INIT, LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_SYNCHRONIZED, LITERAL_SWITCH, LAMBDA",
4237
+ description: "tokens to check"
4238
+ }
4239
+ ]
4240
+ },
4241
+ {
4242
+ id: "Checkstyle_WriteTag",
4243
+ category: "Documentation",
4244
+ severityLevel: "Info",
4245
+ title: "Enforce Presence and Format of User Defined Javadoc Tag",
4246
+ enabled: false,
4247
+ languages: ["Java"],
4248
+ parameters: [
4249
+ {
4250
+ name: "tag",
4251
+ default: "null",
4252
+ description: "Specify the name of tag."
4253
+ },
4254
+ {
4255
+ name: "tagFormat",
4256
+ default: "null",
4257
+ description: "Specify the regexp to match tag content."
4258
+ },
4259
+ {
4260
+ name: "tagSeverity",
4261
+ default: "info",
4262
+ description: "Specify the severity level when tag is found and printed."
4263
+ },
4264
+ {
4265
+ name: "tokens",
4266
+ default: "INTERFACE_DEF, CLASS_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF",
4267
+ description: "tokens to check"
4268
+ },
4269
+ {
4270
+ name: "violateExecutionOnNonTightHtml",
4271
+ default: "false",
4272
+ description: "Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules."
4273
+ }
4274
+ ]
4275
+ }
4276
+ ];
4277
+
4278
+ // src/metadata.ts
4279
+ var descriptor = {
4280
+ id: "Checkstyle",
4281
+ displayName: "Checkstyle",
4282
+ preferredVersion: "13.9.0",
4283
+ languages: ["Java"],
4284
+ filePatterns: ["**/*.java"],
4285
+ supportedOS: ["linux", "darwin", "win32"],
4286
+ supportedArch: ["x64", "arm64"],
4287
+ supportedRunners: ["local", "container"]
4288
+ };
4289
+
4290
+ // src/adapter.ts
4291
+ var TOOL_ID = "Checkstyle";
4292
+ var CHECKSTYLE_VERSION = "13.9.0";
4293
+ var JAR_NAME = `checkstyle-${CHECKSTYLE_VERSION}-all.jar`;
4294
+ var JAR_URL = `https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${CHECKSTYLE_VERSION}/${JAR_NAME}`;
4295
+ var JAVA_VERSION_RANGE = ">=21";
4296
+ var GLOBAL_MODULES = /* @__PURE__ */ new Set([
4297
+ "Header",
4298
+ "RegexpHeader",
4299
+ "MultiFileRegexpHeader",
4300
+ "JavadocPackage",
4301
+ "Translation",
4302
+ "RegexpMultiline",
4303
+ "RegexpSingleline",
4304
+ "RegexpOnFilename",
4305
+ "FileLength",
4306
+ "FileTabCharacter",
4307
+ "NewlineAtEndOfFile",
4308
+ "UniqueProperties",
4309
+ "LineLength",
4310
+ "OrderedProperties",
4311
+ "SeverityMatchFilter",
4312
+ "SuppressionCommentFilter",
4313
+ "SuppressionFilter",
4314
+ "SuppressWithNearbyCommentFilter",
4315
+ "SuppressWarningsFilter"
4316
+ ]);
4317
+ var PATTERN_ID_ALIASES = /* @__PURE__ */ new Map([
4318
+ ["UnnecessaryNullWithInstanceOf", "UnnecessaryNullCheckWithInstanceOf"]
4319
+ ]);
4320
+ var PATTERN_META = new Map(
4321
+ patterns_default.map((p) => [
4322
+ p.id,
4323
+ {
4324
+ category: p.category,
4325
+ severity: p.severityLevel ?? "Info"
4326
+ }
4327
+ ])
4328
+ );
4329
+ function ruleMetadata(patternId) {
4330
+ return PATTERN_META.get(patternId) ?? { category: "CodeStyle", severity: "Info" };
4331
+ }
4332
+ var xmlParser = new import_fast_xml_parser.XMLParser({
4333
+ ignoreAttributes: false,
4334
+ attributeNamePrefix: "@_",
4335
+ isArray: (name) => name === "file" || name === "error",
4336
+ processEntities: {
4337
+ enabled: true,
4338
+ maxTotalExpansions: 1e5
4339
+ }
4340
+ });
4341
+ function extractCheckName(source) {
4342
+ const lastDot = source.lastIndexOf(".");
4343
+ let name = lastDot >= 0 ? source.substring(lastDot + 1) : source;
4344
+ if (name.endsWith("Check")) {
4345
+ name = name.slice(0, -5);
4346
+ }
4347
+ return name;
4348
+ }
4349
+ async function resolveJarPath(ctx) {
4350
+ const codacyJar = import_path.default.join(ctx.toolInstallDir, JAR_NAME);
4351
+ try {
4352
+ await import_promises.default.access(codacyJar);
4353
+ return codacyJar;
4354
+ } catch {
4355
+ return null;
4356
+ }
4357
+ }
4358
+ var CHECK_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9]*$/;
4359
+ var MAX_CONFIG_REPAIRS = 8;
4360
+ function extractUninstantiableModule(stderr) {
4361
+ const match = stderr.match(/Unable to instantiate '([\w$.]+)' class/);
4362
+ if (!match) return void 0;
4363
+ const name = match[1];
4364
+ const lastDot = name.lastIndexOf(".");
4365
+ return lastDot >= 0 ? name.slice(lastDot + 1) : name;
4366
+ }
4367
+ function generateCheckstyleConfig(patterns) {
4368
+ const globalModules = [];
4369
+ const treeWalkerModules = [];
4370
+ for (const pattern of patterns) {
4371
+ const prefix = `${TOOL_ID}_`;
4372
+ if (!pattern.patternId.startsWith(prefix)) continue;
4373
+ const checkName = pattern.patternId.slice(prefix.length);
4374
+ if (!CHECK_NAME_PATTERN.test(checkName)) continue;
4375
+ if (GLOBAL_MODULES.has(checkName)) {
4376
+ globalModules.push(` <module name="${checkName}"/>`);
4377
+ } else {
4378
+ treeWalkerModules.push(` <module name="${checkName}"/>`);
4379
+ }
4380
+ }
4381
+ const lines = [
4382
+ `<?xml version="1.0"?>`,
4383
+ `<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">`,
4384
+ `<module name="Checker">`,
4385
+ ...globalModules,
4386
+ ` <module name="SuppressWarningsFilter"/>`,
4387
+ ` <module name="TreeWalker">`,
4388
+ ...treeWalkerModules,
4389
+ ` <module name="SuppressionCommentFilter"/>`,
4390
+ ` <module name="SuppressWarningsHolder"/>`,
4391
+ ` </module>`,
4392
+ `</module>`
4393
+ ];
4394
+ return lines.join("\n") + "\n";
4395
+ }
4396
+ var CONFIG_FILE_CANDIDATE = "checkstyle.xml";
4397
+ var adapter = {
4398
+ ...descriptor,
4399
+ patternsMetadata: patterns_default,
4400
+ compatibleVersions: ">=13.0.0",
4401
+ website: "https://checkstyle.org",
4402
+ prerequisites: [
4403
+ {
4404
+ name: "Java",
4405
+ versionRange: JAVA_VERSION_RANGE,
4406
+ preferredVersion: "21",
4407
+ checkCommand: "java -version"
4408
+ }
4409
+ ],
4410
+ /**
4411
+ * Checks whether Checkstyle is available by detecting Java and the JAR.
4412
+ *
4413
+ * Reports Java as a dependency. Checkstyle is considered available if:
4414
+ * 1. Java 11+ is found on the system or in the Codacy-managed JRE
4415
+ * 2. The Checkstyle fat JAR exists in the tool install directory
4416
+ */
4417
+ async checkAvailability(ctx) {
4418
+ ctx.logger.debug("Checking availability", { toolId: TOOL_ID });
4419
+ const { java: javaInfo, dependency: javaDep } = await (0, import_tooling.checkJavaRuntime)(
4420
+ ctx.globalDir,
4421
+ JAVA_VERSION_RANGE,
4422
+ ctx.logger
4423
+ );
4424
+ const dependencies = [javaDep];
4425
+ const jarPath = await resolveJarPath(ctx);
4426
+ if (jarPath && javaInfo) {
4427
+ ctx.logger.debug("Checkstyle available", { toolId: TOOL_ID, version: CHECKSTYLE_VERSION });
4428
+ return {
4429
+ available: true,
4430
+ version: CHECKSTYLE_VERSION,
4431
+ path: jarPath,
4432
+ installation: "codacy",
4433
+ dependencies
4434
+ };
4435
+ }
4436
+ if (javaInfo && !jarPath) {
4437
+ ctx.logger.debug("Checkstyle JAR not found", { toolId: TOOL_ID });
4438
+ return {
4439
+ available: false,
4440
+ reason: `Checkstyle JAR not found at ${import_path.default.join(ctx.toolInstallDir, JAR_NAME)}`,
4441
+ installHint: "codacy-analysis analyze . --install-dependencies # auto-download JAR",
4442
+ dependencies
4443
+ };
4444
+ }
4445
+ ctx.logger.debug("Checkstyle not found", { toolId: TOOL_ID });
4446
+ return {
4447
+ available: false,
4448
+ reason: "Java runtime and/or Checkstyle JAR not found",
4449
+ installHint: "Install Java 11+ and run: codacy-analysis analyze . --install-dependencies",
4450
+ dependencies
4451
+ };
4452
+ },
4453
+ /**
4454
+ * Installs Checkstyle by ensuring a JRE is available and downloading
4455
+ * the fat JAR from GitHub releases.
4456
+ *
4457
+ * Uses ensureJre() to download Adoptium Temurin JDK 17 if no system
4458
+ * Java 11+ is found, then downloads the Checkstyle all-in-one JAR.
4459
+ */
4460
+ async install(ctx) {
4461
+ ctx.logger.info("Starting install", { toolId: TOOL_ID });
4462
+ const java = await (0, import_tooling.ensureJre)(ctx.globalDir, JAVA_VERSION_RANGE, ctx.logger);
4463
+ if (!java) {
4464
+ return {
4465
+ success: false,
4466
+ error: {
4467
+ toolId: TOOL_ID,
4468
+ phase: "requirementCheck",
4469
+ kind: "MissingPrerequisite",
4470
+ message: `Java (${JAVA_VERSION_RANGE}) could not be found or downloaded. Checkstyle 10.x requires Java 11+.`,
4471
+ level: "error"
4472
+ }
4473
+ };
4474
+ }
4475
+ try {
4476
+ ctx.logger.info(`Downloading Checkstyle ${CHECKSTYLE_VERSION} JAR...`);
4477
+ const jarPath = await (0, import_tooling.downloadJar)(JAR_URL, ctx.toolInstallDir, JAR_NAME, ctx.logger);
4478
+ ctx.logger.info(`Downloaded Checkstyle to ${jarPath}`);
4479
+ await (0, import_tooling.pruneSupersededArtifacts)(
4480
+ ctx.toolInstallDir,
4481
+ JAR_NAME,
4482
+ (name) => /^checkstyle-.*-all\.jar$/.test(name),
4483
+ ctx.logger
4484
+ );
4485
+ return { success: true, installedPath: jarPath, installedVersion: CHECKSTYLE_VERSION };
4486
+ } catch (err) {
4487
+ return {
4488
+ success: false,
4489
+ error: {
4490
+ toolId: TOOL_ID,
4491
+ phase: "toolInstall",
4492
+ kind: "InstallError",
4493
+ message: `Failed to download Checkstyle JAR: ${err instanceof Error ? err.message : String(err)}`,
4494
+ level: "error"
4495
+ }
4496
+ };
4497
+ }
4498
+ },
4499
+ /**
4500
+ * Checks for a `checkstyle.xml` configuration file in the repository root.
4501
+ */
4502
+ async checkLocalConfigurationFile(ctx) {
4503
+ ctx.logger.debug("Checking for local config", { toolId: TOOL_ID });
4504
+ const candidatePath = import_path.default.join(ctx.repositoryRoot, CONFIG_FILE_CANDIDATE);
4505
+ try {
4506
+ await import_promises.default.access(candidatePath);
4507
+ ctx.logger.debug("Local config found", { toolId: TOOL_ID, path: candidatePath });
4508
+ return { found: true, path: candidatePath };
4509
+ } catch {
4510
+ return { found: false };
4511
+ }
4512
+ },
4513
+ /**
4514
+ * Runs Checkstyle via `java -jar checkstyle-13.9.0-all.jar` against the
4515
+ * target files and converts the XML output into Codacy Issue objects.
4516
+ *
4517
+ * Config resolution:
4518
+ * - If `useLocalConfigurationFile` is true and a local config is found,
4519
+ * passes `-c <path>` to use the project's checkstyle.xml.
4520
+ * - If patterns are specified and no local config is in use, generates
4521
+ * a temporary checkstyle.xml with the enabled modules.
4522
+ * - Otherwise (no local config and no patterns), skips execution.
4523
+ *
4524
+ * Exit codes:
4525
+ * - 0: no violations found
4526
+ * - >0: violations found (normal — parse XML output)
4527
+ * - -1: bad arguments
4528
+ * - -2: internal crash
4529
+ *
4530
+ * The XML output contains `<file>` elements with `<error>` children.
4531
+ * `file/@name` is an absolute path converted to repo-relative.
4532
+ * `error/@source` is an FQCN from which we extract the check name.
4533
+ *
4534
+ * Never throws — all errors are captured in the returned `errors` array.
4535
+ */
4536
+ async analyze(ctx, codacyConfig) {
4537
+ const startMs = Date.now();
4538
+ ctx.logger.info("Starting analysis", { toolId: TOOL_ID, fileCount: ctx.targetFiles.length });
4539
+ const startedAt = /* @__PURE__ */ new Date();
4540
+ const issues = [];
4541
+ const errors = [];
4542
+ if (ctx.targetFiles.length === 0) {
4543
+ return (0, import_tooling.buildResult)(TOOL_ID, startedAt, /* @__PURE__ */ new Date(), issues, errors, 0);
4544
+ }
4545
+ const useLocal = codacyConfig.useLocalConfigurationFile && codacyConfig.localConfigurationFile;
4546
+ const resolved = await (0, import_tooling.resolveJava)(ctx.globalDir, JAVA_VERSION_RANGE, ctx.logger);
4547
+ const javaBinary = resolved?.path ?? "java";
4548
+ const jarPath = await resolveJarPath(ctx);
4549
+ if (!jarPath) {
4550
+ errors.push({
4551
+ toolId: TOOL_ID,
4552
+ phase: "toolInvoke",
4553
+ kind: "MissingPrerequisite",
4554
+ message: `Checkstyle JAR not found at ${import_path.default.join(ctx.toolInstallDir, JAR_NAME)}. Run install first.`,
4555
+ level: "error"
4556
+ });
4557
+ return (0, import_tooling.buildResult)(TOOL_ID, startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
4558
+ }
4559
+ const absoluteFiles = ctx.targetFiles.map((f) => import_path.default.resolve(ctx.repositoryRoot, f));
4560
+ const args = ["-jar", jarPath];
4561
+ let generatedConfigPath = null;
4562
+ if (useLocal) {
4563
+ args.push("-c", codacyConfig.localConfigurationFile);
4564
+ } else if (codacyConfig.patterns.length > 0) {
4565
+ const configXml = generateCheckstyleConfig(codacyConfig.patterns);
4566
+ generatedConfigPath = import_path.default.join(ctx.generatedConfigDir, "checkstyle.xml");
4567
+ await import_promises.default.mkdir(ctx.generatedConfigDir, { recursive: true });
4568
+ await import_promises.default.writeFile(generatedConfigPath, configXml, "utf-8");
4569
+ args.push("-c", generatedConfigPath);
4570
+ } else {
4571
+ ctx.logger.info("Skipping analysis: no local config and no patterns enabled", {
4572
+ toolId: TOOL_ID
4573
+ });
4574
+ return (0, import_tooling.buildResult)(TOOL_ID, startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
4575
+ }
4576
+ args.push("-f", "xml");
4577
+ const fileChunks = (0, import_tooling.chunkFilesForArgv)(absoluteFiles);
4578
+ try {
4579
+ const checkstyleFiles = [];
4580
+ let activePatterns = codacyConfig.patterns;
4581
+ let configRepairs = 0;
4582
+ for (let chunkIdx = 0; chunkIdx < fileChunks.length; chunkIdx++) {
4583
+ const chunk = fileChunks[chunkIdx];
4584
+ const { stdout, stderr, exitCode } = await (0, import_tooling.spawnTool)(javaBinary, [...args, ...chunk], {
4585
+ cwd: ctx.repositoryRoot,
4586
+ logger: ctx.logger
4587
+ });
4588
+ if (generatedConfigPath && configRepairs < MAX_CONFIG_REPAIRS) {
4589
+ const badModule = extractUninstantiableModule(stderr);
4590
+ if (badModule) {
4591
+ configRepairs++;
4592
+ const before = activePatterns.length;
4593
+ activePatterns = activePatterns.filter(
4594
+ (p) => p.patternId !== `${TOOL_ID}_${badModule}`
4595
+ );
4596
+ ctx.logger.debug("Retrying without a module this Checkstyle version lacks", {
4597
+ toolId: TOOL_ID,
4598
+ module: badModule,
4599
+ attempt: configRepairs
4600
+ });
4601
+ if (activePatterns.length < before && activePatterns.length > 0) {
4602
+ await import_promises.default.writeFile(
4603
+ generatedConfigPath,
4604
+ generateCheckstyleConfig(activePatterns),
4605
+ "utf-8"
4606
+ );
4607
+ chunkIdx--;
4608
+ continue;
4609
+ }
4610
+ }
4611
+ }
4612
+ if (exitCode < 0) {
4613
+ errors.push({
4614
+ toolId: TOOL_ID,
4615
+ phase: "toolInvoke",
4616
+ kind: "NonZeroExit",
4617
+ message: `Checkstyle exited with code ${exitCode}${stderr ? `: ${stderr.trim()}` : ""}`,
4618
+ level: "error"
4619
+ });
4620
+ return (0, import_tooling.buildResult)(
4621
+ TOOL_ID,
4622
+ startedAt,
4623
+ /* @__PURE__ */ new Date(),
4624
+ issues,
4625
+ errors,
4626
+ ctx.targetFiles.length
4627
+ );
4628
+ }
4629
+ if (!stdout.trim()) {
4630
+ if (exitCode > 0) {
4631
+ errors.push({
4632
+ toolId: TOOL_ID,
4633
+ phase: "toolInvoke",
4634
+ kind: "NonZeroExit",
4635
+ message: stderr.trim() ? `Checkstyle exited with code ${exitCode}: ${stderr.trim()}` : `Checkstyle exited with code ${exitCode} and produced no output`,
4636
+ level: "error"
4637
+ });
4638
+ return (0, import_tooling.buildResult)(
4639
+ TOOL_ID,
4640
+ startedAt,
4641
+ /* @__PURE__ */ new Date(),
4642
+ issues,
4643
+ errors,
4644
+ ctx.targetFiles.length
4645
+ );
4646
+ }
4647
+ continue;
4648
+ }
4649
+ let parsedFiles;
4650
+ try {
4651
+ const parsed = xmlParser.parse(stdout);
4652
+ parsedFiles = parsed?.checkstyle?.file ?? [];
4653
+ } catch (err) {
4654
+ errors.push({
4655
+ toolId: TOOL_ID,
4656
+ phase: "outputParse",
4657
+ kind: "MalformedOutput",
4658
+ message: `Failed to parse Checkstyle XML output: ${err instanceof Error ? err.message : String(err)}`,
4659
+ level: "error"
4660
+ });
4661
+ return (0, import_tooling.buildResult)(
4662
+ TOOL_ID,
4663
+ startedAt,
4664
+ /* @__PURE__ */ new Date(),
4665
+ issues,
4666
+ errors,
4667
+ ctx.targetFiles.length
4668
+ );
4669
+ }
4670
+ const stderrFiltered = stderr.split("\n").filter((line) => {
4671
+ const trimmed = line.trim();
4672
+ if (!trimmed) return false;
4673
+ if (trimmed.startsWith("Starting audit...")) return false;
4674
+ if (trimmed.startsWith("Audit done.")) return false;
4675
+ if (trimmed.startsWith("Checkstyle ends with")) return false;
4676
+ return true;
4677
+ }).join("\n").trim();
4678
+ if (stderrFiltered) {
4679
+ errors.push({
4680
+ toolId: TOOL_ID,
4681
+ phase: "outputParse",
4682
+ kind: "ParseWarning",
4683
+ message: `Checkstyle stderr: ${stderrFiltered}`,
4684
+ level: "warning"
4685
+ });
4686
+ }
4687
+ checkstyleFiles.push(...parsedFiles);
4688
+ }
4689
+ const enabledPatterns = new Set(codacyConfig.patterns.map((p) => p.patternId));
4690
+ for (const file of checkstyleFiles) {
4691
+ const absoluteFilePath = file["@_name"];
4692
+ if (!absoluteFilePath) continue;
4693
+ const fileErrors = file.error ?? [];
4694
+ if (fileErrors.length === 0) continue;
4695
+ const lines = await (0, import_tooling.readFileLines)(absoluteFilePath);
4696
+ const relPath = import_path.default.relative(ctx.repositoryRoot, absoluteFilePath);
4697
+ for (const error of fileErrors) {
4698
+ const source = error["@_source"];
4699
+ if (!source) continue;
4700
+ let checkName = extractCheckName(source);
4701
+ checkName = PATTERN_ID_ALIASES.get(checkName) ?? checkName;
4702
+ const patternId = `${TOOL_ID}_${checkName}`;
4703
+ if (enabledPatterns.size > 0 && !enabledPatterns.has(patternId)) {
4704
+ continue;
4705
+ }
4706
+ const line = parseInt(error["@_line"], 10) || 1;
4707
+ const column = parseInt(error["@_column"] ?? "1", 10) || 1;
4708
+ const meta = ruleMetadata(patternId);
4709
+ issues.push({
4710
+ filePath: relPath,
4711
+ patternId,
4712
+ toolId: TOOL_ID,
4713
+ line,
4714
+ column,
4715
+ message: error["@_message"],
4716
+ lineContent: (0, import_tooling.getLineContent)(lines, line),
4717
+ category: meta.category,
4718
+ severity: meta.severity
4719
+ });
4720
+ }
4721
+ }
4722
+ } catch (err) {
4723
+ errors.push({
4724
+ toolId: TOOL_ID,
4725
+ phase: "toolInvoke",
4726
+ kind: "InvocationError",
4727
+ message: `Failed to run Checkstyle: ${err instanceof Error ? err.message : String(err)}`,
4728
+ level: "error"
4729
+ });
4730
+ } finally {
4731
+ if (generatedConfigPath) {
4732
+ await import_promises.default.unlink(generatedConfigPath).catch(() => {
4733
+ });
4734
+ }
4735
+ }
4736
+ const durationMs = Date.now() - startMs;
4737
+ ctx.logger.info("Analysis complete", {
4738
+ toolId: TOOL_ID,
4739
+ issueCount: issues.length,
4740
+ errorCount: errors.length,
4741
+ durationMs
4742
+ });
4743
+ return (0, import_tooling.buildResult)(TOOL_ID, startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
4744
+ }
4745
+ };
4746
+
4747
+ // src/index.ts
4748
+ var index_default = (0, import_tooling2.defineToolAdapter)(adapter);