config_version = "0" exclude_patterns = [ "**/vendor/**", "**/node_modules/**", "**/testdata/**", "**/dist/**", "**/.build/**", "**/build/**", "**/*.min.*", "**/generated/**", ".claude/**", "**/Pods/**", # DEBUG-only seed data for the accessibility audit tests. "DomainDig/AuditFixtures.swift", ] test_patterns = [ "**/test/**", "**/tests/**", "**/Tests/**", "**/*_test.*", "**/test_*.*", "**/*.test.*", "**/*Tests.swift", "e2e/**", ] [[source]] name = "default" default = true [[plugin]] name = "osv-scanner" [[plugin]] name = "trufflehog" # Early returns are guard clauses, which keep the happy path unindented. [smells.return_statements] enabled = false # File complexity is a ratchet rather than a target: the threshold sits just # above today's worst file and fails anything past it. Lower it when a file is # genuinely split, never raise it to make a commit pass. # # Measured after A4 and the portfolio split: DomainViewModel 272, # CloudSyncService 198, WatchlistView 146, DomainDataPortabilityService 146, # AuditViews 128, ContentView 119, DomainDiffViews 115, # DomainReportExporter 114, SettingsViews 112, WorkflowsView 107. # # DomainViewModel still holds this threshold, and moving code has stopped # paying: the last 145 lines out of it bought 8 points, because what is left # is orchestration rather than separable clusters. Going much below 270 needs # the batch pipeline restructured, not relocated — it writes six # `private(set)` properties and calls back into eight view-model members, so # any extraction either widens that state or carries a back-reference. See # A13 for the measurements. [smells.file_complexity] enabled = true # Function complexity stays off because qlty's Swift parser mis-attributes it # here, not because the metric is unwanted. It reports `existingShare` # (CloudSyncService:336, eight lines, seven statements) as complexity 184 # spanning lines 336-1515 — the whole rest of the file. `fetchZoneChanges` in # the same file is measured correctly (31, lines 1049-1135), so the fault is # inconsistent rather than systematic. # # That leaves no usable threshold. Anything at or under 184 fails on the # artifact and nothing else; anything above it cannot fail on the one real # result. A gate whose only output is a false positive teaches you to ignore # it. Revisit when qlty's Swift grammar changes. [smells.function_complexity] enabled = false # Exhaustive switch-over-enum lookup tables share shape but not content. [language.swift.smells.duplication] # ownershipHistory and dnsHistory each pair a local history with an external one and merge # them; one generic version would take six closures. filter_patterns = [ "(import_declaration _)", "(switch_statement _)", "(function_declaration name: (simple_identifier) @_n (#match? @_n \"^(ownershipHistory|dnsHistory)$\"))", ] [language.swift.smells.file_complexity] threshold = 280