tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

detekt.yml (25025B)


      1 # Please refer to https://github.com/mozilla-mobile/firefox-android/blob/main/android-components/config/detekt.yml
      2 # for the source of truth for our detekt configuration.
      3 
      4 build:
      5  maxIssues: 0
      6  excludeCorrectable: false
      7  weights:
      8    # complexity: 2
      9    # LongParameterList: 1
     10    # style: 1
     11    # comments: 1
     12 
     13 config:
     14  validation: true
     15  warningsAsErrors: false
     16  checkExhaustiveness: false
     17  # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]'
     18  excludes: ''
     19 
     20 processors:
     21  active: true
     22  exclude:
     23    - 'DetektProgressListener'
     24  # - 'KtFileCountProcessor'
     25  # - 'PackageCountProcessor'
     26  # - 'ClassCountProcessor'
     27  # - 'FunctionCountProcessor'
     28  # - 'PropertyCountProcessor'
     29  # - 'ProjectComplexityProcessor'
     30  # - 'ProjectCognitiveComplexityProcessor'
     31  # - 'ProjectLLOCProcessor'
     32  # - 'ProjectCLOCProcessor'
     33  # - 'ProjectLOCProcessor'
     34  # - 'ProjectSLOCProcessor'
     35  # - 'LicenseHeaderLoaderExtension'
     36 
     37 console-reports:
     38  active: true
     39  exclude:
     40  #  - 'ProjectStatisticsReport'
     41  #  - 'ComplexityReport'
     42  #  - 'NotificationReport'
     43  #  - 'FindingsReport'
     44  #  - 'FileBasedFindingsReport'
     45  #  - 'LiteFindingsReport'
     46 
     47 output-reports:
     48  active: true
     49  exclude:
     50  # - 'TxtOutputReport'
     51  # - 'XmlOutputReport'
     52  # - 'HtmlOutputReport'
     53  # - 'MdOutputReport'
     54  # - 'SarifOutputReport'
     55 
     56 comments:
     57  active: true
     58  AbsentOrWrongFileLicense:
     59    active: true
     60    licenseTemplateFile: 'license.template'
     61    licenseTemplateIsRegex: false
     62  CommentOverPrivateFunction:
     63    active: false
     64  CommentOverPrivateProperty:
     65    active: false
     66  DeprecatedBlockTag:
     67    active: false
     68  EndOfSentenceFormat:
     69    active: false
     70    endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)'
     71  KDocReferencesNonPublicProperty:
     72    active: false
     73    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
     74  OutdatedDocumentation:
     75    active: true # Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1848527
     76    matchTypeParameters: false # (Default: true) Disabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1848527
     77    matchDeclarationsOrder: true
     78    allowParamOnConstructorProperties: false
     79  UndocumentedPublicClass:
     80    active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/76
     81    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
     82    searchInNestedClass: true
     83    searchInInnerClass: true
     84    searchInInnerObject: true
     85    searchInInnerInterface: true
     86    searchInProtectedClass: false
     87    ignoreDefaultCompanionObject: true
     88  UndocumentedPublicFunction:
     89    active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/76
     90    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
     91    searchProtectedFunction: false
     92  UndocumentedPublicProperty:
     93    active: false
     94    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
     95    searchProtectedProperty: false
     96 
     97 complexity:
     98  active: true
     99  CognitiveComplexMethod:
    100    active: true
    101    threshold: 15
    102  ComplexCondition:
    103    active: true
    104    threshold: 4
    105  ComplexInterface:
    106    active: false
    107    threshold: 10
    108    includeStaticDeclarations: false
    109    includePrivateDeclarations: false
    110    ignoreOverloaded: false
    111  CyclomaticComplexMethod:
    112    active: true
    113    threshold: 18 # (Default: 15) Increased in https://github.com/mozilla-mobile/android-components/pull/10328
    114    ignoreSingleWhenExpression: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/3271
    115    ignoreSimpleWhenEntries: false
    116    ignoreNestingFunctions: false
    117    nestingFunctions:
    118      - 'also'
    119      - 'apply'
    120      - 'forEach'
    121      - 'isNotNull'
    122      - 'ifNull'
    123      - 'let'
    124      - 'run'
    125      - 'use'
    126      - 'with'
    127  LabeledExpression:
    128    active: false
    129    ignoredLabels: []
    130  LargeClass:
    131    active: true
    132    threshold: 600
    133  LongMethod:
    134    active: true
    135    threshold: 75 # (Default: 60) Increased in https://github.com/mozilla-mobile/android-components/issues/6350
    136  LongParameterList:
    137    active: true
    138    functionThreshold: 8 # (Default: 6) Increased in https://bugzilla.mozilla.org/show_bug.cgi?id=1872996
    139    constructorThreshold: 7
    140    ignoreDefaultParameters: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/10835
    141    ignoreDataClasses: true
    142    ignoreAnnotatedParameter: []
    143  MethodOverloading:
    144    active: false
    145    threshold: 6
    146  NamedArguments:
    147    active: false
    148    threshold: 3
    149    ignoreArgumentsMatchingNames: false
    150  NestedBlockDepth:
    151    active: true
    152    threshold: 4
    153  NestedScopeFunctions:
    154    active: false
    155    threshold: 1
    156    functions:
    157      - 'kotlin.apply'
    158      - 'kotlin.run'
    159      - 'kotlin.with'
    160      - 'kotlin.let'
    161      - 'kotlin.also'
    162  ReplaceSafeCallChainWithRun:
    163    active: false
    164  StringLiteralDuplication:
    165    active: false
    166    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    167    threshold: 3
    168    ignoreAnnotation: true
    169    excludeStringsWithLessThan5Characters: true
    170    ignoreStringsRegex: '$^'
    171  TooManyFunctions:
    172    active: true
    173    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    174    thresholdInFiles: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927
    175    thresholdInClasses: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927
    176    thresholdInInterfaces: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927
    177    thresholdInObjects: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927
    178    thresholdInEnums: 11
    179    ignoreDeprecated: false
    180    ignorePrivate: false
    181    ignoreOverridden: false
    182    ignoreAnnotatedFunctions: []
    183 
    184 coroutines:
    185  active: true
    186  GlobalCoroutineUsage:
    187    active: false
    188  InjectDispatcher:
    189    active: false # (Default: true)
    190    dispatcherNames:
    191      - 'IO'
    192      - 'Default'
    193      - 'Unconfined'
    194  RedundantSuspendModifier:
    195    active: false # (Default: true)
    196  SleepInsteadOfDelay:
    197    active: false # (Default: true)
    198  SuspendFunSwallowedCancellation:
    199    active: false
    200  SuspendFunWithCoroutineScopeReceiver:
    201    active: false
    202  SuspendFunWithFlowReturnType:
    203    active: false # (Default: true)
    204 
    205 empty-blocks:
    206  active: true
    207  EmptyCatchBlock:
    208    active: true
    209    allowedExceptionNameRegex: '_|(ignore|expected).*'
    210  EmptyClassBlock:
    211    active: true
    212  EmptyDefaultConstructor:
    213    active: true
    214  EmptyDoWhileBlock:
    215    active: true
    216  EmptyElseBlock:
    217    active: true
    218  EmptyFinallyBlock:
    219    active: true
    220  EmptyForBlock:
    221    active: true
    222  EmptyFunctionBlock:
    223    active: true
    224    ignoreOverridden: false
    225  EmptyIfBlock:
    226    active: true
    227  EmptyInitBlock:
    228    active: true
    229  EmptyKtFile:
    230    active: true
    231  EmptySecondaryConstructor:
    232    active: true
    233  EmptyTryBlock:
    234    active: true
    235  EmptyWhenBlock:
    236    active: true
    237  EmptyWhileBlock:
    238    active: true
    239 
    240 exceptions:
    241  active: true
    242  ExceptionRaisedInUnexpectedLocation:
    243    active: false # (Default: true)
    244    methodNames:
    245      - 'equals'
    246      - 'finalize'
    247      - 'hashCode'
    248      - 'toString'
    249  InstanceOfCheckForException:
    250    active: false # (Default: true)
    251    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    252  NotImplementedDeclaration:
    253    active: false
    254  ObjectExtendsThrowable:
    255    active: false
    256  PrintStackTrace:
    257    active: true
    258  RethrowCaughtException:
    259    active: false # (Default: true)
    260  ReturnFromFinally:
    261    active: true
    262    ignoreLabeled: false
    263  SwallowedException:
    264    active: false # (Default: true)
    265    ignoredExceptionTypes:
    266      - 'InterruptedException'
    267      - 'MalformedURLException'
    268      - 'NumberFormatException'
    269      - 'ParseException'
    270    allowedExceptionNameRegex: '_|(ignore|expected).*'
    271  ThrowingExceptionFromFinally:
    272    active: true
    273  ThrowingExceptionInMain:
    274    active: false
    275  ThrowingExceptionsWithoutMessageOrCause:
    276    active: false # (Default: true)
    277    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    278    exceptions:
    279      - 'ArrayIndexOutOfBoundsException'
    280      - 'Exception'
    281      - 'IllegalArgumentException'
    282      - 'IllegalMonitorStateException'
    283      - 'IllegalStateException'
    284      - 'IndexOutOfBoundsException'
    285      - 'NullPointerException'
    286      - 'RuntimeException'
    287      - 'Throwable'
    288  ThrowingNewInstanceOfSameException:
    289    active: true
    290  TooGenericExceptionCaught:
    291    active: true
    292    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    293    exceptionNames:
    294      - 'ArrayIndexOutOfBoundsException'
    295      - 'Error'
    296      - 'Exception'
    297      - 'IllegalMonitorStateException'
    298      - 'IndexOutOfBoundsException'
    299      - 'NullPointerException'
    300      - 'RuntimeException'
    301      - 'Throwable'
    302    allowedExceptionNameRegex: '_|(ignore|expected).*'
    303  TooGenericExceptionThrown:
    304    active: true
    305    exceptionNames:
    306      - 'Error'
    307      - 'Exception'
    308      - 'RuntimeException'
    309      - 'Throwable'
    310 
    311 naming:
    312  active: true
    313  BooleanPropertyNaming:
    314    active: false
    315    allowedPattern: '^(is|has|are)'
    316  ClassNaming:
    317    active: true
    318    classPattern: '[A-Z][a-zA-Z0-9]*'
    319  ConstructorParameterNaming:
    320    active: true
    321    parameterPattern: '[a-z][A-Za-z0-9]*'
    322    privateParameterPattern: '[a-z][A-Za-z0-9]*'
    323    excludeClassPattern: '$^'
    324  EnumNaming:
    325    active: true
    326    enumEntryPattern: '[A-Z][_a-zA-Z0-9]*'
    327  ForbiddenClassName:
    328    active: false
    329    forbiddenName: []
    330  FunctionMaxLength:
    331    active: false
    332    maximumFunctionNameLength: 30
    333  FunctionMinLength:
    334    active: false
    335    minimumFunctionNameLength: 3
    336  FunctionNaming:
    337    active: true
    338    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    339    functionPattern: '[a-z][a-zA-Z0-9]*'
    340    excludeClassPattern: '$^'
    341    ignoreAnnotated: ['Composable'] # Configuration for Compose https://github.com/mozilla-mobile/android-components/issues/11866
    342  FunctionParameterNaming:
    343    active: true
    344    parameterPattern: '[a-z][A-Za-z0-9]*'
    345    excludeClassPattern: '$^'
    346  InvalidPackageDeclaration:
    347    active: false # (Default: true)
    348    rootPackage: ''
    349    requireRootInDeclaration: false
    350  LambdaParameterNaming:
    351    active: false
    352    parameterPattern: '[a-z][A-Za-z0-9]*|_'
    353  MatchingDeclarationName:
    354    active: true
    355    mustBeFirst: true
    356  MemberNameEqualsClassName:
    357    active: false # (Default: true)
    358    ignoreOverridden: true
    359  NoNameShadowing:
    360    active: false # (Default: true)
    361  NonBooleanPropertyPrefixedWithIs:
    362    active: false
    363  ObjectPropertyNaming:
    364    active: true
    365    constantPattern: '[A-Za-z][_A-Za-z0-9]*'
    366    propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
    367    privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
    368  PackageNaming:
    369    active: true
    370    packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*'
    371  TopLevelPropertyNaming:
    372    active: true
    373    constantPattern: '[A-Z][_A-Z0-9]*'
    374    propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
    375    privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*'
    376  VariableMaxLength:
    377    active: false
    378    maximumVariableNameLength: 64
    379  VariableMinLength:
    380    active: false
    381    minimumVariableNameLength: 1
    382  VariableNaming:
    383    active: true
    384    variablePattern: '[a-z][A-Za-z0-9]*'
    385    privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
    386    excludeClassPattern: '$^'
    387 
    388 performance:
    389  active: true
    390  ArrayPrimitive:
    391    active: true
    392  CouldBeSequence:
    393    active: false
    394    threshold: 3
    395  ForEachOnRange:
    396    active: true
    397    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    398  SpreadOperator:
    399    active: true
    400    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    401  UnnecessaryPartOfBinaryExpression:
    402    active: false
    403  UnnecessaryTemporaryInstantiation:
    404    active: true
    405 
    406 potential-bugs:
    407  active: true
    408  AvoidReferentialEquality:
    409    active: false # (Default: true)
    410    forbiddenTypePatterns:
    411      - 'kotlin.String'
    412  CastNullableToNonNullableType:
    413    active: false
    414  CastToNullableType:
    415    active: false
    416  Deprecation:
    417    active: false
    418  DontDowncastCollectionTypes:
    419    active: false
    420  DoubleMutabilityForCollection:
    421    active: true
    422    mutableTypes:
    423      - 'kotlin.collections.MutableList'
    424      - 'kotlin.collections.MutableMap'
    425      - 'kotlin.collections.MutableSet'
    426      - 'java.util.ArrayList'
    427      - 'java.util.LinkedHashSet'
    428      - 'java.util.HashSet'
    429      - 'java.util.LinkedHashMap'
    430      - 'java.util.HashMap'
    431  ElseCaseInsteadOfExhaustiveWhen:
    432    active: false
    433    ignoredSubjectTypes: []
    434  EqualsAlwaysReturnsTrueOrFalse:
    435    active: true
    436  EqualsWithHashCodeExist:
    437    active: true
    438  ExitOutsideMain:
    439    active: false
    440  ExplicitGarbageCollectionCall:
    441    active: true
    442  HasPlatformType:
    443    active: false # (Default: true)
    444  IgnoredReturnValue:
    445    active: false # (Default: true)
    446    restrictToConfig: true
    447    returnValueAnnotations:
    448      - 'CheckResult'
    449      - '*.CheckResult'
    450      - 'CheckReturnValue'
    451      - '*.CheckReturnValue'
    452    ignoreReturnValueAnnotations:
    453      - 'CanIgnoreReturnValue'
    454      - '*.CanIgnoreReturnValue'
    455    returnValueTypes:
    456      - 'kotlin.sequences.Sequence'
    457      - 'kotlinx.coroutines.flow.*Flow'
    458      - 'java.util.stream.*Stream'
    459    ignoreFunctionCall: []
    460  ImplicitDefaultLocale:
    461    active: false # (Default: true)
    462  ImplicitUnitReturnType:
    463    active: false
    464    allowExplicitReturnType: true
    465  InvalidRange:
    466    active: true
    467  IteratorHasNextCallsNextMethod:
    468    active: true
    469  IteratorNotThrowingNoSuchElementException:
    470    active: true
    471  LateinitUsage:
    472    active: false
    473    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    474    ignoreOnClassesPattern: ''
    475  MapGetWithNotNullAssertionOperator:
    476    active: false # (Default: true)
    477  MissingPackageDeclaration:
    478    active: false
    479    excludes: ['**/*.kts']
    480  NullCheckOnMutableProperty:
    481    active: false
    482  NullableToStringCall:
    483    active: false
    484  PropertyUsedBeforeDeclaration:
    485    active: false
    486  UnconditionalJumpStatementInLoop:
    487    active: false
    488  UnnecessaryNotNullCheck:
    489    active: false
    490  UnnecessaryNotNullOperator:
    491    active: true
    492  UnnecessarySafeCall:
    493    active: true
    494  UnreachableCatchBlock:
    495    active: false # (Default: true)
    496  UnreachableCode:
    497    active: true
    498  UnsafeCallOnNullableType:
    499    active: true
    500    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
    501  UnsafeCast:
    502    active: true
    503  UnusedUnaryOperator:
    504    active: false # (Default: true)
    505  UselessPostfixExpression:
    506    active: false # (Default: true)
    507  WrongEqualsTypeParameter:
    508    active: true
    509 
    510 style:
    511  active: true
    512  AlsoCouldBeApply:
    513    active: false
    514  BracesOnIfStatements:
    515    active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/1015
    516    singleLine: 'consistent' # (Default: never)
    517    multiLine: 'always'
    518  BracesOnWhenStatements:
    519    active: false
    520    singleLine: 'necessary'
    521    multiLine: 'consistent'
    522  CanBeNonNullable:
    523    active: false
    524  CascadingCallWrapping:
    525    active: false
    526    includeElvis: true
    527  ClassOrdering:
    528    active: false
    529  CollapsibleIfStatements:
    530    active: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/78
    531  DataClassContainsFunctions:
    532    active: false
    533    conversionFunctionPrefix:
    534      - 'to'
    535    allowOperators: false
    536  DataClassShouldBeImmutable:
    537    active: false
    538  DestructuringDeclarationWithTooManyEntries:
    539    active: false # (Default: true)
    540    maxDestructuringEntries: 3
    541  DoubleNegativeLambda:
    542    active: false
    543    negativeFunctions:
    544      - reason: 'Use `takeIf` instead.'
    545        value: 'takeUnless'
    546      - reason: 'Use `all` instead.'
    547        value: 'none'
    548    negativeFunctionNameParts:
    549      - 'not'
    550      - 'non'
    551  EqualsNullCall:
    552    active: true
    553  EqualsOnSignatureLine:
    554    active: false
    555  ExplicitCollectionElementAccessMethod:
    556    active: false
    557  ExplicitItLambdaParameter:
    558    active: false # (Default: true)
    559  ExpressionBodySyntax:
    560    active: false
    561    includeLineWrapping: false
    562  ForbiddenAnnotation:
    563    active: false
    564    annotations:
    565      - reason: 'it is a java annotation. Use `Suppress` instead.'
    566        value: 'java.lang.SuppressWarnings'
    567      - reason: 'it is a java annotation. Use `kotlin.Deprecated` instead.'
    568        value: 'java.lang.Deprecated'
    569      - reason: 'it is a java annotation. Use `kotlin.annotation.MustBeDocumented` instead.'
    570        value: 'java.lang.annotation.Documented'
    571      - reason: 'it is a java annotation. Use `kotlin.annotation.Target` instead.'
    572        value: 'java.lang.annotation.Target'
    573      - reason: 'it is a java annotation. Use `kotlin.annotation.Retention` instead.'
    574        value: 'java.lang.annotation.Retention'
    575      - reason: 'it is a java annotation. Use `kotlin.annotation.Repeatable` instead.'
    576        value: 'java.lang.annotation.Repeatable'
    577      - reason: 'Kotlin does not support @Inherited annotation, see https://youtrack.jetbrains.com/issue/KT-22265'
    578        value: 'java.lang.annotation.Inherited'
    579  ForbiddenComment:
    580    active: true
    581    comments:
    582      - reason: 'Forbidden FIXME todo marker in comment, please fix the problem.'
    583        value: 'FIXME:'
    584      - reason: 'Forbidden STOPSHIP todo marker in comment, please address the problem before shipping the code.'
    585        value: 'STOPSHIP:'
    586      - reason: 'Forbidden TODO todo marker in comment, please do the changes.'
    587        value: 'TODO:'
    588    allowedPatterns: ''
    589  ForbiddenImport:
    590    active: false
    591    imports: []
    592    forbiddenPatterns: ''
    593  ForbiddenMethodCall:
    594    active: false
    595    methods:
    596      - reason: 'print does not allow you to configure the output stream. Use a logger instead.'
    597        value: 'kotlin.io.print'
    598      - reason: 'println does not allow you to configure the output stream. Use a logger instead.'
    599        value: 'kotlin.io.println'
    600  ForbiddenSuppress:
    601    active: true
    602    rules: ['LongMethod', 'CognitiveComplexMethod', 'CyclomaticComplexMethod', 'MagicNumber']
    603  ForbiddenVoid:
    604    active: false # (Default: true)
    605    ignoreOverridden: false
    606    ignoreUsageInGenerics: false
    607  FunctionOnlyReturningConstant:
    608    active: true
    609    ignoreOverridableFunction: true
    610    ignoreActualFunction: true
    611    excludedFunctions: []
    612  LoopWithTooManyJumpStatements:
    613    active: false # (Default: true)
    614    maxJumpCount: 1
    615  MagicNumber:
    616    active: true
    617    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts']
    618    ignoreNumbers:
    619      - '-1'
    620      - '0'
    621      - '1'
    622      - '2'
    623      - '60' # seconds in minute / minutes in hour
    624      - '1000' # millis in second
    625    ignoreHashCodeFunction: true
    626    ignorePropertyDeclaration: true # Enabled for Compose in https://github.com/mozilla-mobile/android-components/issues/11864
    627    ignoreLocalVariableDeclaration: true # (Default: false) Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1987018
    628    ignoreConstantDeclaration: true
    629    ignoreCompanionObjectPropertyDeclaration: true
    630    ignoreAnnotation: false
    631    ignoreNamedArgument: true
    632    ignoreEnums: true # (Default: false) Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1987018
    633    ignoreRanges: false
    634    ignoreExtensionFunctions: true
    635  MandatoryBracesLoops:
    636    active: false
    637  MaxChainedCallsOnSameLine:
    638    active: false
    639    maxChainedCalls: 5
    640  MaxLineLength:
    641    active: true
    642    maxLineLength: 120
    643    excludePackageStatements: true
    644    excludeImportStatements: true
    645    excludeCommentStatements: false
    646    excludeRawStrings: true
    647  MayBeConst:
    648    active: true
    649  ModifierOrder:
    650    active: true
    651  MultilineLambdaItParameter:
    652    active: false
    653  MultilineRawStringIndentation:
    654    active: false
    655    indentSize: 4
    656    trimmingMethods:
    657      - 'trimIndent'
    658      - 'trimMargin'
    659  NestedClassesVisibility:
    660    active: true
    661  NewLineAtEndOfFile:
    662    active: true
    663  NoTabs:
    664    active: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/78
    665  NullableBooleanCheck:
    666    active: false
    667  ObjectLiteralToLambda:
    668    active: false # (Default: true)
    669  OptionalAbstractKeyword:
    670    active: true
    671  OptionalUnit:
    672    active: false
    673  PreferToOverPairSyntax:
    674    active: false
    675  ProtectedMemberInFinalClass:
    676    active: true
    677  RedundantExplicitType:
    678    active: false
    679  RedundantHigherOrderMapUsage:
    680    active: false # (Default: true)
    681  RedundantVisibilityModifierRule:
    682    active: false
    683  ReturnCount:
    684    active: true
    685    max: 3 # (Default: 2) Increased in https://github.com/mozilla-mobile/android-components/issues/3
    686    excludedFunctions:
    687      - 'equals'
    688    excludeLabeled: false
    689    excludeReturnFromLambda: true
    690    excludeGuardClauses: false
    691  SafeCast:
    692    active: true
    693  SerialVersionUIDInSerializableClass:
    694    active: true
    695  SpacingBetweenPackageAndImports:
    696    active: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/78
    697  StringShouldBeRawString:
    698    active: false
    699    maxEscapedCharacterCount: 2
    700    ignoredCharacters: []
    701  ThrowsCount:
    702    active: true
    703    max: 2
    704    excludeGuardClauses: false
    705  TrailingWhitespace:
    706    active: false
    707  TrimMultilineRawString:
    708    active: false
    709    trimmingMethods:
    710      - 'trimIndent'
    711      - 'trimMargin'
    712  UnderscoresInNumericLiterals:
    713    active: false
    714    acceptableLength: 4
    715    allowNonStandardGrouping: false
    716  UnnecessaryAbstractClass:
    717    active: true
    718  UnnecessaryAnnotationUseSiteTarget:
    719    active: false
    720  UnnecessaryApply:
    721    active: true
    722  UnnecessaryBackticks:
    723    active: false
    724  UnnecessaryBracesAroundTrailingLambda:
    725    active: false
    726  UnnecessaryFilter:
    727    active: false # (Default: true)
    728  UnnecessaryInheritance:
    729    active: true
    730  UnnecessaryInnerClass:
    731    active: false
    732  UnnecessaryLet:
    733    active: false
    734  UnnecessaryParentheses:
    735    active: false
    736    allowForUnclearPrecedence: false
    737  UntilInsteadOfRangeTo:
    738    active: false
    739  UnusedImports: # (Default: false) Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1977548
    740    active: true
    741  UnusedParameter:
    742    active: true
    743    allowedNames: 'ignored|expected'
    744  UnusedPrivateClass:
    745    active: true
    746  UnusedPrivateMember:
    747    active: true
    748    allowedNames: ''
    749    ignoreAnnotated: ['Composable'] # Configuration for Compose https://github.com/mozilla-mobile/android-components/issues/11866
    750  UnusedPrivateProperty:
    751    active: true
    752    allowedNames: '_|ignored|expected|serialVersionUID'
    753  UseAnyOrNoneInsteadOfFind:
    754    active: false # (Default: true)
    755  UseArrayLiteralsInAnnotations:
    756    active: false # (Default: true)
    757  UseCheckNotNull:
    758    active: true
    759  UseCheckOrError:
    760    active: false # (Default: true)
    761  UseDataClass:
    762    active: false
    763    allowVars: false
    764  UseEmptyCounterpart:
    765    active: false
    766  UseIfEmptyOrIfBlank:
    767    active: false
    768  UseIfInsteadOfWhen:
    769    active: false
    770    ignoreWhenContainingVariableDeclaration: false
    771  UseIsNullOrEmpty:
    772    active: false # (Default: true)
    773  UseLet:
    774    active: false
    775  UseOrEmpty:
    776    active: true
    777  UseRequire:
    778    active: true
    779  UseRequireNotNull:
    780    active: true
    781  UseSumOfInsteadOfFlatMapSize:
    782    active: false
    783  UselessCallOnNotNull:
    784    active: true
    785  UtilityClassWithPublicConstructor:
    786    active: true
    787  VarCouldBeVal:
    788    active: true
    789    ignoreLateinitVar: false
    790  WildcardImport:
    791    active: true
    792 
    793 # Custom Rules
    794 
    795 mozilla-detekt-rules:
    796  active: true
    797  MozillaBannedPropertyAccess:
    798    active: true
    799    # BuildConfig.Debug: This property tests whether the application was built
    800    # with the debuggable flag or not. Use a check for different build variants,
    801    # instead.
    802    bannedProperties: 'BuildConfig.DEBUG'
    803  MozillaStrictModeSuppression:
    804    active: true
    805  MozillaRunBlockingCheck:
    806    active: true
    807  MozillaUseLazyMonitored:
    808    active: true