-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetekt.yml
More file actions
688 lines (674 loc) · 22.1 KB
/
Copy pathdetekt.yml
File metadata and controls
688 lines (674 loc) · 22.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
# Detekt Configuration for interlockSim Kotlin Migration
#
# This configuration is designed for a conservative Java-to-Kotlin migration
# of a legacy 2007 codebase. Settings prioritize:
# - Preserving existing Java structure and patterns
# - Catching critical issues (bugs, potential crashes)
# - Avoiding overly strict style enforcement
# - Maintaining readability for developers familiar with Java
#
# Philosophy: We're converting Java syntax to Kotlin, not redesigning the system.
#
# See: https://detekt.dev/docs/intro
build:
maxIssues: 0 # Fail build if any issues found (can be increased during migration)
excludeCorrectable: false
weights:
complexity: 2
LongParameterList: 1
style: 1
comments: 1
config:
validation: true
warningsAsErrors: false
checkExhaustiveness: false
processors:
active: true
exclude:
- 'DetektProgressListener'
console-reports:
active: true
exclude:
- 'ProjectStatisticsReport'
- 'ComplexityReport'
- 'NotificationReport'
- 'FindingsReport'
- 'FileBasedFindingsReport'
comments:
active: true
AbsentOrWrongFileLicense:
active: false # Don't enforce file license headers during migration
CommentOverPrivateFunction:
active: false # Allow private functions without comments
CommentOverPrivateProperty:
active: false # Allow private properties without comments
DeprecatedBlockTag:
active: false # Allow @deprecated JavaDoc tags (legacy pattern)
EndOfSentenceFormat:
active: false # Don't enforce comment formatting
OutdatedDocumentation:
active: false # Don't check for outdated docs during migration
UndocumentedPublicClass:
active: false # Don't require docs for public classes (legacy code)
UndocumentedPublicFunction:
active: false # Don't require docs for public functions (legacy code)
UndocumentedPublicProperty:
active: false # Don't require docs for public properties (legacy code)
complexity:
active: true
ComplexCondition:
active: true
threshold: 8 # Increased from default 4 (legacy code complexity)
ComplexInterface:
active: true
threshold: 20 # Increased from default 10 (legacy interfaces)
includeStaticDeclarations: false
includePrivateDeclarations: false
CyclomaticComplexMethod:
active: true
threshold: 25 # Increased from default 15 (legacy methods)
ignoreSingleWhenExpression: true
ignoreSimpleWhenEntries: true
ignoreNestingFunctions: false
LabeledExpression:
active: false # Allow labeled expressions (useful in nested loops)
LargeClass:
active: true
threshold: 800 # Increased from default 600 (legacy class sizes)
LongMethod:
active: true
threshold: 100 # Increased from default 60 (legacy method lengths)
LongParameterList:
active: true
functionThreshold: 8 # Increased from default 6 (legacy constructors)
constructorThreshold: 10 # Increased from default 7
ignoreDefaultParameters: true
ignoreDataClasses: true
MethodOverloading:
active: false # Allow method overloading (common in Java conversions)
NamedArguments:
active: false # Don't enforce named arguments (optional during migration)
NestedBlockDepth:
active: true
threshold: 6 # Increased from default 4 (legacy nesting)
NestedScopeFunctions:
active: true
threshold: 2 # Limit nested scope functions (let, apply, etc.)
ReplaceSafeCallChainWithRun:
active: false # Don't enforce Kotlin idioms during initial conversion
StringLiteralDuplication:
active: false # Don't enforce string constant extraction (can do later)
TooManyFunctions:
active: true
thresholdInFiles: 25 # Increased from default 11
thresholdInClasses: 25 # Increased from default 11
thresholdInInterfaces: 20 # Increased from default 11
thresholdInObjects: 20 # Increased from default 11
thresholdInEnums: 20 # Increased from default 11
ignoreDeprecated: true
ignorePrivate: true
ignoreOverridden: true
coroutines:
active: false # Not using coroutines in initial migration
GlobalCoroutineUsage:
active: false
InjectDispatcher:
active: false
RedundantSuspendModifier:
active: false
SleepInsteadOfDelay:
active: false
SuspendFunWithCoroutineScopeReceiver:
active: false
SuspendFunWithFlowReturnType:
active: false
empty-blocks:
active: true
EmptyCatchBlock:
active: true
allowedExceptionNameRegex: '_|(ignore|expected).*' # Allow empty catch with clear names
EmptyClassBlock:
active: false # Allow empty class blocks (may exist during conversion)
EmptyDefaultConstructor:
active: true
EmptyDoWhileBlock:
active: true
EmptyElseBlock:
active: false # Allow empty else blocks
EmptyFinallyBlock:
active: true
EmptyForBlock:
active: true
EmptyFunctionBlock:
active: false # Allow empty function blocks (abstract/interface methods)
EmptyIfBlock:
active: true
EmptyInitBlock:
active: true
EmptyKtFile:
active: true
EmptySecondaryConstructor:
active: false # Allow empty secondary constructors
EmptyTryBlock:
active: true
EmptyWhenBlock:
active: true
EmptyWhileBlock:
active: true
exceptions:
active: true
ExceptionRaisedInUnexpectedLocation:
active: true
methodNames: ['equals', 'finalize', 'hashCode', 'toString']
InstanceOfCheckForException:
active: false # Allow instanceof checks for exceptions (Java pattern)
NotImplementedDeclaration:
active: true
ObjectExtendsThrowable:
active: true
PrintStackTrace:
active: false # Allow printStackTrace (exists in legacy code)
RethrowCaughtException:
active: false # Allow rethrowing (may be needed during migration)
ReturnFromFinally:
active: true
SwallowedException:
active: false # Don't enforce exception handling changes during conversion
ThrowingExceptionFromFinally:
active: true
ThrowingExceptionInMain:
active: false # Allow throwing from main (application entry point pattern)
ThrowingExceptionsWithoutMessageOrCause:
active: false # Allow exceptions without messages (legacy pattern)
ThrowingNewInstanceOfSameException:
active: true
TooGenericExceptionCaught:
active: false # Allow catching generic exceptions (legacy pattern)
TooGenericExceptionThrown:
active: false # Allow throwing generic exceptions (legacy APIs)
naming:
active: true
BooleanPropertyNaming:
active: false # Don't enforce is/has prefix during conversion
ClassNaming:
active: true
classPattern: '[A-Z][a-zA-Z0-9]*' # Standard class naming
ConstructorParameterNaming:
active: false # Don't enforce during conversion (Java may use different patterns)
EnumNaming:
active: false # Don't enforce UPPER_CASE enums (Java uses mixed case)
ForbiddenClassName:
active: false # Don't forbid any class names
FunctionMaxLength:
active: false # Don't enforce max function name length
FunctionMinLength:
active: false # Don't enforce min function name length
FunctionNaming:
active: false # Don't enforce naming during conversion (Java may use different patterns)
FunctionParameterNaming:
active: false # Don't enforce during conversion
InvalidPackageDeclaration:
active: true
rootPackage: 'cz.vutbr.fit.interlockSim'
LambdaParameterNaming:
active: false # Don't enforce lambda parameter naming during conversion
MatchingDeclarationName:
active: false # Don't enforce (package-info.kt files don't match)
MemberNameEqualsClassName:
active: false # Allow during conversion (may be intentional)
NoNameShadowing:
active: false # Allow name shadowing (may occur in conversion)
NonBooleanPropertyPrefixedWithIs:
active: false # Don't enforce this during conversion
ObjectPropertyNaming:
active: false # Don't enforce naming during conversion
PackageNaming:
active: true
packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*'
TopLevelPropertyNaming:
active: false # Don't enforce UPPER_CASE constants (Java uses different patterns)
VariableMaxLength:
active: false # Don't enforce max variable name length
VariableMinLength:
active: false # Don't enforce min variable name length (allow i, j, k, etc.)
VariableNaming:
active: false # Don't enforce camelCase (Java may use different patterns)
performance:
active: true
ArrayPrimitive:
active: false # Don't enforce primitive arrays (may not be needed)
CouldBeSequence:
active: false # Don't enforce sequence usage during conversion
ForEachOnRange:
active: false # Allow forEach on ranges (readable)
SpreadOperator:
active: false # Allow spread operator (may be needed)
UnnecessaryPartOfBinaryExpression:
active: true
UnnecessaryTemporaryInstantiation:
active: true
potential-bugs:
active: true
AvoidReferentialEquality:
active: false # Allow === during conversion (may be intentional)
CastNullableToNonNullableType:
active: true
CastToNullableType:
active: false # Allow casting to nullable types
Deprecation:
active: false # Don't fail on deprecations (many in legacy code)
DontDowncastCollectionTypes:
active: true
DoubleMutabilityForCollection:
active: false # Allow during conversion
ElseCaseInsteadOfExhaustiveWhen:
active: false # Don't require exhaustive when during conversion
EqualsAlwaysReturnsTrueOrFalse:
active: true
EqualsWithHashCodeExist:
active: true
ExitOutsideMain:
active: false # Allow System.exit outside main (legacy pattern)
ExplicitGarbageCollectionCall:
active: true
HasPlatformType:
active: false # Platform types will exist during Java interop
IgnoredReturnValue:
active: false # Don't enforce return value usage during conversion
ImplicitDefaultLocale:
active: false # Don't enforce locale specification
ImplicitUnitReturnType:
active: false # Allow implicit Unit return
InvalidRange:
active: true
IteratorHasNextCallsNextMethod:
active: true
IteratorNotThrowingNoSuchElementException:
active: true
LateinitUsage:
active: false # Allow lateinit (useful in conversion)
MapGetWithNotNullAssertionOperator:
active: false # Allow !! on map.get (may be needed)
MissingPackageDeclaration:
active: true
NullCheckOnMutableProperty:
active: false # Allow during conversion
NullableToStringCall:
active: false # Allow during conversion
PropertyUsedBeforeDeclaration:
active: true
UnconditionalJumpStatementInLoop:
active: true
UnnecessaryNotNullCheck:
active: false # Allow during conversion
UnnecessaryNotNullOperator:
active: false # Allow during conversion
UnnecessarySafeCall:
active: false # Allow during conversion
UnreachableCatchBlock:
active: true
UnreachableCode:
active: true
UnsafeCallOnNullableType:
active: false # Will be many during conversion - fix gradually
UnsafeCast:
active: false # Allow unsafe casts during conversion
UnusedUnaryOperator:
active: true
UselessPostfixExpression:
active: true
WrongEqualsTypeParameter:
active: true
style:
active: true
AlsoCouldBeApply:
active: false # Don't enforce scope function preferences
BracesOnIfStatements:
active: false # Allow both styles during conversion
BracesOnWhenStatements:
active: false # Allow both styles during conversion
CanBeNonNullable:
active: false # Don't enforce during conversion
CascadingCallWrapping:
active: false # Don't enforce call wrapping style
ClassOrdering:
active: false # Don't enforce class member ordering (matches Java)
CollapsibleIfStatements:
active: false # Don't enforce during conversion
DataClassContainsFunctions:
active: false # Allow functions in data classes
DataClassShouldBeImmutable:
active: false # Don't enforce immutability during conversion
DestructuringDeclarationWithTooManyEntries:
active: false # Allow during conversion
DoubleNegativeLambda:
active: false # Allow during conversion
EqualsNullCall:
active: true
EqualsOnSignatureLine:
active: false # Don't enforce formatting
ExplicitCollectionElementAccessMethod:
active: false # Allow both [] and get()
ExplicitItLambdaParameter:
active: false # Allow implicit 'it'
ExpressionBodySyntax:
active: false # Don't enforce expression body during conversion
ForbiddenAnnotation:
active: false # Don't forbid annotations
ForbiddenComment:
active: false # Don't forbid comment patterns
ForbiddenImport:
active: false # Don't forbid imports
ForbiddenMethodCall:
active: false # Don't forbid method calls
ForbiddenSuppress:
active: false # Allow @Suppress annotations
ForbiddenVoid:
active: false # Allow Void type during conversion
FunctionOnlyReturningConstant:
active: false # Allow during conversion
LoopWithTooManyJumpStatements:
active: false # Allow complex loops (legacy pattern)
MagicNumber:
active: false # Don't enforce constant extraction during conversion
MandatoryBracesLoops:
active: false # Don't enforce braces on single-line loops
MaxChainedCallsOnSameLine:
active: false # Don't enforce during conversion
MaxLineLength:
active: true
maxLineLength: 120 # Match .editorconfig
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: true # Don't check comments (JavaDoc @link can be long)
excludeRawStrings: true
MayBeConst:
active: false # Don't enforce const during conversion
ModifierOrder:
active: true
MultilineLambdaItParameter:
active: false # Allow 'it' in multiline lambdas
MultilineRawStringIndentation:
active: false # Don't enforce raw string indentation
NestedClassesVisibility:
active: false # Allow nested class visibility patterns from Java
NewLineAtEndOfFile:
active: true
NoTabs:
active: false # ALLOW TABS (matches Java style and .editorconfig)
# CRITICAL: This must be FALSE to allow tab indentation
# Java code from develop branch uses tabs with 4-space visual width
# .editorconfig specifies indent_style = tab for both Java and Kotlin
NullableBooleanCheck:
active: false # Allow during conversion
ObjectLiteralToLambda:
active: false # Allow object literals (Java SAM conversion)
OptionalAbstractKeyword:
active: false # Allow explicit 'abstract' keyword
OptionalUnit:
active: false # Allow explicit ': Unit'
PreferToOverPairSyntax:
active: false # Allow both Pair() and to syntax
ProtectedMemberInFinalClass:
active: false # Allow protected members (may be needed during conversion)
RedundantExplicitType:
active: false # Allow explicit types during conversion
RedundantHigherOrderMapUsage:
active: false # Don't enforce during conversion
RedundantVisibilityModifierRule:
active: false # Allow explicit visibility modifiers
ReturnCount:
active: false # Don't limit return statements (legacy pattern)
SafeCast:
active: false # Don't enforce safe casts during conversion
SerialVersionUIDInSerializableClass:
active: true
SpacingBetweenPackageAndImports:
active: false # Formatting handled by ktlint
StringShouldBeRawString:
active: false # Don't enforce raw strings
ThrowsCount:
active: false # Don't limit throws declarations (legacy pattern)
TrailingWhitespace:
active: false # Formatting handled by ktlint
TrimMultilineRawString:
active: false # Don't enforce trimming
UnderscoresInNumericLiterals:
active: false # Don't enforce underscores in numbers
UnnecessaryAbstractClass:
active: false # Allow abstract classes (legacy pattern)
UnnecessaryAnnotationUseSiteTarget:
active: false # Allow during conversion
UnnecessaryApply:
active: false # Allow during conversion
UnnecessaryBackticks:
active: true
UnnecessaryBracesAroundTrailingLambda:
active: false # Allow during conversion
UnnecessaryFilter:
active: false # Don't enforce during conversion
UnnecessaryInheritance:
active: false # Allow explicit inheritance
UnnecessaryInnerClass:
active: false # Allow inner classes (legacy pattern)
UnnecessaryLet:
active: false # Allow during conversion
UnnecessaryParentheses:
active: false # Allow extra parentheses for clarity
UntilInsteadOfRangeTo:
active: false # Allow .. syntax
UnusedImports:
active: true # Remove unused imports
UnusedParameter:
active: false # Allow unused parameters (may be interface requirements)
UnusedPrivateClass:
active: false # Allow during conversion (may be needed)
UnusedPrivateMember:
active: false # Allow during conversion (may be used via reflection)
UnusedPrivateProperty:
active: false # Allow during conversion
UseAnyOrNoneInsteadOfFind:
active: false # Don't enforce during conversion
UseArrayLiteralsInAnnotations:
active: false # Allow during conversion
UseCheckNotNull:
active: false # Don't enforce Kotlin idioms during conversion
UseCheckOrError:
active: false # Don't enforce during conversion
UseDataClass:
active: false # Don't enforce data class conversion
UseEmptyCounterpart:
active: false # Don't enforce isEmpty() vs size == 0
UseIfEmptyOrIfBlank:
active: false # Don't enforce during conversion
UseIfInsteadOfWhen:
active: false # Allow when with 2 branches
UseIsNullOrEmpty:
active: false # Don't enforce during conversion
UseOrEmpty:
active: false # Don't enforce during conversion
UseRequire:
active: false # Don't enforce require() during conversion
UseRequireNotNull:
active: false # Don't enforce during conversion
UseSumOfInsteadOfFlatMapSize:
active: false # Don't enforce during conversion
UselessCallOnNotNull:
active: true
UtilityClassWithPublicConstructor:
active: false # Allow utility classes with constructors (legacy pattern)
VarCouldBeVal:
active: false # Don't enforce val during conversion (careful analysis needed)
WildcardImport:
active: false # Allow wildcard imports (legacy pattern)
formatting:
active: true
android: false
autoCorrect: true
AnnotationOnSeparateLine:
active: false
AnnotationSpacing:
active: true
ArgumentListWrapping:
active: false # Don't enforce wrapping
BlockCommentInitialStarAlignment:
active: false
ChainWrapping:
active: false # Don't enforce chain wrapping
ClassName:
active: false # Don't enforce during conversion
CommentSpacing:
active: true
CommentWrapping:
active: false # Don't enforce comment wrapping
ContextReceiverMapping:
active: false
DiscouragedCommentLocation:
active: false
EnumEntryNameCase:
active: false # Don't enforce UPPER_CASE enums during conversion
EnumWrapping:
active: false
Filename:
active: false # Don't enforce PascalCase (package-info.kt files don't match)
FinalNewline:
active: true
FunKeywordSpacing:
active: true
FunctionName:
active: false # Don't enforce naming during conversion
FunctionReturnTypeSpacing:
active: false
FunctionSignature:
active: false
FunctionStartOfBodySpacing:
active: false
FunctionTypeReferenceSpacing:
active: false
IfElseBracing:
active: false
IfElseWrapping:
active: false
ImportOrdering:
active: false # Don't enforce import ordering
Indentation:
active: false # DISABLED - Let ktlint use .editorconfig (tabs)
# Note: When active, this rule enforces SPACES not tabs.
# Ktlint reads .editorconfig directly for indentation style.
# Keep disabled to respect tab indentation from .editorconfig
KdocWrapping:
active: false
MaximumLineLength:
active: true
maxLineLength: 120 # Match .editorconfig
ignoreComments: true # Don't check comments (JavaDoc @link can be long)
ModifierListSpacing:
active: false
ModifierOrdering:
active: true
MultiLineIfElse:
active: false
MultilineExpressionWrapping:
active: false
MultilineLoopExpression:
active: false
NoBlankLineBeforeRbrace:
active: false
NoBlankLineInList:
active: false
NoBlankLinesInChainedMethodCalls:
active: false
NoConsecutiveBlankLines:
active: false
NoConsecutiveComments:
active: false
NoEmptyClassBody:
active: false
NoEmptyFirstLineInClassBody:
active: false
NoEmptyFirstLineInMethodBlock:
active: false
NoLineBreakAfterElse:
active: false
NoLineBreakBeforeAssignment:
active: false
NoMultipleSpaces:
active: false
NoSemicolons:
active: true # Remove unnecessary semicolons
NoSingleLineBlockComment:
active: false
NoTrailingSpaces:
active: true
NoUnitReturn:
active: false
NoUnusedImports:
active: true
NoWildcardImports:
active: false # Allow wildcard imports (legacy)
NullableTypeSpacing:
active: false
PackageName:
active: true
ParameterListSpacing:
active: false
ParameterListWrapping:
active: false
ParameterWrapping:
active: false
PropertyName:
active: false # Don't enforce naming during conversion
PropertyWrapping:
active: false
SpacingAroundAngleBrackets:
active: false
SpacingAroundColon:
active: false
SpacingAroundComma:
active: true
SpacingAroundCurly:
active: false
SpacingAroundDot:
active: false
SpacingAroundDoubleColon:
active: false
SpacingAroundKeyword:
active: false
SpacingAroundOperators:
active: false
SpacingAroundParens:
active: false
SpacingAroundRangeOperator:
active: false
SpacingAroundUnaryOperator:
active: false
SpacingBetweenDeclarationsWithAnnotations:
active: false
SpacingBetweenDeclarationsWithComments:
active: false
SpacingBetweenFunctionNameAndOpeningParenthesis:
active: false
StatementWrapping:
active: false
StringTemplate:
active: false
StringTemplateIndent:
active: false
TrailingCommaOnCallSite:
active: false # Don't enforce trailing commas
TrailingCommaOnDeclarationSite:
active: false # Don't enforce trailing commas
TryCatchFinallySpacing:
active: false
TypeArgumentComment:
active: false
TypeArgumentListSpacing:
active: false
TypeParameterComment:
active: false
TypeParameterListSpacing:
active: false
UnnecessaryParenthesesBeforeTrailingLambda:
active: false
Wrapping:
active: false