Public report of FluidInference/FluidAudio, published 28 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 28 October 2026, 23:20 UTC · Survey ID cd_4aef43323cf6420d9e7f200a8c925f04
FluidInference/FluidAudio
Measured 28 October 2026, 23:18 UTC, at code version 6dac59a
No regression since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 114,738 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 1.2 person-years · Weakest lens: Production Readiness, 55
Findings by how serious they are
81 critical1297 serious56 minor
22 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 23:18 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
57of 57 dimensions measured by tools.
1420of 1434 findings point to an exact file and line, so you can open each one in the code. The other 14 concern the repository as a whole, such as missing documentation.
57dimensions across 7 lenses, read from 114,738 lines of product code in 5 projects.
FluidInference/FluidAudio falls short of our standard for a preview release because we found no automated security scanning of the code, its secrets or its dependencies. It scores 60 out of 100 and is rated Adequate, and 80 of its 81 critical findings are security problems in the build pipeline.
Production Readiness, at 55, is the weakest lens and counts most in the score. The best first step is adding automated security scanning, worth about 4 points. Keeping a changelog comes next, worth about 3 points. Raising Production Readiness to 62 would lift the score to about 62.
Seventy-nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. One secret can leak from the build pipeline. Pinning each tool to an exact version and limiting the secret to its own step would close both risks. Moving the business rules into the object that owns the data would take care of the business object that only holds data.
The product code is 114,738 lines, about €170,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 38 findings
These 38 critical or serious findings were in the previous survey, on 14 October 2026, and are gone from this one.
€56,000 to €280,000, for 940 to 2,982 hours of work, about 1.2 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 60. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 114,738 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
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.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €170,000 to build again, about 1.2 person-years of work. Its weakest lens is Production Readiness, at 55 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
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. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 63,271 lines over the last 90 days, which is about 256,599 lines a year. At that pace, the extra work comes to an estimated 32.7 to 196.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
9 modules, with 3 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
204 pairs of types, where a type in FluidAudioCLI uses a type in FluidAudio. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
385 pairs of types, where a type in FluidAudio uses a type in FluidAudioCLI. 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
A05:2025 — Injection
80
High / Critical
A03:2025 — Software Supply Chain Failures
9
Medium
Roadmap
First, integrate automated security scanning into the CI pipeline to block regressions and maintain release hygiene with a consistent changelog. Next, address the 111 functions exceeding the cognitive complexity threshold by refactoring the most complex methods to improve code readability and maintainability. Finally, resolve the 96 test cases lacking assertions to ensure robust test quality and reliable validation of the codebase.
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.
Bring the 111 bodies over 30 down to 30 or less in Cognitive Complexity — start with StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 (cognitive 209), VocabularyRescorer.rescoreWithConstrainedCTCTermCentric (cognitive 202), StreamingNemotronMultilingualAsrManager.processChunk (cognitive 166).
Resolve the 96 No assertions finding(s) in Test Quality — start with NemoTextNormalizerTests.swift (13), TdtDecoderStateV3Tests.swift (13), ContextBiasingSendableTests.swift (9).
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 — 81
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 — 1297
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 — 56
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 22
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. 57 of 57 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — 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 — 57 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, 1420 of 1434 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.
D8 Code Coverage — 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. 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. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
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 — 5 SwiftPM declaration(s) across 6 `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.
D21 Naming Consistency — 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. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — 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. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — 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's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
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`, … (+35 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.
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.
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 reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust, Swift, c, cpp is not read yet, 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.
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 reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust, Swift, c, cpp is not read yet, 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.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
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.
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.
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 reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin 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.
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 reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP 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.
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 reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.
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 reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, Cpp, Python, Rust, Swift is not read yet, 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.
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.
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.
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.
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.
165 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was TTS.run at 131. A further 9 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 53 — they are counted neither in the figure above nor in this dimension's score. 5 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 48), Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedConfig.swift (NemotronUnifiedLanguage.promptId at 27), Sources/FluidAudio/ASR/Canary/CanaryLanguage.swift (CanaryLanguage.tokenId at 26), Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Types.swift (Nemotron3Config.preset at 18), Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift (PhononCharTables.subscriptBase 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.
+ 160 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with TTS.run (cyclomatic 131). — Refactoring it lifts Cyclomatic Complexity from 3.9 to about 4.0/10.
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.
303 method(s) exceeded the cognitive complexity threshold of 15; the worst was StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 at 209.
+ 298 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 111 bodies over 30 down to 30 or less in Cognitive Complexity — start with StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 (cognitive 209), VocabularyRescorer.rescoreWithConstrainedCTCTermCentric (cognitive 202), StreamingNemotronMultilingualAsrManager.processChunk (cognitive 166). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 111 together lifts Cognitive Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
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.0 / 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 78 MethodTooLong finding(s) in God Classes — start with TTSCommand.swift (4), DiarizationBenchmark.swift (3), VocabularyRescorer+TokenRescoring.swift (3). — One of this dimension's main actionable groups (78 warning-level).
Resolve the 29 FileTooLong finding(s) in God Classes — start with TTSCommand.swift, ChunkProcessor.swift, TtsBenchmarkCommand.swift. — One of this dimension's main actionable groups (29 warning-level).
Resolve the 27 ClassTooLong finding(s) in God Classes — start with TTSCommand.swift, ChunkProcessor.swift, TtsBenchmarkCommand.swift. — One of this dimension's main actionable groups (27 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.
425 duplicated block group(s) detected. A further 22 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 9 of the 447 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 160 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 32 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with KokoroAneSynthesizer+Conversion.swift (4), FrenchG2P.swift (2), InflectSynthesizer.swift (2). — One of this dimension's main actionable groups (32 warning-level).
Resolve the 23 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with VocabularyRescorer+CandidateMatching.swift, StreamingNemotronMultilingualAsrManager+Decode.swift, OfflineEmbeddingExtractor.swift. — One of this dimension's main actionable groups (23 warning-level).
Resolve the 22 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with CanaryManager.swift (2), ChatterboxNanoSynthesizer.swift (2), StreamingNemotronMultilingualAsrManager+Decode.swift. — One of this dimension's main actionable groups (22 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 · Coupling8.4 / 10Strong✓ 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.
5 production modules (SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence, with abstractness counted on 3 of the 5 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: LuxTtsG2pResources
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
3056 test methods: 3056 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 Quality9.0 / 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 96 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 (96 warning-level).
Resolve the 87 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 (87 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 (15×131=1965); Sources/FluidAudio/ModelNames.swift (27×53=1431); Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift (13×83=1079) Repeated repair below the complexity floor: Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift (4 of 6 changes were fixes); Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV2.swift (4 of 4 changes were fixes)
Resolve the 28 Hotspot finding(s) in Churn × Complexity Hotspots — start with TTSCommand.swift, ModelNames.swift, TranscribeCommand.swift. — One of this dimension's main actionable groups (28 warning-level).
Resolve the 2 Repeated repair finding(s) in Churn × Complexity Hotspots — start with OfflineDiarizerManager.swift, TdtDecoderV2.swift. — One of this dimension's main actionable groups (2 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.8 / 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.
116 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 365 of the 424 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 114738 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.
✓ On the Gold path — maintain.
Detailed fixes: d17_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.
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).
80 finding(s): 0 critical, 80 high, 0 medium, 0 low. 79 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 79 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 (79 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.
9 of 365 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 365 of the 424 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
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 model7.6 / 10Strong✓ 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.
`MLComputeUnits` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — Sources/FluidAudio/TTS/Inflect/InflectManager.swift:188
What to do
Move delegated behaviour onto the domain entity (or make it a value object); keep invariants inside the type.
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
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying 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 your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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 112387 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 487 use(s) across 122,297 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.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`resolveDataset` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:389
`extractZipFile` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:389
`downloadFullMusanDataset` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:677
`downloadVoicesSubset` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:950
`downloadAndExtractTarGz` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. (×2) — Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:448, Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:443
`top-level code` is async and calls .wait() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Scripts/ane_profile.swift:16
What to do
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×12) — Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:52, Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:155, Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:168, …
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info` at line 143 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:143
`info` at line 144 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:144
`info` at line 151 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:151
`info` at line 152 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:152
`info` at line 168 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:168
`info` at line 169 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:169
`info` at line 170 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:170
`info` at line 171 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:171
`info` at line 184 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:184
`error` at line 282 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:282
`error` at line 285 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — Scripts/voice_cloning/evaluate_voice.py:285
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 — 4 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 — 17 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 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 — 3 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.
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 — 62 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 applicable: Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written.
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.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D12 Dependency Hygiene — Not scored — 5 SwiftPM declaration(s) across 6 `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.
D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
D21 Naming Consistency — Naming consistency is measured on C# only; Python, Rust, Swift not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
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, nor 2+ projects each declaring an entity of their own. 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 — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
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) — 40 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 — Swift suite
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
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
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#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. 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, Rust, 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
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.
X16 Unfloored truncation loop — 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
X18 Disposal-pattern 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
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 asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and 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.
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
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.
DM4 · Rich vs anemic domain model· Anemic domain model · ×1
Anemic domain model: MLComputeUnits Sources/FluidAudio/TTS/Inflect/InflectManager.swift:188— `MLComputeUnits` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
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: testDistanceSweep Tests/FluidAudioTests/Diarizer/CleanSpeakerEmbeddingsAMITests.swift:186— 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: testChunkPairDistances Tests/FluidAudioTests/Diarizer/CleanSpeakerEmbeddingsAMITests.swift:236— 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.
MethodTooLong: VBxClustering.runVBx Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:169— 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: TTS.run Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— MethodTooLong — run runs 375 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 275 over it, 3.75× 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:45— 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: ASRBenchmark.runASRBenchmark Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649— MethodTooLong — runASRBenchmark runs 331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 231 over it, 3.31× 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.processChunk Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58— MethodTooLong — processChunk runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× 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:401— MethodTooLong — extractEmbeddings runs 317 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 217 over it, 3.17× 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: StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:45— MethodTooLong — runSpeculativeBlankDecodeV2 runs 290 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 190 over it, 2.90× 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 282 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 182 over it, 2.82× 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: ChunkProcessor.processWithDualDecodeArbitration Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:45— MethodTooLong — processWithDualDecodeArbitration runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× 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: CtcEarningsBenchmark.runCLI Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:61— MethodTooLong — runCLI 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: 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.processFile Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:429— 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.rescoreWithConstrainedCTCTermCentric Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:744— MethodTooLong — rescoreWithConstrainedCTCTermCentric runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× 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: TtsBenchmarkCommand.run Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— MethodTooLong — run runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× 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.
MethodTooLong: LSEENDCommand.run Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:9— MethodTooLong — run runs 200 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× 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: TranscribeCommand.parseArguments Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:253— MethodTooLong — parseArguments runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× 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: TTSAsrVerifyCommand.run Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:22— MethodTooLong — run runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× 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: FLEURSBenchmark.runCLI Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:822— MethodTooLong — runCLI runs 190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× 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.
Duplicated block (5 lines × 2) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:287— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:287-291 | Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:640-645 — 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 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:479-483 — 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/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:358— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:358-362 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:471-477 — 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/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:548-552 — 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/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/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:179— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:179-183 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:190-194 — 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/KokoroAne/G2P/French/FrenchG2P.swift:71— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:71-75 | Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:24-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.
Duplicated block (5 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:184— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:184-189 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:193-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. 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/TTS/PocketTTS/Small/PocketTtsSmallModel.swift:318— Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallModel.swift:318-322 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallModel.swift:359-363 — 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:251— Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:251-255 | Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:271-275 — 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: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. 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:951— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:951-955 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1012-1016 — 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:951` 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/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/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:230— Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:230-234 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:165-169 — 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/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:39— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:39-43 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:52-56 — before extracting anything, compare `Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift` and `Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 69 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:71— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:71-75 | 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/ASR/Parakeet/AsrTypes.swift:209— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:209-213 | Sources/FluidAudio/Diarizer/DiarizationDER.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/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 5 separate duplicated blocks between them, totalling at least 44 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/Chatterbox/ChatterboxManager.swift:33— Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:33-37 | Sources/FluidAudio/TTS/NeuTts/NeuTtsManager.swift:32-36 — 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/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/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/TTS/Inflect/Pipeline/InflectSynthesizer.swift:135— Sources/FluidAudio/TTS/Inflect/Pipeline/InflectSynthesizer.swift:135-139 | Sources/FluidAudio/TTS/Paradee/Pipeline/ParadeeSynthesizer.swift:103-107 — 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.
FileTooLong: Commands/TTSCommand.swift Sources/FluidAudioCLI/Commands/TTSCommand.swift— FileTooLong — 1488 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: TTS (5-1834). The bar is 500 significant lines; this is 988 over it, 2.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: TDT/ChunkProcessor.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift— FileTooLong — 1219 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ChunkProcessor (3-1905). The bar is 500 significant lines; this is 719 over it, 2.44× 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 — 1215 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: TtsBenchmarkCommand (33-1620). The bar is 500 significant lines; this is 715 over it, 2.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: FluidAudio/ModelNames.swift Sources/FluidAudio/ModelNames.swift— FileTooLong — 1175 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: ModelNames (496-2032). The bar is 500 significant lines; this is 675 over it, 2.35× 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: SlidingWindow/FleursBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift— FileTooLong — 917 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 417 over it, 1.83× 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/TranscribeCommand.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift— FileTooLong — 915 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: TranscribeCommand (198-1285). The bar is 500 significant lines; this is 415 over it, 1.83× 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: Pipeline/PocketTtsSynthesizer.swift Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift— FileTooLong — 881 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PocketTtsSynthesizer (15-1495). The bar is 500 significant lines; this is 381 over it, 1.76× 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 — 836 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CtcEarningsBenchmark (9-1250). The bar is 500 significant lines; this is 336 over it, 1.67× 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: Rescorer/VocabularyRescorer+TokenRescoring.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift— FileTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 324 over it, 1.65× 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 — 818 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: OfflineEmbeddingExtractor (64-1187). The bar is 500 significant lines; this is 318 over it, 1.64× 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/AsrBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift— FileTooLong — 798 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 298 over it, 1.60× 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: Cohere/CoherePipeline.swift Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift— FileTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 283 over it, 1.57× 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: Diarizer/DiarizerTimeline.swift Sources/FluidAudio/Diarizer/DiarizerTimeline.swift— FileTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 282 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: Core/OfflineDiarizerManager.swift Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift— FileTooLong — 739 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: OfflineDiarizerManager (14-1085). The bar is 500 significant lines; this is 239 over it, 1.48× 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: 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: Cohere/CohereBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift— FileTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: CohereBenchmark (12-753). The bar is 500 significant lines; this is 95 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: 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: TDT/AsrModels.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift— FileTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 91 over it, 1.18× 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: Nemotron/StreamingNemotronMultilingualAsrManager.swift Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift— FileTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 79 over it, 1.16× 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 — 555 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: VBxClustering (27-777). The bar is 500 significant lines; this is 55 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 — 544 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: LuxTtsG2p (28-769). The bar is 500 significant lines; this is 44 over it, 1.09× 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 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 131 in TTS.run at line 58. 3 of those changes were fix/bug commits, and the other 12 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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:162— Sources/FluidAudio/ModelNames.swift changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in Repo.name at line 162. 5 of those changes were fix/bug commits, and the other 22 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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:253— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in TranscribeCommand.parseArguments at line 253. 3 of those changes were fix/bug commits, and the other 10 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:256— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in AsrManager.reconcileFinalWindowSeam at line 256. 7 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.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 48 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in ASRBenchmark.runASRBenchmark at line 649. 1 of those changes was a fix/bug commit, 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in TtsBenchmarkCommand.run at line 93. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/CtcEarningsBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:61— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in CtcEarningsBenchmark.runCLI at line 61. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/ChunkProcessor.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:738— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in ChunkProcessor.process at line 738. 4 of those changes were fix/bug commits, 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in StreamingNemotronMultilingualAsrManager.processChunk at line 58. 1 of those changes was a fix/bug commit, and the other 2 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.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 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/FluidAudio/Shared/Download/ModelHub.swift Sources/FluidAudio/Shared/Download/ModelHub.swift:821— Sources/FluidAudio/Shared/Download/ModelHub.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in ModelHub.repoIncludeRule at line 821. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:822— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:432— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:352— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in StreamingNemotronMultilingualAsrManager.loadModels at line 352. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/TDT/AsrModels.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:417— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in AsrModels.load at line 417. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:45— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in ChunkProcessor.processWithDualDecodeArbitration at line 45. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.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/CanaryTranscribeCommand.swift Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift:15— Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in CanaryTranscribeCommand.run 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.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/Cohere/CohereBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:32— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in CohereBenchmark.run at line 32. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.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:369— Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in OfflineDiarizerConfig.validate at line 369. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/Assets/KokoroAneResourceDownloader.swift Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:457— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in KokoroAneResourceDownloader.ensureVoicePack at line 457. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:353— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in StreamingUnifiedAsrManager.processWindow at line 353. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -04:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.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/Cohere/CohereTranscribeCommand.swift Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:12— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in CohereTranscribeCommand.run at line 12. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -04:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.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/Mandarin/MandarinG2P.swift Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:89— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in MandarinG2P.phonemize at line 89. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -04:00' --full-history --no-merges -- Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.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 — 1485 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 1085 over it, 3.71× 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 — 1218 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 818 over it, 3.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: TtsBenchmarkCommand Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:33— ClassTooLong — 1210 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 810 over it, 3.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.
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: PocketTtsSynthesizer Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:15— ClassTooLong — 877 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 477 over it, 2.19× 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:496— ClassTooLong — 844 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 444 over it, 2.11× 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 — 830 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 430 over it, 2.08× 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:198— ClassTooLong — 803 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 403 over it, 2.01× 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:63— ClassTooLong — 768 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 368 over it, 1.92× 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:13— ClassTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 310 over it, 1.78× 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 — 566 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 166 over it, 1.42× 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:26— 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:28— 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:13— 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: ModelHub Sources/FluidAudio/Shared/Download/ModelHub.swift:10— ClassTooLong — 499 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 99 over it, 1.25× 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: EmissionDelayBenchmark Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:18— ClassTooLong — 440 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 40 over it, 1.10× 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:628— 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: 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/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/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:1061— Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:1061-1069 | Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:552-560 — 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:94— Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:94-102 | Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:209-217 — 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/Diarizer/Sortformer/SortformerDiarizer.swift:456— Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:456-464 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:491-499 — 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:500` calls `processLocked` and `Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:465` 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/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:67— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:67-75 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:76-84 — 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:75` calls `featureValue` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:66` 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/G2P/G2PModel.swift:168— Sources/FluidAudio/TTS/G2P/G2PModel.swift:168-176 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:145-153 — 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:168` 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:167` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:144` 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/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:388— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:388-396 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Tokenizer/StyleTTS2Phonemizer.swift:266-274 — 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/PocketTTS/Pipeline/PocketTtsVoiceCloner.swift:94— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsVoiceCloner.swift:94-102 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2GlueOps.swift:91-101 — 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:94` 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/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:83— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:83-91 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:106-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/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.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 (9 lines × 2) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:253— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:253-261 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:265-273 — 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/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:88— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:88-97 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:113-121 — 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: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 (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/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/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:142— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:142-150 | 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:142` 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/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/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:387— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:387-395 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:1296-1304 — 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/Inflect/InflectManager.swift:189— Sources/FluidAudio/TTS/Inflect/InflectManager.swift:189-197 | Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Manager.swift:331-339 — 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:49— Sources/FluidAudio/TTS/LuxTts/LuxTtsManager.swift:49-57 | Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:90-98 — 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:40— Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ModelStore.swift:40-48 | Sources/FluidAudio/TTS/Supertonic3/Supertonic3Manager.swift:52-60 — 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:38` calls `private` and `Sources/FluidAudio/TTS/Supertonic3/Supertonic3Manager.swift:46` 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) Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:134— Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:134-142 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/StreamPlayer.swift:118-126 — 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 `Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.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 (7 lines × 2) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:267— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:267-273 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:859-865 — 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:289— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:289-295 | 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:289` 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/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:504-510 — 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/Unified/UnifiedAsrManager.swift:397— Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:397-403 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:418-424 — 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:397` 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:240— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:240-246 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:273-279 — 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:376— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:376-382 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:449-455 — 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:85— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:85-91 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:79-85 — 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:85` 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/G2P/MultilingualG2PModel.swift:120— Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:120-126 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:146-153 — 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:120` 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:145` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:119` 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/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:205— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:205-211 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:163-169 — before extracting anything, compare `Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift` and `Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 69 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/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:205` 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:299— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:299-305 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:476-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 (7 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1441— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1441-1447 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1487-1493 — 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:1441` 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/PocketTTS/Small/PocketTtsSmallEngine.swift:323— Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:323-329 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:341-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/PocketTTS/Small/PocketTtsSmallEngine.swift:323` 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/PocketTTS/Tokenizer/SentencePieceProto.swift:105— Sources/FluidAudio/TTS/PocketTTS/Tokenizer/SentencePieceProto.swift:105-111 | Sources/FluidAudio/TTS/PocketTTS/Tokenizer/SentencePieceProto.swift:155-161 — 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/Tokenizer/SentencePieceProto.swift:105` 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/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:14— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:14-20 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:30-36 — 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/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/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:561— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:561-567 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:651-657 — 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:561` 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/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:68— Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:68-74 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoManager.swift:78-84 — 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:338— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:338-344 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:420-426 — 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 (7 lines × 2) Examples/PhononDemo/Sources/PhononDemo/Theme.swift:32— Examples/PhononDemo/Sources/PhononDemo/Theme.swift:32-38 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/Theme.swift:32-38 — before extracting anything, compare `Examples/PhononDemo/Sources/PhononDemo/Theme.swift` and `Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/Theme.swift` as WHOLE FILES: 100% 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 (8 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:100— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:100-107 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:192-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.
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:538-546 — 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/Diarizer/Nemotron3/Nemotron3Models.swift:405— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:405-412 | Sources/FluidAudio/Diarizer/Sortformer/SortformerModelInference.swift:307-314 — 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/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/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:124— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:124-131 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:128-135 — 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:306— Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:306-313 | Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:445-452 — 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:306` 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/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:147— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:147-154 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:296-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.
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:284-291 — 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:292` 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/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:520— Sources/FluidAudioCLI/Commands/TTSCommand.swift:520-527 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:598-605 — 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/TTSCommand.swift:550— Sources/FluidAudioCLI/Commands/TTSCommand.swift:550-557 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:628-635 — 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:550` 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:558` calls `Double` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:636` 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:768— Sources/FluidAudioCLI/Commands/TTSCommand.swift:768-775 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1325-1332 — 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:768` 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:1333` calls `Double` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:776` 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:1541— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1541-1548 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1617-1624 — 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:1541` 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/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 (8 lines × 2) Examples/Phonon2Demo/Sources/Phonon2Demo/ContentView.swift:166— Examples/Phonon2Demo/Sources/Phonon2Demo/ContentView.swift:166-173 | Examples/Phonon2Demo/Sources/Phonon2Demo/DemoModel.swift:295-302 — 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) Examples/PhononDemo/Sources/PhononDemo/DemoModel.swift:185— Examples/PhononDemo/Sources/PhononDemo/DemoModel.swift:185-192 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/DemoModel.swift:188-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 `Examples/PhononDemo/Sources/PhononDemo/DemoModel.swift:185` 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) Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:117— Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:117-124 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/StreamPlayer.swift:96-107 — 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, `Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:115` calls `setMuted` and `Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/StreamPlayer.swift:94` 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) Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:144— Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:144-151 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/StreamPlayer.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.
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/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 5 separate duplicated blocks between them, totalling at least 44 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:298— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:298-303 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:371-376 — 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:367— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:367-372 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:440-445 — 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:410— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:410-415 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:483-488 — 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:410` 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:63— Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:63-68 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:63-68 — 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:63` 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/English/KokoroAneEnglishPhonemizer.swift:370— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:370-375 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Tokenizer/StyleTTS2Phonemizer.swift:251-256 — 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:318— Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:318-323 | Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseCutlet.swift:343-348 — 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:318` 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:216— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:216-225 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:230-235 — 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:216` 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:226` calls `digitString`, `intToHanzi` and `Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:235` 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/PocketTTS/Pipeline/PocketTtsStateEngine.swift:396— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:396-401 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:144-151 — 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/SSML/SayAsInterpreter.swift:262— Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:262-267 | Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:268-273 — 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:262` 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:261` calls `interpretYear` and `Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:267` 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/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:19— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:19-25 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:22-27 — 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:19` 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:31— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:31-37 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:38-43 — 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:31` 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:571— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:571-576 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:747-752 — 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:571` 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 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 16 separate duplicated blocks between them, totalling at least 255 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) Sources/FluidAudio/TTS/G2P/G2PModel.swift:62— Sources/FluidAudio/TTS/G2P/G2PModel.swift:62-67 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:46-51 — 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 (6 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:536— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:536-541 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:764-769 — 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 before the matched lines, `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:534` calls `debugLog`, `O` and `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:762` 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) 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/ASR/Parakeet/AsrTypes.swift:137— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:137-150 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:977-990 — 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:137` 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/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/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/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:334— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:334-347 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:381-394 — 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:970— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:970-983 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:389-402 — 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:970` 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:433-446 — 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:456-469 — 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/Diarizer/Offline/Utils/VDSPOperations.swift:128— Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:128-141 | Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:331-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Offline/Utils/VDSPOperations.swift:128` 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/Shared/AudioMelSpectrogram.swift:236— Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:236-249 | Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:398-411 — 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/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:157— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:157-170 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:156-169 — 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/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:107— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:107-120 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:74-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/Cohere/CohereBenchmark.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.
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 (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 16 separate duplicated blocks between them, totalling at least 255 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/TTSAsrVerifyCommand.swift:30— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:30-43 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:114-127 — 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:30` 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/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:213— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:213-226 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallSession.swift:66-79 — 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 (10 lines × 2) Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:235— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:235-244 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:505-515 — 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:235` 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/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/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:81— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:81-90 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:92-101 — 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:81` 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/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:56— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:56-65 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:64-73 — 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:76` calls `featureValue` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:68` 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/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:126— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:126-135 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:84-93 — before extracting anything, compare `Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift` and `Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 69 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 (10 lines × 2) Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:164— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:164-173 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:122-131 — before extracting anything, compare `Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift` and `Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 69 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 (10 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:268— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:268-277 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:372-381 — 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/TTS/StyleTTS2/StyleTTS2Error.swift:17— Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Error.swift:17-26 | Sources/FluidAudio/TTS/Supertonic3/Supertonic3Error.swift:20-29 — 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:17` 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/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:204-213 — 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:215` 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:1168-1177 — 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 (10 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:39— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:39-48 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:429-438 — 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:39` 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/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:1053— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1053-1062 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1697-1706 — 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:1053` 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) Examples/PhononDemo/Sources/PhononDemo/PhononDemoApp.swift:26— Examples/PhononDemo/Sources/PhononDemo/PhononDemoApp.swift:26-35 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/PocketTtsSmallDemoApp.swift:16-25 — 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.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:52— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:155— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:168— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:281— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:398— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:540— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:587— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/Commands/G2PBenchmark.swift:179— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:658— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/Commands/VadBenchmark.swift:805— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:215— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:170— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
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/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/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/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/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/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 (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/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:903— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:903-915 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:351-363 — 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:903` 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 × 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:479-491 — 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:115— Sources/FluidAudio/Diarizer/Segmentation/SegmentationProcessor.swift:115-127 | Sources/FluidAudio/Diarizer/Segmentation/SegmentationProcessor.swift:186-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 (13 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:386— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:386-398 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:459-471 — 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:386` 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:909— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:909-921 | Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.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.
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 (11 lines × 2) Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:209— Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:209-219 | Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:227-237 — 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:209` 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:557— Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:557-567 | Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:578-588 — 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:193— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:193-203 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:125-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/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:193` 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/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:91— Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:91-101 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:117-127 — 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/Phonon/PhononCharTables.swift:91` 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 (11 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:373— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:373-383 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:517-527 — 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/AsrBenchmark.swift:723— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:723-733 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:116-126 — 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:723` 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 × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:465— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:465-475 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:481-491 — 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/TTSCommand.swift:999— Sources/FluidAudioCLI/Commands/TTSCommand.swift:999-1009 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1140-1150 — 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/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 (15 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:516— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:516-530 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:745-759 — 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:516` 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 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/FluidAudio/ModelNames.swift:344— Sources/FluidAudio/ModelNames.swift:344-358 | Sources/FluidAudio/ModelNames.swift:435-449 — 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 (15 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:209— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:209-223 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:163-177 — 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:209` 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/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 (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/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:284-298 — 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/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 (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: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/Paraformer/ParaformerManager.swift:439— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:439-443 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:343-347 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:416-420 — 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/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/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:127— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:127-133 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:246-251 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:249-253 — 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/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:127` 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 (5 lines × 3) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:147— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:147-154 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:199-206 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:262-266 — 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 (5 lines × 3) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:191— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:191-195 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Flow.swift:40-44 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:97-101 — 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:191` 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/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:1173-1177 — 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 (12 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:337— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:337-348 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:437-448 — 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:337` 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/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:860— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:860-871 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:493-504 — 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:860` 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/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:135— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:135-146 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:253-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 (12 lines × 2) Sources/FluidAudio/TTS/PocketTTS/PocketTTSError.swift:11— Sources/FluidAudio/TTS/PocketTTS/PocketTTSError.swift:11-22 | Sources/FluidAudio/TTS/Shared/TTSError.swift:10-21 — before extracting anything, compare `Sources/FluidAudio/TTS/PocketTTS/PocketTTSError.swift` and `Sources/FluidAudio/TTS/Shared/TTSError.swift` as WHOLE FILES: 83% 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:71— Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:71-82 | Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:97-108 — 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:71` 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/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:118— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:118-129 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:221-232 — 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:118` 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:761— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:761-772 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:885-896 — 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:761` 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:28— TooManyMethods — 75 methods, declared across 7 files: Nemotron/StreamingNemotronMultilingualAsrManager.swift (29), Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift (14), Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift (13), Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift (8), +3 more file(s). The bar is 30 methods; this is 45 over it, 2.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 — 59 methods, declared across 2 files: TDT/ChunkProcessor.swift (56), TDT/DualDecodeArbitration.swift (3). The bar is 30 methods; this is 29 over it, 1.97× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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:15— TooManyMethods — 54 methods, declared across 5 files: Pipeline/PocketTtsSynthesizer.swift (31), Pipeline/PocketTtsSynthesizer+KVCache.swift (15), Pipeline/PocketTtsSynthesizer+Mimi.swift (4), Pipeline/PocketTtsSynthesizer+Flow.swift (2), +1 more file(s). The bar is 30 methods; this is 24 over it, 1.80× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 — 48 methods, declared across 4 files: TDT/AsrManager.swift (21), TDT/AsrManager+Transcription.swift (13), TDT/AsrManager+Pipeline.swift (10), TDT/AsrManager+TokenProcessing.swift (4). The bar is 30 methods; this is 18 over it, 1.60× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 — 43 methods, declared across 5 files: Rescorer/VocabularyRescorer+TokenRescoring.swift (15), Rescorer/VocabularyRescorer+Utilities.swift (15), Rescorer/VocabularyRescorer+TokenEvaluation.swift (9), Rescorer/VocabularyRescorer.swift (3), +1 more file(s). The bar is 30 methods; this is 13 over it, 1.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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:13— 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:9— TooManyMethods — 31 methods, declared across 2 files: Clustering/SpeakerManager.swift (28), Clustering/SpeakerOperations.swift (3). The bar is 30 methods; this is 1 over it, 1.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 (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/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/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:276— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:276-291 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:369-384 — 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:276` 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:754— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:754-769 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1017-1032 — 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:754` 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 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:540— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:540-555 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:618-633 — 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:540` 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:743— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:743-758 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:810-825 — 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:743` 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.
Sync-over-async blocking Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:389— `resolveDataset` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:389— `extractZipFile` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:677— `downloadFullMusanDataset` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Sources/FluidAudioCLI/DatasetParsers/DatasetDownloader.swift:950— `downloadVoicesSubset` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:448— `downloadAndExtractTarGz` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:443— `downloadAndExtractTarGz` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Scripts/ane_profile.swift:16— `top-level code` is async and calls .wait() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Duplicated block (7 lines × 3) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:61— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:61-67 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:69-75 | Sources/FluidAudio/TTS/NeuTts/NeuTtsSynthesizer.swift:66-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:76` calls `featureValue` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:68` 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:125— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:125-131 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:129-135 | Sources/FluidAudio/TTS/NeuTts/NeuTtsSynthesizer.swift:103-109 — 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/FluidAudio/TTS/G2P/G2PModel.swift:118— Sources/FluidAudio/TTS/G2P/G2PModel.swift:118-124 | Sources/FluidAudio/TTS/G2P/G2PModel.swift:141-147 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:135-141 — 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/PocketTTS/Phonon/PhononCharTables.swift:95— Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:95-101 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:121-127 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:199-205 — 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/PocketTTS/Phonon/PhononCharTables.swift:95` 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 (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 16 separate duplicated blocks between them, totalling at least 255 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:1423— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1423-1432 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1520-1526 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1595-1602 — 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:1423` 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 lines × 3) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:190— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:190-195 | Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:229-234 | Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:341-346 — 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:86— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:86-91 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:109-114 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:125-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/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:86` 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/PocketTTS/Phonon/PhononCharTables.swift:145— Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:145-151 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:157-162 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:168-174 — 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/PocketTTS/Phonon/PhononCharTables.swift:145` 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:150— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:150-155 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:299-304 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:402-407 — 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 (9 lines × 3) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:190— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:190-198 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:196-204 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:122-130 — 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/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:106— Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:106-114 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:123-131 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:204-212 — 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/PocketTTS/Phonon/PhononCharTables.swift:106` 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/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:59— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:59-67 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:69-77 | Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:147-155 — 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/Parakeet/SlidingWindow/CtcDecodeBenchmark.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.
Duplicated block (9 lines × 3) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:212— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:212-220 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1226-1234 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:426-434 — 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:1053— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1053-1061 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1214-1222 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1697-1705 — 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:1053` 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 (22 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:77— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:77-98 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:116-137 — 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:77` 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:1038— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:1038-1055 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:1064-1082 — 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:1038` 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/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1113— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1113-1130 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1276-1294 — 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:1113` 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/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:170— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:170-188 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:156-174 — 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:170` 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:192` calls `streamingEncoderFile` and `Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:179` 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:359— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:359-377 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:531-549 — 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/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:85— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:85-103 | 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:85` 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 (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 (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:568— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:568-584 | 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:568` 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 (6–8 lines × 2) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:862— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:862-867 | 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:862` 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 — before extracting anything, compare `Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift` and `Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 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/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/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:447-454 — 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 (6–8 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:313— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:313-318 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:344-351 — 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:344` 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:343` calls `featureValue` and `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:312` 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 × 4) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:367— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:367-372 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceManager.swift:118-123 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:271-276 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:375-380 — 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/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:609-614 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:636-641 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:645-650 — 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:561— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:561-568 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:651-658 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:735-741 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:803-808 — 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:561` 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 (6 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100-114 | Sources/FluidAudio/ASR/NemotronTranscribeLite/NemotronTranscribeLiteModels.swift:88-102 | 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 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:116— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:116-127 | Sources/FluidAudio/ASR/NemotronTranscribeLite/NemotronTranscribeLiteModels.swift:125-133 | 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 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:287— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:287-362 | Sources/FluidAudio/TTS/NeuTts/NeuTtsPrompt.swift:40-48 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:786-791 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:806-821 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallSession.swift:83-88 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:284-325 — These 6 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 6 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 6 times.
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:536— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:536-607 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:611-705 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:709-778 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:782-844 — 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:306— Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:306-330 | Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:580-604 — 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:586— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:586-610 | 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:586` 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:108— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:108-131 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:94-116 — 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:108` 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:964-986 — 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:988` 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 (18 lines × 2) Sources/FluidAudio/Diarizer/Extraction/EmbeddingExtractor.swift:135— Sources/FluidAudio/Diarizer/Extraction/EmbeddingExtractor.swift:135-152 | Sources/FluidAudio/Diarizer/Extraction/EmbeddingExtractor.swift:183-200 — 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: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.
Duplicated block (18 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:150— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:150-167 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:160-177 — 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:150` 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–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/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:369— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:369-383 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:492-505 — 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:369` 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/FluidAudioCLI/Commands/TTSCommand.swift:1062— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1062-1075 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1235-1249 — 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:1062` 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:92— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:92-105 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:254-267 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:289-302 — 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:92` 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/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 (14 lines × 3) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1520— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1520-1533 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1596-1609 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1672-1685 — 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 (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:553-565 — 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:572` 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–13 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:227— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:227-236 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:362-374 — 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:227` 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:232— Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:232-241 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:170-182 — 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:232` 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–12 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:333— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:333-342 | Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:412-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3Models.swift:333` 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:61— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:61-72 | 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:61` 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:405— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:405-416 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:456-465 — 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:405` 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/ASR/Cohere/CohereBenchmark.swift:92— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:92-102 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:88-97 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:289-299 — 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:92` 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 × 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 16 separate duplicated blocks between them, totalling at least 255 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 (11 lines × 3) Sources/FluidAudio/Shared/Float16Conversion.swift:12— Sources/FluidAudio/Shared/Float16Conversion.swift:12-22 | Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:25-35 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:38-48 — before extracting anything, compare `Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift` and `Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 69 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/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 × 3) Sources/FluidAudio/Shared/Float16Conversion.swift:26— Sources/FluidAudio/Shared/Float16Conversion.swift:26-36 | Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:12-22 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:25-35 — before extracting anything, compare `Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift` and `Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 69 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/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 × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:89— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:89-99 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:73-83 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:131-141 — 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:89` 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 × 2) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:223— Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:223-232 | Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:334-344 — 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:223` 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/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 (10–11 lines × 2) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:211— Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:211-220 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1225-1235 — 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 lines × 3) Sources/FluidAudio/TTS/Inflect/InflectError.swift:16— Sources/FluidAudio/TTS/Inflect/InflectError.swift:16-25 | Sources/FluidAudio/TTS/LuxTts/LuxTtsError.swift:16-25 | Sources/FluidAudio/TTS/Paradee/ParadeeError.swift:17-26 — 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/FluidAudio/TTS/Inflect/InflectError.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 × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:725— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:725-734 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:118-127 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:865-874 — 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/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:725` 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 × 3) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:794— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:794-803 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:756-765 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1019-1028 — 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/Parakeet/SlidingWindow/AsrBenchmark.swift:794` 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–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/CtcDecodeBenchmark.swift:49— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:49-58 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:146-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/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 (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 (7–8 lines × 2) Sources/FluidAudio/TTS/G2P/G2PModel.swift:121— Sources/FluidAudio/TTS/G2P/G2PModel.swift:121-127 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:137-144 — 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:121` 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:266— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:266-273 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:326-332 — 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:266` 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:274` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:333` 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.
Repeated repair: Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:339— Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift changed 6 times in last 90 days and 4 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 339), 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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/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 4 times in last 90 days and 4 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): take seam-token timing from the window that heard it mid-window (#975)”; “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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 19:12:03 -04:00' --until='2026-10-28 19:12:03 -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.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/FluidAudio/Shared/SystemInfo.swift:91— Sources/FluidAudio/Shared/SystemInfo.swift:91-109 | Sources/FluidAudio/Shared/SystemInfo.swift:115-133 | Sources/FluidAudio/Shared/SystemInfo.swift:139-157 | Sources/FluidAudio/Shared/SystemInfo.swift:160-178 | Sources/FluidAudioCLI/FluidAudioCLI.swift:211-232 — 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:175— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:175-222 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Flow.swift:20-68 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:89-136 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1438-1447 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1483-1493 — 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 (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 (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 (25–26 lines × 2) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:210— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:210-234 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:795-820 — 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:210` 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 (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 (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–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:524-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. 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:564— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:564-577 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:417-434 — 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:564` 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:406-419 — 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 (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 16 separate duplicated blocks between them, totalling at least 255 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 16 separate duplicated blocks between them, totalling at least 255 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/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 (11–15 lines × 2) Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:203— Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:203-213 | Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift:546-560 — 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:203` 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/Cohere/CohereBenchmark.swift:107— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:107-119 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:74-86 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:117-129 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:132-144 — 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/Cohere/CohereBenchmark.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.
Duplicated block (13 lines × 4) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:689— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:689-701 | 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:689` 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 × 3) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:46— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:46-60 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:49-62 | Sources/FluidAudio/TTS/NeuTts/NeuTtsModels.swift:44-56 — 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:46` 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 × 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 (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:899-910 — 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:109— Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxMLSupport.swift:109-121 | Sources/FluidAudio/TTS/NeuTts/NeuTtsSynthesizer.swift:168-179 — 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:109` 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 (8–11 lines × 2) Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:181— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:181-188 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:420-430 — 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:636— Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:636-643 | Sources/FluidAudio/Diarizer/Offline/Extraction/PLDATransform.swift:187-196 — 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:187` 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:1423— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1423-1432 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1519-1526 — 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:1423` 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:208— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:208-215 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:269-277 — 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:208` 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 × 2) Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:465— Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:465-473 | Sources/FluidAudio/TTS/Paradee/ParadeeManager.swift:171-177 — 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/KokoroAneManager.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 (7–9 lines × 2) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:651— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:651-659 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:735-741 — 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: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. 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 lines × 3) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:86— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:86-93 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:109-116 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:124-131 — 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:86` 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:105— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:105-112 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:72-79 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:245-252 — 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: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 (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:407-413 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:434-440 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:457-463 — 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:767— Sources/FluidAudioCLI/Commands/TTSCommand.swift:767-773 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1324-1330 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1448-1454 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1540-1546 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1616-1622 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1692-1698 — 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:767` 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:1333` calls `Double` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:776` 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:745— Sources/FluidAudioCLI/Commands/TTSCommand.swift:745-751 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1146-1152 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1528-1534 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1604-1610 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1680-1686 — 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:752` calls `reduce`, `Double`, `squareRoot` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:1154` 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 (7 lines × 4) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:344— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:344-350 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:392-398 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:417-423 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:465-471 — 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: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:341` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:391` 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) Examples/LocalVQEDemo/Sources/LocalVQEDemo/LocalVQEDemoApp.swift:8— Examples/LocalVQEDemo/Sources/LocalVQEDemo/LocalVQEDemoApp.swift:8-15 | Examples/Phonon2Demo/Sources/Phonon2Demo/Phonon2DemoApp.swift:8-14 | Examples/PhononDemo/Sources/PhononDemo/PhononDemoApp.swift:18-24 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/PocketTtsSmallDemoApp.swift:8-14 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Examples/PhononDemo/Sources/PhononDemo/PhononDemoApp.swift:15` calls `NSApplicationDelegateAdaptor` and `Examples/LocalVQEDemo/Sources/LocalVQEDemo/LocalVQEDemoApp.swift:5` 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 × 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:609-614 | Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:235-240 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:174-179 — 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:172` calls `MLFeatureValue` and `Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:233` 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 × 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:868-874 — 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.
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:8— 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 131) Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— TTS.run has cyclomatic complexity 131 (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.
ASRBenchmark.runASRBenchmark (cyclomatic 83) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649— ASRBenchmark.runASRBenchmark 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.
TranscribeCommand.parseArguments (cyclomatic 83) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:253— TranscribeCommand.parseArguments 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.
StreamingNemotronMultilingualAsrManager.processChunk (cyclomatic 81) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58— StreamingNemotronMultilingualAsrManager.processChunk 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.
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.
PhononTextNormalizer.normalize (cyclomatic 71) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextNormalizer.swift:21— PhononTextNormalizer.normalize has cyclomatic complexity 71 (threshold 15). Of this number, 70 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 (cyclomatic 69) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.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.
ChunkProcessor.processWithDualDecodeArbitration (cyclomatic 63) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:45— ChunkProcessor.processWithDualDecodeArbitration has cyclomatic complexity 63 (threshold 15). Of this number, 57 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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.rescoreWithConstrainedCTCTermCentric (cyclomatic 63) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:744— VocabularyRescorer.rescoreWithConstrainedCTCTermCentric has cyclomatic complexity 63 (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 61) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:61— CtcEarningsBenchmark.runCLI has cyclomatic complexity 61 (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.
EmissionDelayBenchmark.runCLI (cyclomatic 60) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:47— EmissionDelayBenchmark.runCLI 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:169— 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 59) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— TtsBenchmarkCommand.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.
OfflineSegmentationProcessor.process (cyclomatic 57) Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:45— OfflineSegmentationProcessor.process has cyclomatic complexity 57 (threshold 15). Of this number, 44 points are the body's own statements and 13 belong to 2 function items inside it that branch. 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+Transcription.swift:256— AsrManager.reconcileFinalWindowSeam has cyclomatic complexity 55 (threshold 15). Of this number, 54 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
ModelNames.getRequiredModelNames (cyclomatic 50) Sources/FluidAudio/ModelNames.swift:1894— ModelNames.getRequiredModelNames has cyclomatic complexity 50 (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 53) 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.
LuxTtsG2p.phonemizeClause (cyclomatic 48) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:351— 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.
CanaryTranscribeCommand.run (cyclomatic 48) Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift:15— CanaryTranscribeCommand.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.
CohereBenchmark.run (cyclomatic 47) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:32— CohereBenchmark.run 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.
CtcEarningsBenchmark.processFile (cyclomatic 47) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:429— 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.
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:146— SpanishG2P.segment has cyclomatic complexity 42 (threshold 15). Of this number, 41 points are the body's own statements and 1 belongs to one function item inside it that branches. 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:25— 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.
FrenchPhonology.mapToEspeak (cyclomatic 40) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:287— 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/BKTree/VocabularyRescorer+CandidateMatching.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.
FLEURSBenchmark.runCLI (cyclomatic 39) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:822— FLEURSBenchmark.runCLI has cyclomatic complexity 39 (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:225— LuxTtsG2p.phonemizeNormalized has cyclomatic complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
CohereTranscribeCommand.run (cyclomatic 36) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:12— CohereTranscribeCommand.run 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:66— 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.
TranscribeCommand.runStreaming (cyclomatic 34) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:864— TranscribeCommand.runStreaming 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.
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:41— 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:52— 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). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
TranscribeCommand.runBatch (cyclomatic 31) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:636— TranscribeCommand.runBatch 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+SpeechSegmentation.swift:71— VadManager.detectSpeechSampleRanges has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function item inside it that branches. 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:1398— 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.
SayAsInterpreter.formatDate (cyclomatic 29) Sources/FluidAudio/TTS/SSML/SayAsInterpreter.swift:240— 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:23— 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.
VocabularyRescorer.rescoreWithConstrainedCTCWordCentric (cyclomatic 29) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:515— VocabularyRescorer.rescoreWithConstrainedCTCWordCentric 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:918— 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:53— 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:59— 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+Pipeline.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:352— 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:582— 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:390— 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:187— 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.
ModelHub.repoIncludeRule (cyclomatic 27) Sources/FluidAudio/Shared/Download/ModelHub.swift:821— ModelHub.repoIncludeRule has cyclomatic complexity 27 (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.
LuxTtsG2p.selectWord (cyclomatic 27) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:563— 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.
ChunkProcessor.process (cyclomatic 27) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:738— ChunkProcessor.process has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
G2PModel.phonemize (cyclomatic 26) Sources/FluidAudio/TTS/G2P/G2PModel.swift:96— 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:231— 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:867— 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:466— 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.
KokoroAneV3Pipeline.run (cyclomatic 25) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift:112— KokoroAneV3Pipeline.run has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to one function item inside it that branches. 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 25) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1345— ChunkProcessor.mergeUsingMatches 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:332— 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.
OfflineEmbeddingExtractor.extractEmbeddings::processChunk (cyclomatic 24) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:526— OfflineEmbeddingExtractor.extractEmbeddings::processChunk has cyclomatic complexity 24 (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. This shape REPEATS in the file: one other method here (OfflineEmbeddingExtractor.extractEmbeddings) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MandarinG2P.phonemize (cyclomatic 24) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:89— MandarinG2P.phonemize has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
OfflineDiarizerConfig.validate (cyclomatic 23) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:369— OfflineDiarizerConfig.validate has cyclomatic complexity 23 (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.
LuxTtsG2p.selectPhrase (cyclomatic 23) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:608— 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:266— MandarinG2P.segment has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 2 function items inside it that branch. 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.
PhononTextRewriter.urls (cyclomatic 22) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter.swift:260— PhononTextRewriter.urls has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. 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:1121— ChunkProcessor.collapseSeamWordDuplicates has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
VocabularyRescorer.collectSpotterAnchoredCandidates (cyclomatic 22) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1159— VocabularyRescorer.collectSpotterAnchoredCandidates 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.
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:1170— 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:173— 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.
SlidingWindowAsrManager.processWindow (cyclomatic 21) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:432— SlidingWindowAsrManager.processWindow 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:216— 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:291— 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.
PhononTextRewriter.range (cyclomatic 21) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter+Numbers.swift:35— PhononTextRewriter.range has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
DatasetDownloader.downloadCommonVoiceJapanese (cyclomatic 21) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.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). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
OfflineEmbeddingExtractor.extractEmbeddings (cyclomatic 20) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:401— OfflineEmbeddingExtractor.extractEmbeddings 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. This shape REPEATS in the file: one other method here (OfflineEmbeddingExtractor.extractEmbeddings::processChunk) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PocketTtsConstantsLoader.loadVoiceSnapshot (cyclomatic 20) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:162— 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.
PhononTextRewriter.emails (cyclomatic 20) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter.swift:198— PhononTextRewriter.emails has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
PhononTextRewriter.numberWords (cyclomatic 20) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter+Numbers.swift:129— PhononTextRewriter.numberWords has cyclomatic complexity 20 (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.
PocketTtsSmallEngine.generateDecodeFrame (cyclomatic 20) Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:284— PocketTtsSmallEngine.generateDecodeFrame 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.
PocketTtsSmallConstants.loadVoice (cyclomatic 20) Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallModel.swift:356— PocketTtsSmallConstants.loadVoice 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:1616— ChunkProcessor.spliceCandidate has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. 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/NemotronVocabularyBias.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.terminalStates (cyclomatic 20) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcDPAlgorithm.swift:119— CtcDPAlgorithm.terminalStates 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.
CtcDPAlgorithm.ctcWordSpotMultiple (cyclomatic 20) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcDPAlgorithm.swift:310— 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). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. 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/JapaneseDatasetDownloader.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.
Nemotron35TranscribeCommand.run (cyclomatic 20) Sources/FluidAudioCLI/Commands/ASR/Nemotron35TranscribeCommand.swift:14— Nemotron35TranscribeCommand.run has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. 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:293— 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:88— 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:353— 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.
KokoroAneV3Assets.baseIndex (cyclomatic 19) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Assets.swift:243— KokoroAneV3Assets.baseIndex 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.
AsrModels.load (cyclomatic 19) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:417— AsrModels.load 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:121— 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.
MandarinNumberNormalizer.fourDigitChunk (cyclomatic 19) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:81— 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:65— 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.
SpeakerUtilities.cleanEmbeddingsBySpeaker (cyclomatic 18) Sources/FluidAudio/Diarizer/Clustering/SpeakerOperations.swift:551— SpeakerUtilities.cleanEmbeddingsBySpeaker 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.
G2PModel.loadIfNeeded (cyclomatic 18) Sources/FluidAudio/TTS/G2P/G2PModel.swift:218— 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:194— 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.
KokoroAneV3Assets.ensure (cyclomatic 18) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Assets.swift:176— KokoroAneV3Assets.ensure 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.
PocketTtsConstantsLoader.parseSafetensors (cyclomatic 18) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:340— 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.
PhononTextRewriter.digitRun (cyclomatic 18) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter+Numbers.swift:77— PhononTextRewriter.digitRun has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. 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.planWindows (cyclomatic 18) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:170— ChunkProcessor.planWindows 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+Shared.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.
MandarinBopomofoMap.decode (cyclomatic 18) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinBopomofoMap.swift:222— MandarinBopomofoMap.decode 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.
VocabularyRescorer.evaluateCTCMatch (cyclomatic 18) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.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:553— 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.
TranscribeCommand.runUnified (cyclomatic 18) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:534— TranscribeCommand.runUnified 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.
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:35— 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.
KokoroAneV3Pipeline.init (cyclomatic 17) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift:25— KokoroAneV3Pipeline.init has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (open, buckets). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AsrManager.transcribeChunk (cyclomatic 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.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.
ChunkProcessor.repairSeamGaps (cyclomatic 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1706— ChunkProcessor.repairSeamGaps 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:442— 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:52— 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:91— 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:82— 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+Utilities.swift:156— 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.
ModelCache.hasMatchingContent (cyclomatic 16) Sources/FluidAudio/Shared/Download/ModelCache.swift:133— ModelCache.hasMatchingContent 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.
AHCClustering.assignmentsFromDendrogram (cyclomatic 16) Sources/FluidAudio/Diarizer/Offline/Clustering/AHCClustering.swift:125— 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:280— 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:270— 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.
KokoroAneEnglishPhonemizer.resolveWord (cyclomatic 16) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:126— 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:443— 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:119— 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:33— 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+Inference.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+Decode.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.
VocabularyRescorer.rescoreWithConstrainedCTCTermCentric (cognitive 202) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:744— VocabularyRescorer.rescoreWithConstrainedCTCTermCentric has cognitive complexity 202 (threshold 15). Drivers by points: if/else 34 (138 pts), loops 8 (32 pts), boolean chains 16, ternaries 4 (16 pts) (nesting depth added 140). 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.
StreamingNemotronMultilingualAsrManager.processChunk (cognitive 166) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58— StreamingNemotronMultilingualAsrManager.processChunk has cognitive complexity 166 (threshold 15). Drivers by points: if/else 64 (129 pts), boolean chains 34, 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.
TTS.run (cognitive 159) Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— TTS.run has cognitive complexity 159 (threshold 15). Drivers by points: if/else 49 (130 pts), match/switch 5 (15 pts), boolean chains 11, ternaries 1 (2 pts), loops 1 (nesting depth added 92). 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.
ChunkProcessor.processWithDualDecodeArbitration (cognitive 120) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:45— ChunkProcessor.processWithDualDecodeArbitration has cognitive complexity 120 (threshold 15). Drivers by points: loops 14 (44 pts), if/else 27 (43 pts), ternaries 12 (18 pts), boolean chains 15 (nesting depth added 52). Of this number, 114 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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/BKTree/VocabularyRescorer+CandidateMatching.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.
OfflineSegmentationProcessor.process (cognitive 114) Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:45— OfflineSegmentationProcessor.process has cognitive complexity 114 (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. This shape REPEATS in the file: one other method here (OfflineSegmentationProcessor.process::populateWindow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ASRBenchmark.runASRBenchmark (cognitive 113) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649— ASRBenchmark.runASRBenchmark has cognitive complexity 113 (threshold 15). Drivers by points: if/else 35 (84 pts), match/switch 4 (11 pts), error handling 3 (8 pts), ternaries 5, boolean chains 4, loops 1 (nesting depth added 61). 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.
PhononTextNormalizer.normalize (cognitive 111) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextNormalizer.swift:21— PhononTextNormalizer.normalize has cognitive complexity 111 (threshold 15). Drivers by points: if/else 33 (46 pts), ternaries 9 (28 pts), boolean chains 27, loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 38). Of this number, 110 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
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.
TranscribeCommand.parseArguments (cognitive 108) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:253— TranscribeCommand.parseArguments has cognitive complexity 108 (threshold 15). Drivers by points: if/else 32 (93 pts), match/switch 3 (10 pts), boolean chains 4, loops 1 (nesting depth added 68). 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.
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:61— 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:169— 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.
LuxTtsG2p.phonemizeClause (cognitive 87) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:351— 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.
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 76) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:864— TranscribeCommand.runStreaming has cognitive complexity 76 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 7 (25 pts), ternaries 3 (9 pts), match/switch 1 (3 pts), boolean chains 1, error handling 1 (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.
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+SpeechSegmentation.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). Of this number, 70 points are the body's own statements and 2 belong to one function item inside it that branches. 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:25— 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:429— 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.
CanaryTranscribeCommand.run (cognitive 70) Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift:15— CanaryTranscribeCommand.run has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (55 pts), boolean chains 7, ternaries 2 (4 pts), match/switch 1 (2 pts), error handling 1, loops 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.
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:52— 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.
VocabularyRescorer.rescoreWithConstrainedCTCWordCentric (cognitive 66) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:515— VocabularyRescorer.rescoreWithConstrainedCTCWordCentric has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (46 pts), ternaries 4 (10 pts), boolean chains 5, loops 3 (5 pts) (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+Transcription.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). Of this number, 64 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
CohereBenchmark.run (cognitive 65) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:32— CohereBenchmark.run has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (51 pts), boolean chains 8, match/switch 2 (4 pts), error handling 1, loops 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.
FrenchPhonology.phonemize (cognitive 61) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:66— 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:867— 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.
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:225— 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). Of this number, 53 points are the body's own statements and 2 belong to one function item inside it that branches. 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 54) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:636— TranscribeCommand.runBatch has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 3 (13 pts), boolean chains 6, match/switch 1 (3 pts), error handling 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.
CtcDPAlgorithm.terminalStates (cognitive 53) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcDPAlgorithm.swift:119— CtcDPAlgorithm.terminalStates has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 6 (19 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 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.
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:41— 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:146— 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). Of this number, 50 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 51) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:12— CohereTranscribeCommand.run has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 7, match/switch 2 (6 pts), loops 1 (nesting depth added 25). 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:466— 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.
ChunkProcessor.mergeUsingMatches (cognitive 49) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1345— ChunkProcessor.mergeUsingMatches has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 3 (9 pts), ternaries 4 (9 pts), boolean chains 7 (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.
FrenchPhonology.mapToEspeak (cognitive 49) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:287— 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:23— 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:918— 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:53— 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.
SlidingWindowAsrManager.processWindow (cognitive 47) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:432— SlidingWindowAsrManager.processWindow has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (31 pts), ternaries 2 (6 pts), boolean chains 5, loops 1 (4 pts), error handling 1 (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.
OfflineEmbeddingExtractor.extractEmbeddings::processChunk (cognitive 45) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:526— OfflineEmbeddingExtractor.extractEmbeddings::processChunk has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 4 (9 pts), boolean chains 3 (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. This shape REPEATS in the file: one other method here (OfflineEmbeddingExtractor.extractEmbeddings) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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). Of this number, 42 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
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:293— 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.
StreamingNemotronAsrManager.processChunk (cognitive 43) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.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/JapaneseDatasetDownloader.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:96— 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:582— 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:187— 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/JapaneseDatasetDownloader.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:240— 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:125— 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.
KokoroAneV3Pipeline.run (cognitive 39) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift:112— KokoroAneV3Pipeline.run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 4 (10 pts), boolean chains 6, loops 1 (nesting depth added 11). Of this number, 31 points are the body's own statements and 8 belong to one function item inside it that branches. 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 39) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1706— ChunkProcessor.repairSeamGaps has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 6 (12 pts), boolean chains 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.
SpanishG2P.syllabify (cognitive 39) Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:231— 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.
VocabularyRescorer.collectSpotterAnchoredCandidates (cognitive 39) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1159— VocabularyRescorer.collectSpotterAnchoredCandidates has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 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.
OfflineSortformerDiarizer.processComplete (cognitive 38) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:280— 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:1170— 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:291— 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.
ChunkProcessor.process (cognitive 37) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:738— ChunkProcessor.process has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, ternaries 4 (8 pts), loops 3 (4 pts) (nesting depth added 10). Of this number, 35 points are the body's own statements and 2 belong to one function item inside it that branches. 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:390— 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:216— 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.
MandarinG2P.phonemize (cognitive 35) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:89— MandarinG2P.phonemize has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, loops 3 (5 pts), error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 15). Of this number, 30 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
HFTreeLister.listTree (cognitive 34) Sources/FluidAudio/Shared/Download/HFTreeLister.swift:62— HFTreeLister.listTree has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (24 pts), ternaries 3 (6 pts), loops 2 (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.
LuxTtsSynthesizer.synthesize (cognitive 34) Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:59— 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:310— 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.
OfflineEmbeddingExtractor.extractEmbeddings (cognitive 33) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:401— OfflineEmbeddingExtractor.extractEmbeddings has cognitive complexity 33 (threshold 15). Drivers by points: if/else 38 (57 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. This shape REPEATS in the file: one other method here (OfflineEmbeddingExtractor.extractEmbeddings::processChunk) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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:612— 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:352— 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:65— 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:332— 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). Of this number, 29 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
PocketTtsSmallEngine.generateDecodeFrame (cognitive 31) Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:284— PocketTtsSmallEngine.generateDecodeFrame has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 5 (8 pts), ternaries 2 (4 pts), boolean chains 2 (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.
SentencePieceTokenizer.viterbiDecode (cognitive 31) Sources/FluidAudio/TTS/PocketTTS/Tokenizer/SentencePieceTokenizer.swift:107— SentencePieceTokenizer.viterbiDecode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 3 (4 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.
AsrModels.load (cognitive 31) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:417— AsrModels.load has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (22 pts), error handling 1 (3 pts), ternaries 2 (3 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.
VocabularyRescorer.alignBaseWordsToUTF8Ranges (cognitive 31) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+Utilities.swift:156— 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:935— 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:394— 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.
ModelHub.repoIncludeRule (cognitive 30) Sources/FluidAudio/Shared/Download/ModelHub.swift:821— ModelHub.repoIncludeRule has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 20, if/else 6 (10 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.
OfflineDiarizerManager.computeCentroids (cognitive 30) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:742— 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.
SentencePieceProto.parsePiece (cognitive 30) Sources/FluidAudio/TTS/PocketTTS/Tokenizer/SentencePieceProto.swift:99— SentencePieceProto.parsePiece has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 1 (2 pts), 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.
TTS.runKokoroAne (cognitive 30) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1088— 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:221— 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.
StreamingUnifiedAsrManager.processWindow (cognitive 29) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:353— 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:563— 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.planWindows (cognitive 29) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:170— ChunkProcessor.planWindows has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (11 pts), boolean chains 5, 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.
ChunkProcessor.collapseSeamWordDuplicates (cognitive 29) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1121— 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). Of this number, 28 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.segment (cognitive 29) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:266— MandarinG2P.segment has cognitive complexity 29 (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. This shape REPEATS in the file: one other method here (MandarinG2P.segment::flushHanziRun) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TtsBenchmarkCommand.inferCohereLanguage (cognitive 29) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:1398— 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:9— 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:482— 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:247— 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+Inference.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.
SpeakerUtilities.cleanEmbeddingsBySpeaker (cognitive 27) Sources/FluidAudio/Diarizer/Clustering/SpeakerOperations.swift:551— SpeakerUtilities.cleanEmbeddingsBySpeaker has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 6 (9 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.
DiarizerManager.processChunkWithSpeakerTracking (cognitive 27) Sources/FluidAudio/Diarizer/Core/DiarizerManager.swift:266— DiarizerManager.processChunkWithSpeakerTracking has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 4 (6 pts), ternaries 2 (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.
LuxTtsG2p.selectPhrase (cognitive 27) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:608— 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.
FrenchPhonology.tokenize (cognitive 27) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:443— 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:119— 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). Of this number, 23 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
KokoroAneV3Assets.baseIndex (cognitive 26) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Assets.swift:243— KokoroAneV3Assets.baseIndex has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 8, loops 2 (3 pts), ternaries 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.
PocketTtsConstantsLoader.loadVoiceSnapshot (cognitive 26) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:162— 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:510— 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.
PocketTtsSmallConstants.loadVoice (cognitive 26) Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallModel.swift:356— PocketTtsSmallConstants.loadVoice has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 10, 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.
MandarinToneSandhiPOS.applyThirdToneSandhi (cognitive 26) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinToneSandhiPOS.swift:146— 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:82— 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.
BLEUCalculator.corpusBLEU (cognitive 26) Sources/FluidAudioCLI/Utils/BLEUCalculator.swift:50— BLEUCalculator.corpusBLEU has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (11 pts), boolean chains 2, ternaries 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.
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.
Nemotron35TranscribeCommand.run (cognitive 26) Sources/FluidAudioCLI/Commands/ASR/Nemotron35TranscribeCommand.swift:14— Nemotron35TranscribeCommand.run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2 (4 pts), match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 10). Of this number, 24 points are the body's own statements and 2 belong to one function item inside it that branches. 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.runUnified (cognitive 26) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:534— TranscribeCommand.runUnified has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 2 (4 pts), loops 1 (3 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.
TranscribeCommand.runWithVariant (cognitive 26) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1116— 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:88— 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.
PhononTextRewriter.numberWords (cognitive 25) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter+Numbers.swift:129— PhononTextRewriter.numberWords has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, loops 2 (3 pts), ternaries 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, 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.
ChunkProcessor.silenceAlignedChunkStarts (cognitive 25) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:424— ChunkProcessor.silenceAlignedChunkStarts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (7 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.
VocabularyRescorer.buildWordTimings (cognitive 25) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:412— 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.
SpeakerManager.initializeKnownSpeakers (cognitive 24) Sources/FluidAudio/Diarizer/Clustering/SpeakerManager.swift:63— 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:32— 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:732— 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:340— 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.
AsrManager.runInference (cognitive 24) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Pipeline.swift:139— AsrManager.runInference has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (4 pts), loops 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.
MandarinPolyphoneCatalog.init (cognitive 24) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPolyphoneCatalog.swift:61— 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:173— 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.
OfflineSegmentationProcessor.process::populateWindow (cognitive 23) Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:119— OfflineSegmentationProcessor.process::populateWindow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 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. This shape REPEATS in the file: one other method here (OfflineSegmentationProcessor.process) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatterboxSynthesizer.buildPrefillEmbeds (cognitive 23) Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:183— 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:322— 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.
PocketTtsSmallEngine.init (cognitive 23) Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:140— PocketTtsSmallEngine.init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 12). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
MandarinNumberNormalizer.fourDigitChunk (cognitive 23) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinNumberNormalizer.swift:81— 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:33— 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:553— 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.
NemotronTranscribeLiteSpeakers.assign (cognitive 22) Sources/FluidAudio/ASR/NemotronTranscribeLite/NemotronTranscribeLiteSpeakers.swift:55— NemotronTranscribeLiteSpeakers.assign has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (10 pts), boolean chains 2 (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.
ModelCache.adoptLegacyCache (cognitive 22) Sources/FluidAudio/Shared/Download/ModelCache.swift:71— ModelCache.adoptLegacyCache has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5, ternaries 2 (3 pts), error handling 1 (2 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.
OfflineDiarizerConfig.validate (cognitive 22) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:369— OfflineDiarizerConfig.validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, 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.
KokoroAneV3Pipeline.init (cognitive 22) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift:25— KokoroAneV3Pipeline.init has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), error handling 2 (3 pts), loops 3, boolean chains 2 (nesting depth added 6). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (open, buckets). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PhononTextRewriter.urls (cognitive 22) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter.swift:260— PhononTextRewriter.urls has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, loops 2 (nesting depth added 1). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
PhononTextRewriter.range (cognitive 22) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter+Numbers.swift:35— PhononTextRewriter.range has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (8 pts) (nesting depth added 1). Of this number, 16 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
AsrManager.transcribeChunk (cognitive 22) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.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:1616— 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). Of this number, 19 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
MandarinBopomofoMap.decode (cognitive 22) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinBopomofoMap.swift:222— MandarinBopomofoMap.decode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 4). 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.
MandarinG2pwModel.disambiguate (cognitive 22) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2pwModel.swift:125— MandarinG2pwModel.disambiguate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, 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.
VocabularyRescorer.evaluateCTCMatch (cognitive 22) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.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.
BLEUCalculator.tokenize (cognitive 22) Sources/FluidAudioCLI/Utils/BLEUCalculator.swift:12— BLEUCalculator.tokenize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, loops 1 (nesting depth added 7). Of this number, 19 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
PcmWavLayout.parse (cognitive 21) Sources/FluidAudio/Shared/AudioSampleSource.swift:123— PcmWavLayout.parse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, 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.
CoherePipeline.decodeCacheExternal (cognitive 21) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:893— CoherePipeline.decodeCacheExternal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 pts), boolean chains 2, 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.
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:202— 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:43— 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.
ChatterboxTokenizer.init (cognitive 21) Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:27— 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:35— 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:57— 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.
PocketTtsSmallSession.generateChunk (cognitive 21) Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallSession.swift:123— PocketTtsSmallSession.generateChunk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (6 pts), boolean chains 4 (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.
StreamingNemotronMultilingualAsrManager.updateRescueSpans (cognitive 21) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:144— 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.
MandarinJiebaHmm.segment (cognitive 21) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinJiebaHmm.swift:52— 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:175— 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:107— 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:283— 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:42— 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). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
PhononTextRewriter.digitRun (cognitive 20) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter+Numbers.swift:77— PhononTextRewriter.digitRun has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (7 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
PocketTtsSynthesizer.chunkTextWithMetadata (cognitive 20) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:918— 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/NemotronVocabularyBias.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:121— 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.
CoherePipeline.mergeTokenStreams (cognitive 19) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:795— CoherePipeline.mergeTokenStreams has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 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.
SortformerDiarizer.enrollSpeakerInternal (cognitive 19) Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:295— 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:218— 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.
KokoroAneV3NativeSource.waveform (cognitive 19) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3NativeSource.swift:32— KokoroAneV3NativeSource.waveform has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (13 pts), ternaries 1 (3 pts), boolean chains 2, if/else 1 (nesting depth added 9). 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.
NeuTtsBpeTokenizer.init (cognitive 19) Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:40— 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.
PhononTextRewriter.emails (cognitive 19) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter.swift:198— PhononTextRewriter.emails has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, loops 2, ternaries 1 (2 pts), match/switch 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
PocketTtsSession.generateChunk (cognitive 19) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:270— 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:1243— 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+Shared.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:74— 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:79— 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:91— 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:667— 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:339— 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:194— 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:33— 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:137— 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:188— 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:387— 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). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. 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:101— 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.
AudioSourceFactory.makeDiskBackedSource (cognitive 17) Sources/FluidAudio/Shared/AudioSourceFactory.swift:11— AudioSourceFactory.makeDiskBackedSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 3 (4 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.
SortformerStateUpdater.disableLowScores (cognitive 17) Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:352— 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:180— 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:462— 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:150— 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.
KokoroAneV3Assets.ensure (cognitive 17) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Assets.swift:176— KokoroAneV3Assets.ensure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2, match/switch 1, ternaries 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.
LuxTtsG2p.oovPron (cognitive 17) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:697— 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.
PhononTextRewriter.elongations (cognitive 17) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter.swift:379— PhononTextRewriter.elongations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (6 pts), boolean chains 4 (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.
SentencePieceProto.parseModel (cognitive 17) Sources/FluidAudio/TTS/PocketTTS/Tokenizer/SentencePieceProto.swift:51— SentencePieceProto.parseModel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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.
AsrModels.parseVocabulary (cognitive 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:574— 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:126— 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:76— 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.
MandarinG2P.segment::flushHanziRun (cognitive 17) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:291— MandarinG2P.segment::flushHanziRun has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (3 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. This shape REPEATS in the file: one other method here (MandarinG2P.segment) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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:805— 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). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. 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:347— 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:210— 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.
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:28— 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:34— 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:520— 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.
PhononTextChunker.splitIntoBestSentences (cognitive 16) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextChunker.swift:34— PhononTextChunker.splitIntoBestSentences has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), 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.
PhononTextRewriter.dashedDigits (cognitive 16) Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextRewriter.swift:144— PhononTextRewriter.dashedDigits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2 (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.
PocketTtsLayerKeys.discover (cognitive 16) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsLayerKeys.swift:83— 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:230— 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:1137— 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.
PocketTtsSmallSession.generateLoop (cognitive 16) Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallSession.swift:90— PocketTtsSmallSession.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.
VocabularyRescorer.wordIndices (cognitive 16) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1370— VocabularyRescorer.wordIndices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, 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.
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:134— 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.
Change coupling: ChunkProcessor.swift ↔ TdtDecoderV3.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1— `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:164— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:164-218 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:286-320 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:322-355 — 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:100— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:100-122 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:95-119 | Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:25-36 — 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 (99 shared lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:45— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:45-454 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58-575 — These two members are variants of one another: 99 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:34— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:34-167 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:33-177 — 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:354— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:354-415 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:427-488 — 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:120— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:120-165 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:227-280 — 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 (18 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (18 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:534-614 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:636-844 | 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:510-582 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:587-659 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:667-804 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:884-933 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:935-1086 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1088-1258 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1263-1358 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1377-1482 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1487-1573 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1577-1648 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1653-1723 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:494-600 — These 18 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 18 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 18 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:553-634 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:351-374 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1129-1154 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1168-1191 | 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.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:121— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:121-127 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:133-139 | Sources/FluidAudio/TTS/Inflect/Assets/InflectResourceDownloader.swift:42-48 | Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:43-49 | Sources/FluidAudio/TTS/NeuTts/NeuTtsModels.swift:103-109 | Sources/FluidAudio/TTS/Paradee/Assets/ParadeeModelStore.swift:117-123 | Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ResourceDownloader.swift:152-160 | Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ResourceDownloader.swift:99-107 — These 8 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 8 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 8 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
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 (51–61 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:301— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:301-351 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:485-545 — 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:252— Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:252-308 | Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:416-472 — 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:252` 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:1094— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1094-1147 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1205-1258 | 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:1094` 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:1090` calls `exit` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1199` 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:306-352 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:379-425 — 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:306` 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 (44 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:868— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:868-911 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1052-1095 — 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:868` 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 (29–44 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:436— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:436-464 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:909-952 — 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:436` 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 (37–38 lines × 2) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:43— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:43-80 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:47-83 — 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:522— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:522-558 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:649-673 — 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:522` 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 16 separate duplicated blocks between them, totalling at least 255 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 (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 (30–31 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:133— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:133-163 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:118-147 — 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:133` 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 (24–31 lines × 2) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:262— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:262-285 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:420-450 — 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:262` 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–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 16 separate duplicated blocks between them, totalling at least 255 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 (19–30 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:329— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:329-347 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:545-574 — 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–27 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1025— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1025-1049 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1185-1211 — 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 16 separate duplicated blocks between them, totalling at least 255 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 16 separate duplicated blocks between them, totalling at least 255 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 × 8) Sources/FluidAudioCLI/Commands/TTSCommand.swift:564— Sources/FluidAudioCLI/Commands/TTSCommand.swift:564-582 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:641-659 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:785-804 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1339-1358 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1463-1482 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1554-1573 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1629-1648 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1704-1723 — all 8 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:564` 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:41— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:41-60 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:44-62 — 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:41` 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:961— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:961-980 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:1107-1126 — 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:961` 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–19 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:147— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:147-165 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:262-276 — 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/PocketTtsStateEngine.swift:147` 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–18 lines × 5) Sources/FluidAudio/Shared/SystemInfo.swift:92— Sources/FluidAudio/Shared/SystemInfo.swift:92-107 | Sources/FluidAudio/Shared/SystemInfo.swift:116-131 | Sources/FluidAudio/Shared/SystemInfo.swift:140-155 | Sources/FluidAudio/Shared/SystemInfo.swift:161-176 | Sources/FluidAudioCLI/FluidAudioCLI.swift:212-229 — there are 5 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 5 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 (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 (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:166-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/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 (13–18 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:251— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:251-268 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallSession.swift:109-121 — 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/PocketTtsSession.swift:251` 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 (15–18 lines × 2) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:713— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:713-730 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:785-799 — 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:713` 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 × 3) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:684— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:684-698 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:871-885 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1055-1069 — 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/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:684` 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 (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:680— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:680-693 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:96-109 | 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: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–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:269-282 — 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:183— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:183-195 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:301-314 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:331-343 — 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:183` 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:343` calls `featureValue` and `Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:195` 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 (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 (13–14 lines × 2) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:192— Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:192-204 | Sources/FluidAudio/Diarizer/Sortformer/SortformerModelInference.swift:171-184 — 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:192` 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:70— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+State.swift:70-73 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:254-267 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:324-337 — 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 (10–14 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:540— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:540-549 | 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:65— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:65-77 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:44-56 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:33-45 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:905-917 | 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:335-347 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:120-132 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:164-176 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:62-74 — there are 11 copies across 10 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/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.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 (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 (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:385— Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:385-391 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:904-916 — 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:66— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:66-77 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:93-104 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:45-56 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:685-696 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:34-45 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:101-112 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:901-912 | 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:255-266 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:290-301 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:336-347 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:121-132 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:165-176 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:58-69 — there are 20 copies across 15 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 20 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:66` 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:687— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:687-698 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:908-919 | 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:687` 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–12 lines × 6) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:116— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:116-127 | Sources/FluidAudio/ASR/NemotronTranscribeLite/NemotronTranscribeLiteModels.swift:125-133 | 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 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.
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:493-501 | 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 (8–12 lines × 3) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:607— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:607-618 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:635-642 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:644-651 — 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:607` 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 (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 16 separate duplicated blocks between them, totalling at least 255 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 (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:1119-1130 — 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 — before extracting anything, compare `Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift` and `Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 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/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:63— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:63-73 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:95-105 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:42-52 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:31-41 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:103-113 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:903-913 | 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:257-267 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:292-302 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:333-343 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:118-128 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:162-172 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:60-70 — there are 18 copies across 13 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 18 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:63` 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:40` calls `printUsage`, `exit` and `Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:62` 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 × 10) Sources/FluidAudioCLI/Commands/TTSCommand.swift:567— Sources/FluidAudioCLI/Commands/TTSCommand.swift:567-576 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:644-653 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:788-798 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1070-1079 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1243-1252 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1342-1352 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1466-1476 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1557-1567 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1632-1642 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1707-1717 — all 10 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:567` 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 × 8) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:687— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:687-697 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:908-918 | 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:687` 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 × 6) 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/CtcEarningsBenchmark.swift:94-104 | 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:678` 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 × 5) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100-110 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:116-126 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:139-149 | Sources/FluidAudio/Speaker/CampPlusModels.swift:65-75 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:62-72 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100` 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 (10 lines × 6) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:105— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:105-114 | Sources/FluidAudio/ASR/NemotronTranscribeLite/NemotronTranscribeLiteModels.swift:93-102 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:121-130 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:144-153 | Sources/FluidAudio/Speaker/CampPlusModels.swift:70-79 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:67-76 — 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/Canary/CanaryModels.swift:105` 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 (9–10 lines × 3) Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:114— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:114-123 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:273-281 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:338-346 — 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: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. 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:269` calls `info` and `Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:336` 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:103— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:103-110 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:121-128 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:176-185 — 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: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 × 7) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:107— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:107-115 | Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:74-82 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:117-125 | 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:274-282 — there are 7 copies across 6 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 7 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: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.
Duplicated block (9 lines × 5) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:154— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:154-162 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:227-235 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:276-284 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:380-388 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:406-414 — 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:154` 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:100— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:100-108 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:95-103 | Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:27-27 — 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:100` 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–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 (6–8 lines × 4) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:610— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:610-617 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:637-642 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:646-651 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:654-661 — 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:610` 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 (2–8 lines × 20) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:412— Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:412-414 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:603-606 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:820-822 | 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:545-547 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:623-625 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:755-758 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:765-766 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:925-926 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1015-1017 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1148-1155 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1319-1321 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1443-1445 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1530-1537 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1606-1613 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1682-1689 | 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/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:603` 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 (7 lines × 8) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:121— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:121-127 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:133-139 | Sources/FluidAudio/TTS/Inflect/Assets/InflectResourceDownloader.swift:42-48 | Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:43-49 | Sources/FluidAudio/TTS/NeuTts/NeuTtsModels.swift:103-109 | Sources/FluidAudio/TTS/Paradee/Assets/ParadeeModelStore.swift:117-123 | Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ResourceDownloader.swift:152-160 | Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ResourceDownloader.swift:99-107 — 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 (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:407-412 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:434-439 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:457-462 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:636-641 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:645-650 — 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 (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:415-420 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:442-447 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:465-470 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:487-492 — 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 × 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:867-872 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:271-276 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:375-380 — 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:876` 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:111— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:111-116 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:106-111 | Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:30-32 — 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:111` 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–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.
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:406-410 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:433-437 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:456-460 — 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 × 9) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:378— Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:378-382 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:566-571 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcDecodeBenchmark.swift:363-367 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1143-1147 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1180-1184 | 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 (5 lines × 8) Sources/FluidAudioCLI/Commands/TTSCommand.swift:550— Sources/FluidAudioCLI/Commands/TTSCommand.swift:550-554 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:628-632 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:767-771 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1324-1328 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1448-1452 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1540-1544 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1616-1620 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1692-1696 — all 8 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:550` 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:42— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Flow.swift:42-46 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:99-103 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1441-1445 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1487-1491 — 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 (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 (2–5 lines × 6) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:289— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:289-290 | Sources/FluidAudio/TTS/NeuTts/NeuTtsPrompt.swift:41-45 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:787-789 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:815-818 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallSession.swift:84-86 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:307-311 — there are 6 copies across 5 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/TTS/KokoroAne/G2P/French/FrenchG2P.swift:289` 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 (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.
Off the main sequence: LuxTtsG2pResources — LuxTtsG2pResources: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Duplicated predicate Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:479— `!$0.isLetter && !$0.isNumber && !$0.isWhitespace` appears character-identically in 2 files — Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift, Sources/FluidAudio/TTS/Paradee/ParadeeManager.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/Canary/CanaryModels.swift:52— `!force && modelsExist(at: targetDir, precision: precision)` appears character-identically in 3 files — Sources/FluidAudio/ASR/Canary/CanaryModels.swift, Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift, Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.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/ChunkProcessor.swift:1211— `CharacterSet.punctuationCharacters.contains(scalar) || CharacterSet.symbols.contains(scalar)` appears character-identically in 2 files — Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift, Sources/FluidAudioCLI/Utils/BLEUCalculator.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/DiarizationBenchmark.swift:487— `args.minSpeakers != nil || args.maxSpeakers != nil` appears character-identically in 2 files — Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift, Sources/FluidAudioCLI/Commands/ProcessCommand.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: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/FluidAudioCLI/Models/CLIModels.swift:213— `customThresholds.der != nil || customThresholds.jer != nil || customThresholds.rtf != nil` appears character-identically in 2 files — Sources/FluidAudioCLI/Models/CLIModels.swift, Sources/FluidAudioCLI/Utils/ResultsFormatter.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/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:194— `decoderJoint != nil || decoderJointNoEncProj != nil || decoderJointArgmax != nil || (decoder != nil && joint != nil)` appears character-identically in 2 files — Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift, Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.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/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:340— `eosLogit > PocketTtsConstants.eosThreshold && eosStep == nil` appears character-identically in 2 files — Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift, Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.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/Parakeet/SlidingWindow/AsrBenchmark.swift:593— `i > 0 && j > 0 && dp[i][j] == dp[i - 1][j - 1] + 1` appears character-identically in 3 files — Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift, Sources/FluidAudioCLI/Utils/InlineDiff.swift, Sources/FluidAudioCLI/Utils/WERCalculator.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/Parakeet/SlidingWindow/AsrBenchmark.swift:588— `i > 0 && j > 0 && reference[i - 1] == hypothesis[j - 1]` appears character-identically in 2 files — Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift, Sources/FluidAudioCLI/Utils/InlineDiff.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/AsrTypes.swift:241— `isWordBoundary(token) || currentWord.isEmpty` appears character-identically in 4 files — Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.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/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:38— `lowered == "0" || lowered == "false" || lowered == "no"` appears character-identically in 2 files — Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift, Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.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/FluidAudio/ASR/Parakeet/AsrTypes.swift:237— `token.isEmpty || token == "<blank>" || token == "<pad>"` appears character-identically in 4 files — Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift, Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.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:561— `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.
Duplicated predicate Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:332— `v < worstV || (v == worstV && permutedIdx >= worstI)` appears character-identically in 2 files — Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift, Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.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/ChunkProcessor.swift:863— `windowTokens.count == windowTimestamps.count && windowTokens.count == windowConfidences.count` appears character-identically in 2 files — Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.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.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:143— `info` at line 143 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:144— `info` at line 144 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:151— `info` at line 151 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:152— `info` at line 152 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:168— `info` at line 168 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:169— `info` at line 169 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:170— `info` at line 170 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:171— `info` at line 171 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:184— `info` at line 184 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:282— `error` at line 282 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging Scripts/voice_cloning/evaluate_voice.py:285— `error` at line 285 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog.
Orphaned file Sources/FluidAudio/Shared/AudioStream.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/FluidAudio/Diarizer/LS-EEND/LSEENDTypes.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcTokenizer.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/FluidAudio/TTS/SSML/SSMLTagParser.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/BKTree.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/FluidAudio/TTS/SSML/SSMLTypes.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/FluidAudio/Diarizer/Offline/Clustering/SpeakerCountConstraints.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Hand-rolled JSON/XML parsing via regex Sources/FluidAudio/TTS/SSML/SSMLTagParser.swift:13— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Sources/FluidAudio/TTS/SSML/SSMLTagParser.swift:20— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Sources/FluidAudio/TTS/SSML/SSMLTagParser.swift:27— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Silent fallback default in catch Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:74— `getDirectoryFiles` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:244— `getVoxConverseFiles` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:275— `getCALLHOMEFiles` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 114 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift, Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift, Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift, Sources/FluidAudio/Shared/Download/FileDownloader.swift, Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift (+106 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 2 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 (116 single-owned of 365 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 365 of the 424 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: Sources/FluidAudio/Diarizer/DiarizerTimeline.swift, Sources/FluidAudio/VAD/VadTypes.swift.
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)` (111119 LoC, 835 module-visible types across 106 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 — 9 of 365 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, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 365 of the 424 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/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift, Sources/FluidAudio/Diarizer/LS-EEND/LSEENDTypes.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcTokenizer.swift, Sources/FluidAudio/TTS/SSML/SSMLTagParser.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/BKTree.swift, Sources/FluidAudio/TTS/SSML/SSMLTypes.swift (and 1 more). 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 112387 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:224— `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 40 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`, … (+35 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 01a184ce-b8c2-7adf-84aa-a6f690037e46 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 81 · Warnings: 1297 · Recommendations: 56 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 28-10-2026 @ 23:18 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.