Public report of FluidInference/FluidAudio, published 14 November 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.11.4). 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, 14 November 2026, 22:50 UTC · Survey ID cd_8e49a64618124ab5a8645e900b411bb5
FluidInference/FluidAudio
Measured 14 November 2026, 22:50 UTC, at code version 16780f0
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Up 1 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: 123,219 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 1.3 person-years · Weakest lens: Production Readiness, 54
Findings by how serious they are
81 critical1531 serious48 minor
35 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 22:50 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 the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work 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 ▸
39of 39 dimensions measured by tools.
1649of 1660 findings point to an exact file and line, so you can open each one in the code. The other 11 concern the repository as a whole, such as missing documentation.
39dimensions across 7 lenses, read from 123,219 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 61 out of 100 and is rated Adequate, and 80 of its 81 critical findings are security problems in the build pipeline.
Production Readiness, at 54, is the weakest lens and counts most in the score. The best first step is adding automated security scanning, worth about 5 points. Keeping a changelog comes next, worth about 4 points. Raising Production Readiness to 62 would lift the score to about 64.
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 123,219 lines, about €190,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.
If Production Readiness rose from 54 to 62, the lowest score rated Strong, the score would rise from 61 to about 64.
Code composition: what the lines of code are
Product code 71%Tests 29%
New since the last survey: 355 findings
These 355 critical or serious findings weren't in the previous survey, on 28 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · MethodTooLong: AsrManager.transcribeChunk Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift
God Classes · MethodTooLong: ChunkProcessor.repairSeamGaps Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift
God Classes · FileTooLong: TDT/AsrManager+Transcription.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift
God Classes · MethodTooLong: TTS.printUsage Sources/FluidAudioCLI/Commands/TTSCommand.swift
God Classes · TooManyMethods: SlidingWindowAsrManager Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift
Code Duplication · Near-duplicate member pair (159 shared lines) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift
Code Duplication · Near-duplicate member pair (129 shared lines) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift
Code Duplication · Near-duplicate member pair (70 shared lines) Sources/FluidAudioCLI/Commands/LSEENDCommand.swift
Code Duplication · Near-duplicate member pair (70 shared lines) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift
Code Duplication · Edited copy of a member (19 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift
Code Duplication · Members sharing a duplicated core (18 members, 50+ identical tokens) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift
Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift
Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift
Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/FluidAudio/ASR/Canary/CanaryModels.swift
Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/FluidAudio/ASR/Canary/CanaryModels.swift
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/FluidAudio/Shared/SystemInfo.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift
Code Duplication · Edited copy of a member (61 corresponding lines) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift
Code Duplication · Edited copy of a member (108 corresponding lines) Sources/FluidAudio/Shared/AudioMelSpectrogram.swift
Code Duplication · Edited copy of a member (79 corresponding lines) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift
Code Duplication · Edited copy of a member (62 corresponding lines) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift
Code Duplication · Edited copy of a member (81 corresponding lines) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift
Code Duplication · Edited copy of a member (40 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift
Code Duplication · Edited copy of a member (64 corresponding lines) Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift
Code Duplication · Edited copy of a member (58 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift
Code Duplication · Edited copy of a member (64 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift
Code Duplication · Edited copy of a member (43 corresponding lines) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift
Code Duplication · Edited copy of a member (56 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift
Code Duplication · Edited copy of a member (43 corresponding lines) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift
Code Duplication · Edited copy of a member (33 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift
Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift
Code Duplication · Edited copy of a member (32 corresponding lines) Sources/FluidAudioCLI/Utils/WERCalculator.swift
Code Duplication · Edited copy of a member (44 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift
Code Duplication · Edited copy of a member (39 corresponding lines) Sources/FluidAudio/ASR/Canary/CanaryManager.swift
We compare 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: 121 findings
These 121 critical or serious findings were in the previous survey, on 28 October 2026, and are gone from this one. The first 100 are listed here.
€63,000 to €310,000, for 1,045 to 3,314 hours of work, about 1.3 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 61. 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: 123,219 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: We price 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 €190,000 to build again, about 1.3 person-years of work. Its weakest lens is Production Readiness, at 54 (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 5 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 5.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 16% on every change. The history of the code shows how much it changes: about 81,967 lines over the last 90 days, which is about 332,422 lines a year. At that pace, the extra work comes to an estimated 58.9 to 353.2 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 our 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.
189 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.
406 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
Top priorities: 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; Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release; Resolve the 107 Skipped test finding(s) in Test Quality — start with SegmentationProcessorEdgeCaseTests.swift (11), SpeakerEnrollmentTests.swift (9), VadTests.swift (5).
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.
Resolve the 100 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 — 1531
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 — 48
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 35
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
This survey 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. All 39 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.
Every figure here is one of two 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. 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.
What we checked — 39 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, 1649 of 1660 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 or a scanner, 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 — We 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.
D11 Test Reliability — not measured this run — We 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 — We 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.
D22 Internal API Consistency — not measured this run — We 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 — We 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.
D26 Project Cohesion — not measured this run — We 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. `(repository root)` (119600 LoC, 929 module-visible types across 109 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
D32 Data Compliance (PII/GDPR) — not measured this run — We 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/LFM3Audio/LFM3AudioModels.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`, … (+39 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 — We 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 — We 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 — We 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 — We 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 — We 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 — We 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 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 — We 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 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 — We measured this, but not all of it. What we 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — We 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, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust 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.
X12 Unreachable branch — not measured this run — We 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
X13 Undrained process stream — not measured this run — We 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
X15 Unvalidated length from an untrusted reader — not measured this run — We 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, Scala, PHP, Ruby, Python, Go, Rust and Dart source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust or Dart 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.
X16 Unfloored truncation loop — not measured this run — We 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.
X17 Uncapped recursion over a caller-supplied document — not measured this run — We 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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 — We 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.
X19 Unrestored process-global state — not measured this run — We 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, Python, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, 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 — We 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 JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python or Rust 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.
X22 Contradicted release guard — not measured this run — We 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 Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded, and this repository's C, C++, 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.
X23 Unguarded diagnostic materialisation — not measured this run — We 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, F#, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin 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.
X24 Document value interpolated into markup unescaped — not measured this run — We 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, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python 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.
X25 Inert configuration knob — not measured this run — We 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, Scala, PHP, Erlang, Python, Dart and Ruby source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart or Ruby 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.
X27 Collection changed while being enumerated — not measured this run — We 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 Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's C, C++ 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.
X29 Per-element action decided by a fixed element — not measured this run — We 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 (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, 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.
X30 Support guard that admits what it rejects — not measured this run — We 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 Scala, JavaScript/TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart and Ruby source only, and no C# was loaded and no Scala, JavaScript, TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart or Ruby 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.
X4 Structured logging — not measured this run — We 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, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala or Rust 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.
X5 Nullable reference types — not measured this run — We 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, 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
We assess the repository exactly as committed, and only the repository. By design we do 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.
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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
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.
184 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was TTS.run at 142. 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 61 — 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.
+ 179 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 142). — Refactoring it lifts Cyclomatic Complexity from 3.6 to about 3.9/10.
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.
+ 324 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 122 bodies over 30 down to 30 or less in Cognitive Complexity — start with VocabularyRescorer.rescoreWithConstrainedCTCTermCentric (cognitive 226), StreamingNemotronMultilingualAsrManager.runSpeculativeBlankDecodeV2 (cognitive 209), TTS.run (cognitive 179). — 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 122 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.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.2 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 81 MethodTooLong finding(s) in God Classes — start with TTSCommand.swift (5), DiarizationBenchmark.swift (3), VocabularyRescorer+TokenRescoring.swift (3). — One of this dimension's main actionable groups (81 warning-level).
Resolve the 30 FileTooLong finding(s) in God Classes — start with TTSCommand.swift, ChunkProcessor.swift, ModelNames.swift. — One of this dimension's main actionable groups (30 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).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
389 duplicated block group(s) detected. 11.6 % of the production lines (14,274 of 123,219) are in a reported copy. A further 205 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 20 of the 594 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.
+ 221 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 27 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with ChatterboxNanoSynthesizer.swift (3), ModelHub.swift (2), VocabularyRescorer+CandidateMatching.swift. — One of this dimension's main actionable groups (27 warning-level).
Resolve the 25 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 (25 warning-level).
Resolve the 22 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with ChatterboxNanoSynthesizer.swift (2), CanaryManager.swift, LFM3AudioModels.swift. — One of this dimension's main actionable groups (22 warning-level).
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).
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 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with TextNormalizer.swift, TranscribeCommand.swift, ParadeeModelStore.swift. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality8.9 / 10Strong✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
No assertions: testPerformance_SuffixPrefixMatching · ×100Tests/FluidAudioTests/ASR/TokenDeduplicationRegressionTests.swift:369
What to do
Resolve the 107 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 (107 warning-level).
Resolve the 100 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 (100 warning-level).
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 (19×142=2698); Sources/FluidAudio/ModelNames.swift (36×53=1908); Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift (19×86=1634) Repeated repair below the complexity floor: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/VocabularyBoostingSession.swift (5 of 7 changes were fixes); Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift (5 of 7 changes were fixes); Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift (4 of 6 changes were fixes)
Resolve the 36 Hotspot finding(s) in Churn × Complexity Hotspots — start with TTSCommand.swift, ModelNames.swift, TranscribeCommand.swift. — One of this dimension's main actionable groups (36 warning-level).
Resolve the 5 Repeated repair finding(s) in Churn × Complexity Hotspots — start with VocabularyBoostingSession.swift, AsrTypes.swift, OfflineDiarizerManager.swift. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor7.0 / 10Strong✓ 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.
118 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 394 of the 454 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 123219 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: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Package.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
4 naming inconsistencies among 87 declarations measured against a convention their peers follow.
`PocketTTS` spells `TTS` where 61 names in the project spell it `Tts`Sources/FluidAudio/ModelNames.swift:1396
`PocketTTSError` spells `TTS` where 61 names in the project spell it `Tts`Sources/FluidAudio/TTS/PocketTTS/PocketTTSError.swift:5
`calculateASRMetrics` spells `ASR` where 22 names in the project spell it `Asr`Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:361
`runASRBenchmark` spells `ASR` where 22 names in the project spell it `Asr`Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649
What to do
Resolve the 1 `PocketTTS` spells `TTS` where 61 names in the project spell it `Tts` finding(s) in Naming Consistency — start with ModelNames.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `PocketTTSError` spells `TTS` where 61 names in the project spell it… finding(s) in Naming Consistency — start with PocketTTSError.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `calculateASRMetrics` spells `ASR` where 22 names in the project spell… finding(s) in Naming Consistency — start with AsrBenchmark.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
6 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
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.
8 of 394 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 394 of the 454 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 4 Change coupling finding(s) in Change Coupling — start with StreamingUnifiedAsrManager.swift, ChunkProcessor.swift, SlidingWindowAsrManager.swift. — One of this dimension's main actionable groups (4 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.
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.7 / 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 repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
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 repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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's code 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 17 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. — REDACTED:4
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 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 each language's code 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.
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.
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?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 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 — 18 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 — 77 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.
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.
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+ sibling projects each declaring an entity of their own or taking another project's integration events. 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#, Visual Basic, TypeScript and JavaScript 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
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. 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) — 44 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.
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 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — 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
X13 Undrained process stream — 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
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — 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
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
X17 Uncapped recursion over a caller-supplied document — 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
X19 Unrestored process-global state — 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.
X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. In C a `case` label must be a constant expression, and a switch has no guards, so no label can change state. In C++ a `case` label must be a constant expression, and a switch has no guards, so no label can change state. Swift has no `++` or `--`, and an assignment yields `()`, which cannot be an operand of `&&`, `||` or `?:` nor the Bool a `case … where` clause needs. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — 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
X23 Unguarded diagnostic materialisation — 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
X24 Document value interpolated into markup unescaped — 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
X25 Inert configuration knob — 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
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — 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
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — 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
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testSlicedResampleHandlesSliceLargerThanInput Tests/FluidAudioTests/Shared/AudioConverterTests.swift:374— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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:597— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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:713— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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:726— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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:842— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: TTS.run Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— MethodTooLong — run runs 396 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 296 over it, 3.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VBxClustering.runVBx Sources/FluidAudio/Diarizer/Offline/Clustering/VBxClustering.swift: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: 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:172— MethodTooLong — run runs 343 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 243 over it, 3.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: ASRBenchmark.runASRBenchmark Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649— MethodTooLong — runASRBenchmark runs 334 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 234 over it, 3.34× 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 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: OfflineEmbeddingExtractor.extractEmbeddings Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:416— 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 313 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 213 over it, 3.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: 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 283 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 183 over it, 2.83× 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: VocabularyRescorer.rescoreWithConstrainedCTCTermCentric Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:796— MethodTooLong — rescoreWithConstrainedCTCTermCentric runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CtcEarningsBenchmark.runCLI Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:62— MethodTooLong — runCLI runs 260 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 160 over it, 2.60× 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:432— 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: TtsBenchmarkCommand.run Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— MethodTooLong — run runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× 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: NemotronMultilingualFleursBenchmark.runCLI Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:573— MethodTooLong — runCLI runs 218 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 118 over it, 2.18× 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:254— MethodTooLong — parseArguments runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× 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: 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 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.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.
Hotspot: Sources/FluidAudioCLI/Commands/TTSCommand.swift Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— Sources/FluidAudioCLI/Commands/TTSCommand.swift changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 142 in TTS.run at line 58. 3 of those changes were fix/bug commits, and the other 16 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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:2057— Sources/FluidAudio/ModelNames.swift changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in ModelNames.getRequiredModelNames at line 2057. 9 of those changes were fix/bug commits, and the other 27 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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:254— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in TranscribeCommand.parseArguments at line 254. 6 of those changes were fix/bug commits, and the other 13 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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:494— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in AsrManager.reconcileFinalWindowSeam at line 494. 10 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/Commands/TtsBenchmarkCommand.swift Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in TtsBenchmarkCommand.run at line 93. 3 of those changes were fix/bug commits, and the other 6 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in ASRBenchmark.runASRBenchmark at line 649. 1 of those changes was a fix/bug commit, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:62— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in CtcEarningsBenchmark.runCLI at line 62. 1 of those changes was a fix/bug commit, and the other 6 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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:1802— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in ChunkProcessor.spliceCandidate at line 1802. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/SlidingWindow/SlidingWindowAsrManager.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:547— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in SlidingWindowAsrManager.processWindow at line 547. 9 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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+Pipeline.swift Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in StreamingNemotronMultilingualAsrManager.processChunk at line 58. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:796— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in VocabularyRescorer.rescoreWithConstrainedCTCTermCentric at line 796. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.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:363— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in StreamingNemotronMultilingualAsrManager.loadModels at line 363. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:99— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in MandarinG2P.phonemizeTracingPunctuation at line 99. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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.
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 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:33— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in VocabularyRescorer.evaluateCTCMatch at line 33. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.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/PocketTTS/Pipeline/PocketTtsSynthesizer.swift Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1237— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in PocketTtsSynthesizer.splitAtWordBoundaries at line 1237. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.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:834— 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 834. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:457— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in AsrModels.load 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:434— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in VocabularyRescorer.buildWordTimings at line 434. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:32— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift changed 3 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/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 45 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift:136— Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in KokoroAneV3Pipeline.run at line 136. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.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:360— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in StreamingUnifiedAsrManager.processWindow at line 360. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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/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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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.
FileTooLong: Commands/TTSCommand.swift Sources/FluidAudioCLI/Commands/TTSCommand.swift— FileTooLong — 1527 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: TTS (5-1879). The bar is 500 significant lines; this is 1027 over it, 3.05× 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 — 1387 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ChunkProcessor (3-2231). The bar is 500 significant lines; this is 887 over it, 2.77× 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 — 1273 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: ModelNames (559-2201). The bar is 500 significant lines; this is 773 over it, 2.55× 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 — 1238 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: TtsBenchmarkCommand (33-1645). The bar is 500 significant lines; this is 738 over it, 2.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: Commands/DiarizationBenchmark.swift Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift— FileTooLong — 1008 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: StreamDiarizationBenchmark (8-1424). The bar is 500 significant lines; this is 508 over it, 2.02× 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 — 969 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PocketTtsSynthesizer (15-1661). The bar is 500 significant lines; this is 469 over it, 1.94× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: SlidingWindow/TranscribeCommand.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift— FileTooLong — 935 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: TranscribeCommand (198-1310). The bar is 500 significant lines; this is 435 over it, 1.87× 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 — 919 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 419 over it, 1.84× 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: Rescorer/VocabularyRescorer+TokenRescoring.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift— FileTooLong — 890 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 390 over it, 1.78× 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 — 875 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 375 over it, 1.75× 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/CtcEarningsBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift— FileTooLong — 839 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CtcEarningsBenchmark (9-1253). The bar is 500 significant lines; this is 339 over it, 1.68× 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: Extraction/OfflineEmbeddingExtractor.swift Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift— FileTooLong — 828 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: OfflineEmbeddingExtractor (64-1202). The bar is 500 significant lines; this is 328 over it, 1.66× 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 — 803 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 303 over it, 1.61× 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: SlidingWindow/SlidingWindowAsrManager.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift— FileTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 214 over it, 1.43× 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: 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: TDT/AsrModels.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift— FileTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 122 over it, 1.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Streaming/NemotronMultilingualFleursBenchmark.swift Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift— FileTooLong — 621 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 121 over it, 1.24× 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 — 599 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 99 over it, 1.20× 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 — 596 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: CohereBenchmark (12-754). The bar is 500 significant lines; this is 96 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/AsrManager+Transcription.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift— FileTooLong — 570 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 70 over it, 1.14× 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.
ClassTooLong: TTS Sources/FluidAudioCLI/Commands/TTSCommand.swift:5— ClassTooLong — 1524 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 1124 over it, 3.81× 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 — 1386 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 400 significant lines; this is 986 over it, 3.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: TtsBenchmarkCommand Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:33— ClassTooLong — 1233 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 833 over it, 3.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: StreamDiarizationBenchmark Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:8— ClassTooLong — 1003 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 603 over it, 2.51× 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 — 965 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 565 over it, 2.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModelNames Sources/FluidAudio/ModelNames.swift:559— ClassTooLong — 893 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 493 over it, 2.23× 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 — 833 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 433 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 — 823 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 423 over it, 2.06× 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 — 778 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 378 over it, 1.95× 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 — 567 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 167 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 — 534 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 134 over it, 1.34× 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 — 503 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 103 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TdtDecoderV3 Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:33— ClassTooLong — 478 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 78 over it, 1.20× 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 — 442 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 42 over it, 1.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: 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: ProcessCommand Sources/FluidAudioCLI/Commands/ProcessCommand.swift:10— ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 18 over it, 1.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.
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:1076— Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:1076-1084 | 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:329-337 — 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/Shared/Download/ModelHub.swift:267— Sources/FluidAudio/Shared/Download/ModelHub.swift:267-275 | Sources/FluidAudio/Shared/Download/ModelHub.swift:364-372 — 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: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 (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 189 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:393— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:393-401 | 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:45-54 — 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:44` 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/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 7 separate duplicated blocks between them, totalling at least 103 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:1316-1324 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:152— Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:152-160 | Sources/FluidAudioCLI/Commands/ASR/CanaryTranscribeCommand.swift:283-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:152` it begins part-way through the construct above it, so those 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 (9 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:238— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:238-246 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:271-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 (9 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:85— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:85-93 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:79-87 — 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 48 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:89` calls `malformedAsset` and `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:94` 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/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:364— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:364-372 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:437-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 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 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 (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/StreamingNemotronMultilingualAsrManager+Decode.swift:358— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:358-362 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:473-479 — 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 189 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/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:500— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:500-506 | 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:500` it begins part-way through the construct above it, so those exact lines 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/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 70 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:60-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Sources/FluidAudio/Speaker/CampPlusModels.swift:23— Sources/FluidAudio/Speaker/CampPlusModels.swift:23-27 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:23-27 — before extracting anything, compare `Sources/FluidAudio/Speaker/CampPlusModels.swift` and `Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) Sources/FluidAudio/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:663— Sources/FluidAudio/Shared/AudioConverter.swift:663-667 | Sources/FluidAudio/Shared/AudioConverter.swift:671-675 — 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:109-113 — 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 (5 lines × 2) Sources/FluidAudio/TTS/Inflect/Pipeline/InflectSynthesizer.swift:142— Sources/FluidAudio/TTS/Inflect/Pipeline/InflectSynthesizer.swift:142-146 | Sources/FluidAudio/TTS/Paradee/Pipeline/ParadeeSynthesizer.swift:116-120 — 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 (5 lines × 2) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:130— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:130-134 | Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:37-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:130` 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/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:105— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:105-109 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:61-65 — 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 70 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: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 (5 lines × 2) Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:143— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:143-147 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:100-104 — 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 70 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:143` 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/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:181— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:181-185 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:138-142 — 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 70 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: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 (5 lines × 2) Examples/BarkDemo/Sources/BarkDemo/DemoModel.swift:154— Examples/BarkDemo/Sources/BarkDemo/DemoModel.swift:154-158 | Examples/Phonon2Demo/Sources/Phonon2Demo/DemoModel.swift:145-151 — 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:267— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:267-273 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:997-1003 — 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/LFM3Audio/LFM3AudioModels.swift:272— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioModels.swift:272-278 | Sources/FluidAudio/ASR/NemotronTranscribeLite/NemotronTranscribeLiteModels.swift:92-98 — 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/LFM3Audio/LFM3AudioModels.swift:272` 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/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:506-512 — 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/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:99— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:99-105 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:373-379 — 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 before the matched lines, `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:96` calls `defaultConfiguration` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:368` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:401— Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:401-407 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:422-428 — 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:401` it begins part-way through the construct above it, so those exact lines 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: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 189 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/PocketTTS/Pipeline/PocketTtsSession.swift:306— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:306-312 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:483-489 — 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:1607— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1607-1613 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1653-1659 — 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:1607` 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/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:578— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:578-584 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:668-674 — 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:578` 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/Nano/ChatterboxNanoSynthesizer.swift:409— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:409-415 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:482-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 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:409` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:62— Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:62-68 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:62-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.
Duplicated block (7 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:576— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:576-582 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:816-822 — 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/SlidingWindow/AsrBenchmark.swift:954— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:954-960 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1015-1021 — 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:954` 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 lines × 2) Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioDepthDecoder.swift:10— Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioDepthDecoder.swift:10-16 | Sources/FluidAudio/TTS/NeuTts/NeuTtsSynthesizer.swift:250-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.
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) 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:101— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:101-108 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.swift:193-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.
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 189 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/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/TTSCommand.swift:803— Sources/FluidAudioCLI/Commands/TTSCommand.swift:803-810 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1363-1370 — 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:803` 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:1371` calls `Double` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:811` 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:1579— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1579-1586 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1655-1662 — 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:1579` 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/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:205— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:205-212 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:163-170 — 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 70 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 (8 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:816— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:816-823 | 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 (10 lines × 2) Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:249— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:249-258 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:507-517 — 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:249` 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:121— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:121-130 | 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: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 (10 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:238— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:238-247 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:215-224 — 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:238` 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/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 189 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 70 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 70 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/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:207-216 — 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:218` 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: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:1171-1180 — 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/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:1088— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1088-1097 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1735-1744 — 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:1088` it begins part-way through the construct above it, so those exact lines 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/ASR/LFM3Audio/LFM3AudioEncoder.swift:176— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioEncoder.swift:176-185 | Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioCodec.swift:292-301 — 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) 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.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×13
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtModelInference.swift:269— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtModelInference.swift:269-277 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtModelInference.swift:280-288 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:27— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:27-35 | Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:38-49 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:102— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:102-112 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:226-234 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/Shared/Download/ModelCache.swift:171— Sources/FluidAudio/Shared/Download/ModelCache.swift:171-179 | Sources/FluidAudioCLI/Commands/EnhanceBenchmarkDataset.swift:96-106 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:238— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:238-246 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3Synthesizer.swift:281-289 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:402— Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:402-411 | Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:435-443 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/TTS/Inflect/Pipeline/InflectSynthesizer.swift:124— Sources/FluidAudio/TTS/Inflect/Pipeline/InflectSynthesizer.swift:124-132 | Sources/FluidAudio/TTS/Paradee/Pipeline/ParadeeSynthesizer.swift:98-106 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/ModelRegistry.swift:84— Sources/FluidAudio/ModelRegistry.swift:84-96 | Sources/FluidAudio/ModelRegistry.swift:99-107 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioManager.swift:267— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioManager.swift:267-275 | Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioManager.swift:278-288 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:372— Sources/FluidAudio/TTS/LuxTts/LuxTtsSynthesizer.swift:372-381 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:418-426 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:256— Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:256-267 | Sources/FluidAudio/TTS/Paradee/ParadeeManager.swift:170-178 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/ITN/TextNormalizer.swift:70— Sources/FluidAudio/ITN/TextNormalizer.swift:70-80 | Sources/FluidAudio/TTS/Shared/NemoTextNormalizer.swift:46-54 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:24— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:24-32 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:36-44 — These two members are one piece of code written twice and then edited apart: 9 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.
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:481— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:481-494 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:530-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:481` 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/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/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 48 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 7 separate duplicated blocks between them, totalling at least 103 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 15 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/LSEENDCommand.swift:220— Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:220-233 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:296-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:220` it begins part-way through the construct above it, so those exact lines 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:115-128 — 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:220— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:220-233 | 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.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×12
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:12— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:12-17 | Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:19-24 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1264— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1264-1272 | Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:348-353 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:296— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:296-301 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:551-556 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+SpanProtection.swift:129— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+SpanProtection.swift:129-134 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+SpanProtection.swift:139-145 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer.swift:246— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer.swift:246-251 | Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer.swift:255-260 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/TTS/LuxTts/LuxTtsContinuation.swift:254— Sources/FluidAudio/TTS/LuxTts/LuxTtsContinuation.swift:254-259 | Sources/FluidAudio/TTS/LuxTts/LuxTtsContinuation.swift:261-266 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:949— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:949-958 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:363-368 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/Speaker/CampPlusModels.swift:44— Sources/FluidAudio/Speaker/CampPlusModels.swift:44-49 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:44-49 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:1066— Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:1066-1071 | Sources/FluidAudio/Diarizer/Offline/Segmentation/OfflineSegmentationProcessor.swift:542-547 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:86— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:86-91 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:332-337 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Sources/FluidAudio/Shared/AssetDownloader.swift:52— Sources/FluidAudio/Shared/AssetDownloader.swift:52-57 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsMimiKeys.swift:27-34 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:54— Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:54-59 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/StreamPlayer.swift:27-33 — These two members are one piece of code written twice and then edited apart: 6 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· Edited copy of a member (4 corresponding lines) · ×12
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualTokenizer.swift:63— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualTokenizer.swift:63-68 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceTagScores.swift:83-86 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedConfig.swift:104— Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedConfig.swift:104-107 | Sources/FluidAudio/ModelNames.swift:1077-1082 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/Enhancement/LocalVQE/LocalVqeManager.swift:132— Sources/FluidAudio/Enhancement/LocalVQE/LocalVqeManager.swift:132-135 | Sources/FluidAudio/VAD/VadManager.swift:149-154 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:54— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:54-60 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:453-456 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/Diarizer/Core/DiarizerModels.swift:105— Sources/FluidAudio/Diarizer/Core/DiarizerModels.swift:105-108 | Sources/FluidAudio/Diarizer/Sortformer/SortformerModelInference.swift:95-98 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/TTS/G2P/G2PModel.swift:91— Sources/FluidAudio/TTS/G2P/G2PModel.swift:91-94 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:76-79 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:349— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:349-352 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:1158-1161 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:801— Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:801-804 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:355-358 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ModelStore.swift:240— Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ModelStore.swift:240-243 | Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ModelStore.swift:182-185 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:1003— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:1003-1006 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:478-481 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Examples/BarkDemo/Sources/BarkDemo/DemoModel.swift:344— Examples/BarkDemo/Sources/BarkDemo/DemoModel.swift:344-347 | Examples/Phonon2Demo/Sources/Phonon2Demo/DemoModel.swift:284-287 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Examples/BarkDemo/Sources/BarkDemo/DemoModel.swift:371— Examples/BarkDemo/Sources/BarkDemo/DemoModel.swift:371-374 | Examples/Phonon2Demo/Sources/Phonon2Demo/DemoModel.swift:304-307 — These two members are one piece of code written twice and then edited apart: 4 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.
Duplicated block (12 lines × 2) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioTokenizer.swift:163— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioTokenizer.swift:163-174 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/BpeTokenizer.swift:154-165 — 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/LFM3Audio/LFM3AudioTokenizer.swift:163` it begins part-way through the construct above it, so those exact lines 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:918— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:918-929 | 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:918` it begins part-way through the construct above it, so those exact lines 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/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:390— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:390-401 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:460-471 — 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:390` it begins part-way through the construct above it, so those exact lines 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/Diarizer/Sortformer/SortformerDiarizer.swift:537— Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:537-550 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:774-785 — 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/Sortformer/SortformerDiarizer.swift:537` it begins part-way through the construct above it, so those exact lines 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/Shared/TokenLanguageFilter.swift:117— Sources/FluidAudio/Shared/TokenLanguageFilter.swift:117-128 | Sources/FluidAudio/Shared/TokenLanguageFilter.swift:137-148 — 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/TokenLanguageFilter.swift:117` 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 (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:235-246 — 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:723— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:723-734 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:117-128 — 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 (12 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:763— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:763-774 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:887-898 — 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:763` it begins part-way through the construct above it, so those exact lines 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/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:151— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:151-156 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:168-173 — 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:151` it begins part-way through the construct above it, so those exact lines 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:375— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:375-380 | 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/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:579— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:579-584 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:757-762 — 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:579` 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 15 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/FluidAudioCLI/Commands/SortformerBenchmark.swift:333— Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:333-338 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:190-195 — 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/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/LFM3Audio/LFM3AudioEncoder.swift:151— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioEncoder.swift:151-156 | Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioCodec.swift:225-230 — 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:174— `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.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×10
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:72— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:72-96 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:99-112 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:770— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:770-787 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:234-247 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioManager.swift:172— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioManager.swift:172-185 | Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioManager.swift:188-201 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:245— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:245-258 | Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:308-326 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2P.swift:266— Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2P.swift:266-279 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextNormalizer.swift:350-365 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/Diarizer/Clustering/SpeakerManager.swift:354— Sources/FluidAudio/Diarizer/Clustering/SpeakerManager.swift:354-368 | Sources/FluidAudio/Diarizer/Clustering/SpeakerManager.swift:383-396 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:39— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:39-52 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:430-443 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/Shared/AudioStream.swift:163— Sources/FluidAudio/Shared/AudioStream.swift:163-176 | Sources/FluidAudio/Shared/AudioStream.swift:182-196 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:298— Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:298-314 | Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:326-339 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:310— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:310-323 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:325-338 — These two members are one piece of code written twice and then edited apart: 14 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.
Duplicated block (17 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:339— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:339-355 | 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 13 separate duplicated blocks between them, totalling at least 177 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:339` 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:219— Sources/FluidAudio/Shared/AudioConverter.swift:219-235 | Sources/FluidAudio/Shared/AudioConverter.swift:365-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/Shared/AudioConverter.swift:219` 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:764— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:764-780 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1037-1053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:764` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Sources/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/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) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:207— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:207-223 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:161-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.
Duplicated block (17 lines × 2) Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:152— Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:152-168 | Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:172-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) Sources/FluidAudio/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:572— Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:572-582 | Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:593-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:39— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:39-49 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:430-440 — 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 (11 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:468— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:468-478 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:484-494 — 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:1034— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1034-1044 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1178-1188 — 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:327— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:327-337 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:126-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:327` 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 (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 (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 189 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:280— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:280-285 | 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 13 separate duplicated blocks between them, totalling at least 177 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:280` 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:1176-1180 — 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/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:58— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:58-64 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualMultiStreamBench.swift:41-45 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:43-49 — 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 7 separate duplicated blocks between them, totalling at least 103 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.
TooManyMethods: StreamingNemotronMultilingualAsrManager Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:28— TooManyMethods — 80 methods, declared across 7 files: Nemotron/StreamingNemotronMultilingualAsrManager.swift (29), Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift (14), Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift (13), Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift (13), +3 more file(s). The bar is 30 methods; this is 50 over it, 2.67× 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 — 68 methods, declared across 2 files: TDT/ChunkProcessor.swift (65), TDT/DualDecodeArbitration.swift (3). The bar is 30 methods; this is 38 over it, 2.27× 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 — 63 methods, declared across 4 files: TDT/AsrManager+Transcription.swift (28), TDT/AsrManager.swift (21), TDT/AsrManager+Pipeline.swift (10), TDT/AsrManager+TokenProcessing.swift (4). The bar is 30 methods; this is 33 over it, 2.10× 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 — 62 methods, declared across 6 files: Rescorer/VocabularyRescorer+SpanProtection.swift (17), Rescorer/VocabularyRescorer+TokenRescoring.swift (15), Rescorer/VocabularyRescorer+Utilities.swift (15), Rescorer/VocabularyRescorer+TokenEvaluation.swift (11), +2 more file(s). The bar is 30 methods; this is 32 over it, 2.07× 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 — 57 methods, declared across 5 files: Pipeline/PocketTtsSynthesizer.swift (34), 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 27 over it, 1.90× 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: SlidingWindowAsrManager Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:10— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
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.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×8
Edited copy of a member (8 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseMecabDictionary.swift:202— Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseMecabDictionary.swift:202-209 | Sources/FluidAudio/TTS/KokoroAne/G2P/Japanese/JapaneseMecabDictionary.swift:211-219 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/FluidAudioCLI/Models/CLIModels.swift:93— Sources/FluidAudioCLI/Models/CLIModels.swift:93-101 | Sources/FluidAudioCLI/Models/CLIModels.swift:134-141 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:98— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:98-105 | Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioArrays.swift:107-114 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/FluidAudioCLI/Commands/TTSCommand.swift:29— Sources/FluidAudioCLI/Commands/TTSCommand.swift:29-36 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:49-56 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:90— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:90-97 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:217-224 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:37— Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:37-44 | Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:88-95 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+State.swift:25— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+State.swift:25-43 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallManager.swift:117-124 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:376— Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:376-383 | Sources/FluidAudio/Diarizer/LS-EEND/LSEENDPreprocessor.swift:225-234 — These two members are one piece of code written twice and then edited apart: 8 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· Edited copy of a member (16 corresponding lines) · ×7
Edited copy of a member (16 corresponding lines) Sources/FluidAudioCLI/Models/CLIModels.swift:103— Sources/FluidAudioCLI/Models/CLIModels.swift:103-121 | Sources/FluidAudioCLI/Models/CLIModels.swift:143-158 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Sources/FluidAudio/Diarizer/LS-EEND/LSEENDDiarizer.swift:59— Sources/FluidAudio/Diarizer/LS-EEND/LSEENDDiarizer.swift:59-75 | Sources/FluidAudio/Diarizer/LS-EEND/LSEENDDiarizer.swift:82-97 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1196— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1196-1217 | Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:51-66 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Manager.swift:275— Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Manager.swift:275-290 | Sources/FluidAudio/TTS/Supertonic3/Supertonic3Manager.swift:113-128 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:529— Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:529-544 | Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:546-561 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:230— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:230-245 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:932-947 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:126— Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:126-142 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/StreamPlayer.swift:111-126 — These two members are one piece of code written twice and then edited apart: 16 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.
Duplicated block (16 lines × 2) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioEncoder.swift:119— Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioEncoder.swift:119-134 | Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioCodec.swift:153-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
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:284— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:284-299 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:378-393 — 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:284` 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/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:557— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:557-572 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:635-650 — 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:557` 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:760— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:760-775 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:827-842 — 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:760` 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/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:90— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:90-102 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:106-118 — 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: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. 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:961— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:961-973 | 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:961` 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:481-493 — 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:911— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:911-923 | 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/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.
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.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×6
Edited copy of a member (17 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:408— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:408-430 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:458-474 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsResourceDownloader.swift:195— Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsResourceDownloader.swift:195-211 | Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsResourceDownloader.swift:258-280 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:629— Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerManager.swift:629-645 | Sources/FluidAudio/Diarizer/Offline/Extraction/PLDATransform.swift:181-198 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:450— Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:450-466 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:484-502 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:597— Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:597-613 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3UnicodeProcessor.swift:180-196 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Sources/FluidAudio/ASR/Parakeet/ParakeetLanguageModels.swift:49— Sources/FluidAudio/ASR/Parakeet/ParakeetLanguageModels.swift:49-65 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:117-137 — These two members are one piece of code written twice and then edited apart: 17 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· Edited copy of a member (13 corresponding lines) · ×6
Edited copy of a member (13 corresponding lines) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:362— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:362-374 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceManager.swift:97-111 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:107— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:107-119 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:119-131 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:389— Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:389-401 | Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:439-453 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1102— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1102-1114 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1117-1129 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Sources/FluidAudio/VAD/VadManager.swift:79— Sources/FluidAudio/VAD/VadManager.swift:79-92 | Sources/FluidAudio/VAD/VadManager.swift:110-122 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedMelExtractor.swift:26— Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedMelExtractor.swift:26-40 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMelExtractor.swift:25-37 — These two members are one piece of code written twice and then edited apart: 13 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· Edited copy of a member (10 corresponding lines) · ×6
Edited copy of a member (10 corresponding lines) Sources/FluidAudio/Speaker/CampPlusModels.swift:51— Sources/FluidAudio/Speaker/CampPlusModels.swift:51-64 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:51-60 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:85— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:85-94 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:79-91 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/FluidAudio/TTS/G2P/G2PModel.swift:49— Sources/FluidAudio/TTS/G2P/G2PModel.swift:49-58 | Sources/FluidAudio/TTS/G2P/MultilingualG2PModel.swift:33-42 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:1145— Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:1145-1154 | Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:1157-1166 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:97— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:97-106 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:80-89 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:334— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:334-343 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:531-540 — These two members are one piece of code written twice and then edited apart: 10 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· Edited copy of a member (7 corresponding lines) · ×6
Edited copy of a member (7 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:395— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:395-401 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:143-151 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:245— Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:245-251 | Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:261-267 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:374— Sources/FluidAudio/TTS/KokoroAne/G2P/English/KokoroAneEnglishPhonemizer.swift:374-380 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Tokenizer/StyleTTS2Phonemizer.swift:250-256 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:81— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:81-87 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:209-215 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:400— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:400-407 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:164-170 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:87— Examples/PhononDemo/Sources/PhononDemo/StreamPlayer.swift:87-93 | Examples/PocketTtsSmallDemo/Sources/PocketTtsSmallDemo/StreamPlayer.swift:70-76 — These two members are one piece of code written twice and then edited apart: 7 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.
Duplicated block (15 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:556— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:556-570 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:797-811 — 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:556` 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/ChunkProcessor.swift:1030— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1030-1044 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:388-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:1030` 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 (15 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:169— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:169-183 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:197-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/DualDecodeArbitration.swift:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:102— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:102-116 | Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:39-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/FluidAudioCLI/Commands/SortformerCommand.swift:83— Sources/FluidAudioCLI/Commands/SortformerCommand.swift:83-97 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:309-323 — 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/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:384— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:384-398 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:457-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 189 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.
Repeated repair: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/VocabularyBoostingSession.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/VocabularyBoostingSession.swift:184— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/VocabularyBoostingSession.swift changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is VocabularyBoostingSession.rescore at line 184), AT OR 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/vocab): rescue similarity floors on by default, score the original as spoken (#1151) (#1152)”; “fix(asr/vocab): read CTC tokenizer next to the loaded CtcModels (#1114) (#1126)”; “fix(asr/vocab): no context bias against a word TDT heard confidently (#1100)”; “fix(asr/vocab): bound the spotter-rescue nearest-word fallback; surface spotter detections; pass rescue flags to streaming (#899) (#900)”. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/VocabularyBoostingSession.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:287— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ASRError.errorDescription at line 287), AT OR 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(audio): give transcribe(url) and transcribe(samples) the same samples (#1134)”; “fix(asr/tdtJa): long-form Japanese defaults to no mel context and probes only long seam gaps (#1098)”; “fix(asr): seam-gap repair probes a short window around every inter-word gap (#1061)”; “fix(asr): take seam-token timing from the window that heard it mid-window (#975)”. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/FluidAudio/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), AT OR 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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), AT OR 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05: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.
Repeated repair: Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:84— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is CtcModels.loadDirect at line 84), AT OR 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(download): reject compiled bundles missing their program or weights (#1150)”; “fix(asr/vocab): read CTC tokenizer next to the loaded CtcModels (#1114) (#1126)”; “fix(ctc): run the CTC MelSpectrogram on the CPU (#1079)”. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 20:05:30 -05:00' --until='2026-11-13 20:05:30 -05:00' --full-history --no-merges -- Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.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· Edited copy of a member (15 corresponding lines) · ×5
Edited copy of a member (15 corresponding lines) Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:132— Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:132-146 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:155-170 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:13— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:13-27 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Synthesize/Supertonic3MultiArray.swift:29-43 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:569— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:569-583 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:335-353 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualStreamingConfig.swift:54— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronMultilingualStreamingConfig.swift:54-72 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronStreamingConfig.swift:37-51 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:664— Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:664-678 | Sources/FluidAudio/Diarizer/Sortformer/SortformerDiarizer.swift:689-704 — These two members are one piece of code written twice and then edited apart: 15 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· Edited copy of a member (11 corresponding lines) · ×5
Edited copy of a member (11 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:297— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:297-309 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:314-324 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinWordBoundaries.swift:108— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinWordBoundaries.swift:108-118 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinWordBoundaries.swift:140-150 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Sources/FluidAudioCLI/Utils/TextNormalizer.swift:369— Sources/FluidAudioCLI/Utils/TextNormalizer.swift:369-379 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:383-393 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Sources/FluidAudioCLI/Utils/TextNormalizer.swift:330— Sources/FluidAudioCLI/Utils/TextNormalizer.swift:330-347 | Sources/FluidAudioCLI/Utils/TextNormalizer.swift:355-365 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:631— Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:631-643 | Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:50-60 — These two members are one piece of code written twice and then edited apart: 11 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· Edited copy of a member (20 corresponding lines) · ×5
Edited copy of a member (20 corresponding lines) Sources/FluidAudio/TTS/LuxTts/LuxTtsManager.swift:98— Sources/FluidAudio/TTS/LuxTts/LuxTtsManager.swift:98-119 | Sources/FluidAudio/TTS/LuxTts/LuxTtsManager.swift:148-167 — These two members are one piece of code written twice and then edited apart: 20 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.
Edited copy of a member (20 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:52— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:52-73 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:189-208 — These two members are one piece of code written twice and then edited apart: 20 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.
Edited copy of a member (20 corresponding lines) Sources/FluidAudio/Diarizer/LS-EEND/LSEENDDiarizer.swift:162— Sources/FluidAudio/Diarizer/LS-EEND/LSEENDDiarizer.swift:162-182 | Sources/FluidAudio/Diarizer/LS-EEND/LSEENDDiarizer.swift:184-203 — These two members are one piece of code written twice and then edited apart: 20 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.
Edited copy of a member (20 corresponding lines) Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:172— Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:172-191 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:212-231 — These two members are one piece of code written twice and then edited apart: 20 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.
Edited copy of a member (20 corresponding lines) Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:282— Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:282-301 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:303-322 — These two members are one piece of code written twice and then edited apart: 20 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.
Duplicated block (7–8 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/EncoderFrameView.swift:21— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/EncoderFrameView.swift:21-27 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtModelInference.swift:193-200 — 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 (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/Commands/VadBenchmark.swift:131— Sources/FluidAudioCLI/Commands/VadBenchmark.swift:131-137 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:573-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:573` 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:1022— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:1022-1029 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:821-827 — 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/FleursBenchmark.swift:1022` 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 × 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 189 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 189 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/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 15 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:1461— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1461-1470 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1558-1564 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1633-1640 — 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:1461` it begins part-way through the construct above it, so those 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.
Change coupling: StreamingUnifiedAsrManager.swift ↔ UnifiedAsrManager.swift Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:1— `Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift` and `Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift` change together 80% of the time (8 of the 10 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 the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `02bcb9a4` fix(asr/vocab): read CTC tokenizer next to the loaded CtcModels (#111…; `2cbae2b5` feat(vocab): session thresholds and a detectedTerms floor (#967) (#1080); `55f65d9c` feat(asr/unified): Nemotron Unified ASR 0.6B (25 European languages) … — run `git show` on any of them.
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 60% of the time (12 of the 20 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 12 shared commits counted here, the most recent 3 are `e000dfde` fix(asr): flush pending tokens on an interior window that ends in a p…; `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`) — run `git show` on any of them.
Change coupling: SlidingWindowAsrManager.swift ↔ AsrManager+Transcription.swift Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:1— `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift` and `Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift` change together 57% of the time (8 of the 14 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 8 shared commits counted here, the most recent 3 are `70f44050` fix(asr/tdtJa): streaming seam re-decodes a time tail, not the whole …; `30379135` fix(asr/streaming): a re-spelled word at a window seam replaces the k…; `f59050ed` fix(asr/streaming): join a window that opens mid-word onto the previo… — run `git show` on any of them.
Change coupling: ModelNames.swift ↔ KokoroAneSynthesizer+Types.swift Sources/FluidAudio/ModelNames.swift:1— `Sources/FluidAudio/ModelNames.swift` and `Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Types.swift` change together 50% of the time (5 of the 10 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 5 shared commits counted here, the most recent 3 are `e63b5230` feat(tts/kokoro-ane): keep the fp16 vocoder as default; fp32 KokoroVo…; `810a0bd7` fix(tts/kokoro-ane): robotic onsets on SME chips — use fp32 KokoroVoc…; `8c1bd913` fix(tts/kokoro-ane): quiet onset on long utterances — use fp32 Kokoro… — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×4
Edited copy of a member (26 corresponding lines) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:1162— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:1162-1193 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:1195-1220 — These two members are one piece of code written twice and then edited apart: 26 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.
Edited copy of a member (26 corresponding lines) Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ModelStore.swift:143— Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ModelStore.swift:143-168 | Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ModelStore.swift:171-196 — These two members are one piece of code written twice and then edited apart: 26 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.
Edited copy of a member (26 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:421— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:421-451 | Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ResourceDownloader.swift:59-84 — These two members are one piece of code written twice and then edited apart: 26 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.
Edited copy of a member (26 corresponding lines) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:949— Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:949-974 | Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:986-1012 — These two members are one piece of code written twice and then edited apart: 26 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· Edited copy of a member (25 corresponding lines) · ×4
Edited copy of a member (25 corresponding lines) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:51— Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:51-75 | Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:88-115 — These two members are one piece of code written twice and then edited apart: 25 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.
Edited copy of a member (25 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:138— Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:138-174 | Sources/FluidAudio/ASR/Parakeet/Streaming/RnntDecoder.swift:179-203 — These two members are one piece of code written twice and then edited apart: 25 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.
Edited copy of a member (25 corresponding lines) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:152— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:152-176 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:150-176 — These two members are one piece of code written twice and then edited apart: 25 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.
Edited copy of a member (25 corresponding lines) Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:103— Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:103-127 | Sources/FluidAudio/Diarizer/DiarizerTimeline.swift:140-164 — These two members are one piece of code written twice and then edited apart: 25 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· Edited copy of a member (3 corresponding lines) · ×4
Edited copy of a member (3 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:195— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:195-197 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:153-155 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:85— Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:85-87 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:101-105 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2P.swift:414— Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2P.swift:414-416 | Sources/FluidAudioCLI/Commands/MinimaxCorpusCommand.swift:130-132 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:836— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:836-839 | Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:299-301 — These two members are one piece of code written twice and then edited apart: 3 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.
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 7 separate duplicated blocks between them, totalling at least 103 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/LSEENDCommand.swift:239— Sources/FluidAudioCLI/Commands/LSEENDCommand.swift:239-263 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:314-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:239` it begins part-way through the construct above it, so those exact lines 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:588— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:588-612 | 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:588` 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 (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:645— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:645-666 | Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:850-871 — 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:645` 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 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 189 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/Commands/DiarizationBenchmark.swift:318— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:318-335 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:397-414 — 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: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 (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 (16–17 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:265— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:265-281 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:355-370 — 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:286— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:286-301 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:373-389 — 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 (15–16 lines × 2) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:190— Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:190-204 | Sources/FluidAudio/Diarizer/Sortformer/SortformerModelInference.swift:169-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.
Duplicated block (15–16 lines × 2) Sources/FluidAudio/Shared/AudioConverter.swift:202— Sources/FluidAudio/Shared/AudioConverter.swift:202-217 | Sources/FluidAudio/Shared/AudioConverter.swift:341-355 — 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/AudioConverter.swift:202` it begins part-way through the construct above it, so those exact lines 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–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–16 lines × 2) Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:68— Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:68-82 | Sources/FluidAudioCLI/Utils/ResultsFormatter.swift:273-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.
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 70 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 70 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/AsrBenchmark.swift:796— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:796-806 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:766-776 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1039-1049 — 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:796` it begins part-way through the construct above it, so those exact lines 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/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:90— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:90-100 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:73-83 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:134-144 — 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:90` 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:195-205 — 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:1263-1273 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:248— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:248-257 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:139-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 75 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:248` 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 × 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/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.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×3
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.
Edited copy of a member (19 corresponding lines) Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:220— Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:220-238 | Sources/FluidAudio/TTS/Shared/EnglishTextNormalizer.swift:330-352 — 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.
Edited copy of a member (19 corresponding lines) Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:70— Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:70-88 | Sources/FluidAudio/TTS/Shared/AudioPostProcessor.swift:96-118 — 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 (6 members, 50+ identical tokens) · ×3
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:82-93 | 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:795-800 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:815-830 | 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.
Members sharing a duplicated core (6 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+KVCache.swift:551-562 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+Mimi.swift:89-136 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1604-1613 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1649-1659 — 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:324— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:324-355 | 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/ASR/Parakeet/Streaming/NemotronBenchmark.swift:37— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:37-86 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualMultiStreamBench.swift:36-228 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:42-131 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:25-77 — 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:553— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:553-624 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:628-722 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:726-795 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:799-861 — 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.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×3
Edited copy of a member (32 corresponding lines) Sources/FluidAudioCLI/Utils/WERCalculator.swift:33— Sources/FluidAudioCLI/Utils/WERCalculator.swift:33-64 | Sources/FluidAudioCLI/Utils/WERCalculator.swift:75-107 — These two members are one piece of code written twice and then edited apart: 32 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.
Edited copy of a member (32 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:237— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:237-275 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallSession.swift:90-121 — These two members are one piece of code written twice and then edited apart: 32 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.
Edited copy of a member (32 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:247— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:247-278 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:949-994 — These two members are one piece of code written twice and then edited apart: 32 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· Edited copy of a member (23 corresponding lines) · ×3
Edited copy of a member (23 corresponding lines) Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Manager.swift:188— Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Manager.swift:188-215 | Sources/FluidAudio/TTS/StyleTTS2/StyleTTS2Manager.swift:244-266 — These two members are one piece of code written twice and then edited apart: 23 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.
Edited copy of a member (23 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:379— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:379-401 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:420-447 — These two members are one piece of code written twice and then edited apart: 23 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.
Edited copy of a member (23 corresponding lines) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:55— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:55-77 | Sources/FluidAudio/Diarizer/Core/DiarizerTypes.swift:44-66 — These two members are one piece of code written twice and then edited apart: 23 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· Edited copies of one member (3 members, 12+ corresponding lines) · ×3
Edited copies of one member (3 members, 12+ corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:305— Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:305-323 | Sources/FluidAudio/TTS/PocketTTS/Assets/PocketTtsConstantsLoader.swift:444-462 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallModel.swift:445-456 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:178— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:178-193 | Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:238-256 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:215-226 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) Sources/FluidAudio/ITN/TextNormalizer.swift:120— Sources/FluidAudio/ITN/TextNormalizer.swift:120-131 | Sources/FluidAudio/ITN/TextNormalizer.swift:139-150 | Sources/FluidAudio/ITN/TextNormalizer.swift:166-182 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (23–24 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:111— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:111-134 | 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:111` 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:984-1006 — 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:1008` 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:43— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:43-65 | 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 75 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:43` 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–19 lines × 2) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:1176— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:1176-1193 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:1202-1220 — 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:1176` 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:260— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:260-278 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:521-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:301— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:301-318 | 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 75 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:301` 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:300` 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:173— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:173-191 | 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:173` 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:195` 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:366— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:366-384 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:538-556 — 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:86— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:86-104 | 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:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:91— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:91-105 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:108-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.
Duplicated block (14–15 lines × 2) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:376— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:376-390 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:496-509 — 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:376` 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:1097— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1097-1110 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1273-1287 — 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:1097` it begins part-way through the construct above it, so those exact lines 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/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:62— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:62-73 | 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:62` 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:408— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:408-419 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:458-467 — 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:408` 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:289— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:289-299 | 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 13 separate duplicated blocks between them, totalling at least 177 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:289` 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:314-324 — 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 15 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 (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:129-138 — 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:149-157 — 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 (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:1264-1272 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:443-451 — 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:1088— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1088-1096 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1252-1260 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1735-1743 — 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:1088` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:167— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:167-172 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:651-656 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:678-683 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:687-692 — 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:167` it begins part-way through the construct above it, so those exact lines 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:578— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:578-585 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:668-675 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:752-758 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:820-825 — 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:578` 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.
Low cohesion: TextNormalizer (LCOM4 7) Sources/FluidAudio/ITN/TextNormalizer.swift:29— 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.
Low cohesion: ParadeeModelStore (LCOM4 4) Sources/FluidAudio/TTS/Paradee/Assets/ParadeeModelStore.swift:11— ParadeeModelStore's methods fall into 4 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 4 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.
Near-duplicate member pair (70 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: 70 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 (70 shared lines) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:12— Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:12-131 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:145-273 — These two members are variants of one another: 70 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· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:100-114 | Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioModels.swift:268-285 | 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:66-80 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:62-76 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:357— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:357-375 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:377-399 | 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.
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/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:13— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:13-204 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:65-138 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:45-454 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58-577 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedRnntDecoder.swift:112-135 — 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/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:216-237 — 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.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×2
Edited copy of a member (40 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:775— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:775-816 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:529-568 — These two members are one piece of code written twice and then edited apart: 40 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.
Edited copy of a member (40 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:455— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:455-494 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:497-544 — These two members are one piece of code written twice and then edited apart: 40 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· Edited copy of a member (64 corresponding lines) · ×2
Edited copy of a member (64 corresponding lines) Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:214— Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:214-278 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:397-460 — These two members are one piece of code written twice and then edited apart: 64 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.
Edited copy of a member (64 corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:110— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:110-179 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter.swift:191-254 — These two members are one piece of code written twice and then edited apart: 64 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· Edited copy of a member (43 corresponding lines) · ×2
Edited copy of a member (43 corresponding lines) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:247— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:247-289 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:394-458 — These two members are one piece of code written twice and then edited apart: 43 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.
Edited copy of a member (43 corresponding lines) Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:331— Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:331-373 | Sources/FluidAudioCLI/DatasetParsers/JapaneseDatasetDownloader.swift:376-424 — These two members are one piece of code written twice and then edited apart: 43 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· Edited copy of a member (36 corresponding lines) · ×2
Edited copy of a member (36 corresponding lines) Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:171— Sources/FluidAudio/Diarizer/Sortformer/Offline/OfflineSortformerDiarizer.swift:171-206 | Sources/FluidAudio/Diarizer/Sortformer/SortformerModelInference.swift:139-191 — These two members are one piece of code written twice and then edited apart: 36 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.
Edited copy of a member (36 corresponding lines) Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:237— Sources/FluidAudio/ASR/Parakeet/AsrTypes.swift:237-272 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:487-535 — These two members are one piece of code written twice and then edited apart: 36 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· Edited copy of a member (22 corresponding lines) · ×2
Edited copy of a member (22 corresponding lines) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:223— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:223-244 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:352-391 — These two members are one piece of code written twice and then edited apart: 22 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.
Edited copy of a member (22 corresponding lines) Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:70— Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:70-93 | Sources/FluidAudio/TTS/Supertonic3/Pipeline/Preprocess/Supertonic3TextChunker.swift:95-116 — These two members are one piece of code written twice and then edited apart: 22 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· Edited copy of a member (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:202— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:202-219 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:160-178 — These two members are one piece of code written twice and then edited apart: 18 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.
Edited copy of a member (18 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:425— Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:425-443 | Sources/FluidAudio/TTS/PocketTTS/Small/PocketTtsSmallEngine.swift:445-462 — These two members are one piece of code written twice and then edited apart: 18 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· Edited copy of a member (30 corresponding lines) · ×2
Edited copy of a member (30 corresponding lines) Sources/FluidAudio/Shared/ANEMemoryOptimizer.swift:86— Sources/FluidAudio/Shared/ANEMemoryOptimizer.swift:86-116 | Sources/FluidAudio/Shared/ANEMemoryUtils.swift:130-159 — These two members are one piece of code written twice and then edited apart: 30 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.
Edited copy of a member (30 corresponding lines) Sources/FluidAudio/Shared/AudioStream.swift:376— Sources/FluidAudio/Shared/AudioStream.swift:376-407 | Sources/FluidAudio/Shared/AudioStream.swift:413-442 — These two members are one piece of code written twice and then edited apart: 30 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· Edited copies of one member (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:500— Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:500-524 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:527-551 | Sources/FluidAudioCLI/DatasetParsers/AMIParser.swift:564-586 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:10— Sources/FluidAudioCLI/Commands/Nemotron3DiarizeCommand.swift:10-43 | Sources/FluidAudioCLI/Commands/VadAnalyzeCommand.swift:429-457 | Sources/FluidAudioCLI/Commands/VadBenchmark.swift:161-183 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×2
Edited copy of a member (5 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:190— Sources/FluidAudioCLI/Commands/ASR/CanaryEarningsBenchmark.swift:190-194 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronVocabBenchmark.swift:194-200 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:444— Sources/FluidAudioCLI/Commands/EnhanceBenchmarkCommand.swift:444-448 | Sources/FluidAudioCLI/Commands/EnhanceCommand.swift:184-188 — These two members are one piece of code written twice and then edited apart: 5 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.
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 7 separate duplicated blocks between them, totalling at least 103 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:352— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:352-378 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:431-457 — 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:352` it begins part-way through the construct above it, so those exact lines 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:933-958 — 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 (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 15 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 (21 lines × 2) Sources/FluidAudioCLI/Utils/WERCalculator.swift:44— Sources/FluidAudioCLI/Utils/WERCalculator.swift:44-64 | Sources/FluidAudioCLI/Utils/WERCalculator.swift:87-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:44` 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–20 lines × 2) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1057— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1057-1076 | Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1104-1121 — 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:1057` 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:526-543 — 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:408-421 — 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:211— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:211-224 | 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: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.
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:196-210 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 15 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 15 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 (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:1558— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1558-1571 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1634-1647 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1710-1723 — 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 (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:118-130 | 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:156-168 — 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 (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:919-930 — 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:42-53 | 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 7 separate duplicated blocks between them, totalling at least 103 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:178— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:178-189 | 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:178` 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:187— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:187-194 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:427-437 — 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 (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:119-128 | 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/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:189— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:189-198 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:195-204 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:121-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 48 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:189` 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 (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:1461— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1461-1470 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1557-1564 — 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:1461` it begins part-way through the construct above it, so those 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:270-277 — 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 (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/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 (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:409-415 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:436-442 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:459-465 — 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:802— Sources/FluidAudioCLI/Commands/TTSCommand.swift:802-808 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1362-1368 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1486-1492 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1578-1584 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1654-1660 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1730-1736 — 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:802` 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:1371` calls `Double` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:811` 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:780— Sources/FluidAudioCLI/Commands/TTSCommand.swift:780-786 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1184-1190 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1566-1572 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1642-1648 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1718-1724 — 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:787` calls `reduce`, `Double`, `squareRoot` and `Sources/FluidAudioCLI/Commands/TTSCommand.swift:1192` 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 189 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:665— Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:665-670 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:117-122 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:167-172 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:651-656 | 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:665` it begins part-way through the construct above it, so those 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:106— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:106-112 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:126-132 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:250-256 | 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:910-916 — 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 13 separate duplicated blocks between them, totalling at least 177 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: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. ★ 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:116` 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.
TTS.run (cyclomatic 142) Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— TTS.run has cyclomatic complexity 142 (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 106) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:172— StreamDiarizationBenchmark.run has cyclomatic complexity 106 (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.
TranscribeCommand.parseArguments (cyclomatic 86) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:254— TranscribeCommand.parseArguments has cyclomatic complexity 86 (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 85) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649— ASRBenchmark.runASRBenchmark has cyclomatic complexity 85 (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 82) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58— StreamingNemotronMultilingualAsrManager.processChunk has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LSEENDBenchmark.run (cyclomatic 81) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:57— LSEENDBenchmark.run has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SortformerBenchmark.run (cyclomatic 78) Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:66— SortformerBenchmark.run has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProcessCommand.parseArguments (cyclomatic 72) Sources/FluidAudioCLI/Commands/ProcessCommand.swift:288— ProcessCommand.parseArguments has cyclomatic complexity 72 (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.
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.
VocabularyRescorer.rescoreWithConstrainedCTCTermCentric (cyclomatic 69) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:796— VocabularyRescorer.rescoreWithConstrainedCTCTermCentric 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.
TtsBenchmarkCommand.run (cyclomatic 64) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— TtsBenchmarkCommand.run has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AsrManager.reconcileFinalWindowSeam (cyclomatic 63) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:494— AsrManager.reconcileFinalWindowSeam has cyclomatic complexity 63 (threshold 15). Of this number, 62 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.
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.
CtcEarningsBenchmark.runCLI (cyclomatic 62) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:62— CtcEarningsBenchmark.runCLI has cyclomatic complexity 62 (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 61) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/EmissionDelayBenchmark.swift:47— EmissionDelayBenchmark.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.
NemotronMultilingualFleursBenchmark.runCLI (cyclomatic 60) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:573— NemotronMultilingualFleursBenchmark.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.
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.
ModelNames.getRequiredModelNames (cyclomatic 53) Sources/FluidAudio/ModelNames.swift:2057— ModelNames.getRequiredModelNames has cyclomatic complexity 53 (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 61) 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:958— 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:432— 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 45) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:103— TdtDecoderV3.decodeWithTimings has cyclomatic complexity 45 (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 40) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:822— FLEURSBenchmark.runCLI 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.
TokenLanguageFilter.matches (cyclomatic 39) Sources/FluidAudio/Shared/TokenLanguageFilter.swift:95— TokenLanguageFilter.matches has cyclomatic complexity 39 (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.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.
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.
TranscribeCommand.runStreaming (cyclomatic 35) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:883— TranscribeCommand.runStreaming has cyclomatic complexity 35 (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 34) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:363— StreamingNemotronMultilingualAsrManager.loadModels has cyclomatic complexity 34 (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.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.
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.
SlidingWindowAsrManager.processWindow (cyclomatic 32) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:547— SlidingWindowAsrManager.processWindow 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.
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.
AsrManager.transcribeChunk (cyclomatic 32) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:745— AsrManager.transcribeChunk 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.
ChunkProcessor.spliceCandidate (cyclomatic 32) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1802— ChunkProcessor.spliceCandidate has cyclomatic complexity 32 (threshold 15). Of this number, 18 points are the body's own statements and 14 belong to 5 function items inside it that branch. 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.
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.
TranscribeCommand.runBatch (cyclomatic 32) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:644— TranscribeCommand.runBatch 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.
StreamingNemotronAsrManager.processChunk (cyclomatic 31) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:13— StreamingNemotronAsrManager.processChunk 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.
TTSAsrVerifyCommand.run (cyclomatic 31) Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift:22— TTSAsrVerifyCommand.run has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VadAnalyzeCommand.run (cyclomatic 31) Sources/FluidAudioCLI/Commands/VadAnalyzeCommand.swift:29— VadAnalyzeCommand.run has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VadManager.detectSpeechSampleRanges (cyclomatic 30) Sources/FluidAudio/VAD/VadManager+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.
MandarinG2P.phonemizeTracingPunctuation (cyclomatic 30) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:99— MandarinG2P.phonemizeTracingPunctuation has cyclomatic complexity 30 (threshold 15). Of this number, 23 points are the body's own statements and 7 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.
VocabularyRescorer.rescoreWithConstrainedCTCWordCentric (cyclomatic 30) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:555— VocabularyRescorer.rescoreWithConstrainedCTCWordCentric has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TtsBenchmarkCommand.inferCohereLanguage (cyclomatic 30) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:1418— 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.
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:938— 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.
ParadeeG2P.prepare (cyclomatic 28) Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2P.swift:219— ParadeeG2P.prepare has cyclomatic complexity 28 (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.
ChunkProcessor.process (cyclomatic 28) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:786— ChunkProcessor.process has cyclomatic complexity 28 (threshold 15). Of this number, 26 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.
StreamingNemotronMultilingualAsrManager.warmupModels (cyclomatic 28) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:624— 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.
VocabularyRescorer.evaluateCTCMatch (cyclomatic 28) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:33— VocabularyRescorer.evaluateCTCMatch 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:834— 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.
KokoroAneV3Pipeline.run (cyclomatic 27) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift:136— KokoroAneV3Pipeline.run has cyclomatic complexity 27 (threshold 15). Of this number, 21 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.
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.
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:870— 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.
AudioConverter.convertFile (cyclomatic 25) Sources/FluidAudio/Shared/AudioConverter.swift:139— AudioConverter.convertFile 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.
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.
ChunkProcessor.mergeUsingMatches (cyclomatic 25) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1443— 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.
ChunkProcessor.repairSeamGaps (cyclomatic 25) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1996— ChunkProcessor.repairSeamGaps 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.
MandarinG2P.segment (cyclomatic 25) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:324— MandarinG2P.segment has cyclomatic complexity 25 (threshold 15). Of this number, 15 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.
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:541— 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.
PocketTtsSynthesizer.splitAtWordBoundaries (cyclomatic 24) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1237— PocketTtsSynthesizer.splitAtWordBoundaries 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.
SlidingWindowTokenCursor.next (cyclomatic 23) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowTokenUpdate.swift:76— SlidingWindowTokenCursor.next has cyclomatic complexity 23 (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.
OfflineDiarizerConfig.validate (cyclomatic 23) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:377— 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.
PocketTtsSynthesizer.clauseParts (cyclomatic 23) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1138— PocketTtsSynthesizer.clauseParts has cyclomatic complexity 23 (threshold 15). Of this number, 20 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.
VocabularyRescorer.collectSpotterAnchoredCandidates (cyclomatic 23) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1243— VocabularyRescorer.collectSpotterAnchoredCandidates 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.
NemotronMultilingualTranscribe.run (cyclomatic 23) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:42— NemotronMultilingualTranscribe.run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ParakeetEouCommand.runBenchmark (cyclomatic 23) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:244— ParakeetEouCommand.runBenchmark has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CohereMelSpectrogram.compute (cyclomatic 22) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:127— CohereMelSpectrogram.compute has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ParaformerManager.decodeWithTimestamps (cyclomatic 22) Sources/FluidAudio/ASR/Paraformer/ParaformerManager.swift:134— ParaformerManager.decodeWithTimestamps has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamingUnifiedAsrManager.processWindow (cyclomatic 22) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:360— StreamingUnifiedAsrManager.processWindow 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:1184— 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:630— 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.
MandarinBopomofoMap.encode (cyclomatic 22) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinBopomofoMap.swift:122— MandarinBopomofoMap.encode has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DownloadCommand.run (cyclomatic 22) Sources/FluidAudioCLI/Commands/DownloadCommand.swift:8— DownloadCommand.run has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DiarizerTimeline.updateSegments (cyclomatic 21) Sources/FluidAudio/Diarizer/DiarizerTimeline.swift: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.
LFM3AudioTokenizer.init (cyclomatic 21) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioTokenizer.swift:20— LFM3AudioTokenizer.init 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.
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.
AsrManager.unspacedKeptCopyCount (cyclomatic 21) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:202— AsrManager.unspacedKeptCopyCount has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 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.
VocabularyRescorer.arbitratePendingReplacements (cyclomatic 21) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:276— VocabularyRescorer.arbitratePendingReplacements 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatasetDownloader.downloadCommonVoiceJapanese (cyclomatic 21) Sources/FluidAudioCLI/DatasetParsers/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.
AudioConverter.streamResample (cyclomatic 20) Sources/FluidAudio/Shared/AudioConverter.swift:298— AudioConverter.streamResample 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.
OfflineEmbeddingExtractor.extractEmbeddings (cyclomatic 20) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:416— 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.
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.
LFM3AudioManager.synthesize (cyclomatic 19) Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioManager+Speech.swift:79— LFM3AudioManager.synthesize 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.
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.
KokoroAneV3Assets.baseIndex (cyclomatic 19) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Assets.swift:252— 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:457— 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.
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.
LFM3AudioCommand.parse (cyclomatic 19) Sources/FluidAudioCLI/Commands/ASR/LFM3AudioCommand.swift:259— LFM3AudioCommand.parse has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
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.
SenseVoiceTranscribeCommand.run (cyclomatic 19) Sources/FluidAudioCLI/Commands/ASR/SenseVoiceTranscribeCommand.swift:10— SenseVoiceTranscribeCommand.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:185— 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.
ChunkProcessor.mergeChunks (cyclomatic 18) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1281— ChunkProcessor.mergeChunks 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.
StreamingNemotronMultilingualAsrManager.preloadShared (cyclomatic 18) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:84— 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.
MisakiBritishFallback.fromAmerican (cyclomatic 18) Sources/FluidAudio/TTS/KokoroAne/G2P/English/MisakiBritishFallback.swift:24— MisakiBritishFallback.fromAmerican 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.
MandarinBopomofoMap.decode (cyclomatic 18) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinBopomofoMap.swift:224— 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.
MandarinG2pwModel.disambiguate (cyclomatic 18) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2pwModel.swift:132— MandarinG2pwModel.disambiguate 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.
CtcKeywordSpotter.makeLogProbs (cyclomatic 18) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter+Inference.swift:372— CtcKeywordSpotter.makeLogProbs has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 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.
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:542— 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.
LFM3AudioDepthDecoder.sample (cyclomatic 17) Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioDepthDecoder.swift:225— LFM3AudioDepthDecoder.sample 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.
PhonemeChunker.chunkRanges (cyclomatic 17) Sources/FluidAudio/TTS/Shared/PhonemeChunker.swift:58— PhonemeChunker.chunkRanges has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
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:27— 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.
PocketTtsSynthesizer.splitSentences (cyclomatic 17) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1392— PocketTtsSynthesizer.splitSentences 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.
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.buildWordTimings (cyclomatic 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:434— VocabularyRescorer.buildWordTimings 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.protectedSearchWindow (cyclomatic 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+SpanProtection.swift:255— VocabularyRescorer.protectedSearchWindow 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.
LFM3AudioManager.transcribeLiveChunk (cyclomatic 16) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioManager.swift:211— LFM3AudioManager.transcribeLiveChunk 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.
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:277— 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:132— 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.
VocabularyRescorer.rescoreWithConstrainedCTCTermCentric (cognitive 226) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:796— VocabularyRescorer.rescoreWithConstrainedCTCTermCentric has cognitive complexity 226 (threshold 15). Drivers by points: if/else 38 (158 pts), loops 8 (32 pts), ternaries 5 (19 pts), boolean chains 17 (nesting depth added 158). 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.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.
TTS.run (cognitive 179) Sources/FluidAudioCLI/Commands/TTSCommand.swift:58— TTS.run has cognitive complexity 179 (threshold 15). Drivers by points: if/else 53 (141 pts), boolean chains 16, match/switch 5 (15 pts), ternaries 2 (6 pts), loops 1 (nesting depth added 102). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingNemotronMultilingualAsrManager.processChunk (cognitive 167) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:58— StreamingNemotronMultilingualAsrManager.processChunk has cognitive complexity 167 (threshold 15). Drivers by points: if/else 64 (129 pts), boolean chains 35, 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:172— 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.
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.
TranscribeCommand.parseArguments (cognitive 111) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:254— TranscribeCommand.parseArguments has cognitive complexity 111 (threshold 15). Drivers by points: if/else 33 (96 pts), match/switch 3 (10 pts), boolean chains 4, loops 1 (nesting depth added 70). To reduce it, split the body into named stages: move each independent 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.
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:62— 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.
TtsBenchmarkCommand.run (cognitive 90) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:93— TtsBenchmarkCommand.run has cognitive complexity 90 (threshold 15). Drivers by points: if/else 28 (72 pts), ternaries 2 (6 pts), match/switch 2 (4 pts), error handling 3, loops 2 (3 pts), boolean chains 2 (nesting depth added 51). To reduce it, split the body into named stages: move each independent 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:958— 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.
NemotronMultilingualFleursBenchmark.runCLI (cognitive 86) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:573— NemotronMultilingualFleursBenchmark.runCLI has cognitive complexity 86 (threshold 15). Drivers by points: if/else 27 (64 pts), match/switch 3 (9 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (3 pts), loops 2 (3 pts) (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.
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.
TdtDecoderV3.decodeWithTimings (cognitive 79) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:103— TdtDecoderV3.decodeWithTimings has cognitive complexity 79 (threshold 15). Drivers by points: if/else 28 (55 pts), boolean chains 19, loops 3 (5 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsrManager.reconcileFinalWindowSeam (cognitive 77) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:494— AsrManager.reconcileFinalWindowSeam has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 38, if/else 20 (31 pts), loops 4 (5 pts), ternaries 2 (3 pts) (nesting depth added 13). Of this number, 76 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.
TranscribeCommand.runStreaming (cognitive 76) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:883— 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.
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.
SlidingWindowAsrManager.processWindow (cognitive 72) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:547— SlidingWindowAsrManager.processWindow has cognitive complexity 72 (threshold 15). Drivers by points: if/else 17 (43 pts), ternaries 5 (16 pts), boolean chains 8, loops 1 (4 pts), error handling 1 (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.
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:432— 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.
VocabularyRescorer.rescoreWithConstrainedCTCWordCentric (cognitive 69) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:555— VocabularyRescorer.rescoreWithConstrainedCTCWordCentric has cognitive complexity 69 (threshold 15). Drivers by points: if/else 19 (49 pts), ternaries 4 (10 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent 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.
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:870— 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.
ChunkProcessor.repairSeamGaps (cognitive 57) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1996— ChunkProcessor.repairSeamGaps has cognitive complexity 57 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 6 (12 pts), ternaries 4 (10 pts), boolean chains 3 (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.
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:644— 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:1443— 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.
StreamingNemotronAsrManager.processChunk (cognitive 49) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:13— StreamingNemotronAsrManager.processChunk has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 14, loops 3 (5 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.
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:938— 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.
TokenLanguageFilter.matches (cognitive 48) Sources/FluidAudio/Shared/TokenLanguageFilter.swift:95— TokenLanguageFilter.matches has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 24, if/else 11 (23 pts), match/switch 1 (nesting depth added 12). 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.
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.
OfflineEmbeddingExtractor.extractEmbeddings::processChunk (cognitive 45) Sources/FluidAudio/Diarizer/Offline/Extraction/OfflineEmbeddingExtractor.swift:541— 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.
MandarinG2P.phonemizeTracingPunctuation (cognitive 45) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:99— MandarinG2P.phonemizeTracingPunctuation has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 9, loops 3 (5 pts), error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 19). Of this number, 34 points are the body's own statements and 11 belong to 2 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.
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.
AsrManager.transcribeChunk (cognitive 44) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:745— AsrManager.transcribeChunk has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 14, ternaries 5 (10 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.
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.
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.
LFM3AudioManager.synthesize (cognitive 42) Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioManager+Speech.swift:79— LFM3AudioManager.synthesize has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent 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.
KokoroAneV3Pipeline.run (cognitive 41) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift:136— KokoroAneV3Pipeline.run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 4 (10 pts), boolean chains 6, loops 1 (nesting depth added 11). Of this number, 33 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.
StreamingNemotronMultilingualAsrManager.warmupModels (cognitive 41) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:624— 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.
VocabularyRescorer.collectSpotterAnchoredCandidates (cognitive 41) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1243— VocabularyRescorer.collectSpotterAnchoredCandidates has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
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.
PocketTtsSynthesizer.clauseParts (cognitive 39) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1138— PocketTtsSynthesizer.clauseParts has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 9, loops 1 (nesting depth added 15). Of this number, 35 points are the body's own statements and 4 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.
StreamingNemotronMultilingualAsrManager.loadModels (cognitive 39) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:363— StreamingNemotronMultilingualAsrManager.loadModels has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26 (29 pts), boolean chains 10 (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.
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.
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.
ChunkProcessor.process (cognitive 38) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:786— ChunkProcessor.process has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 5 (9 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 10). Of this number, 36 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.
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.
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.
VocabularyRescorer.evaluateCTCMatch (cognitive 37) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenEvaluation.swift:33— VocabularyRescorer.evaluateCTCMatch has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 13 (18 pts), if/else 8 (13 pts), boolean chains 6 (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.
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.segment (cognitive 36) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:324— MandarinG2P.segment has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 5 (11 pts), boolean chains 5, ternaries 1 (4 pts) (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. 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.
StreamingUnifiedAsrManager.processWindow (cognitive 35) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:360— StreamingUnifiedAsrManager.processWindow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 7, loops 2 (4 pts) (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.
ParadeeG2P.prepare (cognitive 35) Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2P.swift:219— ParadeeG2P.prepare has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 14, if/else 6 (12 pts), loops 4 (5 pts), match/switch 1 (2 pts), 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.
NemotronMultilingualTranscribe.run (cognitive 35) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:201— NemotronMultilingualTranscribe.run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 3 (10 pts), loops 2 (6 pts), error handling 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent 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.
ChunkProcessor.spliceCandidate (cognitive 34) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1802— ChunkProcessor.spliceCandidate has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 15, if/else 8 (10 pts), loops 7, ternaries 1 (2 pts) (nesting depth added 3). Of this number, 20 points are the body's own statements and 14 belong to 5 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.
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:211— 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:416— 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.
VocabularyRescorer.buildWordTimings (cognitive 33) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer.swift:434— VocabularyRescorer.buildWordTimings has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 4 (12 pts), boolean chains 4, 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.
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.
AudioConverter.convertFile (cognitive 32) Sources/FluidAudio/Shared/AudioConverter.swift:139— AudioConverter.convertFile has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 5, loops 2 (3 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.
PocketTtsSynthesizer.splitAtWordBoundaries (cognitive 32) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1237— PocketTtsSynthesizer.splitAtWordBoundaries has cognitive complexity 32 (threshold 15). Drivers by points: loops 8 (14 pts), boolean chains 9, if/else 6 (9 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.
StreamingGenerator.generatePipelined (cognitive 32) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:621— 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.
MandarinG2pwModel.disambiguate (cognitive 32) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2pwModel.swift:132— MandarinG2pwModel.disambiguate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 4, loops 2 (3 pts) (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.
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.
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:457— 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:970— 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:834— 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.
VocabularyRescorer.arbitratePendingReplacements (cognitive 30) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:276— VocabularyRescorer.arbitratePendingReplacements has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 10). Of this number, 23 points are the body's own statements and 7 belong to 2 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.
TTS.runKokoroAne (cognitive 30) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1123— 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.
NemotronMultilingualTranscribe.run (cognitive 30) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:42— NemotronMultilingualTranscribe.run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 3, 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.
AudioConverter.streamResample (cognitive 29) Sources/FluidAudio/Shared/AudioConverter.swift:298— AudioConverter.streamResample has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 3 (5 pts), boolean chains 2, 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.
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.
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.
ParadeeG2P.phonemize (cognitive 29) Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2P.swift:37— ParadeeG2P.phonemize has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 3 (10 pts), loops 3 (5 pts), boolean chains 1, match/switch 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.
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:1184— 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.
TtsBenchmarkCommand.inferCohereLanguage (cognitive 29) Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:1418— 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.
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.
LFM3AudioTokenizer.init (cognitive 28) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioTokenizer.swift:20— LFM3AudioTokenizer.init has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 7 (10 pts), boolean chains 5 (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.
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.
PocketTtsSynthesizer.splitSentences (cognitive 28) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1392— PocketTtsSynthesizer.splitSentences has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 5, loops 2 (3 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.
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.
LFM3AudioModels.load (cognitive 27) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioModels.swift:113— LFM3AudioModels.load has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), boolean chains 1, match/switch 1, ternaries 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.
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:252— 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:519— 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:542— 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:1137— 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:471— 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.protectedSearchWindow (cognitive 25) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+SpanProtection.swift:255— VocabularyRescorer.protectedSearchWindow has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, loops 2, ternaries 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.
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.
LFM3AudioDepthDecoder.sample (cognitive 24) Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioDepthDecoder.swift:225— LFM3AudioDepthDecoder.sample has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (7 pts), loops 3 (4 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.
KokoroAneV3Pipeline.init (cognitive 24) Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Pipeline.swift:27— KokoroAneV3Pipeline.init has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3 (4 pts), error handling 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 11 of the 24 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.
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:142— 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.
AsrManager.unspacedKeptCopyCount (cognitive 24) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:202— AsrManager.unspacedKeptCopyCount has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (10 pts), loops 1 (nesting depth added 4). Of this number, 22 points are the body's own statements and 2 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.
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.
SenseVoiceTranscribeCommand.run (cognitive 24) Sources/FluidAudioCLI/Commands/ASR/SenseVoiceTranscribeCommand.swift:10— SenseVoiceTranscribeCommand.run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 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.
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.
StreamingNemotronMultilingualAsrManager.downloadVariant (cognitive 23) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:368— StreamingNemotronMultilingualAsrManager.downloadVariant has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 5 (6 pts), boolean chains 5, error handling 2 (5 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.
MandarinBopomofoMap.encode (cognitive 23) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinBopomofoMap.swift:122— MandarinBopomofoMap.encode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, 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.
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.
SlidingWindowTokenCursor.next (cognitive 22) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowTokenUpdate.swift:76— SlidingWindowTokenCursor.next has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 21, if/else 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.
OfflineDiarizerConfig.validate (cognitive 22) Sources/FluidAudio/Diarizer/Offline/Core/OfflineDiarizerTypes.swift:377— 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.
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.
StreamingEouAsrManager.processChunkAndDecode (cognitive 22) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:630— 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:224— 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.
StreamDiarizationBenchmark.processStreamingMeeting (cognitive 22) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:631— 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:1031— 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.
LFM3AudioEncoderPlanner.makeCall (cognitive 21) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioEncoder.swift:55— LFM3AudioEncoderPlanner.makeCall has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 4 (8 pts), ternaries 2 (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.
LFM3AudioRows.write (cognitive 21) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioLanguageModel.swift:22— LFM3AudioRows.write has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 12). 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.
StreamingDownloadDelegate.urlSession (cognitive 21) Sources/FluidAudio/Shared/Download/FileDownloader.swift:559— 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.
PhonemeChunker.chunkRanges (cognitive 21) Sources/FluidAudio/TTS/Shared/PhonemeChunker.swift:58— PhonemeChunker.chunkRanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 6 (8 pts), boolean chains 5 (nesting depth added 5). 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, split the body into named stages: move each independent 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.
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:435— 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.
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:943— 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.
MisakiBritishFallback.fromAmerican (cognitive 20) Sources/FluidAudio/TTS/KokoroAne/G2P/English/MisakiBritishFallback.swift:24— MisakiBritishFallback.fromAmerican has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 3 (4 pts), match/switch 2 (3 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.
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:476— 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:933— 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:304— 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.
ParadeeG2P.predictBatch (cognitive 19) Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2P.swift:165— ParadeeG2P.predictBatch has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 2 (8 pts), loops 3 (7 pts), error handling 2, if/else 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.
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:277— 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.
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.
ChunkProcessor.mergeChunks (cognitive 19) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/ChunkProcessor.swift:1281— ChunkProcessor.mergeChunks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 2). 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.
StreamingNemotronMultilingualAsrManager.preloadShared (cognitive 19) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:84— 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:80— 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.
CtcKeywordSpotter.makeLogProbs (cognitive 19) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcKeywordSpotter+Inference.swift:372— CtcKeywordSpotter.makeLogProbs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, ternaries 3 (4 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 6 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.
TdtDecoderV3.applyEnglishBlocklist (cognitive 19) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:674— 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:702— 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.
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.
ModelHub.loadWithRecovery (cognitive 18) Sources/FluidAudio/Shared/Download/ModelHub.swift:242— ModelHub.loadWithRecovery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 7). 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, split the body into named stages: move each independent 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 18) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:328— SlidingWindowAsrManager.finish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, error handling 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.
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:392— 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.
LFM3AudioCommand.speak (cognitive 18) Sources/FluidAudioCLI/Commands/ASR/LFM3AudioCommand.swift:116— LFM3AudioCommand.speak has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 6 (7 pts), boolean chains 1, 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.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.
LFM3AudioManager.transcribeLiveChunk (cognitive 17) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioManager.swift:211— LFM3AudioManager.transcribeLiveChunk has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 2, loops 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.
LFM3AudioTokenizer.bpe (cognitive 17) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioTokenizer.swift:146— LFM3AudioTokenizer.bpe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), boolean chains 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.
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.
LFM3AudioDepthDecoder.kthLargest (cognitive 17) Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioDepthDecoder.swift:191— LFM3AudioDepthDecoder.kthLargest has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 5 (8 pts) (nesting depth added 8). 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.
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.
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:185— 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.
PocketTtsSynthesizer.splitOversizedSentence (cognitive 17) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1062— PocketTtsSynthesizer.splitOversizedSentence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (5 pts), 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.
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:614— 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:132— 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:355— 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.
MainlandBins.init (cognitive 17) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2pwModel.swift:227— MainlandBins.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VocabularyRescorer.recognizedVocabularySpans (cognitive 17) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+SpanProtection.swift:162— VocabularyRescorer.recognizedVocabularySpans has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 3 (6 pts), boolean chains 3, 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.
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.
LFM3AudioCommand.benchmark (cognitive 17) Sources/FluidAudioCLI/Commands/ASR/LFM3AudioCommand.swift:176— LFM3AudioCommand.benchmark has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (4 pts), ternaries 2 (3 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.
CtcEarningsBenchmark.tokenize (cognitive 17) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:808— 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.
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.
LFM3AudioCoreMLBackbone.call (cognitive 16) Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioCoreMLBackbone.swift:304— LFM3AudioCoreMLBackbone.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 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.
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.
LFM3AudioOverlapAdd.add (cognitive 16) Sources/FluidAudio/TTS/LFM3Audio/LFM3AudioCodec.swift:89— LFM3AudioOverlapAdd.add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 3). 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.
ParadeeManager.ensurePhonemizer (cognitive 16) Sources/FluidAudio/TTS/Paradee/ParadeeManager.swift:254— ParadeeManager.ensurePhonemizer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (6 pts), boolean chains 2, 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.
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.
KokoroAnePauses.spans (cognitive 16) Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAnePauses.swift:44— KokoroAnePauses.spans has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). 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 into named stages: move each independent 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:237— 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.
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.
MandarinG2P.normalizeTracingPunctuation (cognitive 16) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinG2P.swift:576— MandarinG2P.normalizeTracingPunctuation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 6). Of this number, 14 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.
VocabularyRescorer.wordIndices (cognitive 16) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1462— 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.
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:270— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:270-322 | 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, 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 (129 shared lines) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:172— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:172-629 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:288-482 — These two members are variants of one another: 129 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 (38 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: 38 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· 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:542-622 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:644-855 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:118-243 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:201-318 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:114-194 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:535-617 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:622-694 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:702-839 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:919-968 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:970-1121 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1123-1296 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1301-1396 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1415-1520 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1525-1611 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1615-1686 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1691-1761 | 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:1132-1157 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1171-1194 | 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:148-154 | 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· Edited copy of a member (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:292— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:292-352 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:365-425 — These two members are one piece of code written twice and then edited apart: 61 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· Edited copy of a member (108 corresponding lines) · ×1
Edited copy of a member (108 corresponding lines) Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:207— Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:207-314 | Sources/FluidAudio/Shared/AudioMelSpectrogram.swift:347-478 — These two members are one piece of code written twice and then edited apart: 108 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· Edited copy of a member (79 corresponding lines) · ×1
Edited copy of a member (79 corresponding lines) Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:293— Sources/FluidAudio/Diarizer/Nemotron3/Nemotron3StateUpdater.swift:293-371 | Sources/FluidAudio/Diarizer/Sortformer/SortformerStateUpdater.swift:466-579 — These two members are one piece of code written twice and then edited apart: 79 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· Edited copy of a member (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1274— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:1274-1335 | Sources/FluidAudioCLI/Commands/DiarizationBenchmarkUtils.swift:335-400 — These two members are one piece of code written twice and then edited apart: 62 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· Edited copy of a member (81 corresponding lines) · ×1
Edited copy of a member (81 corresponding lines) Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:25— Sources/FluidAudio/TTS/Chatterbox/ChatterboxModels.swift:25-105 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoModels.swift:25-117 — These two members are one piece of code written twice and then edited apart: 81 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· Edited copy of a member (58 corresponding lines) · ×1
Edited copy of a member (58 corresponding lines) Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:111— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:111-170 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:94-151 — These two members are one piece of code written twice and then edited apart: 58 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· Edited copy of a member (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:241— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:241-296 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:310-375 — These two members are one piece of code written twice and then edited apart: 56 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· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:66— Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:66-98 | Sources/FluidAudio/TTS/KokoroAne/G2P/Mandarin/MandarinPinyinDict.swift:101-137 — These two members are one piece of code written twice and then edited apart: 33 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· Edited copies of one member (3 members, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:45— Sources/FluidAudio/TTS/Chatterbox/ChatterboxManager.swift:45-76 | Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoManager.swift:57-86 | Sources/FluidAudio/TTS/NeuTts/NeuTtsManager.swift:44-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:19— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:19-74 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:333-376 — These two members are one piece of code written twice and then edited apart: 44 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· Edited copy of a member (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) Sources/FluidAudio/ASR/Canary/CanaryManager.swift:210— Sources/FluidAudio/ASR/Canary/CanaryManager.swift:210-248 | Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:933-979 — These two members are one piece of code written twice and then edited apart: 39 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· Edited copy of a member (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:96— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:96-152 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:161-210 — These two members are one piece of code written twice and then edited apart: 50 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· Edited copies of one member (3 members, 25+ corresponding lines) · ×1
Edited copies of one member (3 members, 25+ corresponding lines) Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:286— Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:286-320 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:357-388 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2Synthesizer.swift:390-414 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:536— Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift:536-576 | Sources/FluidAudio/TTS/Paradee/ParadeeManager.swift:254-291 — These two members are one piece of code written twice and then edited apart: 38 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· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:555— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift:555-588 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:409-446 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Unified/UnifiedBenchmark.swift:208-228 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×1
Edited copies of one member (4 members, 20+ corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:119— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:119-139 | Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:157-177 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:76-96 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:115-134 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:303— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:303-323 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:326-349 — These two members are one piece of code written twice and then edited apart: 21 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· Edited copies of one member (3 members, 37+ corresponding lines) · ×1
Edited copies of one member (3 members, 37+ corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:172— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:172-211 | Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:173-214 | Sources/FluidAudio/ASR/Parakeet/Unified/UnifiedAsrManager.swift:156-192 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:13— Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:13-41 | Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ResourceDownloader.swift:27-52 | Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ResourceDownloader.swift:17-45 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) Sources/FluidAudio/ASR/Shared/PunctuationCommitLayer.swift:237— Sources/FluidAudio/ASR/Shared/PunctuationCommitLayer.swift:237-271 | Sources/FluidAudio/ASR/Shared/PunctuationCommitLayer.swift:276-309 — These two members are one piece of code written twice and then edited apart: 34 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· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:187— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoTokenizer.swift:187-203 | Sources/FluidAudio/TTS/Chatterbox/Tokenizer/ChatterboxTokenizer.swift:187-209 | Sources/FluidAudio/TTS/NeuTts/Tokenizer/NeuTtsBpeTokenizer.swift:119-135 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 14+ corresponding lines) · ×1
Edited copies of one member (5 members, 14+ corresponding lines) Sources/FluidAudio/ASR/Canary/CanaryModels.swift:44— Sources/FluidAudio/ASR/Canary/CanaryModels.swift:44-63 | Sources/FluidAudio/ASR/Paraformer/ParaformerModels.swift:63-78 | Sources/FluidAudio/ASR/SenseVoice/SenseVoiceModels.swift:71-94 | Sources/FluidAudio/Speaker/CampPlusModels.swift:29-42 | Sources/FluidAudio/VAD/Fsmn/FsmnVadModels.swift:29-42 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) Sources/FluidAudioCLI/Utils/DiarizationMetrics.swift:511— Sources/FluidAudioCLI/Utils/DiarizationMetrics.swift:511-537 | Sources/FluidAudioCLI/Utils/DiarizationMetrics.swift:552-578 — These two members are one piece of code written twice and then edited apart: 27 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· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:383— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:383-408 | Sources/FluidAudio/TTS/StyleTTS2/Assets/StyleTTS2ResourceDownloader.swift:92-115 — These two members are one piece of code written twice and then edited apart: 24 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· Edited copies of one member (6 members, 12+ corresponding lines) · ×1
Edited copies of one member (6 members, 12+ corresponding lines) Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:105— Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:105-116 | Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:143-154 | Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneSynthesizer+Conversion.swift:181-192 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:61-73 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:100-112 | Sources/FluidAudio/TTS/KokoroAne/V3/KokoroAneV3Arrays.swift:138-150 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 23+ corresponding lines) · ×1
Edited copies of one member (5 members, 23+ corresponding lines) Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:86— Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:86-115 | Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:134-159 | Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:162-187 | Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:212-235 | Sources/FluidAudio/TTS/PocketTTS/PocketTtsManager.swift:248-270 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 23 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) Sources/FluidAudio/TTS/Inflect/Assets/InflectModelStore.swift:78— Sources/FluidAudio/TTS/Inflect/Assets/InflectModelStore.swift:78-90 | Sources/FluidAudio/TTS/LuxTts/LuxTtsModelStore.swift:188-202 | Sources/FluidAudio/TTS/Paradee/Assets/ParadeeModelStore.swift:134-146 | Sources/FluidAudio/TTS/Supertonic3/Assets/Supertonic3ModelStore.swift:187-201 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 6+ corresponding lines) · ×1
Edited copies of one member (6 members, 6+ corresponding lines) Sources/FluidAudio/TTS/Inflect/Pipeline/InflectSynthesizer.swift:134— Sources/FluidAudio/TTS/Inflect/Pipeline/InflectSynthesizer.swift:134-139 | Sources/FluidAudio/TTS/Inflect/Pipeline/InflectSynthesizer.swift:141-146 | Sources/FluidAudio/TTS/Paradee/Pipeline/ParadeeSynthesizer.swift:108-113 | Sources/FluidAudio/TTS/Paradee/Pipeline/ParadeeSynthesizer.swift:115-120 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:15-25 | Sources/FluidAudio/TTS/StyleTTS2/Pipeline/Synthesize/StyleTTS2MultiArray.swift:27-37 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 51+ corresponding lines) · ×1
Edited copies of one member (5 members, 51+ corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1097— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1097-1166 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1228-1301 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:486-554 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:13-64 | Sources/FluidAudioCLI/Commands/SortformerCommand.swift:435-485 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 51 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) Sources/FluidAudio/ModelRegistry.swift:112— Sources/FluidAudio/ModelRegistry.swift:112-118 | Sources/FluidAudio/ModelRegistry.swift:121-131 | Sources/FluidAudio/ModelRegistry.swift:134-140 | Sources/FluidAudio/ModelRegistry.swift:143-151 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:317— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcModels.swift:317-326 | Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:423-432 | Sources/FluidAudio/Shared/MLModelConfigurationUtils.swift:37-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) Sources/FluidAudio/ASR/Parakeet/ParakeetLanguageModels.swift:235— Sources/FluidAudio/ASR/Parakeet/ParakeetLanguageModels.swift:235-252 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:657-668 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:671-681 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:493— Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:493-501 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrModels.swift:683-696 | Sources/FluidAudio/TTS/Paradee/Assets/ParadeeModelStore.swift:101-109 | Sources/FluidAudioCLI/Commands/EnhanceCommand.swift:190-198 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×1
Edited copies of one member (3 members, 6+ corresponding lines) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronVocabularyBias.swift:219— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/NemotronVocabularyBias.swift:219-228 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononCharTables.swift:134-139 | Sources/FluidAudio/TTS/PocketTTS/Phonon/PhononTextNormalizer.swift:316-321 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 33+ corresponding lines) · ×1
Edited copies of one member (3 members, 33+ corresponding lines) Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:243— Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereTranscribeCommand.swift:243-285 | Sources/FluidAudioCLI/Commands/ASR/JapaneseAsrBenchmark.swift:497-529 | Sources/FluidAudioCLI/Commands/DownloadCommand.swift:88-122 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:281— Sources/FluidAudio/TTS/KokoroAne/G2P/French/FrenchG2P.swift:281-283 | Sources/FluidAudio/TTS/KokoroAne/G2P/Spanish/SpanishG2P.swift:462-464 | Sources/FluidAudio/TTS/Paradee/G2P/ParadeeG2PNumbers.swift:124-126 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) Examples/BarkDemo/Sources/BarkDemo/DemoModel.swift:376— Examples/BarkDemo/Sources/BarkDemo/DemoModel.swift:376-379 | Examples/Phonon2Demo/Sources/Phonon2Demo/DemoModel.swift:309-312 | Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift:375-378 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
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:252— Sources/FluidAudioCLI/Commands/DiarizationBenchmark.swift:252-309 | 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:252` it begins part-way through the construct above it, so those exact lines 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:1097— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:1097-1150 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1228-1281 | Sources/FluidAudioCLI/Commands/ProcessCommand.swift:486-539 — 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:1097` 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:1093` calls `exit` and `Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:1222` 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 (51 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:936— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:936-986 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1128-1178 — 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:936` it begins part-way through the construct above it, so those exact lines 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–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 189 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 (45–46 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:863— Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:863-907 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/ParakeetEouCommand.swift:511-556 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (25–41 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:436— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+BlankRescue.swift:436-460 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:951-991 — 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 (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:531— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:531-567 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:658-682 — 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:531` it begins part-way through the construct above it, so those 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 15 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 (21–32 lines × 2) Sources/FluidAudio/Shared/Download/ModelHub.swift:100— Sources/FluidAudio/Shared/Download/ModelHub.swift:100-131 | Sources/FluidAudio/Shared/Download/ModelHub.swift:284-304 — 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:419— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:419-449 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:565-592 — 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:136— Sources/FluidAudio/ASR/Parakeet/Unified/StreamingUnifiedAsrManager.swift:136-166 | 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:136` 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 15 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:331— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:331-349 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:547-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25–27 lines × 2) Sources/FluidAudioCLI/Commands/TTSCommand.swift:1060— Sources/FluidAudioCLI/Commands/TTSCommand.swift:1060-1084 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1223-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.
Duplicated block (49–53 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:270— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:270-322 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Buffers.swift:212-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 13 separate duplicated blocks between them, totalling at least 177 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 (12–37 lines × 3) Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:392— Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift:392-427 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:395-431 | Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift:488-499 — before extracting anything, compare `Sources/FluidAudioCLI/Commands/LSEENDBenchmark.swift` and `Sources/FluidAudioCLI/Commands/SortformerBenchmark.swift` as WHOLE FILES: this scan already matched 15 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 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 (18–22 lines × 2) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:236— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:236-257 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/Decoder/TdtDecoderV3.swift:493-510 — 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–20 lines × 8) Sources/FluidAudioCLI/Commands/TTSCommand.swift:599— Sources/FluidAudioCLI/Commands/TTSCommand.swift:599-617 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:676-694 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:820-839 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1377-1396 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1501-1520 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1592-1611 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1667-1686 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1742-1761 — 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:599` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 3) Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:729— Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:729-748 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:939-958 | Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/Rescorer/VocabularyRescorer+TokenRescoring.swift:1131-1150 — 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:729` it begins part-way through the construct above it, so those 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 (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:963— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:963-982 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:1109-1128 — 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:963` 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:217-234 — 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 (16–18 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:184— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager.swift:184-201 | 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:184` 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:258— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSession.swift:258-275 | 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:258` 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:730— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:730-747 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:802-816 — 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:730` 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 (2–15 lines × 6) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:362— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:362-363 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:385-399 | 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 13 separate duplicated blocks between them, totalling at least 177 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:385` 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:384` calls `bindMemory` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:360` 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 (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 (26–30 lines × 2) Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:29— Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:29-58 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:339-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:29` it begins part-way through the construct above it, so those exact lines 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 × 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:97-110 | 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:294-307 — 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 (11–14 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:401— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:401-414 | 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 13 separate duplicated blocks between them, totalling at least 177 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 (20–22 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:367— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:367-386 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:435-456 — 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 (4–14 lines × 3) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+State.swift:71— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+State.swift:71-74 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:262-275 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:333-346 — 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:907-919 | 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:360-372 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:121-133 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:170-182 | 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 (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 (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 (24–28 lines × 2) Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:281— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:281-304 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:580-607 — 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:614` calls `warmupModels` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift:310` 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 (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:909-921 — 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:102-113 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:903-914 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:616-627 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:639-650 | 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:280-291 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:315-326 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:361-372 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:122-133 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:171-182 | 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:910-921 | 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:154-165 | 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:82-93 | 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:114— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:114-117 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:136-147 | 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:495-503 | 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 13 separate duplicated blocks between them, totalling at least 177 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:114` 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:135` calls `featureValue` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:114` 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:649— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:649-660 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:677-684 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:686-693 — 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:649` 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 (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:1139-1150 — 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:324— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:324-335 | 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 13 separate duplicated blocks between them, totalling at least 177 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:324` 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:104-114 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/FleursBenchmark.swift:905-915 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:618-628 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualFleursBenchmark.swift:660-670 | 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:282-292 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:317-327 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:358-368 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:119-129 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:168-178 | 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:602— Sources/FluidAudioCLI/Commands/TTSCommand.swift:602-611 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:679-688 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:823-833 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1105-1114 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1281-1290 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1380-1390 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1504-1514 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1595-1605 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1670-1680 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1745-1755 — 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:602` it begins part-way through the construct above it, so those 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:910-920 | 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:154-164 | 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:95-105 | 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:199-209 — 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:66-76 | 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:365— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:365-375 | 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 13 separate duplicated blocks between them, totalling at least 177 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:365` 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 (9–11 lines × 2) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:250— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:250-258 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:450-460 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:250` 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 × 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:71-80 | 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:120— Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:120-129 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:279-287 | Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:344-352 — 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: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. 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:275` calls `info` and `Sources/FluidAudio/TTS/KokoroAne/Assets/KokoroAneResourceDownloader.swift:342` 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 × 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:118-126 | 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:299-307 — 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 48 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 (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/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:668— Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:668-676 | Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift:752-758 — 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:668` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 5) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:665— Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:665-672 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:42-49 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:105-112 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:249-256 | 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 13 separate duplicated blocks between them, totalling at least 177 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:665` it begins part-way through the construct above it, so those 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:116` 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:652— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:652-659 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:679-684 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:688-693 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:696-703 — 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:652` it begins part-way through the construct above it, so those 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:611-614 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/TranscribeCommand.swift:831-833 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronBenchmark.swift:212-213 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronMultilingualTranscribe.swift:297-298 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/Streaming/NemotronTranscribe.swift:173-174 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:579-581 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:658-660 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:790-793 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:800-801 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:960-961 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1050-1052 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1186-1193 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1357-1359 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1481-1483 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1568-1575 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1644-1651 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1720-1727 | 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 7 separate duplicated blocks between them, totalling at least 103 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:611` 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:148-154 | 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:42— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:42-47 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:105-110 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:249-254 | 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:409-414 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:436-441 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:459-464 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:678-683 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:687-692 — 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:42` it begins part-way through the construct above it, so those exact lines 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:417-422 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:444-449 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:467-472 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:489-494 — 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:125— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:125-130 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Decode.swift:410-415 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:909-914 | 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:135` calls `featureValue` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager.swift:918` 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 (28 lines × 2) Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:298— Sources/FluidAudio/TTS/Chatterbox/Nano/ChatterboxNanoSynthesizer.swift:298-325 | Sources/FluidAudio/TTS/Chatterbox/Pipeline/ChatterboxSynthesizer.swift:371-398 — 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 189 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 (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 48 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 lines × 12) Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:663— Sources/FluidAudio/ASR/Parakeet/Streaming/EOU/StreamingEouAsrManager.swift:663-667 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:41-45 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:104-108 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:248-252 | 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:165-169 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:408-412 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:435-439 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Pipeline.swift:458-462 — 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 13 separate duplicated blocks between them, totalling at least 177 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:663` 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:669` calls `MLFeatureValue` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:47` 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:1146-1150 | Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/CtcEarningsBenchmark.swift:1183-1187 | 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:584— Sources/FluidAudioCLI/Commands/TTSCommand.swift:584-588 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:663-667 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:802-806 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1362-1366 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1486-1490 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1578-1582 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1654-1658 | Sources/FluidAudioCLI/Commands/TTSCommand.swift:1730-1734 — 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:584` 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:1607-1611 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1653-1657 — 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:359— Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:359-362 | Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:377-382 | 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 13 separate duplicated blocks between them, totalling at least 177 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:377` 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:382` calls `MLMultiArray`, `NSNumber` and `Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronAsrManager+Pipeline.swift:362` 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:796-798 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:824-827 | 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 (4–5 lines × 3) Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:180— Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsStateEngine.swift:180-186 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer+KVCache.swift:554-557 | Sources/FluidAudio/TTS/PocketTTS/Pipeline/PocketTtsSynthesizer.swift:1650-1654 — 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:180` 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.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:350— Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:350-394 | Scripts/nemo_ami_benchmark/nemo_ami_benchmark.py:398-454 — These two members are one piece of code written twice and then edited apart: 45 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· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) Examples/BarkDemo/Sources/BarkDemo/BarkDemoApp.swift:19— Examples/BarkDemo/Sources/BarkDemo/BarkDemoApp.swift:19-26 | Examples/LocalVQEDemo/Sources/LocalVQEDemo/LocalVQEDemoApp.swift:17-24 | Examples/Phonon2Demo/Sources/Phonon2Demo/Phonon2DemoApp.swift:16-22 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
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/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift:733— `!$0.isEmpty && $0 != ASRConstants.sentencePieceUnknownToken` appears character-identically in 2 files — Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager+Transcription.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/TDT/AsrManager.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/KokoroAne/KokoroAneManager.swift:550— `!$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:1274— `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:490— `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:196— `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:347— `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:255— `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:349— `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:251— `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:921— `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.
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/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, 116 significant file(s) lose their only recent owner: Sources/FluidAudioCLI/Commands/TTSCommand.swift, Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift, Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift, Sources/FluidAudio/TTS/KokoroAne/KokoroAneManager.swift, Sources/FluidAudio/ASR/Parakeet/Streaming/Nemotron/StreamingNemotronMultilingualAsrManager+Shared.swift, Sources/FluidAudioCLI/Commands/ASR/Cohere/CohereBenchmark.swift, Sources/FluidAudio/Shared/Download/FileDownloader.swift, Sources/FluidAudio/TTS/KokoroAne/Pipeline/KokoroAneModelStore.swift (+108 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 (118 single-owned of 394 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; 394 of the 454 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 Package.swift:18— 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/`. ADRs are expected here because `Package.swift` makes this repository a deployable product (line 18).
D21 · Naming Consistency· `PocketTTS` spells `TTS` where 61 names in the project spell it `Tts` · ×1
`PocketTTS` spells `TTS` where 61 names in the project spell it `Tts` Sources/FluidAudio/ModelNames.swift:1396— 61 of 63 names in project FluidAudio spell the token `Tts` (61 of 63; unit: names in project FluidAudio containing `Tts`). Peers: FluidAudio.LuxTts (Sources/FluidAudio/ModelNames.swift:1752); FluidAudio.NeuTts (Sources/FluidAudio/ModelNames.swift:1975); FluidAudio.LuxTtsEnglishNormalizer (Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:13); FluidAudio.LuxTtsG2p (Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:28); FluidAudio.LuxTtsConstants (Sources/FluidAudio/TTS/LuxTts/LuxTtsConstants.swift:9). Rename to `PocketTts`. [rule N6]
D21 · Naming Consistency· `PocketTTSError` spells `TTS` where 61 names in the project spell it `Tts` · ×1
`PocketTTSError` spells `TTS` where 61 names in the project spell it `Tts` Sources/FluidAudio/TTS/PocketTTS/PocketTTSError.swift:5— 61 of 63 names in project FluidAudio spell the token `Tts` (61 of 63; unit: names in project FluidAudio containing `Tts`). Peers: FluidAudio.LuxTts (Sources/FluidAudio/ModelNames.swift:1752); FluidAudio.NeuTts (Sources/FluidAudio/ModelNames.swift:1975); FluidAudio.LuxTtsEnglishNormalizer (Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsEnglishNormalizer.swift:13); FluidAudio.LuxTtsG2p (Sources/FluidAudio/TTS/LuxTts/G2p/LuxTtsG2p.swift:28); FluidAudio.LuxTtsConstants (Sources/FluidAudio/TTS/LuxTts/LuxTtsConstants.swift:9). Rename to `PocketTtsError`. [rule N6]
D21 · Naming Consistency· `calculateASRMetrics` spells `ASR` where 22 names in the project spell it `Asr` · ×1
`calculateASRMetrics` spells `ASR` where 22 names in the project spell it `Asr` Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:361— 22 of 24 names in project FluidAudio spell the token `Asr` (22 of 24; unit: names in project FluidAudio containing `Asr`). Peers: FluidAudio.CohereAsrConfig (Sources/FluidAudio/ASR/Cohere/CohereAsrConfig.swift:4); FluidAudio.CohereAsrError (Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:20); FluidAudio.SlidingWindowAsrManager (Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:10); FluidAudio.SlidingWindowAsrConfig (Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:1019); FluidAudio.SlidingWindowAsrSession (Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrSession.swift:6). Rename to `calculateAsrMetrics`. [rule N6]
D21 · Naming Consistency· `runASRBenchmark` spells `ASR` where 22 names in the project spell it `Asr` · ×1
`runASRBenchmark` spells `ASR` where 22 names in the project spell it `Asr` Sources/FluidAudioCLI/Commands/ASR/Parakeet/SlidingWindow/AsrBenchmark.swift:649— 22 of 24 names in project FluidAudio spell the token `Asr` (22 of 24; unit: names in project FluidAudio containing `Asr`). Peers: FluidAudio.CohereAsrConfig (Sources/FluidAudio/ASR/Cohere/CohereAsrConfig.swift:4); FluidAudio.CohereAsrError (Sources/FluidAudio/ASR/Cohere/CoherePipeline.swift:20); FluidAudio.SlidingWindowAsrManager (Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:10); FluidAudio.SlidingWindowAsrConfig (Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrManager.swift:1019); FluidAudio.SlidingWindowAsrSession (Sources/FluidAudio/ASR/Parakeet/SlidingWindow/SlidingWindowAsrSession.swift:6). Rename to `runAsrBenchmark`. [rule N6]
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 8 of 394 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; 394 of the 454 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: Sources/FluidAudio/Shared/AudioStream.swift, Sources/FluidAudioCLI/DatasetParsers/AMIKaldiData.swift, Sources/FluidAudio/Diarizer/LS-EEND/LSEENDTypes.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/WordSpotting/CtcTokenizer.swift, Sources/FluidAudio/TTS/SSML/SSMLTagParser.swift, Sources/FluidAudio/ASR/Parakeet/SlidingWindow/CustomVocabulary/BKTree/BKTree.swift, Sources/FluidAudio/TTS/SSML/SSMLTypes.swift, Sources/FluidAudio/Diarizer/Offline/Clustering/SpeakerCountConstraints.swift. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No SAST REDACTED:4— 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 17 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:270— `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 44 file(s) — `Examples/LocalVQEDemo/Sources/LocalVQEDemo/DemoModel.swift`, `Sources/FluidAudio/ASR/LFM3Audio/LFM3AudioModels.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`, … (+39 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 01a1dc40-f118-730b-ac5a-23e720a6f64a · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 81 · Warnings: 1531 · Recommendations: 48 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 22:50 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.