# ⚡ v1.3.1: detekt Configuration
# Pragmatic rules for simple-notes-sync

build:
  maxIssues: 100  # Allow existing issues for v1.3.1 release, fix in v1.4.0
  excludeCorrectable: false

config:
  validation: true
  warningsAsErrors: false

comments:
  CommentOverPrivateProperty:
    active: false
  UndocumentedPublicClass:
    active: false
  UndocumentedPublicFunction:
    active: false

complexity:
  ComplexCondition:
    active: true
    threshold: 5
  CyclomaticComplexMethod:
    active: true
    threshold: 65  # v1.5.0: Increased for sync methods (TODO: refactor in v1.6.0)
    ignoreSingleWhenExpression: true
  LargeClass:
    active: true
    threshold: 600  # Increased for WebDavSyncService
  LongMethod:
    active: true
    threshold: 200  # v1.5.0: Increased for sync methods (TODO: refactor in v1.6.0)
  LongParameterList:
    active: true
    functionThreshold: 10  # v1.5.0: Compose functions often have many params
    constructorThreshold: 7
  NestedBlockDepth:
    active: true
    threshold: 5
  TooManyFunctions:
    active: true
    thresholdInFiles: 35  # v1.5.0: Increased for large classes
    thresholdInClasses: 35
    thresholdInInterfaces: 20
    thresholdInObjects: 20
    thresholdInEnums: 10

empty-blocks:
  EmptyCatchBlock:
    active: true
    allowedExceptionNameRegex: "_|(ignore|expected).*"
  EmptyFunctionBlock:
    active: true
    ignoreOverridden: true

exceptions:
  SwallowedException:
    active: true
    ignoredExceptionTypes:
      - "InterruptedException"
      - "MalformedURLException"
      - "NumberFormatException"
      - "ParseException"
  TooGenericExceptionCaught:
    active: true
    exceptionNames:
      - "Error"
      - "Throwable"
    allowedExceptionNameRegex: "_|(ignore|expected).*"

naming:
  FunctionNaming:
    active: true
    functionPattern: "[a-zA-Z][a-zA-Z0-9]*"
  VariableNaming:
    active: true
    variablePattern: "[a-z][A-Za-z0-9]*"
  PackageNaming:
    active: true
    packagePattern: "[a-z]+(\\.[a-z][A-Za-z0-9]*)*"

performance:
  SpreadOperator:
    active: false  # Spread operator is fine in most cases

potential-bugs:
  CastToNullableType:
    active: true
  EqualsWithHashCodeExist:
    active: true
  UnconditionalJumpStatementInLoop:
    active: true

style:
  ForbiddenComment:
    active: true
    comments:
      - "FIXME:"
      - "STOPSHIP:"
    allowedPatterns: ""
  MagicNumber:
    active: true
    ignoreNumbers:
      - "-1"
      - "0"
      - "1"
      - "2"
      - "100"
      - "1000"
    ignoreHashCodeFunction: true
    ignorePropertyDeclaration: true
    ignoreLocalVariableDeclaration: true
    ignoreAnnotation: true
    ignoreEnums: true
    ignoreRanges: true
    ignoreExtensionFunctions: true
  MaxLineLength:
    active: true
    maxLineLength: 140  # v1.5.0: Increased for Compose code readability
    excludePackageStatements: true
    excludeImportStatements: true
    excludeCommentStatements: true
  ReturnCount:
    active: true
    max: 4
    excludedFunctions: []
    excludeLabeled: true
    excludeReturnFromLambda: true
    excludeGuardClauses: true
  UnusedImports:
    active: true
  UnusedPrivateMember:
    active: true
    allowedNames: "_.*"
  WildcardImport:
    active: false  # Allow wildcard imports
