Public report — FluidAudio, published 30 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_42225868884048d0b2d121e2f4b12a1c
Filed 30 September 2026, 23:11 UTC
Public
Large · 102,264 LoC · 4 projects · rebuild ~1.1 person-years · weakest lens: Readiness (55%)
Findings by grade
75 critical1161 serious16 minor44 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
30 September 2026, 23:02 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
1236findings with an exact file:lineof 1252 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
40/125dimensions across the health lenses102264 LoC · 4 projects — wide & deep
Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.
The system holds an adequate standing with a health score of 62%, indicating a workable asset that carries real operational risk. While the core architecture is robust, the overall reliability is compromised by gaps in operational readiness and security practices. This balance means the business can continue delivering features, but at a higher cost and with increased exposure to outages or security incidents.
The value tied up in this large codebase is significant, requiring approximately 1.1 person-years to rebuild. The composition is highly structured, with no boilerplate or straight-line logic, suggesting a mature domain model. However, the sheer size means that even small inefficiencies compound quickly. The cost of inaction is substantial, as technical debt in weaker areas imposes a velocity tax on every change, potentially slowing delivery by 5–11% annually.
The primary risk lies in operational readiness, which scored lowest at 55%. For a system of this scale, weak readiness means changes are more likely to cause defects or outages because the safety nets—such as comprehensive testing and observability—are insufficient. This lens is where remediation buys the most protection, as it directly impacts the stability and predictability of releases. Without improvement, the team will face increasing friction and longer resolution times for production issues.
A secondary concern is the security posture, which sits at 61%. The absence of automated security scanning in the development pipeline allows vulnerabilities to slip through to production. This is not merely a technical oversight but a business risk that could lead to data exposure or compliance failures. Addressing this requires integrating static analysis tools into the continuous integration process to catch regressions before they land.
On the positive side, the domain modeling is excellent, and the architecture is highly cohesive, providing a solid foundation for future growth. The code is well-organized, which aids in maintainability and onboarding. These strengths should be preserved and leveraged as the team addresses the identified gaps.
The first focus should be adding automated security scanning to the CI pipeline. This action has the highest leverage, paying for itself within months by preventing costly security regressions. It is a low-effort, high-impact step that immediately reduces risk. Following this, the team should prioritize improving operational readiness to stabilize the system and reduce the velocity tax on future changes.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
137 finding(s) are new versus the previous scan (2026-09-15) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
0.9× (at 62% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~1.1 person-years of build effort (about ~€160,000 to rebuild). Its weakest lens is Readiness at 55% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.9× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 28.6–171.3 engineer-days every year, paid as drag on the ~230,088 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–4 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–11% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 56,734 line(s) changed over a 90-day window ⇒ ~230,088/year · D1/D2/D4/D6 code quality: averaging 6.0/10 ⇒ a 5–11% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 4 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Large asset (~1.1 person-years to rebuild), and its weakest lens is Readiness at 55%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.0/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–11% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 6.0/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
6 modules, 3 dependencies. 1 dependency cycle across 2 modules, marked above the diagonal.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
192 distinct (type in FluidAudioCLI → type in FluidAudio) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
337 distinct (type in FluidAudio → type in FluidAudioCLI) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2021 — Injection
75
High / Critical
Roadmap
First, integrate automated security scanning into the CI pipeline to block regressions and resolve the specific secret exposure issue in the workflow files. Second, establish a changelog to clearly track release contents and create an architecture decision record to document significant design choices. Finally, organize these architectural records in a standard directory structure to ensure they remain discoverable alongside existing design documentation.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 75
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 1161
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 16
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 44
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 35 of 40 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 40 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1236 of 1252 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.swift) and this repository declares a SwiftPM test suite (FluidAudio), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 1 SwiftPM declaration(s) across 2 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (0 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Examples/LocalVQEDemo/Sources/LocalVQEDemo/DemoModel.swift`, `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift`, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift`, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift`, `Sources/FluidAudio/ASR/Parakeet/Streaming/ParakeetModelVariant.swift`, … (+30 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and no container it models, or knows cannot hold a captive, was found in this repository's source, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX2 Stateful singletons — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection singletons in C#, Spring/JSR-330/CDI singletons in Java and Kotlin, and module state in Python request handlers only, and this repository's product is written in Swift, which was left unread, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
PF3 Async & latency hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Those languages colour their functions async, so blocking inside them is the same defect this card counts elsewhere, but their blocking vocabulary is not modelled yet. That is a gap in this analyzer's language reach — not a finding that the code is free of it.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript source only, and no C# was loaded and no JavaScript/TypeScript was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. X7 measured the part of this repository it reads (C#, Python, TypeScript/JavaScript, Rust and Go), and its Swift source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
147 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was TTS.run at 113. A further 6 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being Repo.name at 47 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Sources/FluidAudioCLI/FluidAudioCLI.swift (FluidAudioCLI.main at 47), Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Types.swift (Nemotron3Config.preset at 18). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 140 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 TTS.run (cyclomatic 113) finding(s) in Cyclomatic Complexity — start with TTSCommand.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 StreamDiarizationBenchmark.run (cyclomatic 105) finding(s) in Cyclomatic Complexity — start with DiarizationBenchmark.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 SortformerCommand.run (cyclomatic 93) finding(s) in Cyclomatic Complexity — start with SortformerCommand.swift. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
270 method(s) exceeded the cognitive complexity threshold of 15; the worst was StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 at 209.
+ 262 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2… finding(s) in Cognitive Complexity — start with StreamingNemotronMultilingualAsrManager.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 StreamingNemotronMultilingualAsrManager.processChunk (cognitive 168) finding(s) in Cognitive Complexity — start with StreamingNemotronMultilingualAsrManager.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 StreamDiarizationBenchmark.run (cognitive 163) finding(s) in Cognitive Complexity — start with DiarizationBenchmark.swift. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.2 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 73 MethodTooLong finding(s) in God Classes — start with TTSCommand.swift (4), StreamingNemotronMultilingualAsrManager.swift (3), DiarizationBenchmark.swift (3). — One of this dimension's main actionable groups (73 warning-level).
Resolve the 27 FileTooLong finding(s) in God Classes — start with TTSCommand.swift, TtsBenchmarkCommand.swift, ModelNames.swift. — One of this dimension's main actionable groups (27 warning-level).
Resolve the 26 ClassTooLong finding(s) in God Classes — start with TTSCommand.swift, TtsBenchmarkCommand.swift, DiarizationBenchmark.swift. — One of this dimension's main actionable groups (26 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
390 duplicated block group(s) detected. A further 21 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 159 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 22 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with SortformerDiarizer.swift, ModelHub.swift, G2PModel.swift. — One of this dimension's main actionable groups (22 warning-level).
Resolve the 22 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with FrenchG2P.swift (2), AssetDownloader.swift, SayAsInterpreter.swift. — One of this dimension's main actionable groups (22 warning-level).
Resolve the 19 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with CanaryManager.swift (2), ChatterboxNanoSynthesizer.swift (2), MultilingualG2PModel.swift. — One of this dimension's main actionable groups (19 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
4 production modules (SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 2 of the 4 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with TextNormalizer.swift, TranscribeCommand.swift. — One of this dimension's main actionable groups (2 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
2750 test methods: 2750 unit, 0 integration, 0 BDD, 0 e2e. The Python suite contributes 16 test function(s) across 1 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality8.9 / 10Strong✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
Resolve the 88 No assertions finding(s) in Test Quality — start with NemoTextNormalizerTests.swift (13), TdtDecoderStateV3Tests.swift (13), ContextBiasingSendableTests.swift (9). — One of this dimension's main actionable groups (88 warning-level).
Resolve the 79 Skipped test finding(s) in Test Quality — start with SegmentationProcessorEdgeCaseTests.swift (11), SpeakerEnrollmentTests.swift (9), VadTests.swift (5). — One of this dimension's main actionable groups (79 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: Sources/FluidAudioCLI/Commands/TTSCommand.swift (12×113=1356); Sources/FluidAudio/ModelNames.swift (21×47=987); Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift (10×64=640) Repeated repair below the complexity floor: Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift (5 of 6 changes were fixes); Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Types.swift (3 of 5 changes were fixes); Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift (3 of 5 changes were fixes)
Resolve the 26 Hotspot finding(s) in Churn × Complexity Hotspots — start with TTSCommand.swift, ModelNames.swift, TranscribeCommand.swift. — One of this dimension's main actionable groups (26 warning-level).
Resolve the 5 Repeated repair finding(s) in Churn × Complexity Hotspots — start with OfflineDiarizerManager.swift, KokoroAneSynthesizer+Types.swift, AsrTypes.swift. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor6.9 / 10Adequate✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
104 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/FluidAudioCLI/Commands/TTSCommand.swift. Counted over 336 of the 389 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 102264 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README (FluidAudio - Transcription, Text-to-speech, VAD, Speaker diarization with CoreML Models) is a clear, well-structured overview of the project: it describes what FluidAudio does (local Swift SDK for AI on Apple devices), its architecture (ANE inference, actor-based model stores, async streams), and links to detailed architecture docs. The Documentation/README.md README documents the models/API reference, CLI, benchmarks, and diarization pipelines separately from the root, showing a well-organized directory hierarchy. All visible sections are present in the outline: the root's overview is judged against its own body; the missing-architecture-docs finding is flagged against the standalone Architecture/Docs markdown file (FluidAudio Architecture) rather than the repository as a whole.
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyStronggated by 1 serious finding◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
1 API inconsistencies across a 400-member sample of 420 exposed types.
Naming inconsistency between model and dataset resolution methods. While the parameters are identical, the method names use different verbs ('resolveModel' vs 'resolveDataset') rather than a unified 'resolve' method with a type discriminator or a generic 'resolve' method.
What to do
Resolve the 1 Naming inconsistency between model and dataset resolution methods. While… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
1 of 1 build units (SwiftPM) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
75 finding(s): 0 critical, 75 high, 0 medium, 0 low. 74 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. Separately, one or more rules could not re-parse an embedded snippet in 8 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 74 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (74 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
6 of 336 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Sources/FluidAudio/Shared/AudioStream.swift. Counted over 336 of the 389 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned files with no living knowledge
✓ On the Gold path — maintain.
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 1 Change coupling finding(s) in Change Coupling — start with ChunkProcessor.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour — a data-only reference entity whose logic lives in a foreign service is anemic. Rich models enforce their own invariants.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a reference entity protects its own invariants — a class whose identity is a computed content hash but whose hashed fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 106375 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 453 use(s) across 112,338 production line(s) (~4.0/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 5 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 78 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D12 Dependency Hygiene — Not scored — 1 SwiftPM declaration(s) across 2 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (0 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — Package licences not graded — dependencies declared to CocoaPods
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 35 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Aggregate boundaries — not scored for Swift: the sidecar flattens array/collection types (a child COLLECTION = legitimate membership vs a single embedded aggregate is indistinguishable), and aggregate-vs-value-object classification cannot be told apart in source (every struct-holding-struct reads alike) — reported as guidance rather than measured
DM2 Strongly-typed ids — no in-repo typed-id idiom — primitive-obsession recorded as advisory DM8, DM2 not gated
DM3 Integration-event coupling — not scored for Swift: a cross-SwiftPM-target domain leak cannot be told apart in source from a legitimate shared-kernel/contracts module, and most repositories ship a single module — reported as guidance rather than measured
DM6 Domain ↔ infrastructure boundary — this Swift package maps no type to a persistence framework and declares no domain-model type carrying a method of its own, so DM6's domain↔infrastructure boundary read has no population to be taken over
DM7 Repository granularity — not scored for Swift: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python, Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF3 Async & latency hygiene — Sync-over-async was not assessed: this repository's async code is written in Swift, whose blocking calls this check does not model yet. That is a gap in the analyzer's language reach, not a finding about your code.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
No assertions: testPerformance_SuffixPrefixMatching Tests/FluidAudioTests/ASR/TokenDeduplicationRegressionTests.swift:369— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testPerformance_LCS Tests/FluidAudioTests/ASR/TokenDeduplicationRegressionTests.swift:386— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testPackageImports Tests/FluidAudioTests/CI/CITests.swift:11— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testAudioProcessingPerformance Tests/FluidAudioTests/CI/CITests.swift:225— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testCosineDistancePerformance Tests/FluidAudioTests/CI/CITests.swift:235— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testAsrModelsIsSendable Tests/FluidAudioTests/CI/SendableTests.swift:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testDiarizerModelsIsSendable Tests/FluidAudioTests/CI/SendableTests.swift:14— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testErrorTypesAreSendable Tests/FluidAudioTests/CI/SendableTests.swift:21— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testResetBetweenQueuedPushesStartsFreshClip Tests/FluidAudioTests/Enhancement/LocalVqeTests.swift:218— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testIndependentStreamsCanRunConcurrently Tests/FluidAudioTests/Enhancement/LocalVqeTests.swift:306— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testConvert48kHzMonoTo16kHzMono Tests/FluidAudioTests/Shared/AudioConverterTests.swift:146— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testConvert8kHzMonoTo16kHzMono Tests/FluidAudioTests/Shared/AudioConverterTests.swift:162— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testConvertVeryLongBuffer Tests/FluidAudioTests/Shared/AudioConverterTests.swift:336— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testConverterReuse Tests/FluidAudioTests/Shared/AudioConverterTests.swift:417— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLargeBufferConversion Tests/FluidAudioTests/Shared/AudioConverterTests.swift:533— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLinearResample3ChannelTo16kHz Tests/FluidAudioTests/Shared/AudioConverterTests.swift:546— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testLinearResampleHighChannelCount Tests/FluidAudioTests/Shared/AudioConverterTests.swift:662— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRejectsHTMLContentType Tests/FluidAudioTests/Shared/DownloadArtifactValidationTests.swift:104— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRejectsEmptyBody Tests/FluidAudioTests/Shared/DownloadArtifactValidationTests.swift:113— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRejectsHTMLBodyServedAsBinaryContentType Tests/FluidAudioTests/Shared/DownloadArtifactValidationTests.swift:121— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRejectsTruncatedBody Tests/FluidAudioTests/Shared/DownloadArtifactValidationTests.swift:131— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testRejectsOversizedBody Tests/FluidAudioTests/Shared/DownloadArtifactValidationTests.swift:140— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testShortInputsDoNotCrash Tests/FluidAudioTests/TTS/AudioPostProcessorTests.swift:72— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testEnglishMoney Tests/FluidAudioTests/TTS/NemoTextNormalizerTests.swift:37— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testEnglishInSentence Tests/FluidAudioTests/TTS/NemoTextNormalizerTests.swift:42— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
MethodTooLong: PocketTtsSynthesizer.validateKVCacheCapacity Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:9— MethodTooLong — validateKVCacheCapacity runs 864 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 764 over it, 8.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PocketTtsSynthesizer.isStatePlacementAvailable Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:12— MethodTooLong — isStatePlacementAvailable runs 864 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 764 over it, 8.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StreamingNemotronMultilingualAsrManager.runPreprocessorPure Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:17— MethodTooLong — runPreprocessorPure runs 570 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 470 over it, 5.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VBxClustering.runVBx Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:168— MethodTooLong — runVBx runs 392 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 292 over it, 3.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OfflineSegmentationProcessor.process Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:44— MethodTooLong — process runs 347 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 247 over it, 3.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StreamDiarizationBenchmark.run Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:171— MethodTooLong — run runs 341 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 241 over it, 3.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AsrManager.transcribeWithState Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:5— MethodTooLong — transcribeWithState runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TTS.run Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— MethodTooLong — run runs 319 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 219 over it, 3.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OfflineEmbeddingExtractor.extractEmbeddings Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:299— MethodTooLong — extractEmbeddings runs 315 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 215 over it, 3.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TdtDecoderV3.decodeWithTimings Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:103— MethodTooLong — decodeWithTimings runs 308 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 208 over it, 3.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ASRBenchmark.runASRBenchmark Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:642— MethodTooLong — runASRBenchmark runs 305 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 205 over it, 3.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EmissionDelayBenchmark.runCLI Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:47— MethodTooLong — runCLI runs 279 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 179 over it, 2.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LSEENDBenchmark.run Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:57— MethodTooLong — run runs 279 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 179 over it, 2.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SortformerBenchmark.run Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:66— MethodTooLong — run runs 276 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 176 over it, 2.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SortformerCommand.run Sources/FluidAudioCLI/Commands/SortformerCommand.swift:10— MethodTooLong — run runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CtcEarningsBenchmark.runCLI Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:58— MethodTooLong — runCLI runs 252 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 152 over it, 2.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CtcEarningsBenchmark.processFile Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:420— MethodTooLong — processFile runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CtcDecodeBenchmark.runCLI Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:11— MethodTooLong — runCLI runs 243 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 143 over it, 2.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VocabularyRescorer.stringSimilarity Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:8— MethodTooLong — stringSimilarity runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VocabularyRescorer.debugLog Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:9— MethodTooLong — debugLog runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EnhanceBenchmarkCommand.run Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:53— MethodTooLong — run runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VadManager.makeStreamState Sources/FluidAudio/VAD/VadManager.swift:6— MethodTooLong — makeStreamState runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VadManager.processStreamingChunk Sources/FluidAudio/VAD/VadManager.swift:11— MethodTooLong — processStreamingChunk runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VadManager.segmentSpeech Sources/FluidAudio/VAD/VadManager.swift:12— MethodTooLong — segmentSpeech runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NemotronMultilingualFleursBenchmark.runCLI Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:568— MethodTooLong — runCLI runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: Commands/TTSCommand.swift Sources/FluidAudioCLI/Commands/TTSCommand.swift— FileTooLong — 1310 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: TTS (5-1623). The bar is 500 significant lines; this is 810 over it, 2.62× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Commands/TtsBenchmarkCommand.swift Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift— FileTooLong — 1158 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: TtsBenchmarkCommand (33-1554). The bar is 500 significant lines; this is 658 over it, 2.32× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: FluidAudio/ModelNames.swift Sources/FluidAudio/ModelNames.swift— FileTooLong — 1077 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: ModelNames (403-1856). The bar is 500 significant lines; this is 577 over it, 2.15× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Commands/DiarizationBenchmark.swift Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift— FileTooLong — 1005 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: StreamDiarizationBenchmark (8-1421). The bar is 500 significant lines; this is 505 over it, 2.01× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: TDT/ChunkProcessor.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift— FileTooLong — 991 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ChunkProcessor (3-1535). The bar is 500 significant lines; this is 491 over it, 1.98× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: SlidingWindow/FleursBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift— FileTooLong — 911 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 411 over it, 1.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Pipeline/PocketTtsSynthesizer.swift Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift— FileTooLong — 866 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PocketTtsSynthesizer (14-1481). The bar is 500 significant lines; this is 366 over it, 1.73× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: SlidingWindow/CtcEarningsBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift— FileTooLong — 827 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CtcEarningsBenchmark (9-1241). The bar is 500 significant lines; this is 327 over it, 1.65× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: SlidingWindow/TranscribeCommand.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift— FileTooLong — 790 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: TranscribeCommand (197-1124). The bar is 500 significant lines; this is 290 over it, 1.58× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Diarizer/DiarizerTimeline.swift Sources/FluidAudio/Diarizer/DiarizerTimeline.swift— FileTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 280 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SlidingWindow/AsrBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift— FileTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 264 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Extraction/OfflineEmbeddingExtractor.swift Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift— FileTooLong — 716 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: OfflineEmbeddingExtractor (63-1033). The bar is 500 significant lines; this is 216 over it, 1.43× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Core/OfflineDiarizerManager.swift Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift— FileTooLong — 707 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: OfflineDiarizerManager (13-1045). The bar is 500 significant lines; this is 207 over it, 1.41× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: DatasetParsers/DatasetDownloader.swift Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift— FileTooLong — 670 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: DatasetDownloader (7-1071). The bar is 500 significant lines; this is 170 over it, 1.34× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Cohere/CoherePipeline.swift Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift— FileTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 168 over it, 1.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Streaming/NemotronMultilingualFleursBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift— FileTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 108 over it, 1.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Commands/VadBenchmark.swift Sources/FluidAudioCLI/Commands/VadBenchmark.swift— FileTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: VadBenchmark (8-832). The bar is 500 significant lines; this is 93 over it, 1.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Cohere/CohereBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift— FileTooLong — 592 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: CohereBenchmark (12-749). The bar is 500 significant lines; this is 92 over it, 1.18× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Nemotron/StreamingNemotronMultilingualAsrManager.swift Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift— FileTooLong — 574 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 74 over it, 1.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Commands/Nemotron3DiarizeCommand.swift Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift— FileTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: Nemotron3DiarizeCommand (7-698). The bar is 500 significant lines; this is 63 over it, 1.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Clustering/VBxClustering.swift Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift— FileTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: VBxClustering (26-776). The bar is 500 significant lines; this is 53 over it, 1.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Commands/SortformerBenchmark.swift Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift— FileTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: SortformerBenchmark (6-748). The bar is 500 significant lines; this is 53 over it, 1.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: G2p/LuxTtsG2p.swift Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift— FileTooLong — 539 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: LuxTtsG2p (24-765). The bar is 500 significant lines; this is 39 over it, 1.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: SlidingWindow/SlidingWindowAsrManager.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift— FileTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 35 over it, 1.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Sortformer/SortformerDiarizer.swift Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift— FileTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: SortformerDiarizer (12-980). The bar is 500 significant lines; this is 35 over it, 1.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
Hotspot: Sources/FluidAudioCLI/Commands/TTSCommand.swift Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— Sources/FluidAudioCLI/Commands/TTSCommand.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 113 in TTS.run at line 58. 3 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/TTSCommand.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ModelNames.swift Sources/FluidAudio/ModelNames.swift:133— Sources/FluidAudio/ModelNames.swift changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in Repo.name at line 133. 4 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ModelNames.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:241— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in TranscribeCommand.parseArguments at line 241. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/Shared/Download/ModelHub.swift Sources/FluidAudio/Shared/Download/ModelHub.swift:763— Sources/FluidAudio/Shared/Download/ModelHub.swift changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ModelHub.repoIncludeRule at line 763. 5 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/Shared/Download/ModelHub.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/FluidAudioCLI.swift Sources/FluidAudioCLI/FluidAudioCLI.swift:15— Sources/FluidAudioCLI/FluidAudioCLI.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in FluidAudioCLI.main at line 15. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/FluidAudioCLI.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:256— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in AsrManager.reconcileFinalWindowSeam at line 256. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:45— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in ChunkProcessor.processWithDualDecodeArbitration at line 45. 3 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in TtsBenchmarkCommand.run at line 93. 1 of those changes was a fix/bug commit, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:642— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in ASRBenchmark.runASRBenchmark at line 642. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:58— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in StreamingNemotronMultilingualAsrManager.processChunk at line 58. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:432— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in SlidingWindowAsrManager.processWindow at line 432. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:58— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in CtcEarningsBenchmark.runCLI at line 58. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:103— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in TdtDecoderV3.decodeWithTimings at line 103. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:47— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in EmissionDelayBenchmark.runCLI at line 47. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:822— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in FLEURSBenchmark.runCLI at line 822. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:134— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ParaformerManager.decodeWithTimestamps at line 134. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:145— Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in DatasetDownloader.downloadCommonVoiceJapanese at line 145. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:10— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in StreamingNemotronAsrManager.processChunk at line 10. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:321— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in AsrModels.load at line 321. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:29— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in VocabularyRescorer.findCandidateTermsForWord at line 29. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:450— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in KokoroAneResourceDownloader.ensureVoicePack at line 450. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/Shared/Download/FileDownloader.swift Sources/FluidAudio/Shared/Download/FileDownloader.swift:294— Sources/FluidAudio/Shared/Download/FileDownloader.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in FileDownloader.download at line 294. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/Shared/Download/FileDownloader.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:22— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in TTSAsrVerifyCommand.run at line 22. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:357— Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in OfflineDiarizerConfig.validate at line 357. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:125— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in KokoroAneEnglishPhonemizer.resolveWord at line 125. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
ClassTooLong: TTS Sources/FluidAudioCLI/Commands/TTSCommand.swift:5— ClassTooLong — 1307 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 907 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TtsBenchmarkCommand Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:33— ClassTooLong — 1153 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 753 over it, 2.88× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StreamDiarizationBenchmark Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:8— ClassTooLong — 1000 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 600 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ChunkProcessor Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:3— ClassTooLong — 990 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 590 over it, 2.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PocketTtsSynthesizer Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:14— ClassTooLong — 864 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 464 over it, 2.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CtcEarningsBenchmark Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:9— ClassTooLong — 821 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 421 over it, 2.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModelNames Sources/FluidAudio/ModelNames.swift:403— ClassTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 397 over it, 1.99× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OfflineDiarizerManager Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:12— ClassTooLong — 698 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 298 over it, 1.75× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TranscribeCommand Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:197— ClassTooLong — 679 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 279 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OfflineEmbeddingExtractor Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:62— ClassTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 268 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DatasetDownloader Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:7— ClassTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 265 over it, 1.66× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VadBenchmark Sources/FluidAudioCLI/Commands/VadBenchmark.swift:8— ClassTooLong — 587 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 187 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CohereBenchmark Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:12— ClassTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 163 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Nemotron3DiarizeCommand Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:7— ClassTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 155 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SortformerBenchmark Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:6— ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 149 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VBxClustering Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:25— ClassTooLong — 548 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 148 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LuxTtsG2p Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:24— ClassTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 138 over it, 1.35× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SortformerDiarizer Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:12— ClassTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 131 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FLEURSBenchmark Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:9— ClassTooLong — 513 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 113 over it, 1.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LSEENDBenchmark Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:6— ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 104 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TdtDecoderV3 Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:33— ClassTooLong — 465 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 65 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModelHub Sources/FluidAudio/Shared/Download/ModelHub.swift:10— ClassTooLong — 456 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 56 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DiarizerTimeline Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:627— ClassTooLong — 434 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 34 over it, 1.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EmissionDelayBenchmark Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:18— ClassTooLong — 434 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 34 over it, 1.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DiarizationMetricsCalculator Sources/FluidAudioCLI/Utils/DiarizationMetrics.swift:69— ClassTooLong — 417 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 17 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (9 lines × 2) Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:455— Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:455-463 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:490-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:499` calls `processLocked` and `Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:464` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Sources/FluidAudio/Shared/Download/ModelHub.swift:86— Sources/FluidAudio/Shared/Download/ModelHub.swift:86-94 | Sources/FluidAudio/Shared/Download/ModelHub.swift:320-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Shared/Download/ModelHub.swift:86` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/G2P/G2PModel.swift:115— Sources/FluidAudio/TTS/G2P/G2PModel.swift:115-123 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:94-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/G2P/G2PModel.swift:115` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/G2P/G2PModel.swift:114` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:93` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:907— Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:907-915 | Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:551-559 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:93— Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:93-101 | Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:208-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:66— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:66-74 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:75-83 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:74` calls `featureValue` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:65` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsVoiceCloner.swift:93— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsVoiceCloner.swift:93-101 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2GlueOps.swift:90-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsVoiceCloner.swift:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:387— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:387-395 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Tokenizer/StyleTTS2Phonemizer.swift:250-258 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:82— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:82-90 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:105-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:252— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:252-260 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:264-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/VocabularyRescorer+CandidateMatching.swift:55— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/VocabularyRescorer+CandidateMatching.swift:55-63 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/VocabularyRescorer+CandidateMatching.swift:127-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/VocabularyRescorer+CandidateMatching.swift:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:81— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:81-89 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:179-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:133— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:133-141 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:98-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:133` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:387— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:387-395 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:1233-1241 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:69— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:69-77 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:53-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/FluidAudioCLI/Commands/ASR/ParaformerTranscribeCommand.swift:30— Sources/FluidAudioCLI/Commands/ASR/ParaformerTranscribeCommand.swift:30-38 | Sources/FluidAudioCLI/Commands/ASR/SenseVoiceTranscribeCommand.swift:36-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/ParaformerTranscribeCommand.swift:30` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/Commands/ASR/SenseVoiceTranscribeCommand.swift:35` calls `printUsage` and `Sources/FluidAudioCLI/Commands/ASR/ParaformerTranscribeCommand.swift:29` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:84— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:84-93 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:109-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:417— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:417-425 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:485-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:417` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:267— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:267-275 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:159-167 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/Inflect/InflectManager.swift:186— Sources/FluidAudio/TTS/Inflect/InflectManager.swift:186-194 | Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Manager.swift:328-336 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/LuxTts/LuxTtsManager.swift:48— Sources/FluidAudio/TTS/LuxTts/LuxTtsManager.swift:48-56 | Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:89-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ModelStore.swift:39— Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ModelStore.swift:39-47 | Sources/FluidAudio/TTS/Supertonic3/Supertonic3Manager.swift:51-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ModelStore.swift:37` calls `private` and `Sources/FluidAudio/TTS/Supertonic3/Supertonic3Manager.swift:45` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) Sources/FluidAudio/Shared/AssetDownloader.swift:81— Sources/FluidAudio/Shared/AssetDownloader.swift:81-85 | Sources/FluidAudio/Shared/AssetDownloader.swift:88-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:250— Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:250-254 | Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:270-274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Sources/FluidAudio/VAD/Fsmn/FsmnVadManager.swift:125— Sources/FluidAudio/VAD/Fsmn/FsmnVadManager.swift:125-129 | Sources/FluidAudio/VAD/Fsmn/FsmnVadManager.swift:142-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/VAD/Fsmn/FsmnVadManager.swift:125` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:178— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:178-182 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:189-193 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:183— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:183-188 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:192-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:291— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:291-295 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:543-547 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:70— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:70-74 | Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:23-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:88— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:88-92 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:480-484 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/FluidAudioCLI/Commands/SortformerCommand.swift:266— Sources/FluidAudioCLI/Commands/SortformerCommand.swift:266-270 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:386-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:134— Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:134-142 | Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:288-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) Sources/FluidAudioCLI/Utils/WERCalculator.swift:12— Sources/FluidAudioCLI/Utils/WERCalculator.swift:12-16 | Sources/FluidAudioCLI/Utils/WERCalculator.swift:39-45 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Utils/WERCalculator.swift:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:915— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:915-919 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:976-980 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:915` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:495— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:495-501 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualMultiStreamBench.swift:150-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:495` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:229— Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:229-233 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:164-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (5 lines × 2) Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:169— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:169-173 | Sources/FluidAudio/Diarizer/DiarizationDER.swift:30-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Sources/FluidAudio/Speaker/CampPlusModels.swift:23— Sources/FluidAudio/Speaker/CampPlusModels.swift:23-27 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:23-27 — before extracting anything, compare `Sources/FluidAudio/Speaker/CampPlusModels.swift` and `Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:36— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:36-40 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceManager.swift:39-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:32— Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:32-36 | Sources/FluidAudio/TTS/NeuTts/NeuTtsManager.swift:31-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Sources/FluidAudio/Shared/AudioConverter.swift:510— Sources/FluidAudio/Shared/AudioConverter.swift:510-514 | Sources/FluidAudio/Shared/AudioConverter.swift:518-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualStreamingConfig.swift:90— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualStreamingConfig.swift:90-94 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronStreamingConfig.swift:68-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:129— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:129-133 | Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:36-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Scripts/voice_cloning/evaluate_voice.py:224— Scripts/voice_cloning/evaluate_voice.py:224-228 | Scripts/voice_cloning/evaluate_voice.py:237-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:149— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:149-155 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:652-658 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:171— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:171-177 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceManager.swift:121-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Canary/CanaryManager.swift:171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:69— Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:69-75 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:95-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:94` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:68` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:316— Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:316-322 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:337-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:316` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:239— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:239-245 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:272-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:375— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:375-381 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:448-454 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:84— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:84-90 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:78-84 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:294— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:294-300 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:471-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1427— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1427-1433 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1473-1479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1427` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:13— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:13-19 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:29-35 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:166— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:166-172 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:505-511 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:489— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:489-495 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:714-720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:489` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:485` calls `debugLog`, `O` and `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:710` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:30— Sources/FluidAudioCLI/Commands/TTSCommand.swift:30-36 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:50-56 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:555— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:555-561 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:645-651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:555` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:765— Sources/FluidAudioCLI/Commands/VadBenchmark.swift:765-771 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:773-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/VadBenchmark.swift:765` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:214— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:214-220 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:142-149 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:67— Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:67-73 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoManager.swift:77-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:332— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:332-338 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:414-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Scripts/run_benchmarks.py:170— Scripts/run_benchmarks.py:170-176 | Scripts/run_benchmarks.py:196-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Sources/FluidAudio/Speaker/CampPlusModels.swift:34— Sources/FluidAudio/Speaker/CampPlusModels.swift:34-39 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:34-39 — before extracting anything, compare `Sources/FluidAudio/Speaker/CampPlusModels.swift` and `Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:240— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:240-245 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceManager.swift:118-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:261— Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:261-266 | Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:267-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:261` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:260` calls `interpretYear` and `Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:266` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:297— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:297-302 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:370-375 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:366— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:366-371 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:439-444 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:409— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:409-414 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:482-487 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:409` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:62— Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:62-67 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:62-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:126— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:126-132 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:245-250 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:393— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:393-398 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:143-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:369— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:369-374 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Tokenizer/StyleTTS2Phonemizer.swift:235-240 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:317— Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:317-322 | Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:342-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:317` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:215— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:215-224 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:229-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:225` calls `digitString`, `intToHanzi` and `Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:234` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:18— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:18-24 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:21-26 — before extracting anything, compare `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift` and `Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:18` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:30— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:30-36 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:37-42 — before extracting anything, compare `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift` and `Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:30` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:149— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:149-154 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:166-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:527— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:527-533 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:634-639 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:527` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Scripts/run_benchmarks.py:180— Scripts/run_benchmarks.py:180-185 | Scripts/run_benchmarks.py:193-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:217— Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:217-230 | Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:379-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:368— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:368-381 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:415-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:368` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:127— Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:127-140 | Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:330-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:127` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:156— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:156-169 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:155-168 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CTC/CtcDecoder.swift:257— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CTC/CtcDecoder.swift:257-270 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:202-215 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:300— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:300-313 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:347-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:715— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:715-728 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:343-356 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:715` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:139— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:139-152 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:192-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualStreamingConfig.swift:54— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualStreamingConfig.swift:54-67 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronStreamingConfig.swift:37-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualStreamingConfig.swift:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:367— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:367-380 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:434-447 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:388— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:388-401 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:457-470 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:468— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:468-481 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:694-707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:468` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:83— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:83-96 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:97-110 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103-116 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:69-82 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:118— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:118-131 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:114-127 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:133` calls `info`, `downloadLibriSpeech` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:129` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Sources/FluidAudio/Shared/ModelWarmup.swift:55— Sources/FluidAudio/Shared/ModelWarmup.swift:55-62 | Sources/FluidAudio/Shared/ModelWarmup.swift:69-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Shared/ModelWarmup.swift:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:404— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:404-411 | Sources/FluidAudio/Diarizer/Sortformer/SortformerModelInference.swift:306-313 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:123— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:123-130 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:127-134 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:305— Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:305-312 | Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:444-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:305` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:146— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:146-153 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:198-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:282— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:282-289 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:533-541 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:146— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:146-153 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:295-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Sources/FluidAudioCLI/Commands/ASR/SenseVoiceBenchmark.swift:20— Sources/FluidAudioCLI/Commands/ASR/SenseVoiceBenchmark.swift:20-27 | Sources/FluidAudioCLI/Commands/G2PBenchmark.swift:58-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/SenseVoiceBenchmark.swift:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:330— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:330-337 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:129-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:137` calls `Date` and `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:338` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:226— Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:226-233 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:302-309 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:629— Sources/FluidAudioCLI/Commands/TTSCommand.swift:629-636 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1129-1136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:629` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/TTSCommand.swift:1137` calls `Double` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:637` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1345— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1345-1352 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1421-1428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:1345` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:50— Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:50-57 | Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:262-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:153— Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:153-160 | Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift:139-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:161` calls `Double` and `Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift:147` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:785— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:785-792 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtModelInference.swift:255-264 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:195— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:195-204 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:499-509 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:80— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:80-89 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:91-100 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:80` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Sources/FluidAudio/TTS/Inflect/InflectError.swift:15— Sources/FluidAudio/TTS/Inflect/InflectError.swift:15-24 | Sources/FluidAudio/TTS/LuxTts/LuxTtsError.swift:15-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Inflect/InflectError.swift:15` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Error.swift:16— Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Error.swift:16-25 | Sources/FluidAudio/TTS/Supertonic3/Supertonic3Error.swift:19-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Error.swift:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:55— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:55-64 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:63-72 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:75` calls `featureValue` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:67` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:267— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:267-276 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:371-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:105— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:105-114 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:406-415 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:53— Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:53-62 | Sources/FluidAudioCLI/Commands/VadAnalyzeCommand.swift:29-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:861— Sources/FluidAudioCLI/Commands/TTSCommand.swift:861-870 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1501-1510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:861` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:105— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:105-114 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:195-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:206` calls `printUsage` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:115` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:243— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:243-252 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:273-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:340— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:340-349 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:27-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:351— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:351-360 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1159-1168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Sources/FluidAudio/Shared/AudioConverter.swift:221— Sources/FluidAudio/Shared/AudioConverter.swift:221-237 | Sources/FluidAudio/Shared/AudioConverter.swift:328-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) Sources/FluidAudio/ASR/Shared/PunctuationCommitLayer.swift:248— Sources/FluidAudio/ASR/Shared/PunctuationCommitLayer.swift:248-264 | Sources/FluidAudio/ASR/Shared/PunctuationCommitLayer.swift:286-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Shared/PunctuationCommitLayer.swift:248` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:323— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:323-339 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:276-292 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:323` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17 lines × 2) Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:90— Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:90-106 | Sources/FluidAudioCLI/Commands/EnhanceCommand.swift:44-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:648— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:648-664 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:156-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:648` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:668— Sources/FluidAudioCLI/Commands/VadBenchmark.swift:668-684 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:745-761 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/VadBenchmark.swift:685` calls `appendingPathComponent`, `max` and `Sources/FluidAudioCLI/Commands/VadBenchmark.swift:762` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:108— Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:108-124 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:240-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:126` calls `info` and `Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:258` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:508— Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:508-524 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:533-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:508` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17 lines × 2) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:89— Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:89-105 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:230-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:89` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:152— Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:152-168 | Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:172-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) Sources/FluidAudio/Shared/Float16Conversion.swift:12— Sources/FluidAudio/Shared/Float16Conversion.swift:12-22 | Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:24-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Shared/Float16Conversion.swift:12` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) Sources/FluidAudio/Shared/Float16Conversion.swift:26— Sources/FluidAudio/Shared/Float16Conversion.swift:26-36 | Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:11-21 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Shared/Float16Conversion.swift:26` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:208— Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:208-218 | Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:226-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:208` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:452— Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:452-462 | Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:473-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:192— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:192-202 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:124-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:192` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:807— Sources/FluidAudioCLI/Commands/TTSCommand.swift:807-817 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:948-958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:482— Sources/FluidAudioCLI/Commands/VadBenchmark.swift:482-492 | Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:626-636 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:367— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:367-377 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:511-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:456— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:456-466 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:472-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:572— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:572-582 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:304-314 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) Sources/FluidAudio/Diarizer/Segmentation/SegmentationProcessor.swift:114— Sources/FluidAudio/Diarizer/Segmentation/SegmentationProcessor.swift:114-126 | Sources/FluidAudio/Diarizer/Segmentation/SegmentationProcessor.swift:185-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:385— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:385-397 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:458-470 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:385` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:113— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:113-125 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:480-492 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:79— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:79-91 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:95-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:317— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:317-329 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:397-409 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:317` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/FluidAudioCLI/Commands/ProcessCommand.swift:15— Sources/FluidAudioCLI/Commands/ProcessCommand.swift:15-27 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:12-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ProcessCommand.swift:15` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:556— Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:556-568 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:253-265 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:556` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/FluidAudioCLI/Utils/WERCalculator.swift:52— Sources/FluidAudioCLI/Utils/WERCalculator.swift:52-64 | Sources/FluidAudioCLI/Utils/WERCalculator.swift:95-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Utils/WERCalculator.swift:52` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:591— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:591-603 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:864-876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:591` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:104— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:104-115 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:970-981 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) Sources/FluidAudio/TTS/PocketTTS/PocketTTSError.swift:10— Sources/FluidAudio/TTS/PocketTTS/PocketTTSError.swift:10-21 | Sources/FluidAudio/TTS/Shared/TTSError.swift:9-20 — before extracting anything, compare `Sources/FluidAudio/TTS/PocketTTS/PocketTTSError.swift` and `Sources/FluidAudio/TTS/Shared/TTSError.swift` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:70— Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:70-81 | Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:96-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:70` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `cutoffHz` to `Float = 10000` in one and `Float = 80` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:163— Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:163-174 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:192-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:163` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:134— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:134-145 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:252-263 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:322— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:322-333 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:436-447 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:322` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:114— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:114-125 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:198-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:736— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:736-747 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:878-889 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:736` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TooManyMethods: StreamingNemotronMultilingualAsrManager Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:25— TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PocketTtsSynthesizer Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:14— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChunkProcessor Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:3— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AsrManager Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:6— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VocabularyRescorer Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:12— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SortformerDiarizer Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:12— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SpeakerManager Sources/FluidAudio/Diarizer/Clustering/SpeakerManager.swift:8— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (15 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:208— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:208-222 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:162-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:208` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:169— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:169-183 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:197-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:102— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:102-116 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:39-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/FluidAudioCLI/Commands/SortformerCommand.swift:83— Sources/FluidAudioCLI/Commands/SortformerCommand.swift:83-97 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:260-274 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/SortformerCommand.swift:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:53— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:53-67 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:153-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:53` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:455— Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:455-469 | Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:472-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:44— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:44-58 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:350-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:43` calls `info` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:349` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:240— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:240-245 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:109-114 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:410-415 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) Sources/FluidAudio/ASR/SenseVoice/SenseVoiceManager.swift:118— Sources/FluidAudio/ASR/SenseVoice/SenseVoiceManager.swift:118-123 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:270-275 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:374-379 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:189— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:189-194 | Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:228-233 | Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:340-345 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:85— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:85-90 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:108-113 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:124-129 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:149— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:149-154 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:298-303 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:401-406 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:784— Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:784-789 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:134-140 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:285-291 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:254— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:254-259 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:283-288 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:323-328 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:368— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:368-372 | Sources/FluidAudio/Speaker/CampPlusEmbedder.swift:39-43 | Sources/FluidAudio/VAD/Fsmn/FsmnVadManager.swift:124-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:52— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:52-56 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:69-73 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:79-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:439— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:439-443 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:342-346 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:415-419 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:439` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:190— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:190-194 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Flow.swift:39-43 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:96-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:264— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:264-269 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:180-184 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:218-223 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:264` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 3) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:364— Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:364-371 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:356-360 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1164-1168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:171— Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:171-175 | Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:179-183 | Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:186-191 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:52— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:52-67 | Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:89-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:275— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:275-290 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:368-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:275` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/VocabularyRescorer+CandidateMatching.swift:73— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/VocabularyRescorer+CandidateMatching.swift:73-88 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/VocabularyRescorer+CandidateMatching.swift:99-114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/VocabularyRescorer+CandidateMatching.swift:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:119— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:119-134 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:56-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:534— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:534-549 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:612-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:534` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:737— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:737-752 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:804-819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:737` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Repeated repair: Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:335— Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is OfflineDiarizerManager.cluster at line 335), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(offline-diarizer): hold speaker caps against both cluster censuses (#891)”; “fix(diarizer/offline): warn on macOS 14 BNNS-crash-prone builds + document known OS issue (#878) (#885)”; “fix(diarizer/offline): propagate cancellation to workers (#886)”; “fix(offline-diarizer): pyannote-parity clustering — threshold semantics, constraint count, constrained assignment (#802)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Types.swift Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Types.swift:132— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Types.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is KokoroAneStage.bundleName at line 132), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tts/kokoro-ane): restore long-text chunking in synthesizeDetailed(text:) (#940) (#965)”; “fix(tts/kokoro-ane): quiet onset on long utterances — use fp32 KokoroProsody_v2 (#947) (#963)”; “fix(tts/kokoro-ane): adopt COLA-corrected KokoroTail_v2 + native output level for all variants (#868)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Types.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:233— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ASRError.errorDescription at line 233), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(asr/tdt): default v3 long-form to the no-mel path (silence-aligned starts) (#869)”; “fix(asr): end-align the final window at the last speech-bearing frame (#747) (#800)”; “fix(asr/nemotron): native-Swift mel front-end to fix iPadOS cold-start zero output (#739) (#744)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsResourceDownloader.swift Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsResourceDownloader.swift:163— Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsResourceDownloader.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is PocketTtsResourceDownloader.shouldSkipAsset at line 163), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tts/pockettts): per-language mimi encoders for non-English voice cloning (#793) (#871)”; “fix(download): latch pre-attach cancellation so cancelled downloads never start (#864)”; “fix(tts/pocket-tts): enable voice cloning for 24-layer non-English packs (#793) (#797)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsResourceDownloader.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV2.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV2.swift:61— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV2.swift changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is TdtDecoderV2.adaptConfigForV2 at line 61), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(asr): resolve sentence-final punctuation ids from the loaded vocabulary (#905) (#906)”; “fix(asr/tdt): default v3 long-form to the no-mel path (silence-aligned starts) (#869)”; “fix(asr/streaming): re-decode final window from frame 0 — stops #855 trailing-word loss (#861)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 13:13:51 -04:00' --until='2026-09-30 13:13:51 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV2.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (7 lines × 3) Sources/FluidAudio/TTS/G2P/G2PModel.swift:65— Sources/FluidAudio/TTS/G2P/G2PModel.swift:65-71 | Sources/FluidAudio/TTS/G2P/G2PModel.swift:88-94 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:84-90 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:60— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:60-66 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:68-74 | Sources/FluidAudio/TTS/NeuTts/NeuTtsSynthesizer.swift:65-71 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:75` calls `featureValue` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:67` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:124— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:124-130 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:128-134 | Sources/FluidAudio/TTS/NeuTts/NeuTtsSynthesizer.swift:102-108 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:366— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:366-374 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:373-381 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:469-475 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:375` calls `fflush` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:476` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1227— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1227-1236 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1324-1330 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1399-1406 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:1227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100-114 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:116-130 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:139-153 | Sources/FluidAudio/Speaker/CampPlusModels.swift:65-79 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:62-76 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:116— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:116-127 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:148-159 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:172-183 | Sources/FluidAudio/Speaker/CampPlusModels.swift:81-92 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:78-89 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:286— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:286-361 | Sources/FluidAudio/TTS/NeuTts/NeuTtsPrompt.swift:39-47 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:785-790 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:805-820 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:284-325 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:174— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:174-221 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Flow.swift:19-67 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:88-135 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1424-1433 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1469-1479 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (22 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:76— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:76-97 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:115-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (22 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:642— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:642-663 | Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:847-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:642` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:214— Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:214-235 | Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:510-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:246— Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:246-267 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:427-448 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:246` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `frameStep` to `Double = defaultFrameStep` in one and `Double` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18–19 lines × 2) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:832— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:832-849 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:858-876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:832` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1106— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1106-1123 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1267-1285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1106` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:259— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:259-277 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:515-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:264— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:264-281 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:176-194 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:264` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:263` calls `info` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:175` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:161— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:161-179 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:149-167 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:183` calls `streamingEncoderFile` and `Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:172` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:354— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:354-372 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:526-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) Sources/FluidAudioCLI/Commands/EnhanceCommand.swift:64— Sources/FluidAudioCLI/Commands/EnhanceCommand.swift:64-82 | Sources/FluidAudioCLI/Commands/VadAnalyzeCommand.swift:81-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/EnhanceCommand.swift:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:82— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:82-100 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:69-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:264— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:264-280 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:354-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:285— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:285-300 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:372-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:561— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:561-577 | Sources/FluidAudioCLI/Utils/InlineDiff.swift:44-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:561` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `hypothesis` to `[String]` in one and `[String]) -> (String` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16–17 lines × 2) Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:351— Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:351-366 | Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:402-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–15 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:348— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:348-362 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:402-415 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:348` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–15 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:82— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:82-96 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:99-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:870— Sources/FluidAudioCLI/Commands/TTSCommand.swift:870-883 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1039-1053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:870` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:465— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:465-478 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:712-726 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:465` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:189— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:189-197 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:195-203 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:121-129 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:147— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:147-155 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:59-67 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:69-77 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:212— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:212-220 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1030-1038 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:420-428 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:212` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) Sources/FluidAudioCLI/Commands/TTSCommand.swift:861— Sources/FluidAudioCLI/Commands/TTSCommand.swift:861-869 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1018-1026 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1501-1509 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:861` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–8 lines × 2) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:655— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:655-660 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:128-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:655` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–8 lines × 2) Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:69— Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:69-74 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:79-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–8 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:312— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:312-317 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:343-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:343` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `s` to `[Float] ) async throws -> (d: [Float]` in one and `[Float] ) async throws -> (f0: [Float]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:342` calls `featureValue` and `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:311` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–8 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:381— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:381-386 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:448-455 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:308— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:308-339 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:140-165 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:262-292 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:348-365 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:530— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:530-601 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:605-699 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:703-772 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:776-838 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:677— Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:677-762 | Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:950-1070 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:12-131 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:145-273 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (25 lines × 2) Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:305— Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:305-329 | Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:579-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:58— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:58-82 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:43-67 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:580— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:580-604 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:397-422 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:580` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:104— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:104-127 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:92-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/MultiStreamCommand.swift:201— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/MultiStreamCommand.swift:201-224 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:811-833 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/MultiStreamCommand.swift:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:835` calls `Double`, `updateAudioPosition` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/MultiStreamCommand.swift:226` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23–24 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:40— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:40-62 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:26-49 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:651— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:651-673 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:311-333 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:651` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:65— Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:65-87 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:206-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronVocabBenchmark.swift:267— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronVocabBenchmark.swift:267-290 | Sources/FluidAudioCLI/Commands/G2PBenchmark.swift:343-365 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronVocabBenchmark.swift:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) Sources/FluidAudio/Diarizer/Extraction/EmbeddingExtractor.swift:134— Sources/FluidAudio/Diarizer/Extraction/EmbeddingExtractor.swift:134-151 | Sources/FluidAudio/Diarizer/Extraction/EmbeddingExtractor.swift:182-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Extraction/EmbeddingExtractor.swift:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:149— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:149-166 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:159-176 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:149` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:527— Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:527-544 | Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:574-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:527` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:88— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:88-101 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:230-243 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:265-278 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1324— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1324-1337 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1400-1413 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1476-1489 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:28— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:28-41 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:26-39 | Sources/FluidAudioCLI/Commands/TTS/LuxTtsG2pDumpCommand.swift:23-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–13 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:226— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:226-235 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:361-373 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–13 lines × 2) Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:231— Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:231-240 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:169-181 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–13 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:296— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:296-305 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:548-560 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:567` calls `warmupModels` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:311` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–12 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:332— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:332-341 | Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:411-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:332` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:58— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:58-69 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:47-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:396— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:396-407 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:450-459 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:396` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 3) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:273— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:273-283 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:185-194 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:227-237 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:273` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:376— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:376-386 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:383-393 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:476-485 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:88— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:88-98 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:88-97 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:265-275 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:222— Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:222-231 | Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:333-343 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:211— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:211-220 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1029-1039 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:31— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:31-40 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:189-199 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:31` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:380— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:380-388 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceManager.swift:103-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `features` to `MLMultiArray` in one and `MLMultiArray) throws -> (MLMultiArray` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9–10 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:87— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:87-95 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:36-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:49— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:49-58 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:137-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) Sources/FluidAudio/TTS/G2P/G2PModel.swift:68— Sources/FluidAudio/TTS/G2P/G2PModel.swift:68-74 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:86-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/G2P/G2PModel.swift:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:265— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:265-272 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:325-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:265` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:273` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:332` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 2) Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:76— Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:76-82 | Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:281-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:165— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:165-170 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:604-609 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:631-636 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:640-645 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:165` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:328— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:328-333 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:127-132 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:153-158 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:197-202 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:555— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:555-562 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:645-652 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:729-735 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:797-802 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:555` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:120— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:120-126 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:132-138 | Sources/FluidAudio/TTS/Inflect/Assets/InflectResourceDownloader.swift:41-47 | Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:42-48 | Sources/FluidAudio/TTS/NeuTts/NeuTtsModels.swift:102-108 | Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ResourceDownloader.swift:151-159 | Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ResourceDownloader.swift:98-106 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:341— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:341-359 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:361-383 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:326-344 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:367-387 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:205-232 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:249-275 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedRnntDecoder.swift:137-150 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Duplicated block (27 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:349— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:349-375 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:429-455 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:349` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:378— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:378-404 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:196-222 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25–26 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:129— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:129-154 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:116-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:129` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (25–26 lines × 2) Scripts/run_benchmarks.py:79— Scripts/run_benchmarks.py:79-103 | Scripts/run_benchmarks.py:107-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–20 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1054— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1054-1073 | Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1101-1118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1054` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–20 lines × 2) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:107— Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:107-124 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:248-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–18 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:436— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:436-449 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:525-542 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:436` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–18 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:558— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:558-571 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:410-427 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:558` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–16 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:341— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:341-356 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:407-420 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:341` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–16 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:210— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:210-223 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:310-325 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 3) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:45— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:45-59 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:48-61 | Sources/FluidAudio/TTS/NeuTts/NeuTtsModels.swift:43-55 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 3) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:681— Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:681-695 | Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:954-968 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:16-28 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:681` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:137— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:137-150 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:107-120 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:190-204 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:179— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:179-193 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:127-140 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:169-183 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–15 lines × 2) Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:202— Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:202-212 | Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:545-559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:202` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–15 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:254— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:254-268 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:212-222 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:254` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 4) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:680— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:680-692 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:167-179 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:146-158 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:150-162 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:680` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 4) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103-115 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:69-81 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:114-126 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:132-144 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/MultiStreamCommand.swift:54— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/MultiStreamCommand.swift:54-66 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/MultiStreamCommand.swift:69-81 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:746-757 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (12–13 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:37— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:37-49 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:39-50 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:25-37 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxMLSupport.swift:108— Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxMLSupport.swift:108-120 | Sources/FluidAudio/TTS/NeuTts/NeuTtsSynthesizer.swift:167-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxMLSupport.swift:108` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:177— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:177-188 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:289-301 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:177` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 8) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:678— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:678-688 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:901-911 | Sources/FluidAudioCLI/Commands/G2PBenchmark.swift:71-81 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:165-175 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:144-154 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:49-59 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:148-158 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:65-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:678` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 8) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:679— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:679-689 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:902-912 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:166-176 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:145-155 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:50-60 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:128-138 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:149-159 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:66-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 8 times.
Duplicated block (8–11 lines × 2) Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:180— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:180-187 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:413-423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–11 lines × 2) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:341— Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:341-348 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:388-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:341` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:341` calls `String` and `Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:388` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–10 lines × 2) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:596— Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:596-603 | Sources/FluidAudio/Diarizer/Offline/Extraction/PLDATransform.swift:186-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Offline/Extraction/PLDATransform.swift:186` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8–10 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1227— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1227-1236 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1323-1330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:1227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:129— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:129-137 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:236-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:207— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:207-214 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:268-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–8 lines × 4) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:605— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:605-612 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:632-637 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:641-646 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:649-656 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:605` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–8 lines × 4) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:357— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:357-362 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:402-407 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:421-428 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:471-478 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:85— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:85-92 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:108-115 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:123-130 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:101— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:101-108 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:67-74 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:222-229 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 6) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:344— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:344-350 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:368-374 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:389-395 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:408-414 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:435-441 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:458-464 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:344` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 6) Sources/FluidAudioCLI/Commands/TTSCommand.swift:628— Sources/FluidAudioCLI/Commands/TTSCommand.swift:628-634 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1128-1134 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1252-1258 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1344-1350 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1420-1426 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1496-1502 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:628` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/TTSCommand.swift:1137` calls `Double` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:637` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 5) Sources/FluidAudioCLI/Commands/TTSCommand.swift:606— Sources/FluidAudioCLI/Commands/TTSCommand.swift:606-612 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:954-960 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1332-1338 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1408-1414 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1484-1490 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/TTSCommand.swift:613` calls `reduce`, `Double`, `squareRoot` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:962` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 5) Sources/FluidAudioCLI/Utils/TextNormalizer.swift:448— Sources/FluidAudioCLI/Utils/TextNormalizer.swift:448-462 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:485-494 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:538-549 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:555-561 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:593-601 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:468` calls `replacingOccurrences` and `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:555` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5–6 lines × 2) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:287— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:287-291 | Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:621-626 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5–6 lines × 2) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:133— Sources/FluidAudioCLI/Commands/VadBenchmark.swift:133-137 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:575-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/VadBenchmark.swift:133` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Low cohesion: TextNormalizer (LCOM4 7) Sources/FluidAudio/ITN/TextNormalizer.swift:27— TextNormalizer's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: TranscriptionTracker (LCOM4 5) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:7— TranscriptionTracker's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
TTS.run (cyclomatic 113) Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— TTS.run has cyclomatic complexity 113 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamDiarizationBenchmark.run (cyclomatic 105) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:171— StreamDiarizationBenchmark.run has cyclomatic complexity 105 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SortformerCommand.run (cyclomatic 93) Sources/FluidAudioCLI/Commands/SortformerCommand.swift:10— SortformerCommand.run has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamingNemotronMultilingualAsrManager.processChunk (cyclomatic 83) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:58— StreamingNemotronMultilingualAsrManager.processChunk has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LSEENDBenchmark.run (cyclomatic 81) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:57— LSEENDBenchmark.run has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SortformerBenchmark.run (cyclomatic 78) Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:66— SortformerBenchmark.run has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProcessCommand.parseArguments (cyclomatic 71) Sources/FluidAudioCLI/Commands/ProcessCommand.swift:288— ProcessCommand.parseArguments has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ASRBenchmark.runASRBenchmark (cyclomatic 70) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:642— ASRBenchmark.runASRBenchmark has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 (cyclomatic 69) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:45— StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TranscribeCommand.parseArguments (cyclomatic 64) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:241— TranscribeCommand.parseArguments has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LSEENDCommand.run (cyclomatic 60) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:9— LSEENDCommand.run has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VBxClustering.runVBx (cyclomatic 59) Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:168— VBxClustering.runVBx has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EnhanceBenchmarkCommand.run (cyclomatic 59) Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:53— EnhanceBenchmarkCommand.run has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TtsBenchmarkCommand.run (cyclomatic 58) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— TtsBenchmarkCommand.run has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CtcEarningsBenchmark.runCLI (cyclomatic 58) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:58— CtcEarningsBenchmark.runCLI has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OfflineSegmentationProcessor.process (cyclomatic 57) Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:44— OfflineSegmentationProcessor.process has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EmissionDelayBenchmark.runCLI (cyclomatic 57) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:47— EmissionDelayBenchmark.runCLI has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NemotronMultilingualFleursBenchmark.runCLI (cyclomatic 57) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:568— NemotronMultilingualFleursBenchmark.runCLI has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AsrManager.reconcileFinalWindowSeam (cyclomatic 55) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:256— AsrManager.reconcileFinalWindowSeam has cyclomatic complexity 55 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ChunkProcessor.processWithDualDecodeArbitration (cyclomatic 54) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:45— ChunkProcessor.processWithDualDecodeArbitration has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OfflineEmbeddingExtractor.extractEmbeddings (cyclomatic 53) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:299— OfflineEmbeddingExtractor.extractEmbeddings has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuxTtsG2p.phonemizeClause (cyclomatic 48) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:347— LuxTtsG2p.phonemizeClause has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamDiarizationBenchmark.calculateStreamingMetrics (cyclomatic 48) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:955— StreamDiarizationBenchmark.calculateStreamingMetrics has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CohereBenchmark.run (cyclomatic 48) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:32— CohereBenchmark.run has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CtcEarningsBenchmark.processFile (cyclomatic 47) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:420— CtcEarningsBenchmark.processFile has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModelNames.getRequiredModelNames (cyclomatic 45) Sources/FluidAudio/ModelNames.swift:1729— ModelNames.getRequiredModelNames has cyclomatic complexity 45 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Repo.name (cyclomatic 47) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
TdtDecoderV3.decodeWithTimings (cyclomatic 43) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:103— TdtDecoderV3.decodeWithTimings has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanaryEarningsBenchmark.run (cyclomatic 43) Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:14— CanaryEarningsBenchmark.run has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NemotronMultilingualMultiStreamBench.run (cyclomatic 43) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualMultiStreamBench.swift:36— NemotronMultilingualMultiStreamBench.run has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SpanishG2P.segment (cyclomatic 42) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:145— SpanishG2P.segment has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CtcDecodeBenchmark.runCLI (cyclomatic 41) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:11— CtcDecodeBenchmark.runCLI has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OfflineReconstruction.buildSegments (cyclomatic 40) Sources/FluidAudio/Diarizer/Offline/Utils/OfflineReconstruction.swift:24— OfflineReconstruction.buildSegments has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChunkProcessor.process (cyclomatic 40) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:455— ChunkProcessor.process has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrenchPhonology.mapToEspeak (cyclomatic 40) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:286— FrenchPhonology.mapToEspeak has cyclomatic complexity 40 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
VocabularyRescorer.findCandidateTermsForWord (cyclomatic 40) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:29— VocabularyRescorer.findCandidateTermsForWord has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuxTtsG2p.phonemizeNormalized (cyclomatic 37) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:221— LuxTtsG2p.phonemizeNormalized has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TokenLanguageFilter.matches (cyclomatic 36) Sources/FluidAudio/Shared/TokenLanguageFilter.swift:81— TokenLanguageFilter.matches has cyclomatic complexity 36 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FLEURSBenchmark.runCLI (cyclomatic 36) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:822— FLEURSBenchmark.runCLI has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ParakeetEouCommand.main (cyclomatic 36) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:8— ParakeetEouCommand.main has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrenchPhonology.phonemize (cyclomatic 34) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:65— FrenchPhonology.phonemize has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CohereTranscribeCommand.run (cyclomatic 33) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:12— CohereTranscribeCommand.run has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TranscribeCommand.runStreaming (cyclomatic 33) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:698— TranscribeCommand.runStreaming has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NemotronVocabBenchmark.runCLI (cyclomatic 33) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronVocabBenchmark.swift:30— NemotronVocabBenchmark.runCLI has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatterboxAlignmentAnalyzer.step (cyclomatic 32) Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxAlignmentAnalyzer.swift:40— ChatterboxAlignmentAnalyzer.step has cyclomatic complexity 32 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
JapaneseTokenizer.tokenize (cyclomatic 32) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseTokenizer.swift:51— JapaneseTokenizer.tokenize has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Nemotron3DiarizeCommand.runDiarize (cyclomatic 32) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:172— Nemotron3DiarizeCommand.runDiarize has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VadBenchmark.runVadBenchmarkWithErrorHandling (cyclomatic 32) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:19— VadBenchmark.runVadBenchmarkWithErrorHandling has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TTSAsrVerifyCommand.run (cyclomatic 31) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:22— TTSAsrVerifyCommand.run has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VadAnalyzeCommand.run (cyclomatic 31) Sources/FluidAudioCLI/Commands/VadAnalyzeCommand.swift:29— VadAnalyzeCommand.run has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VadManager.detectSpeechSampleRanges (cyclomatic 30) Sources/FluidAudio/VAD/VadManager.swift:71— VadManager.detectSpeechSampleRanges has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TtsBenchmarkCommand.inferCohereLanguage (cyclomatic 30) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:1339— TtsBenchmarkCommand.inferCohereLanguage has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TranscribeCommand.runBatch (cyclomatic 30) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:462— TranscribeCommand.runBatch has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SayAsInterpreter.formatDate (cyclomatic 29) Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:239— SayAsInterpreter.formatDate has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SpanishG2P.phonemize (cyclomatic 29) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:22— SpanishG2P.phonemize has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EnhanceCommand.run (cyclomatic 29) Sources/FluidAudioCLI/Commands/EnhanceCommand.swift:23— EnhanceCommand.run has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
G2PBenchmark.runBenchmark (cyclomatic 29) Sources/FluidAudioCLI/Commands/G2PBenchmark.swift:50— G2PBenchmark.runBenchmark has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TtsBenchmarkCommand.runPhraseLoop (cyclomatic 29) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:858— TtsBenchmarkCommand.runPhraseLoop has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InlineDiff.generate (cyclomatic 29) Sources/FluidAudioCLI/Utils/InlineDiff.swift:21— InlineDiff.generate has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiarizationDER.compute (cyclomatic 28) Sources/FluidAudio/Diarizer/DiarizationDER.swift:52— DiarizationDER.compute has cyclomatic complexity 28 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LuxTtsSynthesizer.synthesize (cyclomatic 28) Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:58— LuxTtsSynthesizer.synthesize has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StreamingNemotronAsrManager.processChunk (cyclomatic 28) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:10— StreamingNemotronAsrManager.processChunk has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamingNemotronMultilingualAsrManager.loadModels (cyclomatic 28) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:347— StreamingNemotronMultilingualAsrManager.loadModels has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StreamingNemotronMultilingualAsrManager.warmupModels (cyclomatic 28) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:577— StreamingNemotronMultilingualAsrManager.warmupModels has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrenchPhonology.applyLiaison (cyclomatic 28) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:389— FrenchPhonology.applyLiaison has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JapaneseCutlet.singleMapping (cyclomatic 28) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:186— JapaneseCutlet.singleMapping has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FLEURSBenchmark.downloadLanguageSamples (cyclomatic 28) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:221— FLEURSBenchmark.downloadLanguageSamples has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuxTtsG2p.selectWord (cyclomatic 27) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:559— LuxTtsG2p.selectWord has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VocabularyRescorer.rescoreWithConstrainedCTCWordCentric (cyclomatic 27) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:467— VocabularyRescorer.rescoreWithConstrainedCTCWordCentric has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Nemotron3DiarizeCommand.runBenchmark (cyclomatic 27) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:460— Nemotron3DiarizeCommand.runBenchmark has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ModelHub.repoIncludeRule (cyclomatic 26) Sources/FluidAudio/Shared/Download/ModelHub.swift:763— ModelHub.repoIncludeRule has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
G2PModel.phonemize (cyclomatic 26) Sources/FluidAudio/TTS/G2P/G2PModel.swift:43— G2PModel.phonemize has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SpanishG2P.syllabify (cyclomatic 26) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:230— SpanishG2P.syllabify has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CtcEarningsBenchmark.applyKeywordCorrections (cyclomatic 26) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:858— CtcEarningsBenchmark.applyKeywordCorrections has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SortformerStateUpdater.getTopKIndices (cyclomatic 25) Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:465— SortformerStateUpdater.getTopKIndices has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SpanishG2P.applyAllophones (cyclomatic 25) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:331— SpanishG2P.applyAllophones has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CtcDPAlgorithm.fillDPTable (cyclomatic 25) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcDPAlgorithm.swift:121— CtcDPAlgorithm.fillDPTable has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
verify_localvqe_benchmark.verify (cyclomatic 24) Scripts/verify_localvqe_benchmark.py:119— verify_localvqe_benchmark.verify has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
LuxTtsG2p.selectPhrase (cyclomatic 23) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:604— LuxTtsG2p.selectPhrase has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MandarinG2P.segment (cyclomatic 23) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:237— MandarinG2P.segment has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanaryTranscribeCommand.run (cyclomatic 23) Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift:13— CanaryTranscribeCommand.run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ParakeetEouCommand.runBenchmark (cyclomatic 23) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:244— ParakeetEouCommand.runBenchmark has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CohereMelSpectrogram.compute (cyclomatic 22) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:127— CohereMelSpectrogram.compute has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ParaformerManager.decodeWithTimestamps (cyclomatic 22) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:134— ParaformerManager.decodeWithTimestamps has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OfflineDiarizerConfig.validate (cyclomatic 22) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:357— OfflineDiarizerConfig.validate has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChunkProcessor.collapseSeamWordDuplicates (cyclomatic 22) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:857— ChunkProcessor.collapseSeamWordDuplicates has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
StreamingEouAsrManager.processChunkAndDecode (cyclomatic 22) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:546— StreamingEouAsrManager.processChunkAndDecode has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DownloadCommand.run (cyclomatic 22) Sources/FluidAudioCLI/Commands/DownloadCommand.swift:8— DownloadCommand.run has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DiarizerTimeline.updateSegments (cyclomatic 21) Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:1169— DiarizerTimeline.updateSegments has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SayAsInterpreter.addOrdinalSuffix (cyclomatic 21) Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:172— SayAsInterpreter.addOrdinalSuffix has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatterboxNanoSynthesizer.sample (cyclomatic 21) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:215— ChatterboxNanoSynthesizer.sample has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatterboxSynthesizer.sample (cyclomatic 21) Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:290— ChatterboxSynthesizer.sample has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatasetDownloader.downloadCommonVoiceJapanese (cyclomatic 21) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:145— DatasetDownloader.downloadCommonVoiceJapanese has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnifiedBenchmark.seamArtifacts (cyclomatic 21) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Unified/UnifiedBenchmark.swift:492— UnifiedBenchmark.seamArtifacts has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SlidingWindowAsrManager.processWindow (cyclomatic 20) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:432— SlidingWindowAsrManager.processWindow has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PocketTtsConstantsLoader.loadVoiceSnapshot (cyclomatic 20) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:161— PocketTtsConstantsLoader.loadVoiceSnapshot has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChunkProcessor.spliceCandidate (cyclomatic 20) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1316— ChunkProcessor.spliceCandidate has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
StreamingNemotronMultilingualAsrManager.rebuildVocabularyBias (cyclomatic 20) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:373— StreamingNemotronMultilingualAsrManager.rebuildVocabularyBias has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CtcDPAlgorithm.ctcWordSpotMultiple (cyclomatic 20) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcDPAlgorithm.swift:311— CtcDPAlgorithm.ctcWordSpotMultiple has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CtcDecoder.swift.ctcBeamSearch (cyclomatic 20) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CTC/CtcDecoder.swift:118— CtcDecoder.swift.ctcBeamSearch has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Nemotron3DiarizeCommand.runBatch (cyclomatic 20) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:342— Nemotron3DiarizeCommand.runBatch has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
DatasetDownloader.downloadJSUTBasic5000 (cyclomatic 20) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:12— DatasetDownloader.downloadJSUTBasic5000 has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WERCalculator.editDistance (cyclomatic 20) Sources/FluidAudioCLI/Utils/WERCalculator.swift:186— WERCalculator.editDistance has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NemotronMultilingualTranscribe.run (cyclomatic 20) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:39— NemotronMultilingualTranscribe.run has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Nemotron3StateUpdater.topKIndices (cyclomatic 19) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:292— Nemotron3StateUpdater.topKIndices has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MultilingualG2PModel.phonemize (cyclomatic 19) Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:37— MultilingualG2PModel.phonemize has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamingUnifiedAsrManager.processWindow (cyclomatic 19) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:332— StreamingUnifiedAsrManager.processWindow has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChunkProcessor.mergeUsingMatches (cyclomatic 19) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1076— ChunkProcessor.mergeUsingMatches has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MandarinBopomofoMap.encode (cyclomatic 19) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinBopomofoMap.swift:139— MandarinBopomofoMap.encode has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: MandarinBopomofoMap.normalizePinyinForLookup (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
MandarinNumberNormalizer.fourDigitChunk (cyclomatic 19) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:80— MandarinNumberNormalizer.fourDigitChunk has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MandarinToneSandhiPOS.applyBuYiSandhi (cyclomatic 19) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinToneSandhiPOS.swift:64— MandarinToneSandhiPOS.applyBuYiSandhi has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EnhanceBenchmarkDataset.parseMetadata (cyclomatic 19) Sources/FluidAudioCLI/Commands/EnhanceBenchmarkDataset.swift:108— EnhanceBenchmarkDataset.parseMetadata has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JapaneseAsrBenchmark.run (cyclomatic 19) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:29— JapaneseAsrBenchmark.run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SenseVoiceBenchmark.run (cyclomatic 19) Sources/FluidAudioCLI/Commands/ASR/SenseVoiceBenchmark.swift:14— SenseVoiceBenchmark.run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
G2PModel.loadIfNeeded (cyclomatic 18) Sources/FluidAudio/TTS/G2P/G2PModel.swift:165— G2PModel.loadIfNeeded has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VDSPOperations.pairwiseEuclideanDistances (cyclomatic 18) Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:193— VDSPOperations.pairwiseEuclideanDistances has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PocketTtsConstantsLoader.parseSafetensors (cyclomatic 18) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:339— PocketTtsConstantsLoader.parseSafetensors has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamingNemotronMultilingualAsrManager.preloadShared (cyclomatic 18) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:82— StreamingNemotronMultilingualAsrManager.preloadShared has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MandarinG2P.phonemize (cyclomatic 18) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:87— MandarinG2P.phonemize has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
VocabularyRescorer.evaluateCTCMatch (cyclomatic 18) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:29— VocabularyRescorer.evaluateCTCMatch has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ASRBenchmark.generateWordDifferences (cyclomatic 18) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:546— ASRBenchmark.generateWordDifferences has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
UnifiedBenchmark.run (cyclomatic 18) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Unified/UnifiedBenchmark.swift:30— UnifiedBenchmark.run has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CanaryKeywordBooster.boost (cyclomatic 17) Sources/FluidAudio/ASR/Canary/CanaryKeywordBooster.swift:93— CanaryKeywordBooster.boost has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RomanceNumberNormalizer.read (cyclomatic 17) Sources/FluidAudio/TTS/KokoroAne/G2P/RomanceNumberNormalizer.swift:34— RomanceNumberNormalizer.read has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AsrManager.transcribeChunk (cyclomatic 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:436— AsrManager.transcribeChunk has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MandarinG2P.normalizeText (cyclomatic 17) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:413— MandarinG2P.normalizeText has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
MandarinJiebaHmm.segment (cyclomatic 17) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinJiebaHmm.swift:51— MandarinJiebaHmm.segment has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SpanishG2P.phonemizeWord (cyclomatic 17) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:90— SpanishG2P.phonemizeWord has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StyleTTS2Phonemizer.phonemize (cyclomatic 17) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Tokenizer/StyleTTS2Phonemizer.swift:66— StyleTTS2Phonemizer.phonemize has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VocabularyRescorer.alignBaseWordsToUTF8Ranges (cyclomatic 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:140— VocabularyRescorer.alignBaseWordsToUTF8Ranges has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatasetDownloader.downloadEarnings22KWS (cyclomatic 17) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:829— DatasetDownloader.downloadEarnings22KWS has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FLEURSBenchmark.downloadFLEURS (cyclomatic 17) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:122— FLEURSBenchmark.downloadFLEURS has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
nemo_ami_benchmark.calculate_der (cyclomatic 17) Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:231— nemo_ami_benchmark.calculate_der has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CoherePipeline.decodeCacheExternal (cyclomatic 16) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:680— CoherePipeline.decodeCacheExternal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AHCClustering.assignmentsFromDendrogram (cyclomatic 16) Sources/FluidAudio/Diarizer/Offline/Clustering/AHCClustering.swift:124— AHCClustering.assignmentsFromDendrogram has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OfflineSortformerDiarizer.processComplete (cyclomatic 16) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:279— OfflineSortformerDiarizer.processComplete has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PocketTtsSession.generateChunk (cyclomatic 16) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:265— PocketTtsSession.generateChunk has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AsrModels.load (cyclomatic 16) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:321— AsrModels.load has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChunkProcessor.repairSeamGaps (cyclomatic 16) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1394— ChunkProcessor.repairSeamGaps has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KokoroAneEnglishPhonemizer.resolveWord (cyclomatic 16) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:125— KokoroAneEnglishPhonemizer.resolveWord has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FrenchPhonology.tokenize (cyclomatic 16) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:442— FrenchPhonology.tokenize has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
JapaneseCutlet.romajiTokens (cyclomatic 16) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:118— JapaneseCutlet.romajiTokens has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MandarinToneSandhi.apply (cyclomatic 16) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinToneSandhi.swift:32— MandarinToneSandhi.apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CtcKeywordSpotter.computeLogProbsChunked (cyclomatic 16) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:33— CtcKeywordSpotter.computeLogProbsChunked has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatasetDownloader.downloadVoicesSubset (cyclomatic 16) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:950— DatasetDownloader.downloadVoicesSubset has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NemotronBenchmark.run (cyclomatic 16) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:37— NemotronBenchmark.run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 (cognitive 209) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:45— StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 has cognitive complexity 209 (threshold 15). Drivers by points: if/else 55 (149 pts), loops 9 (32 pts), boolean chains 17, ternaries 5 (11 pts) (nesting depth added 123). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingNemotronMultilingualAsrManager.processChunk (cognitive 168) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:58— StreamingNemotronMultilingualAsrManager.processChunk has cognitive complexity 168 (threshold 15). Drivers by points: if/else 64 (129 pts), boolean chains 36, loops 2 (3 pts) (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamDiarizationBenchmark.run (cognitive 163) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:171— StreamDiarizationBenchmark.run has cognitive complexity 163 (threshold 15). Drivers by points: if/else 63 (151 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 91). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OfflineSegmentationProcessor.process (cognitive 138) Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:44— OfflineSegmentationProcessor.process has cognitive complexity 138 (threshold 15). Drivers by points: if/else 39 (90 pts), loops 12 (36 pts), ternaries 2 (6 pts), boolean chains 3, match/switch 1 (2 pts), error handling 1 (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TTS.run (cognitive 136) Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— TTS.run has cognitive complexity 136 (threshold 15). Drivers by points: if/else 42 (111 pts), match/switch 5 (15 pts), boolean chains 9, loops 1 (nesting depth added 79). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerCommand.run (cognitive 128) Sources/FluidAudioCLI/Commands/SortformerCommand.swift:10— SortformerCommand.run has cognitive complexity 128 (threshold 15). Drivers by points: if/else 48 (95 pts), boolean chains 15, loops 6 (13 pts), match/switch 2 (3 pts), error handling 2 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LSEENDBenchmark.run (cognitive 118) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:57— LSEENDBenchmark.run has cognitive complexity 118 (threshold 15). Drivers by points: if/else 49 (95 pts), match/switch 3 (10 pts), error handling 3 (5 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VocabularyRescorer.findCandidateTermsForWord (cognitive 115) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:29— VocabularyRescorer.findCandidateTermsForWord has cognitive complexity 115 (threshold 15). Drivers by points: if/else 24 (82 pts), loops 7 (23 pts), boolean chains 10 (nesting depth added 74). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EnhanceBenchmarkCommand.run (cognitive 110) Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:53— EnhanceBenchmarkCommand.run has cognitive complexity 110 (threshold 15). Drivers by points: if/else 18 (46 pts), ternaries 9 (29 pts), loops 8 (18 pts), boolean chains 11, match/switch 2 (5 pts), error handling 1 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkProcessor.processWithDualDecodeArbitration (cognitive 109) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:45— ChunkProcessor.processWithDualDecodeArbitration has cognitive complexity 109 (threshold 15). Drivers by points: loops 13 (43 pts), if/else 24 (38 pts), ternaries 11 (17 pts), boolean chains 11 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProcessCommand.parseArguments (cognitive 107) Sources/FluidAudioCLI/Commands/ProcessCommand.swift:288— ProcessCommand.parseArguments has cognitive complexity 107 (threshold 15). Drivers by points: if/else 35 (100 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 69). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerBenchmark.run (cognitive 102) Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:66— SortformerBenchmark.run has cognitive complexity 102 (threshold 15). Drivers by points: if/else 48 (89 pts), loops 3 (5 pts), ternaries 3, boolean chains 2, match/switch 1 (2 pts), error handling 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASRBenchmark.runASRBenchmark (cognitive 101) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:642— ASRBenchmark.runASRBenchmark has cognitive complexity 101 (threshold 15). Drivers by points: if/else 31 (74 pts), match/switch 4 (11 pts), error handling 3 (8 pts), ternaries 5, boolean chains 2, loops 1 (nesting depth added 55). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EmissionDelayBenchmark.runCLI (cognitive 101) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:47— EmissionDelayBenchmark.runCLI has cognitive complexity 101 (threshold 15). Drivers by points: if/else 28 (74 pts), boolean chains 10, loops 3 (6 pts), match/switch 2 (6 pts), ternaries 2 (4 pts), error handling 1 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtcEarningsBenchmark.runCLI (cognitive 97) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:58— CtcEarningsBenchmark.runCLI has cognitive complexity 97 (threshold 15). Drivers by points: if/else 32 (69 pts), ternaries 7 (13 pts), match/switch 3 (8 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VBxClustering.runVBx (cognitive 95) Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:168— VBxClustering.runVBx has cognitive complexity 95 (threshold 15). Drivers by points: if/else 29 (55 pts), boolean chains 23, loops 10 (17 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamDiarizationBenchmark.calculateStreamingMetrics (cognitive 89) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:955— StreamDiarizationBenchmark.calculateStreamingMetrics has cognitive complexity 89 (threshold 15). Drivers by points: if/else 19 (51 pts), loops 11 (21 pts), boolean chains 11, ternaries 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OfflineEmbeddingExtractor.extractEmbeddings (cognitive 88) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:299— OfflineEmbeddingExtractor.extractEmbeddings has cognitive complexity 88 (threshold 15). Drivers by points: if/else 37 (56 pts), ternaries 7 (14 pts), loops 7 (12 pts), boolean chains 5, error handling 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsG2p.phonemizeClause (cognitive 87) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:347— LuxTtsG2p.phonemizeClause has cognitive complexity 87 (threshold 15). Drivers by points: if/else 18 (52 pts), boolean chains 16, loops 7 (15 pts), match/switch 2 (4 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanaryEarningsBenchmark.run (cognitive 87) Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:14— CanaryEarningsBenchmark.run has cognitive complexity 87 (threshold 15). Drivers by points: if/else 16 (47 pts), ternaries 8 (19 pts), loops 3 (8 pts), boolean chains 7, error handling 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TranscribeCommand.parseArguments (cognitive 87) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:241— TranscribeCommand.parseArguments has cognitive complexity 87 (threshold 15). Drivers by points: if/else 27 (78 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LSEENDCommand.run (cognitive 85) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:9— LSEENDCommand.run has cognitive complexity 85 (threshold 15). Drivers by points: if/else 23 (48 pts), loops 7 (15 pts), boolean chains 10, match/switch 3 (10 pts), error handling 2 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronMultilingualFleursBenchmark.runCLI (cognitive 84) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:568— NemotronMultilingualFleursBenchmark.runCLI has cognitive complexity 84 (threshold 15). Drivers by points: if/else 26 (63 pts), match/switch 3 (9 pts), ternaries 2 (4 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TtsBenchmarkCommand.run (cognitive 80) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— TtsBenchmarkCommand.run has cognitive complexity 80 (threshold 15). Drivers by points: if/else 26 (66 pts), match/switch 2 (4 pts), error handling 3, loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranscribeCommand.runStreaming (cognitive 80) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:698— TranscribeCommand.runStreaming has cognitive complexity 80 (threshold 15). Drivers by points: if/else 19 (41 pts), loops 7 (25 pts), ternaries 3 (9 pts), match/switch 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TdtDecoderV3.decodeWithTimings (cognitive 74) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:103— TdtDecoderV3.decodeWithTimings has cognitive complexity 74 (threshold 15). Drivers by points: if/else 27 (51 pts), boolean chains 18, loops 3 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VadManager.detectSpeechSampleRanges (cognitive 72) Sources/FluidAudio/VAD/VadManager.swift:71— VadManager.detectSpeechSampleRanges has cognitive complexity 72 (threshold 15). Drivers by points: if/else 30 (67 pts), boolean chains 3, loops 2 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OfflineReconstruction.buildSegments (cognitive 72) Sources/FluidAudio/Diarizer/Offline/Utils/OfflineReconstruction.swift:24— OfflineReconstruction.buildSegments has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 13 (21 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtcEarningsBenchmark.processFile (cognitive 71) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:420— CtcEarningsBenchmark.processFile has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (42 pts), boolean chains 15, ternaries 4 (8 pts), loops 5 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtcDecodeBenchmark.runCLI (cognitive 69) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:11— CtcDecodeBenchmark.runCLI has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (56 pts), loops 4 (8 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FLEURSBenchmark.downloadLanguageSamples (cognitive 69) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:221— FLEURSBenchmark.downloadLanguageSamples has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (40 pts), error handling 4 (9 pts), loops 3 (9 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronMultilingualMultiStreamBench.run (cognitive 68) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualMultiStreamBench.swift:36— NemotronMultilingualMultiStreamBench.run has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 12 (18 pts), error handling 3 (6 pts), boolean chains 4, match/switch 1 (2 pts), ternaries 2 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JapaneseTokenizer.tokenize (cognitive 67) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseTokenizer.swift:51— JapaneseTokenizer.tokenize has cognitive complexity 67 (threshold 15). Drivers by points: if/else 13 (35 pts), loops 11 (25 pts), boolean chains 4, ternaries 3 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsrManager.reconcileFinalWindowSeam (cognitive 65) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:256— AsrManager.reconcileFinalWindowSeam has cognitive complexity 65 (threshold 15). Drivers by points: boolean chains 33, if/else 16 (23 pts), loops 4 (5 pts), ternaries 3 (4 pts) (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CtcDPAlgorithm.fillDPTable (cognitive 64) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcDPAlgorithm.swift:121— CtcDPAlgorithm.fillDPTable has cognitive complexity 64 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 7 (24 pts), loops 6 (8 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CohereBenchmark.run (cognitive 63) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:32— CohereBenchmark.run has cognitive complexity 63 (threshold 15). Drivers by points: if/else 21 (49 pts), boolean chains 8, match/switch 2 (4 pts), error handling 1, loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VocabularyRescorer.rescoreWithConstrainedCTCWordCentric (cognitive 62) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:467— VocabularyRescorer.rescoreWithConstrainedCTCWordCentric has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (43 pts), ternaries 4 (10 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkProcessor.process (cognitive 61) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:455— ChunkProcessor.process has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (26 pts), ternaries 11 (21 pts), boolean chains 10, loops 3 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrenchPhonology.phonemize (cognitive 61) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:65— FrenchPhonology.phonemize has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 6 (15 pts), boolean chains 10, loops 4 (7 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtcEarningsBenchmark.applyKeywordCorrections (cognitive 61) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:858— CtcEarningsBenchmark.applyKeywordCorrections has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 5 (12 pts), boolean chains 7 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FLEURSBenchmark.runCLI (cognitive 60) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:822— FLEURSBenchmark.runCLI has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (39 pts), match/switch 3 (10 pts), ternaries 4 (7 pts), loops 2 (3 pts), error handling 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronVocabBenchmark.runCLI (cognitive 60) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronVocabBenchmark.swift:30— NemotronVocabBenchmark.runCLI has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (38 pts), loops 4 (10 pts), boolean chains 5, ternaries 1 (4 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranscribeCommand.runBatch (cognitive 58) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:462— TranscribeCommand.runBatch has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 3 (13 pts), boolean chains 6, match/switch 1 (3 pts), error handling 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FLEURSBenchmark.downloadFLEURS (cognitive 57) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:122— FLEURSBenchmark.downloadFLEURS has cognitive complexity 57 (threshold 15). Drivers by points: if/else 9 (31 pts), ternaries 2 (11 pts), loops 3 (10 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LuxTtsG2p.phonemizeNormalized (cognitive 55) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:221— LuxTtsG2p.phonemizeNormalized has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 15, loops 4 (6 pts), match/switch 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
G2PBenchmark.runBenchmark (cognitive 52) Sources/FluidAudioCLI/Commands/G2PBenchmark.swift:50— G2PBenchmark.runBenchmark has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (35 pts), ternaries 4 (7 pts), error handling 2 (4 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatterboxAlignmentAnalyzer.step (cognitive 51) Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxAlignmentAnalyzer.swift:40— ChatterboxAlignmentAnalyzer.step has cognitive complexity 51 (threshold 15). Drivers by points: loops 11 (26 pts), if/else 11 (16 pts), boolean chains 9 (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SpanishG2P.segment (cognitive 51) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:145— SpanishG2P.segment has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 12, ternaries 2 (4 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerStateUpdater.getTopKIndices (cognitive 50) Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:465— SortformerStateUpdater.getTopKIndices has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 9 (16 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TTSAsrVerifyCommand.run (cognitive 50) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:22— TTSAsrVerifyCommand.run has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (33 pts), ternaries 5 (10 pts), loops 2 (3 pts), error handling 2, match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrenchPhonology.mapToEspeak (cognitive 49) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:286— FrenchPhonology.mapToEspeak has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 24, if/else 10 (18 pts), ternaries 2 (4 pts), loops 3 (nesting depth added 10). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SpanishG2P.phonemize (cognitive 49) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:22— SpanishG2P.phonemize has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 5 (12 pts), boolean chains 10, loops 2, match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TtsBenchmarkCommand.runPhraseLoop (cognitive 49) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:858— TtsBenchmarkCommand.runPhraseLoop has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 14 (27 pts), if/else 10 (14 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiarizationDER.compute (cognitive 47) Sources/FluidAudio/Diarizer/DiarizationDER.swift:52— DiarizationDER.compute has cognitive complexity 47 (threshold 15). Drivers by points: loops 13 (26 pts), if/else 8 (15 pts), boolean chains 5, ternaries 1 (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MandarinG2P.segment (cognitive 47) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:237— MandarinG2P.segment has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtcDecoder.swift.ctcBeamSearch (cognitive 45) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CTC/CtcDecoder.swift:118— CtcDecoder.swift.ctcBeamSearch has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 4 (17 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VadBenchmark.runVadBenchmarkWithErrorHandling (cognitive 45) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:19— VadBenchmark.runVadBenchmarkWithErrorHandling has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (33 pts), match/switch 2 (6 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CohereTranscribeCommand.run (cognitive 45) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:12— CohereTranscribeCommand.run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 6, match/switch 2 (6 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SlidingWindowAsrManager.processWindow (cognitive 44) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:432— SlidingWindowAsrManager.processWindow has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 5, loops 1 (4 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParakeetEouCommand.main (cognitive 44) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:8— ParakeetEouCommand.main has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 3 (4 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenLanguageFilter.matches (cognitive 43) Sources/FluidAudio/Shared/TokenLanguageFilter.swift:81— TokenLanguageFilter.matches has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 23, if/else 9 (19 pts), match/switch 1 (nesting depth added 10). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Nemotron3StateUpdater.topKIndices (cognitive 43) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:292— Nemotron3StateUpdater.topKIndices has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 6 (13 pts), boolean chains 6 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkProcessor.repairSeamGaps (cognitive 43) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1394— ChunkProcessor.repairSeamGaps has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingNemotronAsrManager.processChunk (cognitive 43) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:10— StreamingNemotronAsrManager.processChunk has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 14, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetDownloader.downloadCommonVoiceJapanese (cognitive 42) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:145— DatasetDownloader.downloadCommonVoiceJapanese has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 6, error handling 3 (5 pts), loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
G2PModel.phonemize (cognitive 41) Sources/FluidAudio/TTS/G2P/G2PModel.swift:43— G2PModel.phonemize has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 9 (15 pts), boolean chains 5, ternaries 2 (5 pts), error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingNemotronMultilingualAsrManager.warmupModels (cognitive 41) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:577— StreamingNemotronMultilingualAsrManager.warmupModels has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 11 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JapaneseCutlet.singleMapping (cognitive 41) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:186— JapaneseCutlet.singleMapping has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 10 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetDownloader.downloadVoicesSubset (cognitive 41) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:950— DatasetDownloader.downloadVoicesSubset has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (7 pts), ternaries 1 (5 pts), boolean chains 3, error handling 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DatasetDownloader.downloadJSUTBasic5000 (cognitive 41) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:12— DatasetDownloader.downloadJSUTBasic5000 has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 5, error handling 3 (5 pts), loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CohereMelSpectrogram.compute (cognitive 40) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:127— CohereMelSpectrogram.compute has cognitive complexity 40 (threshold 15). Drivers by points: loops 15 (31 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SayAsInterpreter.formatDate (cognitive 40) Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:239— SayAsInterpreter.formatDate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 7, match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AHCClustering.assignmentsFromDendrogram (cognitive 39) Sources/FluidAudio/Diarizer/Offline/Clustering/AHCClustering.swift:124— AHCClustering.assignmentsFromDendrogram has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 4 (6 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkProcessor.mergeUsingMatches (cognitive 39) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1076— ChunkProcessor.mergeUsingMatches has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 6, loops 2 (6 pts), ternaries 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpanishG2P.syllabify (cognitive 39) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:230— SpanishG2P.syllabify has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9, loops 6 (8 pts), ternaries 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OfflineSortformerDiarizer.processComplete (cognitive 38) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:279— OfflineSortformerDiarizer.processComplete has cognitive complexity 38 (threshold 15). Drivers by points: loops 6 (20 pts), if/else 9 (17 pts), boolean chains 1 (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
InlineDiff.generate (cognitive 38) Sources/FluidAudioCLI/Utils/InlineDiff.swift:21— InlineDiff.generate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 7 (8 pts), boolean chains 7, ternaries 5 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParakeetEouCommand.runBenchmark (cognitive 38) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:244— ParakeetEouCommand.runBenchmark has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (24 pts), error handling 4 (6 pts), loops 3 (4 pts), ternaries 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiarizerTimeline.updateSegments (cognitive 37) Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:1169— DiarizerTimeline.updateSegments has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatterboxSynthesizer.sample (cognitive 37) Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:290— ChatterboxSynthesizer.sample has cognitive complexity 37 (threshold 15). Drivers by points: loops 11 (18 pts), if/else 9 (16 pts), ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrenchPhonology.applyLiaison (cognitive 37) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:389— FrenchPhonology.applyLiaison has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 10, ternaries 4 (9 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EnhanceCommand.run (cognitive 37) Sources/FluidAudioCLI/Commands/EnhanceCommand.swift:23— EnhanceCommand.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (28 pts), match/switch 2 (5 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SenseVoiceBenchmark.run (cognitive 37) Sources/FluidAudioCLI/Commands/ASR/SenseVoiceBenchmark.swift:14— SenseVoiceBenchmark.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 5 (15 pts), ternaries 4 (13 pts), loops 3 (6 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatterboxNanoSynthesizer.sample (cognitive 36) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:215— ChatterboxNanoSynthesizer.sample has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 9 (15 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParaformerManager.decodeWithTimestamps (cognitive 34) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:134— ParaformerManager.decodeWithTimestamps has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (8 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsSynthesizer.synthesize (cognitive 34) Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:58— LuxTtsSynthesizer.synthesize has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (19 pts), loops 11 (15 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CtcDPAlgorithm.ctcWordSpotMultiple (cognitive 34) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcDPAlgorithm.swift:311— CtcDPAlgorithm.ctcWordSpotMultiple has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 4 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetDownloader.downloadVadFilesFromHF (cognitive 34) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:496— DatasetDownloader.downloadVadFilesFromHF has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (11 pts), error handling 3 (9 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetDownloader.downloadEarnings22KWS (cognitive 34) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:829— DatasetDownloader.downloadEarnings22KWS has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 4, loops 2 (4 pts), error handling 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronMultilingualFleursBenchmark.runLanguage (cognitive 34) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:206— NemotronMultilingualFleursBenchmark.runLanguage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (28 pts), error handling 2 (4 pts), loops 1, ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VadAnalyzeCommand.run (cognitive 33) Sources/FluidAudioCLI/Commands/VadAnalyzeCommand.swift:29— VadAnalyzeCommand.run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (6 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JapaneseAsrBenchmark.run (cognitive 33) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:29— JapaneseAsrBenchmark.run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (25 pts), error handling 2 (3 pts), match/switch 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronMultilingualTranscribe.run (cognitive 33) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:166— NemotronMultilingualTranscribe.run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (8 pts), loops 2 (6 pts), error handling 2 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingGenerator.generatePipelined (cognitive 32) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:611— StreamingGenerator.generatePipelined has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 3 (6 pts), boolean chains 2, error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingNemotronMultilingualAsrManager.loadModels (cognitive 32) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:347— StreamingNemotronMultilingualAsrManager.loadModels has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MandarinToneSandhiPOS.applyBuYiSandhi (cognitive 32) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinToneSandhiPOS.swift:64— MandarinToneSandhiPOS.applyBuYiSandhi has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 6, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpanishG2P.applyAllophones (cognitive 32) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:331— SpanishG2P.applyAllophones has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 11, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Nemotron3DiarizeCommand.runDiarize (cognitive 32) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:172— Nemotron3DiarizeCommand.runDiarize has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (6 pts), ternaries 2 (5 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanaryTranscribeCommand.run (cognitive 32) Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift:13— CanaryTranscribeCommand.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 1 (2 pts), ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify_localvqe_benchmark.verify (cognitive 32) Scripts/verify_localvqe_benchmark.py:119— verify_localvqe_benchmark.verify has cognitive complexity 32 (threshold 15). Drivers by points: loops 8 (13 pts), boolean chains 9, ternaries 4 (8 pts), if/else 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VocabularyRescorer.alignBaseWordsToUTF8Ranges (cognitive 31) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:140— VocabularyRescorer.alignBaseWordsToUTF8Ranges has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TTS.runPocketTts (cognitive 31) Sources/FluidAudioCLI/Commands/TTSCommand.swift:743— TTS.runPocketTts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerStateUpdater.boostTopKScores (cognitive 30) Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:393— SortformerStateUpdater.boostTopKScores has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (13 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OfflineDiarizerManager.computeCentroids (cognitive 30) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:702— OfflineDiarizerManager.computeCentroids has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (7 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TTS.runKokoroAne (cognitive 30) Sources/FluidAudioCLI/Commands/TTSCommand.swift:896— TTS.runKokoroAne has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 2 (4 pts), error handling 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FLEURSBenchmark.loadFLEURSSamples (cognitive 30) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:401— FLEURSBenchmark.loadFLEURSSamples has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 pts), loops 3 (7 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerStateUpdater.compressSpkcache (cognitive 29) Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:220— SortformerStateUpdater.compressSpkcache has cognitive complexity 29 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 6 (13 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
HFTreeLister.listTree (cognitive 29) Sources/FluidAudio/Shared/Download/HFTreeLister.swift:49— HFTreeLister.listTree has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelHub.repoIncludeRule (cognitive 29) Sources/FluidAudio/Shared/Download/ModelHub.swift:763— ModelHub.repoIncludeRule has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 20, if/else 5 (9 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StreamingUnifiedAsrManager.processWindow (cognitive 29) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:332— StreamingUnifiedAsrManager.processWindow has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsG2p.selectWord (cognitive 29) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:559— LuxTtsG2p.selectWord has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 14 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ChunkProcessor.collapseSeamWordDuplicates (cognitive 29) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:857— ChunkProcessor.collapseSeamWordDuplicates has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 10, loops 5 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TtsBenchmarkCommand.inferCohereLanguage (cognitive 29) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:1339— TtsBenchmarkCommand.inferCohereLanguage has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, if/else 14. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MultiStreamCommand.run (cognitive 29) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/MultiStreamCommand.swift:10— MultiStreamCommand.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (7 pts), ternaries 2 (6 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nemo_ami_benchmark.calculate_der (cognitive 29) Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:231— nemo_ami_benchmark.calculate_der has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HungarianAssignment.solve (cognitive 28) Sources/FluidAudio/Diarizer/HungarianAssignment.swift:8— HungarianAssignment.solve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 6 (12 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiarizerManager.createTimedSegments (cognitive 28) Sources/FluidAudio/Diarizer/Core/DiarizerManager.swift:415— DiarizerManager.createTimedSegments has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Nemotron3StateUpdater.boostTopKScores (cognitive 28) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:246— Nemotron3StateUpdater.boostTopKScores has cognitive complexity 28 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 5 (12 pts), boolean chains 3 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CtcKeywordSpotter.computeLogProbsChunked (cognitive 28) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:33— CtcKeywordSpotter.computeLogProbsChunked has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronMultilingualTranscribe.run (cognitive 28) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:39— NemotronMultilingualTranscribe.run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsG2p.selectPhrase (cognitive 27) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:604— LuxTtsG2p.selectPhrase has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 11, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SentencePieceProto.parsePiece (cognitive 27) Sources/FluidAudio/TTS/PocketTTS/Tokenizer/SentencePieceProto.swift:69— SentencePieceProto.parsePiece has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsrModels.load (cognitive 27) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:321— AsrModels.load has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 1 (3 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrenchPhonology.tokenize (cognitive 27) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:442— FrenchPhonology.tokenize has cognitive complexity 27 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (9 pts), boolean chains 7 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JapaneseCutlet.romajiTokens (cognitive 27) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:118— JapaneseCutlet.romajiTokens has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedBenchmark.seamArtifacts (cognitive 27) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Unified/UnifiedBenchmark.swift:492— UnifiedBenchmark.seamArtifacts has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (13 pts), loops 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CanaryKeywordBooster.boost (cognitive 26) Sources/FluidAudio/ASR/Canary/CanaryKeywordBooster.swift:93— CanaryKeywordBooster.boost has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiarizerManager.processChunkWithSpeakerTracking (cognitive 26) Sources/FluidAudio/Diarizer/Core/DiarizerManager.swift:255— DiarizerManager.processChunkWithSpeakerTracking has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 4 (6 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PocketTtsConstantsLoader.loadVoiceSnapshot (cognitive 26) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:161— PocketTtsConstantsLoader.loadVoiceSnapshot has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingGenerator.generate (cognitive 26) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:509— StreamingGenerator.generate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 2 (5 pts), boolean chains 2, error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MandarinToneSandhiPOS.applyThirdToneSandhi (cognitive 26) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinToneSandhiPOS.swift:145— MandarinToneSandhiPOS.applyThirdToneSandhi has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (11 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StyleTTS2Phonemizer.phonemize (cognitive 26) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Tokenizer/StyleTTS2Phonemizer.swift:66— StyleTTS2Phonemizer.phonemize has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextNormalizer.parseNumberSequence (cognitive 26) Sources/FluidAudioCLI/Utils/TextNormalizer.swift:664— TextNormalizer.parseNumberSequence has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranscribeCommand.runWithVariant (cognitive 26) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:960— TranscribeCommand.runWithVariant has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (6 pts), boolean chains 1, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultilingualG2PModel.phonemize (cognitive 25) Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:37— MultilingualG2PModel.phonemize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (6 pts), boolean chains 5, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VocabularyRescorer.buildWordTimings (cognitive 25) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:397— VocabularyRescorer.buildWordTimings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EnhanceBenchmarkDataset.parseMetadata (cognitive 25) Sources/FluidAudioCLI/Commands/EnhanceBenchmarkDataset.swift:108— EnhanceBenchmarkDataset.parseMetadata has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerBenchmark.processMeeting (cognitive 25) Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:514— SortformerBenchmark.processMeeting has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (2 pts), match/switch 1 (2 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WERCalculator.editDistance (cognitive 25) Sources/FluidAudioCLI/Utils/WERCalculator.swift:186— WERCalculator.editDistance has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, loops 5 (6 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FLEURSBenchmark.processLanguageSamples (cognitive 25) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:594— FLEURSBenchmark.processLanguageSamples has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 2 (5 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoherePipeline.decodeCacheExternal (cognitive 24) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:680— CoherePipeline.decodeCacheExternal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpeakerManager.initializeKnownSpeakers (cognitive 24) Sources/FluidAudio/Diarizer/Clustering/SpeakerManager.swift:62— SpeakerManager.initializeKnownSpeakers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerStateUpdater.streamingUpdate (cognitive 24) Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:31— SortformerStateUpdater.streamingUpdate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (24 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsG2p.camelParts (cognitive 24) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:728— LuxTtsG2p.camelParts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PocketTtsConstantsLoader.parseSafetensors (cognitive 24) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:339— PocketTtsConstantsLoader.parseSafetensors has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ARPALanguageModel.load (cognitive 24) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CTC/ARPALanguageModel.swift:48— ARPALanguageModel.load has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MandarinG2P.phonemize (cognitive 24) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:87— MandarinG2P.phonemize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (8 pts), error handling 1 (2 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MandarinPolyphoneCatalog.init (cognitive 24) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPolyphoneCatalog.swift:59— MandarinPolyphoneCatalog.init has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LSEENDBenchmark.processMeeting (cognitive 24) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:429— LSEENDBenchmark.processMeeting has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SayAsInterpreter.addOrdinalSuffix (cognitive 23) Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:172— SayAsInterpreter.addOrdinalSuffix has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatterboxSynthesizer.buildPrefillEmbeds (cognitive 23) Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:182— ChatterboxSynthesizer.buildPrefillEmbeds has cognitive complexity 23 (threshold 15). Drivers by points: loops 8 (19 pts), if/else 2 (4 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PocketTtsVoiceCloner.extractConditioning (cognitive 23) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsVoiceCloner.swift:321— PocketTtsVoiceCloner.extractConditioning has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 4 (5 pts), ternaries 2, boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MandarinNumberNormalizer.fourDigitChunk (cognitive 23) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:80— MandarinNumberNormalizer.fourDigitChunk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MandarinToneSandhi.apply (cognitive 23) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinToneSandhi.swift:32— MandarinToneSandhi.apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (7 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BpeTokenizer.encode (cognitive 23) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/BpeTokenizer.swift:112— BpeTokenizer.encode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MinimaxCorpusCommand.run (cognitive 23) Sources/FluidAudioCLI/Commands/MinimaxCorpusCommand.swift:38— MinimaxCorpusCommand.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 2 (3 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiarizationMetricsCalculator.isolateSingleSpeakerSegments (cognitive 23) Sources/FluidAudioCLI/Utils/DiarizationMetrics.swift:345— DiarizationMetricsCalculator.isolateSingleSpeakerSegments has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResultsFormatter.printBenchmarkResults (cognitive 23) Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:103— ResultsFormatter.printBenchmarkResults has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 6 (9 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASRBenchmark.runLibriSpeechBenchmark (cognitive 23) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:77— ASRBenchmark.runLibriSpeechBenchmark has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (4 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASRBenchmark.generateWordDifferences (cognitive 23) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:546— ASRBenchmark.generateWordDifferences has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 5 (6 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronBenchmark.run (cognitive 23) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:37— NemotronBenchmark.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SentencePieceTokenizer.viterbiDecode (cognitive 22) Sources/FluidAudio/TTS/PocketTTS/Tokenizer/SentencePieceTokenizer.swift:81— SentencePieceTokenizer.viterbiDecode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsrManager.transcribeChunk (cognitive 22) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:436— AsrManager.transcribeChunk has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5 (7 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkProcessor.spliceCandidate (cognitive 22) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1316— ChunkProcessor.spliceCandidate has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, loops 5 (7 pts), if/else 5 (6 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingEouAsrManager.processChunkAndDecode (cognitive 22) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:546— StreamingEouAsrManager.processChunkAndDecode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 9 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VocabularyRescorer.evaluateCTCMatch (cognitive 22) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:29— VocabularyRescorer.evaluateCTCMatch has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (13 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
StreamDiarizationBenchmark.processStreamingMeeting (cognitive 22) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:628— StreamDiarizationBenchmark.processStreamingMeeting has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (5 pts), boolean chains 1, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Nemotron3DiarizeCommand.speechMask (cognitive 22) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:122— Nemotron3DiarizeCommand.speechMask has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (9 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VadBenchmark.runVadBenchmarkInternal (cognitive 22) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:494— VadBenchmark.runVadBenchmarkInternal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (8 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParaformerTranscribeCommand.run (cognitive 22) Sources/FluidAudioCLI/Commands/ASR/ParaformerTranscribeCommand.swift:10— ParaformerTranscribeCommand.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsG2pDumpCommand.run (cognitive 22) Sources/FluidAudioCLI/Commands/TTS/LuxTtsG2pDumpCommand.swift:19— LuxTtsG2pDumpCommand.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FLEURSBenchmark.loadSingleFLEURSSample (cognitive 22) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:469— FLEURSBenchmark.loadSingleFLEURSSample has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 1 (6 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UnifiedBenchmark.runMode (cognitive 22) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Unified/UnifiedBenchmark.swift:122— UnifiedBenchmark.runMode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 5 (6 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingDownloadDelegate.urlSession (cognitive 21) Sources/FluidAudio/Shared/Download/FileDownloader.swift:549— StreamingDownloadDelegate.urlSession has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsManager.synthesize (cognitive 21) Sources/FluidAudio/TTS/LuxTts/LuxTtsManager.swift:201— LuxTtsManager.synthesize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FsmnVadManager.decide (cognitive 21) Sources/FluidAudio/VAD/Fsmn/FsmnVadManager.swift:159— FsmnVadManager.decide has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SequenceMatcher.findContiguousMatches (cognitive 21) Sources/FluidAudio/ASR/Parakeet/TokenDeduplication/SequenceMatcher.swift:188— SequenceMatcher.findContiguousMatches has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VBxClustering.refine (cognitive 21) Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:42— VBxClustering.refine has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 4 (8 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OfflineDiarizerConfig.validate (cognitive 21) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:357— OfflineDiarizerConfig.validate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChatterboxTokenizer.init (cognitive 21) Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:26— ChatterboxTokenizer.init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RomanceNumberNormalizer.read (cognitive 21) Sources/FluidAudio/TTS/KokoroAne/G2P/RomanceNumberNormalizer.swift:34— RomanceNumberNormalizer.read has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PocketTtsMimiKeys.discover (cognitive 21) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsMimiKeys.swift:56— PocketTtsMimiKeys.discover has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsrManager.runInference (cognitive 21) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:139— AsrManager.runInference has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (4 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkProcessor.silenceAlignedChunkStarts (cognitive 21) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:189— ChunkProcessor.silenceAlignedChunkStarts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingNemotronMultilingualAsrManager.updateRescueSpans (cognitive 21) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:70— StreamingNemotronMultilingualAsrManager.updateRescueSpans has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MandarinG2pwModel.disambiguate (cognitive 21) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2pwModel.swift:73— MandarinG2pwModel.disambiguate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MandarinJiebaHmm.segment (cognitive 21) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinJiebaHmm.swift:51— MandarinJiebaHmm.segment has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 3 (6 pts), match/switch 3 (5 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StyleTTS2MelExtractor.htkMelFilterbank (cognitive 21) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Preprocess/StyleTTS2MelExtractor.swift:174— StyleTTS2MelExtractor.htkMelFilterbank has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 3 (7 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetDownloader.downloadAnnotationFile (cognitive 21) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:251— DatasetDownloader.downloadAnnotationFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, error handling 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NemotronTranscribe.run (cognitive 21) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:114— NemotronTranscribe.run has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 2 (7 pts), error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioSourceFactory.streamConvert (cognitive 20) Sources/FluidAudio/Shared/AudioSourceFactory.swift:94— AudioSourceFactory.streamConvert has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParaformerManager.energySpan (cognitive 20) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:322— ParaformerManager.energySpan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpeakerManager.findMergeablePairs (cognitive 20) Sources/FluidAudio/Diarizer/Clustering/SpeakerManager.swift:282— SpeakerManager.findMergeablePairs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelHub.download (cognitive 20) Sources/FluidAudio/Shared/Download/ModelHub.swift:422— ModelHub.download has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PhonemeChunker.chunk (cognitive 20) Sources/FluidAudio/TTS/Shared/PhonemeChunker.swift:41— PhonemeChunker.chunk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (6 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PocketTtsSynthesizer.chunkTextWithMetadata (cognitive 20) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:917— PocketTtsSynthesizer.chunkTextWithMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingNemotronMultilingualAsrManager.rebuildVocabularyBias (cognitive 20) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:373— StreamingNemotronMultilingualAsrManager.rebuildVocabularyBias has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MandarinBopomofoMap.encode (cognitive 20) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinBopomofoMap.swift:139— MandarinBopomofoMap.encode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, match/switch 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DatasetDownloader.downloadAMIFile (cognitive 20) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:109— DatasetDownloader.downloadAMIFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NemotronMultilingualFleursBenchmark.loadLibriSpeechSamples (cognitive 20) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:471— NemotronMultilingualFleursBenchmark.loadLibriSpeechSamples has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 pts), ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronTranscribe.run (cognitive 20) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:25— NemotronTranscribe.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerDiarizer.enrollSpeakerInternal (cognitive 19) Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:294— SortformerDiarizer.enrollSpeakerInternal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileDownloader.download (cognitive 19) Sources/FluidAudio/Shared/Download/FileDownloader.swift:294— FileDownloader.download has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
G2PModel.loadIfNeeded (cognitive 19) Sources/FluidAudio/TTS/G2P/G2PModel.swift:165— G2PModel.loadIfNeeded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NeuTtsBpeTokenizer.init (cognitive 19) Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:39— NeuTtsBpeTokenizer.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PocketTtsSession.generateChunk (cognitive 19) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:265— PocketTtsSession.generateChunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PocketTtsSynthesizer.splitSentences (cognitive 19) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1234— PocketTtsSynthesizer.splitSentences has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CustomVocabularyContext.loadFromSimpleFormat (cognitive 19) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/CustomVocabularyContext.swift:230— CustomVocabularyContext.loadFromSimpleFormat has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingNemotronMultilingualAsrManager.preloadShared (cognitive 19) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:82— StreamingNemotronMultilingualAsrManager.preloadShared has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
KokoroAneEnglishPhonemizer.phonemize (cognitive 19) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:73— KokoroAneEnglishPhonemizer.phonemize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexicon.commonPrefixSearch (cognitive 19) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseMecabDictionary.swift:78— Lexicon.commonPrefixSearch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpanishG2P.phonemizeWord (cognitive 19) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:90— SpanishG2P.phonemizeWord has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (8 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TdtDecoderV3.applyEnglishBlocklist (cognitive 19) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:643— TdtDecoderV3.applyEnglishBlocklist has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Nemotron3DiarizeCommand.runBenchmark (cognitive 19) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:460— Nemotron3DiarizeCommand.runBenchmark has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (5 pts), loops 2 (3 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TTS.runLuxTts (cognitive 19) Sources/FluidAudioCLI/Commands/TTSCommand.swift:528— TTS.runLuxTts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetDownloader.downloadAMIAnnotations (cognitive 19) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:174— DatasetDownloader.downloadAMIAnnotations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedBenchmark.runLongformBenchmark (cognitive 19) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Unified/UnifiedBenchmark.swift:373— UnifiedBenchmark.runLongformBenchmark has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (8 pts), loops 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify_localvqe_benchmark.merge (cognitive 19) Scripts/verify_localvqe_benchmark.py:56— verify_localvqe_benchmark.merge has cognitive complexity 19 (threshold 15). Drivers by points: loops 7 (10 pts), ternaries 4 (8 pts), boolean chains 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ModelWarmup.warmupEmbeddingModel (cognitive 18) Sources/FluidAudio/Shared/ModelWarmup.swift:46— ModelWarmup.warmupEmbeddingModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OfflineDiarizerManager.cluster (cognitive 18) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:335— OfflineDiarizerManager.cluster has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 4, ternaries 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VDSPOperations.pairwiseEuclideanDistances (cognitive 18) Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:193— VDSPOperations.pairwiseEuclideanDistances has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, loops 5 (6 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChatterboxSynthesizer.synthesize (cognitive 18) Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:32— ChatterboxSynthesizer.synthesize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RomanceNumberNormalizer.french (cognitive 18) Sources/FluidAudio/TTS/KokoroAne/G2P/RomanceNumberNormalizer.swift:136— RomanceNumberNormalizer.french has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsG2p.rawTokens (cognitive 18) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:184— LuxTtsG2p.rawTokens has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 4 (6 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KokoroAneEnglishPhonemizer.splitWords (cognitive 18) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:386— KokoroAneEnglishPhonemizer.splitWords has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MandarinPinyinDict.parsePhrases (cognitive 18) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:100— MandarinPinyinDict.parsePhrases has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiarizationMetricsCalculator.offlineMetrics (cognitive 18) Sources/FluidAudioCLI/Utils/DiarizationMetrics.swift:105— DiarizationMetricsCalculator.offlineMetrics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NemotronBenchmark.run (cognitive 18) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:118— NemotronBenchmark.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (3 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_benchmarks.compare_results (cognitive 18) Scripts/run_benchmarks.py:164— run_benchmarks.compare_results has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 3, if/else 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerStateUpdater.disableLowScores (cognitive 17) Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:351— SortformerStateUpdater.disableLowScores has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsContinuation.speechRuns (cognitive 17) Sources/FluidAudio/TTS/LuxTts/LuxTtsContinuation.swift:179— LuxTtsContinuation.speechRuns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingUnifiedAsrManager.maybeRescoreSegment (cognitive 17) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:441— StreamingUnifiedAsrManager.maybeRescoreSegment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ChatterboxTokenizer.splitAddedTokens (cognitive 17) Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:149— ChatterboxTokenizer.splitAddedTokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsG2p.oovPron (cognitive 17) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:693— LuxTtsG2p.oovPron has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsrModels.parseVocabulary (cognitive 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:466— AsrModels.parseVocabulary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (6 pts), error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronVocabularyBias.candidates (cognitive 17) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronVocabularyBias.swift:280— NemotronVocabularyBias.candidates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KokoroAneEnglishPhonemizer.resolveWord (cognitive 17) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:125— KokoroAneEnglishPhonemizer.resolveWord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
JapaneseCutlet.normalize (cognitive 17) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:75— JapaneseCutlet.normalize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AMIKaldiData.loadDERReference (cognitive 17) Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:214— AMIKaldiData.loadDERReference has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetDownloader.downloadFullMusanDataset (cognitive 17) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:677— DatasetDownloader.downloadFullMusanDataset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, error handling 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiarizationMetricsCalculator.clipSegments (cognitive 17) Sources/FluidAudioCLI/Utils/DiarizationMetrics.swift:409— DiarizationMetricsCalculator.clipSegments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtcEarningsBenchmark.tokenize (cognitive 17) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:796— CtcEarningsBenchmark.tokenize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedBenchmark.run (cognitive 17) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Unified/UnifiedBenchmark.swift:30— UnifiedBenchmark.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (3 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
materialize_notsofar_card_audio.materialize (cognitive 17) Scripts/materialize_notsofar_card_audio.py:76— materialize_notsofar_card_audio.materialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioConverter.convertBuffer (cognitive 16) Sources/FluidAudio/Shared/AudioConverter.swift:299— AudioConverter.convertBuffer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AudioMelSpectrogram.computeFlatTransposed (cognitive 16) Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:328— AudioMelSpectrogram.computeFlatTransposed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (3 pts), boolean chains 2, match/switch 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanaryManager.mergeTokenStreams (cognitive 16) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:92— CanaryManager.mergeTokenStreams has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoherePipeline.mergeTokenStreams (cognitive 16) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:592— CoherePipeline.mergeTokenStreams has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParakeetLanguageModels.download (cognitive 16) Sources/FluidAudio/ASR/Parakeet/ParakeetLanguageModels.swift:171— ParakeetLanguageModels.download has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SlidingWindowAsrManager.finish (cognitive 16) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:237— SlidingWindowAsrManager.finish has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortformerSpeakerStitcher.alignment (cognitive 16) Sources/FluidAudio/Diarizer/Sortformer/Offline/SortformerSpeakerStitcher.swift:27— SortformerSpeakerStitcher.alignment has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 3 (5 pts), boolean chains 3 (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ChatterboxNanoSynthesizer.synthesize (cognitive 16) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:33— ChatterboxNanoSynthesizer.synthesize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuxTtsG2p.updateCounters (cognitive 16) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:516— LuxTtsG2p.updateCounters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PocketTtsLayerKeys.discover (cognitive 16) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsLayerKeys.swift:82— PocketTtsLayerKeys.discover has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PocketTtsSession.generateLoop (cognitive 16) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:225— PocketTtsSession.generateLoop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (5 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PocketTtsSynthesizer.splitAtWordBoundaries (cognitive 16) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1130— PocketTtsSynthesizer.splitAtWordBoundaries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SentencePieceProto.parse (cognitive 16) Sources/FluidAudio/TTS/PocketTTS/Tokenizer/SentencePieceProto.swift:25— SentencePieceProto.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TdtModelInference.normalizeDecoderProjection (cognitive 16) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtModelInference.swift:187— TdtModelInference.normalizeDecoderProjection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DiarizationBenchmarkUtils.loadProgress (cognitive 16) Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:445— DiarizationBenchmarkUtils.loadProgress has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (5 pts), error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Nemotron3DiarizeCommand.runBatch (cognitive 16) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:342— Nemotron3DiarizeCommand.runBatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProcessCommand.runOffline (cognitive 16) Sources/FluidAudioCLI/Commands/ProcessCommand.swift:120— ProcessCommand.runOffline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VadAnalyzeCommand.runStreaming (cognitive 16) Sources/FluidAudioCLI/Commands/VadAnalyzeCommand.swift:321— VadAnalyzeCommand.runStreaming has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (5 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AMIParser.frameAlignedDERReference (cognitive 16) Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:397— AMIParser.frameAlignedDERReference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetDownloader.downloadAMIRTTMs (cognitive 16) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:309— DatasetDownloader.downloadAMIRTTMs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASRBenchmark.downloadLibriSpeech (cognitive 16) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:19— ASRBenchmark.downloadLibriSpeech has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WordTimingMerger.mergeTokensIntoWords (cognitive 16) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:133— WordTimingMerger.mergeTokensIntoWords has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NemotronBenchmark.collectLibriSpeechFiles (cognitive 16) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:406— NemotronBenchmark.collectLibriSpeechFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency· Naming inconsistency between model and dataset resolution methods. While the parameters are identical, the method names use different verbs ('resolveModel' vs 'resolveDataset') rather than a unified 'resolve' method with a type discriminator or a generic 'resolve' method. · ×1
Naming inconsistency between model and dataset resolution methods. While the parameters are identical, the method names use different verbs ('resolveModel' vs 'resolveDataset') rather than a unified 'resolve' method with a type discriminator or a generic 'resolve' method. — Unify to a single method signature such as `resolve(String, String, revision: String, type: ModelType): URL` or `resolveModel(...)` and `resolveAsset(...)` if the distinction is critical, but currently the parallel structure suggests a naming convention drift. (signatures: FluidAudio.ModelRegistry.resolveModel(String, String, revision: String): URL | FluidAudio.ModelRegistry.resolveDataset(String, String, revision: String): URL)
Change coupling: ChunkProcessor.swift ↔ TdtDecoderV3.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift— `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift` and `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift` change together 58% of the time (11 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `80488128` fix(asr): add opt-in v3 no-mel decode arbitration (#604); `0f7493bd` feat: Support Parakeet-TDT-CTC-110M hybrid model (#433) (at that commit the files were still `Sources/FluidAudio/ASR/ChunkProcessor.swift` and `Sources/FluidAudio/ASR/TDT/TdtDecoderV3.swift`); `289833a5` fix: populate tokenDurations in TDT decoder for accurate word endTime… (at that commit the files were still `Sources/FluidAudio/ASR/ChunkProcessor.swift` and `Sources/FluidAudio/ASR/TDT/TdtDecoderV3.swift`) — run `git show` on any of them.
D4 · Code Duplication· Near-duplicate member family (3 members, 15 shared lines) · ×1
Near-duplicate member family (3 members, 15 shared lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:254— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:254-306 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:170-210 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:212-260 — These 3 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 13 shared lines) · ×1
Near-duplicate member family (3 members, 13 shared lines) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:163— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:163-217 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:285-319 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:321-354 — These 3 members are variants of one another: a block of 13 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 4 shared lines) · ×1
Near-duplicate member family (3 members, 4 shared lines) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:99— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:99-121 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:94-118 | Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:24-35 — These 3 members are variants of one another: a block of 4 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (159 shared lines) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:57— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:57-427 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:66-431 — These two members are variants of one another: 159 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (124 shared lines) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:171— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:171-626 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:288-480 — These two members are variants of one another: 124 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (104 shared lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58-577 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:45-454 — These two members are variants of one another: 104 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (63 shared lines) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:9— Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:9-267 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:10-342 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (46 shared lines) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:33— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:33-166 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:32-176 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (32 shared lines) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:353— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:353-414 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:426-487 — These two members are variants of one another: 32 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:119— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:119-164 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:226-279 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (15 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (15 members, 50+ identical tokens) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:393— Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:393-431 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:462-678 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:118-243 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:166-281 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:114-194 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:448-520 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:528-665 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:743-894 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:896-1062 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1067-1162 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1181-1286 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1291-1377 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1381-1452 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1457-1527 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:494-600 — These 15 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 15 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 15 times.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:363— Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:363-389 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:546-627 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:351-374 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1120-1145 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1159-1182 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:289-317 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:483-509 | Sources/FluidAudioCLI/Utils/InlineDiff.swift:21-97 | Sources/FluidAudioCLI/Utils/WERCalculator.swift:186-251 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Duplicated block (51–61 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:300— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:300-350 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:484-544 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (56–58 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:251— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:251-308 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:332-387 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (57 lines × 2) Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:233— Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:233-289 | Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:397-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (53–56 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:124— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:124-179 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:202-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:124` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (54 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1058— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1058-1111 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1049-1102 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:484-537 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1058` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1054` calls `exit` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1043` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–47 lines × 4) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:433— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:433-436 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:109-113 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:305-351 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:378-424 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:305` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (29–44 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:366— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:366-394 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:902-945 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:366` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (39–43 lines × 2) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:92— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:92-130 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:592-634 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (39 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:817— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:817-855 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:996-1034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:817` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (37–38 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:42— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:42-79 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:46-82 — before extracting anything, compare `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift` and `Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25–37 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:521— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:521-557 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:648-672 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (33–36 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:366— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:366-401 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:373-405 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–35 lines × 2) Sources/FluidAudio/Shared/Download/ModelHub.swift:100— Sources/FluidAudio/Shared/Download/ModelHub.swift:100-134 | Sources/FluidAudio/Shared/Download/ModelHub.swift:280-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Shared/Download/ModelHub.swift:100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–31 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:261— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:261-284 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:419-449 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:261` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–31 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:418— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:418-448 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:548-575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–31 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:329— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:329-348 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:546-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27–31 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:239— Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:239-269 | Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:272-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (31 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:290— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:290-320 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:269-299 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27–28 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:581— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:581-608 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:404-430 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (25–27 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:833— Sources/FluidAudioCLI/Commands/TTSCommand.swift:833-857 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:989-1015 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:281— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:281-306 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:235-260 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:281` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (3–25 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:403— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:403-427 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:407-431 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:497-499 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:403` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:240— Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:240-263 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:315-338 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:240` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–22 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:235— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:235-256 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:487-504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:135— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:135-155 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:105-125 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 7) Sources/FluidAudioCLI/Commands/TTSCommand.swift:502— Sources/FluidAudioCLI/Commands/TTSCommand.swift:502-520 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:646-665 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1143-1162 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1267-1286 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1358-1377 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1433-1452 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1508-1527 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:502` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:40— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:40-59 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:43-61 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:40` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:954— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:954-973 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:1100-1119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:954` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15–18 lines × 4) Sources/FluidAudioCLI/Utils/TextNormalizer.swift:425— Sources/FluidAudioCLI/Utils/TextNormalizer.swift:425-439 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:471-485 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:532-549 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:571-585 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:552` calls `replacingOccurrences` and `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:442` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–18 lines × 3) Sources/FluidAudio/Shared/SystemInfo.swift:92— Sources/FluidAudio/Shared/SystemInfo.swift:92-107 | Sources/FluidAudio/Shared/SystemInfo.swift:113-128 | Sources/FluidAudioCLI/FluidAudioCLI.swift:209-226 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–18 lines × 3) Sources/FluidAudioCLI/Utils/TextNormalizer.swift:448— Sources/FluidAudioCLI/Utils/TextNormalizer.swift:448-465 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:538-552 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:555-563 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:468` calls `replacingOccurrences` and `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:555` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–18 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:181— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:181-198 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:159-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:181` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–18 lines × 2) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:707— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:707-724 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:779-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:707` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–17 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtConfig.swift:17— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtConfig.swift:17-33 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedConfig.swift:53-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtConfig.swift:17` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15–16 lines × 2) Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:230— Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:230-244 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:410-425 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 5) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100-114 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:116-130 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:139-153 | Sources/FluidAudio/Speaker/CampPlusModels.swift:65-79 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:62-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (15 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:55— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:55-69 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:30-44 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:114-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:598— Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:598-612 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:50-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:598` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (2–15 lines × 6) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:346— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:346-347 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:369-383 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:331-332 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:374-387 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:254-255 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedRnntDecoder.swift:141-142 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:369` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:368` calls `bindMemory` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:344` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–15 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:29— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:29-43 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:339-350 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:44` calls `info` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:351` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 4) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:671— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:671-684 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:93-106 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:80-93 | Sources/FluidAudioCLI/Commands/G2PBenchmark.swift:64-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:671` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 4) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:74— Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:74-86 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:59-71 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:108-120 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:245-258 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 3) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:182— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:182-194 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:300-313 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:330-342 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:182` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `s` to `[Float] ) async throws -> (d: [Float]` in one and `[Float] ) async throws -> (f0: [Float]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:342` calls `featureValue` and `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:194` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–14 lines × 2) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:191— Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:191-203 | Sources/FluidAudio/Diarizer/Sortformer/SortformerModelInference.swift:170-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:191` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (4–14 lines × 3) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+State.swift:69— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+State.swift:69-72 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:253-266 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:323-336 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11–14 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:385— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:385-398 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:389-399 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–14 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:533— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:533-542 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:755-768 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 11) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:61— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:61-73 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:39-51 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:33-45 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:898-910 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:141-153 | Sources/FluidAudioCLI/Commands/TTS/LuxTtsG2pDumpCommand.swift:28-40 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:36-48 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:310-322 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:120-132 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:164-176 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:62-74 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–13 lines × 4) Sources/FluidAudioCLI/Utils/TextNormalizer.swift:468— Sources/FluidAudioCLI/Utils/TextNormalizer.swift:468-477 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:505-513 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:549-561 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:568-577 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:549` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:465` calls `replacingOccurrences` and `Sources/FluidAudioCLI/Utils/TextNormalizer.swift:549` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:51— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:51-63 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:168-180 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:151-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–13 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:255— Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:255-267 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:330-342 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:424-433 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:255` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–13 lines × 2) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:384— Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:384-390 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:903-915 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 20) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:62— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:62-73 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:89-100 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:40-51 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:676-687 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:34-45 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:98-109 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:894-905 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:610-621 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:633-644 | Sources/FluidAudioCLI/Commands/G2PBenchmark.swift:69-80 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:163-174 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:137-148 | Sources/FluidAudioCLI/Commands/TTS/LuxTtsG2pDumpCommand.swift:29-40 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:37-48 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:231-242 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:266-277 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:311-322 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:121-132 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:165-176 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:58-69 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 7) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:678— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:678-689 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:901-912 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:165-176 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:144-155 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:49-60 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:148-159 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:65-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:678` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 5) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:116— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:116-127 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:148-159 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:172-183 | Sources/FluidAudio/Speaker/CampPlusModels.swift:81-92 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:78-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (8–12 lines × 3) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:602— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:602-613 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:630-637 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:639-646 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:602` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–12 lines × 6) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:98— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:98-101 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:120-131 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:124-125 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:419-425 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:494-502 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedRnntDecoder.swift:125-129 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:119` calls `featureValue` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:98` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–12 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:392— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:392-402 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:395-406 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:488-496 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 266 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:902— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:902-913 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:50-61 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:128-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10–12 lines × 3) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:258— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:258-268 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:353-362 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:1059-1070 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 3) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:686— Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:686-696 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:19-30 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:157-168 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:686` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–12 lines × 4) Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:135— Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:135-146 | Sources/FluidAudio/ASR/Parakeet/ParakeetLanguageModels.swift:309-314 | Sources/FluidAudio/ASR/Parakeet/ParakeetLanguageModels.swift:319-326 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:159-170 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:135` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–12 lines × 4) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:308— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:308-319 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:149-152 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:262-272 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:352-353 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:308` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:190— Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:190-201 | Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:483-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:190` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 18) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:59— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:59-69 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:91-101 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:37-47 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:31-41 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:100-110 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:896-906 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:612-622 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:654-664 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:29-39 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:139-149 | Sources/FluidAudioCLI/Commands/TTS/LuxTtsG2pDumpCommand.swift:26-36 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:34-44 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:233-243 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:268-278 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:308-318 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:118-128 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:162-172 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:60-70 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:35` calls `printUsage`, `exit` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:58` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 9) Sources/FluidAudioCLI/Commands/TTSCommand.swift:505— Sources/FluidAudioCLI/Commands/TTSCommand.swift:505-514 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:649-659 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:878-887 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1047-1056 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1146-1156 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1270-1280 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1361-1371 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1436-1446 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1511-1521 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:505` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 6) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:669— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:669-679 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:91-101 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:78-88 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:140-150 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:110-120 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:193-203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:669` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–11 lines × 5) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:349— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:349-359 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:300-303 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:334-344 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:355-365 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:222-232 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:349` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:86— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:86-96 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:73-83 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:123-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 3) Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:113— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:113-122 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:272-280 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:337-345 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:268` calls `info` and `Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:335` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–10 lines × 3) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:102— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:102-109 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:120-127 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:175-184 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–9 lines × 7) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:120— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:120-126 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:132-138 | Sources/FluidAudio/TTS/Inflect/Assets/InflectResourceDownloader.swift:41-47 | Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:42-48 | Sources/FluidAudio/TTS/NeuTts/NeuTtsModels.swift:102-108 | Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ResourceDownloader.swift:151-159 | Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ResourceDownloader.swift:98-106 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 7) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103-111 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:69-77 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:114-122 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:78-86 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:63-71 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:112-120 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:250-258 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:153— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:153-161 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:226-234 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:275-283 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:379-387 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:405-413 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (1–9 lines × 3) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:99— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:99-107 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:94-102 | Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:26-26 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–9 lines × 2) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:645— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:645-653 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:729-735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:645` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 5) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:579— Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:579-586 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:39-46 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:89-96 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:233-240 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:117-123 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:579` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:126` calls `featureValue` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (2–8 lines × 17) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:412— Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:412-414 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:654-656 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:212-213 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:260-261 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:173-174 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:484-486 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:616-619 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:626-627 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:823-825 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:956-963 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1123-1125 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1247-1249 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1334-1341 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1410-1417 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1486-1493 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:570-572 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:585-587 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:616` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:212` calls `info` and `Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:412` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–8 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:198— Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:198-205 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:276-283 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:397-399 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudioCLI/Commands/SortformerCommand.swift:396` calls `sorted`, `String` and `Sources/FluidAudioCLI/Commands/SortformerCommand.swift:276` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 6) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:90— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:90-96 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:110-116 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:234-240 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:118-123 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:411-416 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:862-868 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:126` calls `featureValue` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:343— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:343-349 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:391-397 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:416-422 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:464-470 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:343` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:340` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:390` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5–7 lines × 4) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:559— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:559-565 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1134-1138 | Sources/FluidAudioCLI/Utils/InlineDiff.swift:42-48 | Sources/FluidAudioCLI/Utils/WERCalculator.swift:208-212 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:559` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `hypothesis` to `[String]` in one and `[String]) -> (String` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 11) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:39— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:39-44 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:89-94 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:233-238 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:344-349 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:368-373 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:389-394 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:408-413 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:435-440 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:458-463 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:631-636 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:640-645 — there are 11 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 11 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5–6 lines × 9) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:378— Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:378-382 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:559-564 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:363-367 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1134-1138 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1171-1175 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:306-310 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:495-499 | Sources/FluidAudioCLI/Utils/InlineDiff.swift:42-47 | Sources/FluidAudioCLI/Utils/WERCalculator.swift:208-212 — there are 9 copies across 8 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `hypothesis` to `[String]` in one and `[String]) -> (String` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 8) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:121— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:121-126 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:352-357 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:376-381 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:397-402 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:416-421 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:443-448 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:466-471 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:488-493 — there are 8 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:579— Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:579-584 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:117-122 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:165-170 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:604-609 | Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:234-239 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:173-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:579` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:171` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:232` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 5) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:109— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:109-114 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:410-415 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:861-866 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:270-275 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:374-379 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:119` calls `featureValue` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:870` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–6 lines × 3) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:110— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:110-115 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:105-110 | Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:29-31 — before extracting anything, compare `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift` and `Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:110` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 12) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:577— Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:577-581 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:38-42 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:88-92 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:232-236 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:115-119 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:343-347 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:367-371 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:388-392 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:163-167 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:407-411 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:434-438 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:457-461 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:577` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:583` calls `MLFeatureValue` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:44` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 7) Sources/FluidAudioCLI/Commands/TTSCommand.swift:489— Sources/FluidAudioCLI/Commands/TTSCommand.swift:489-493 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:628-632 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1128-1132 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1252-1256 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1344-1348 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1420-1424 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1496-1500 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSCommand.swift:489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Flow.swift:41— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Flow.swift:41-45 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:98-102 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1427-1431 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1473-1477 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (2–5 lines × 5) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:288— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:288-289 | Sources/FluidAudio/TTS/NeuTts/NeuTtsPrompt.swift:40-44 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:786-788 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:814-817 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:307-311 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–5 lines × 7) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:343— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:343-346 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:361-366 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:328-331 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:367-371 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:208-210 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:251-254 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedRnntDecoder.swift:138-141 — before extracting anything, compare `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:366` calls `MLMultiArray`, `NSNumber` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:346` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (29–31 lines × 2) Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:464— Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:464-494 | Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:596-624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Coverage not measured — Swift suite — Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
Duplicated predicate Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:33— `arguments.contains("--help") || arguments.contains("-h")` appears character-identically in 10 files — Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:172— `p.hasPrefix(ASRConstants.sentencePieceWordBoundary) || p.hasPrefix(" ")` appears character-identically in 2 files — Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:555— `url.pathExtension == "txt" && url.lastPathComponent.contains(".trans.")` appears character-identically in 3 files — Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 99 significant file(s) lose their only recent owner: Sources/FluidAudioCLI/Commands/TTSCommand.swift, Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift, Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift, Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift, Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift, Sources/FluidAudio/Shared/Download/FileDownloader.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/Unified/UnifiedBenchmark.swift, Sources/FluidAudioCLI/Utils/DiarizationMetrics.swift (+91 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 3 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (104 single-owned of 336 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 336 of the 389 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (2 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (99939 LoC, 473 public types across 72 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 6 of 336 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 336 of the 389 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: Sources/FluidAudio/Shared/AudioStream.swift, Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift, Sources/FluidAudio/Diarizer/LS-EEND/LSEENDTypes.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcTokenizer.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/BKTree.swift, Sources/FluidAudio/Diarizer/Offline/Clustering/SpeakerCountConstraints.swift. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 106375 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Subsumed condition operand Tests/FluidAudioTests/TTS/KokoroAne/MandarinErhuaTests.swift:165— `phon.hasPrefix("ㄦ2")` can never decide this `||` — every value satisfying `phon.hasPrefix("ㄦ2")` also satisfies `phon.hasPrefix("ㄦ")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 35 file(s) — `Examples/LocalVQEDemo/Sources/LocalVQEDemo/DemoModel.swift`, `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift`, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift`, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift`, `Sources/FluidAudio/ASR/Parakeet/Streaming/ParakeetModelVariant.swift`, … (+30 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
0
—
Run 01a0f48d-fb1f-70a7-bb17-36bdb09689a8 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 75 · Warnings: 1161 · Recommendations: 16 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 30-09-2026 @ 23:02 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.