Public report of izwi-ai/izwi, published 17 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 report Measured 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, 17 November 2026, 03:37 UTC · Survey ID cd_3d57ee9ad9c24f218547499fe833be23

izwi-ai/izwi

Measured 17 November 2026, 03:28 UTC, at code version 8f8d5e2

First survey, so nothing to compare with yet
CAI score 66.0out of 100 Strong
CriticalWeakAdequateStrongExemplary

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 very large codebase: 900,289 lines of product code in 22 projects, tests not counted · Estimated rebuild effort: about 7.7 person-years · Weakest lens: Code Health, 55.2

Findings by how serious they are

27 critical 3244 serious 170 minor

9 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

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 03:28 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 ▸

92of 92 dimensions measured by tools.
3406of 3441 findings point to an exact file and line, so you can open each one in the code. The other 35 concern the repository as a whole, such as missing documentation.
92dimensions across 9 lenses, read from 900,289 lines of product code in 22 projects.
Chapters

Executive summary

izwi-ai/izwi meets our standard for a preview release. It scores 66.0 out of 100 and is rated Strong, and 19 of its 27 critical findings are security problems.

Code Health, at 55.2, is the weakest lens and counts most in the score. The best first step is replacing the two packages under a banned licence, worth about 3.6 points. Splitting the oversized files would lift Code Health itself, worth about 2.9 points. Raising Code Health to 67 would lift the score to about 71.3.

Ten weaknesses in the code could be used by an attacker. Two passwords or keys are open to anyone who can read the repository, and two pipeline steps run downloads nobody checks. Fixing the weaknesses the scanner points to, replacing each exposed password or key and checking each download against a checksum would close these risks. Pinning each tool to an exact version would fix the two pipeline tools referenced by a changeable name, and the two unsafe settings in infrastructure or container files need changing to safe values. Giving each kind of identifier a type of its own would take care of the four identifiers passed around as plain numbers or text.

The product code is 900,289 lines, about €1,100,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 for The 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.
Code Health 55.2 · counts for 45%Production Readiness 66.8 · counts for 25%Domain Modelling 77.1 · counts for 14%Security and Compliance 83.4 · counts for 8%Maturity 84.1 · counts for 4%Performance 88.6 · counts for 2%Architecture 91.8 · counts for 1%Accessibility 93.0 · counts for 1%Event Sourcing 100.0 · counts for 0%

If Code Health rose from 55.2 to 67, the lowest score rated Strong, the score would rise from 66.0 to about 71.3.

Code composition: what the lines of code are
Product code 87%Tests 13%
Rebuild cost: about €1,100,000 · Estimate
Cost to rebuild€370,000 to €1,900,000, for 6,178 to 19,599 hours of work, about 7.7 person-years for 4 to 15 engineers
Difficulty of the problemLow, 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.9 at a score of 66. 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.
SizeVery large: 900,289 lines of product code
What it is notNot 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
Resolve the 2 Banned license finding(s) in License Compliance.
Raises the score by about 3.6 points · Low effort · License Compliance
2
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 2.9 points · Medium effort · Large Files
3
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Raises the score by about 2.9 points · Medium effort · Outbound HTTP resilience

Diagnosis: what the measurements show together

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 €1,100,000 to build again, about 7.7 person-years of work. Its weakest lens is Code Health, at 55.2 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Banned license finding(s) in License Compliance. Of all the actions in this report, it raises the score most for the work it takes: about 3.6 points for low effort, because it clears the 2 License Compliance findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 6% on every change. The history of the code shows how much it changes: about 1,279,234 lines over the last 90 days, which is about 5,188,005 lines a year. At that pace, the extra work comes to an estimated 367.7 to 2206.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of 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.

arch izwi-agent izwi-agent izwi-asr-toolkit izwi-asr-toolkit izwi-vad izwi-vad izwi-asr-toolkit->izwi-vad izwi-audio-codec izwi-audio-codec izwi-cli izwi-cli izwi-core izwi-core izwi-cli->izwi-core izwi-env izwi-env izwi-cli->izwi-env izwi-core->izwi-asr-toolkit izwi-core->izwi-env izwi-model-catalog izwi-model-catalog izwi-core->izwi-model-catalog izwi-prometheus izwi-prometheus izwi-core->izwi-prometheus izwi-core->izwi-vad izwi-db izwi-db izwi-desktop izwi-desktop izwi-desktop->izwi-audio-codec izwi-dictation izwi-dictation izwi-desktop->izwi-dictation izwi-desktop->izwi-env izwi-dictation->izwi-audio-codec izwi-dictation->izwi-vad izwi-gateway izwi-gateway izwi-gateway->izwi-db izwi-gateway->izwi-env izwi-hooks izwi-hooks izwi-gateway->izwi-hooks izwi-gateway->izwi-model-catalog izwi-gateway->izwi-prometheus izwi-serving-client izwi-serving-client izwi-gateway->izwi-serving-client izwi-serving-protocol izwi-serving-protocol izwi-gateway->izwi-serving-protocol izwi-server izwi-server izwi-server->izwi-agent izwi-server->izwi-audio-codec izwi-server->izwi-core izwi-server->izwi-db izwi-server->izwi-env izwi-server->izwi-gateway izwi-server->izwi-hooks izwi-server->izwi-serving-client izwi-server->izwi-serving-protocol izwi-server->izwi-vad izwi-serving-client->izwi-serving-protocol izwi-serving-fence izwi-serving-fence izwi-serving-fence->izwi-serving-protocol izwi-serving-protocol->izwi-env izwi-serving-supervisor izwi-serving-supervisor izwi-serving-supervisor->izwi-env izwi-serving-supervisor->izwi-serving-client izwi-serving-supervisor->izwi-serving-fence izwi-serving-supervisor->izwi-serving-protocol izwi-serving-worker izwi-serving-worker izwi-serving-worker->izwi-core izwi-serving-worker->izwi-env izwi-serving-worker->izwi-serving-client izwi-serving-worker->izwi-serving-fence izwi-serving-worker->izwi-serving-protocol __more__ +1 more projects

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.

1190 modules, with 3438 dependencies between them. 12 loops run through 192 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1150 more are left out to keep it readable.

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.
uses →1 izwi_core.error2 izwi_core.performance3 izwi_core.tokenizer4 izwi_gateway.error5 izwi_model_catalog.backend6 izwi_serving_protocol.identity7 izwi_core.backends.device8 izwi_core.config9 izwi_core.engine.types10 izwi_core.kernels.cuda.shape_graphs11 izwi_core.kv.v2.contract12 izwi_core.models.architectures.fish_drama3.config13 izwi_core.models.shared.weights.gguf14 izwi_gateway.gateway15 izwi_model_catalog.catalog.metadata16 izwi_core.backends.state.tensor17 izwi_core.engine.execution18 izwi_core.kv.resolved19 izwi_core.kv.v2.descriptor20 izwi_core.runtime.adapters21 izwi_core.kv.batch22 izwi_core.backends.kv23 izwi_core.models.shared.attention.physical24 izwi_core.kv.v2.runtime25 izwi_core.models.architectures.fish_drama3.model26 izwi_core.models.architectures.qwen3.asr27 izwi_core.models.architectures.qwen36moe.text28 izwi_core.models.architectures.qwen38.chat29 izwi_core.models.registry30 izwi_core.runtime.adapters.loaded31 izwi_core.runtime.coordinator32 izwi_core.runtime.types33 izwi_core.models.architectures.qwen3.tts34 izwi_core.engine.executor.state35 izwi_core.engine.request36 izwi_core.engine.cache.managed37 izwi_core.engine.executor38 izwi_core.runtime.lifecycle.controller39 izwi_core.runtime.service40 izwi_server.state
1 izwi_core.error
2 izwi_core.performance
3 izwi_core.tokenizer
4 izwi_gateway.error
5 izwi_model_catalog.backend
6 izwi_serving_protocol.identity
7 izwi_core.backends.device1
8 izwi_core.config12
9 izwi_core.engine.types2
10 izwi_core.kernels.cuda.shape_graphs1
11 izwi_core.kv.v2.contract1
12 izwi_core.models.architectures.fish_drama3.config1
13 izwi_core.models.shared.weights.gguf1
14 izwi_gateway.gateway1
15 izwi_model_catalog.catalog.metadata1
16 izwi_core.backends.state.tensor18
17 izwi_core.engine.execution31143222
18 izwi_core.kv.resolved1222
19 izwi_core.kv.v2.descriptor151
20 izwi_core.runtime.adapters2124
21 izwi_core.kv.batch2
22 izwi_core.backends.kv3144
23 izwi_core.models.shared.attention.physical543
24 izwi_core.kv.v2.runtime186119823
25 izwi_core.models.architectures.fish_drama3.model132
26 izwi_core.models.architectures.qwen3.asr2431231114
27 izwi_core.models.architectures.qwen36moe.text133345
28 izwi_core.models.architectures.qwen38.chat115321213
29 izwi_core.models.registry121221333262232121
30 izwi_core.runtime.adapters.loaded82288122
31 izwi_core.runtime.coordinator35511622
32 izwi_core.runtime.types1111
33 izwi_core.models.architectures.qwen3.tts1152147121
34 izwi_core.engine.executor.state212212214
35 izwi_core.engine.request16729114117331
36 izwi_core.engine.cache.managed13317611
37 izwi_core.engine.executor22136247223631226
38 izwi_core.runtime.lifecycle.controller211111211111311
39 izwi_core.runtime.service21663153214571
40 izwi_server.state11251
Uses a module listed above itPart of a loopThe module itself
1 izwi_core.error2 izwi_core.performance3 izwi_core.tokenizer4 izwi_gateway.error5 izwi_model_catalog.backend6 izwi_serving_protocol.identity7 izwi_core.backends.device8 izwi_core.config9 izwi_core.engine.types10 izwi_core.kernels.cuda.shape_graphs11 izwi_core.kv.v2.contract12 izwi_core.models.architectures.fish_drama3.config13 izwi_core.models.shared.weights.gguf14 izwi_gateway.gateway15 izwi_model_catalog.catalog.metadata16 izwi_core.backends.state.tensor17 izwi_core.engine.execution18 izwi_core.kv.resolved19 izwi_core.kv.v2.descriptor20 izwi_core.runtime.adapters21 izwi_core.kv.batch22 izwi_core.backends.kv23 izwi_core.models.shared.attention.physical24 izwi_core.kv.v2.runtime25 izwi_core.models.architectures.fish_drama3.model26 izwi_core.models.architectures.qwen3.asr27 izwi_core.models.architectures.qwen36moe.text28 izwi_core.models.architectures.qwen38.chat29 izwi_core.models.registry30 izwi_core.runtime.adapters.loaded31 izwi_core.runtime.coordinator32 izwi_core.runtime.types33 izwi_core.models.architectures.qwen3.tts34 izwi_core.engine.executor.state35 izwi_core.engine.request36 izwi_core.engine.cache.managed37 izwi_core.engine.executor38 izwi_core.runtime.lifecycle.controller39 izwi_core.runtime.service40 izwi_server.stateizwi_core.error1izwi_core.performance2izwi_core.tokenizer3izwi_gateway.error4izwi_model_catalog.backend5izwi_serving_protocol.identity6izwi_core.backends.device7izwi_core.config8izwi_core.engine.types9izwi_core.kernels.cuda.shape_graphs10izwi_core.kv.v2.contract11izwi_core.models.architectures.fish_drama3.config12izwi_core.models.shared.weights.gguf13izwi_gateway.gateway14izwi_model_catalog.catalog.metadata15izwi_core.backends.state.tensor16izwi_core.engine.execution17izwi_core.kv.resolved18izwi_core.kv.v2.descriptor19izwi_core.runtime.adapters20izwi_core.kv.batch21izwi_core.backends.kv22izwi_core.models.shared.attention.physical23izwi_core.kv.v2.runtime24izwi_core.models.architectures.fish_drama3.model25izwi_core.models.architectures.qwen3.asr26izwi_core.models.architectures.qwen36moe.text27izwi_core.models.architectures.qwen38.chat28izwi_core.models.registry29izwi_core.runtime.adapters.loaded30izwi_core.runtime.coordinator31izwi_core.runtime.types32izwi_core.models.architectures.qwen3.tts33izwi_core.engine.executor.state34izwi_core.engine.request35izwi_core.engine.cache.managed36izwi_core.engine.executor37izwi_core.runtime.lifecycle.controller38izwi_core.runtime.service39izwi_server.state4011221111111831143222122215121242314454318611982313224312311141333451153212131212213332622321218228812235511622111111521471212122122141672911411733113317611221362472236312262111112111113112166315321457111251+1150 more modules (most-connected shown)

At a glance — Code Health · 55.2 · Adequate · gated by D2, R3, X4 ·

At a glance — Architecture · 91.8 · Exemplary ·

At a glance — Maturity · 84.1 · Exemplary ·

At a glance — Readiness · 66.8 · Adequate · gated by P7 ·

At a glance — Security · 83.4 · Adequate · gated by D29 ·

At a glance — Domain Modelling · 77.1 · Adequate · gated by DM2 ·

At a glance — Event Sourcing · 100.0 · Exemplary ·

At a glance — Accessibility · 93.0 · Exemplary ·

At a glance — Performance · 88.6 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A02:2025 — Security Misconfiguration45High / Critical
A05:2025 — Injection23High / Critical
A03:2025 — Software Supply Chain Failures9Medium
A07:2025 — Authentication Failures3High / Critical

Roadmap

Top priorities: Resolve the 2 Banned license finding(s) in License Compliance; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 2 Banned license finding(s) in License Compliance.+3.6 ptsLowLicense Compliance
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+2.9 ptsMediumLarge Files
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.+2.9 ptsMediumOutbound HTTP resilience
Interpolated log message defeats structured logging+2.8 ptsMediumStructured logging
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.+1.6 ptsMediumCode Duplication
Bring the 10 bodies over 120 down to 120 or less in Cognitive Complexity — start with Scheduler::schedule_inner (cognitive 252), ManagedKvCacheManager::prepare_inner (cognitive 243), NativeExecutor::voxtral_realtime_batch_with_managed (cognitive 233).+1.3 ptsHighCognitive Complexity
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.+1.3 ptsMediumIncompleteness & stubs
Adopt the repo's newtype typed-id idiom consistently — wrap every entity identity in its own newtype.+1.2 ptsMediumStrongly-typed ids

File quality

Per-file score 0–10 — a quality signature. Of 471 files carrying findings, judged against the Preview bar: 1% slop · 3% mixed · 96% near-clean.

FileScoreBandWorst signal
REDACTED1.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.8SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.8SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
crates/izwi-model-catalog/src/catalog/variant.rs4.8MixedCyclomatic Complexity: izwi_model_catalog::catalog::variant::resolve_by_heuristic (cyclomatic 89)
REDACTED5.1MixedDependency Vulnerabilities: Medium vulnerability: REDACTED
crates/izwi-model-catalog/src/catalog/metadata.rs5.5MixedGod Classes: ClassTooLong: ModelVariant
crates/izwi-gateway/src/gateway.rs5.5MixedGod Classes: FileTooLong: src/gateway.rs
ui/src/features/text-to-speech/route.tsx5.7MixedCyclomatic Complexity: route.TextToSpeechPage (cyclomatic 94)
crates/izwi-core/src/engine/request.rs5.7MixedGod Classes: TooManyMethods: EngineCoreRequest
REDACTED5.8MixedSecrets (history): REDACTED: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
ui/src/features/models/catalog/modelMetadata.ts5.9MixedCyclomatic Complexity: modelMetadata.getModelProviderLabel (cyclomatic 23)
crates/izwi-core/src/runtime/lifecycle/controller.rs5.9MixedGod Classes: TooManyMethods: ModelLifecycleController
crates/izwi-server/src/api/chat/handlers.rs6.3MixedCognitive Complexity: izwi_server::api::chat::handlers::create_streaming_thread_message (cognitive 16)
crates/izwi-core/src/engine/scheduler/mod.rs7.0Near-cleanCyclomatic Complexity: Scheduler::schedule_inner (cyclomatic 159)
crates/izwi-core/src/artifacts/downloader.rs7.0Near-cleanCyclomatic Complexity: ModelDownloader::get_single_file_size_estimate (cyclomatic 100)
crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs7.0Near-cleanCyclomatic Complexity: NativeExecutor::voxtral_realtime_batch_with_managed (cyclomatic 92)

How the grades work

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 — 27

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 — 3244

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 — 170

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 9

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 92 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, 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 — 92 dimensions across the health lenses
D1D2D3D4D5D6D7D10D12D13D14D15D17D19D20D23D24D26D28D29D30D31D34D35D36D40D41D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX5AX8AX9C2DM1DM2DM4DM5DM6ES1ES2GD1IC1M1M2M3M4P1P10P2P3P4P5P6P7PF1PF3R1R10R2R3R4R5R6R7R8R9S1X1X12X13X14X15X16X17X18X2X21X23X25X28X29X30X4X5

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
  1. 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, 3406 of 3441 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1e78c-2442-7fde-9b84-3457c1ed775b.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

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: this repository's production source spans .ts, .tsx, .rs, and our analyzer cannot run the .rs test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 76.9% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • D10 Test Quality — 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. The 831 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 122 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • 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 reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in ui/ (850 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D14 License Compliance — 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. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — 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. Single-maintainer repository — bus factor is not applicable (2 contributor(s) across 1624 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 1 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — 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. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • 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 per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): 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 — 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — 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. `ui/src/features/chat/components/ChatPlayground.tsx`, `ui/src/features/voice/useVoiceSession.ts` 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.
  • 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXR1 Runtime accessibility — 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. Render strategy: boot via DockerCompose (docker-compose.yml). compose up failed (exit -1 — compose exited without a cause this engine recognises) — Tool stalled (no output) after 00:08:15.0255120.; runtime evidence skipped.
  • IC1 Incompleteness & stubs — 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. 42 further occurrence(s) are not listed individually; the score already reflects all 82.
  • 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.
  • P8 Schema migrations — 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. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
  • R10 Code Duplication — 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. 58 further occurrence(s) are not listed individually; the score already reflects all 98.
  • R2 Cyclomatic Complexity — 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. 76 further occurrence(s) are not listed individually; the score already reflects all 116.
  • X10 Duplicated predicate — 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. 40 further occurrence(s) are not listed individually; the score already reflects all 80.
  • X18 Disposal-pattern correctness — 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. 15 further occurrence(s) are not listed individually; the score already reflects all 55.
  • 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X25 Inert configuration knob — 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. 57 further occurrence(s) are not listed individually; the score already reflects all 97.
  • X3 Exception handling — 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — 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. 13 further occurrence(s) are not listed individually; the score already reflects all 53.
  • X4 Structured logging — 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. 289 further occurrence(s) are not listed individually; the score already reflects all 329.
  • X5 Nullable reference types — 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. 756 further occurrence(s) are not listed individually; the score already reflects all 796.

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.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED 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").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • 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.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • 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.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • 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.
  • D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
  • D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • 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.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • 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.

Dimensions

D1 · Cyclomatic Complexity5.5 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 5.5 / 10 · rule-coverage 100% · ceiling Prevented

306 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was NewTextToSpeechModal.NewTextToSpeechModal at 167. A further 22 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 ModelVariant::display_name at 57 — they are counted neither in the figure above nor in this dimension's score. 9 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: crates/izwi-model-catalog/src/catalog/metadata.rs (ModelVariant::display_name at 57), crates/izwi-cli/src/config.rs (Config::set_value at 30), crates/izwi-core/src/runtime/adapters/table.rs (LoadedAdapterKind::factory_id at 28), crates/izwi-db/src/storage_layout.rs (izwi_db::storage_layout::media_extension_for_content_type at 26), crates/izwi-core/src/error.rs (Error::replicate at 20), and 4 more not listed here. 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.

NativeExecutor::voxtral_realtime_batch_with_managed (cyclomatic 92) · ×49crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs:6
izwi_server::app::voice_realtime::map_typed_voice_event (cyclomatic 49) · ×30crates/izwi-server/src/app/voice_realtime/mod.rs:3936
izwi_core::runtime::service::bind_request_to_residency (cyclomatic 32) · ×24crates/izwi-core/src/runtime/service.rs:1062
izwi_cli::commands::bench::print_asr_stage_timing_summary (cyclomatic 76) · ×9crates/izwi-cli/src/commands/bench.rs:4536
izwi_gateway::roles::gateway::gateway_state (cyclomatic 42) · ×9crates/izwi-gateway/src/roles/gateway.rs:203

+ 141 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 3 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with NewTextToSpeechModal.NewTextToSpeechModal (cyclomatic 167), Scheduler::schedule_inner (cyclomatic 159), route.TranscriptionPage (cyclomatic 127). — 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 3 together lifts Cyclomatic Complexity from 5.5 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity3.7 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 3.7 / 10 · rule-coverage 100% · ceiling Prevented

454 method(s) exceeded the cognitive complexity threshold of 15; the worst was Scheduler::schedule_inner at 252.

izwi_core::kernels::cuda::graphs_region::device::run (cognitive 48) · ×55crates/izwi-core/src/kernels/cuda/graphs_region.rs:238
NativeExecutor::voxtral_realtime_batch_with_managed (cognitive 233) · ×51crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs:6
izwi_server::api::tts_long_form::generate_speech_plan_stream_with_progress (cognitive 111) · ×40crates/izwi-server/src/api/tts_long_form.rs:1130
izwi_cli::commands::bench::print_asr_stage_timing_summary (cognitive 82) · ×20crates/izwi-cli/src/commands/bench.rs:4536
izwi_gateway::app::realtime_translate::run_translate_session (cognitive 90) · ×14crates/izwi-gateway/src/app/realtime_translate.rs:287

+ 187 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 10 bodies over 120 down to 120 or less in Cognitive Complexity — start with Scheduler::schedule_inner (cognitive 252), ManagedKvCacheManager::prepare_inner (cognitive 243), NativeExecutor::voxtral_realtime_batch_with_managed (cognitive 233). — 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 10 together lifts Cognitive Complexity from 3.7 to about 4.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.5 / 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.

Maturity: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 100% · ceiling Prevented

622 god class(es) detected.

MethodTooLong: Engine.retain_incremental_model_identity · ×198crates/izwi-core/src/engine/mod.rs:1795
FileTooLong: commands/bench.rs · ×185crates/izwi-cli/src/commands/bench.rs
FunctionTooLong: ChatPlayground.ChatPlayground · ×155ui/src/features/chat/components/ChatPlayground.tsx:167
ClassTooLong: Scheduler · ×39crates/izwi-core/src/engine/scheduler/mod.rs:438
TooManyMethods: RuntimeService · ×21crates/izwi-core/src/runtime/service.rs:1010

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 198 MethodTooLong finding(s) in God Classes — start with handler_tts.rs (12), tts_preparation.rs (11), asr_preparation.rs (10). — One of this dimension's main actionable groups (198 warning-level).
  2. Resolve the 185 FileTooLong finding(s) in God Classes — start with mod.rs (7), handlers.rs (6), lib.rs (5). — One of this dimension's main actionable groups (185 warning-level).
  3. Resolve the 155 FunctionTooLong finding(s) in God Classes — start with handlers.rs (13), route.tsx (10), mod.rs (8). — One of this dimension's main actionable groups (155 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication8.4 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.4 / 10 · rule-coverage 100% · ceiling Verified

937 duplicated block group(s) detected. 3.9 % of the production lines (35,312 of 900,289) are in a reported copy. A further 427 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 31 of the 1364 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.

Duplicated block (7 lines × 2) · ×63crates/izwi-cli/src/commands/bench.rs:1855
Duplicated block (8 lines × 2) · ×62crates/izwi-core/src/engine/cache/coordinator.rs:476
Duplicated block (9 lines × 2) · ×58crates/izwi-core/src/artifacts/downloader.rs:2012
Duplicated block (6 lines × 2) · ×50crates/izwi-cli/src/commands/bench.rs:2911
Duplicated block (10 lines × 2) · ×49crates/izwi-cli/src/commands/bench.rs:2330

+ 331 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 63 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with moe.rs (6), cuda.rs (5), bench.rs (2). — One of this dimension's main actionable groups (63 warning-level).
  2. Resolve the 62 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with lfm25_audio.rs (5), cuda.rs (5), continuous.rs (3). — One of this dimension's main actionable groups (62 warning-level).
  3. Resolve the 58 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with asr.rs (4), metal_qwen36moe.rs (3), downloader.rs (2). — One of this dimension's main actionable groups (58 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling5.7 / 10Adequate✓ 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.

Maturity: Documented → Verified → Prevented · effective 5.7 / 10 · rule-coverage 100% · ceiling Prevented

21 production modules (Cargo+npm), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 10 module(s) off the main sequence.

Off the main sequence: izwi-db · ×10
Unstable project izwi-gateway

What to do

  1. Resolve the 10 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 1 Unstable project izwi-gateway 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.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 6 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

6 of 614 classes have LCOM4 above 3.

Low cohesion: GatewayState (LCOM4 9) · ×6crates/izwi-gateway/src/gateway.rs:58

What to do

  1. Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with gateway.rs, request.rs, controller.rs. — One of this dimension's main actionable groups (6 warning-level).

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Prevented

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ 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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 831 tests. Measured on the JavaScript/TypeScript suite only — at least 122 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.

Mock-dominated test: reconnects durable speech from consumed PCM without restarting playback or duplicating chunks · ×25ui/src/shared/api/audio.test.ts:274

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D12 · Dependency Hygiene9.2 9.0 / 10Strong✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 98% · ceiling Verified

17 outdated, 0 yanked direct Cargo dependencies. 106 of 108 direct crates were graded against crates.io (0 not published there, 2 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.

Outdated: clap · ×17

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Verified

2 of 884 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

Banned license: mp3lame-encoder · ×2

What to do

  1. Resolve the 2 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (2 issue-level).

Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots9.5 / 10Stronggated by 125 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: ui/src/features/chat/components/ChatPlayground.tsx (10×280=2800); crates/izwi-core/src/engine/scheduler/mod.rs (17×159=2703); crates/izwi-core/src/artifacts/downloader.rs (22×100=2200)

Hotspot: ui/src/features/chat/components/ChatPlayground.tsx · ×125ui/src/features/chat/components/ChatPlayground.tsx:167

What to do

  1. Resolve the 125 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (9), route.tsx (7), handlers.rs (4). — One of this dimension's main actionable groups (125 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 deducted task-comment markers across 900289 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.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 74 document(s) read across 2 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 of 1 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D23 · Boundary Type-Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.

Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.

Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

No domain types leak across context boundaries (2 contexts). Contexts: izwi-agent, izwi-server.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value10.0 10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 of 374 judged comments only repeat the code they sit on (0.0 %). 1 comment(s) in another language or script were not judged.

doc comments repeat the namesui/src/features/text-to-speech/take.ts:34

✓ On the Gold path — maintain.

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion6.4 / 10Adequate✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

Maturity: Documented → Verified → Prevented · effective 6.4 / 10 · rule-coverage 100% · ceiling Documented

4 of 22 build units (Cargo, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×4crates/izwi-core/Cargo.toml:1

What to do

  1. Resolve the 4 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Cargo.toml (3), package.json. — One of this dimension's main actionable groups (4 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED 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.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)0.5 / 10Critical✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 0.5 / 10 · rule-coverage 100% · ceiling Documented

23 finding(s): 0 critical, 15 high, 8 medium, 0 low. semgrep hit a parse error in 25 file(s) — `Dockerfile` (lines 44–286), `crates/izwi-audio-codec/src/mp3.rs` (line 40, line 41, line 63, …), `crates/izwi-core/src/models/architectures/qwen36moe/text.rs` (line 1986), `crates/izwi-dictation/src/insert/windows.rs` (line 285), `crates/izwi-gateway/src/app/chat.rs` (line 1732), … (+20 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 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
REDACTED
REDACTED
REDACTED

+ 4 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities8.5 / 10Strong✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 100% · ceiling Documented

9 finding(s): 0 critical, 0 high, 8 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 5 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
  2. Resolve the 1 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security5.3 / 10Adequate✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 5.3 / 10 · rule-coverage 100% · ceiling Documented

45 finding(s): 0 critical, 2 high, 39 medium, 4 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 39 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (20), REDACTED (19). — One of this dimension's main actionable groups (39 warning-level).
  2. Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 4 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 recommendation-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 1084 of the 1295 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.9 / 10Stronggated by 9 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: publish.rs↔metadata.rs 74%; completions.rs↔handlers.rs 74%; metadata.rs↔types.ts 68%

Change coupling: publish.rs ↔ metadata.rs · ×9crates/izwi-core/src/runtime/lifecycle/publish.rs:1

What to do

  1. Resolve the 9 Change coupling finding(s) in Change Coupling — start with route.tsx (2), variant.rs (2), publish.rs. — One of this dimension's main actionable groups (9 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Build pipeline generates provenance, signs artifacts and produces an SBOM.

✓ On the Gold path — maintain.

Detailed fixes: d36_recommendation.md.

D40 · Network Egress Confinement6.0 / 10Adequate✓ Tool-verified

What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

0/2 network-egress controls present (network policy, egress restriction).

No network policy

What to do

  1. Resolve the 1 No network policy finding(s) in Network Egress Confinement. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d40_recommendation.md · top locations in Appendix A, every location in findings.md.

D41 · Kernel & Syscall Confinement6.0 / 10Adequate✓ Tool-verified

What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

0/2 workload(s) run every container under a seccomp profile; 0/2 declare an AppArmor/SELinux profile.

No seccomp profile · ×2REDACTED:59

What to do

  1. Resolve the 2 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 recommendation-level).

Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

AC2 · Forms & labels7.7 / 10Strong✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. — ui/src/features/chat/components/ChatPlayground.tsx:1732

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC4 · Keyboard semantics10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AX10 · Code composition9.1 / 10Exemplary✓ Tool-verified

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.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

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.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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.

  • `ModelDownloader.get_file_download_plans` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — crates/izwi-core/src/artifacts/downloader.rs:3014

What to do

  • Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

DM1 · Aggregate boundaries10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether an aggregate references another aggregate by identity rather than embedding it by object reference.

Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.

Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.

DM2 · Strongly-typed ids3.0 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether domain identifiers are strongly typed (a newtype wrapper) rather than raw primitives — consistency once an idiom exists.

Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.

Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.

  • `TurnTrace.trace_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — crates/izwi-server/src/app/agent_runtime.rs:566
  • `TurnTrace.span_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — crates/izwi-server/src/app/agent_runtime.rs:567
  • `Session.correlation_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — crates/izwi-server/src/app/openai_realtime/connection.rs:92
  • `Session.conversation_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — crates/izwi-server/src/app/openai_realtime/connection.rs:97

What to do

  • Adopt the repo's newtype typed-id idiom consistently — wrap every entity identity in its own newtype.
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.

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.

DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.

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.

DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.

Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.

Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Rust: functions whose whole body is still `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs5.8 / 10Adequate✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Rust: functions whose body is `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, match arms and branches left as `todo!()`, functions that take inputs and return a constant (`Ok(())`, `None`, `Default::default()`, an empty `Vec`) or do nothing, and impls most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • `impl Theme` has 4 unfinished methods out of 6 — a scaffolded type that was never implemented. — crates/izwi-cli/src/style.rs:44
  • `success` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/izwi-cli/src/style.rs:63
  • `warning` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/izwi-cli/src/style.rs:67
  • `info` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/izwi-cli/src/style.rs:71
  • `step` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/izwi-cli/src/style.rs:75
  • `print_error` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/izwi-cli/src/style.rs:81
  • `certified_mixed_step` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/izwi-core/src/catalog/mixed_step.rs:28
  • `finish_scheduled_execution` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/engine/executor/dispatch.rs:1568
  • `qwen_tts_request_with_managed_cache` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/engine/executor/handler_tts.rs:2834
  • `tts_decode_batch_with_managed` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/engine/executor/handler_tts.rs:4125
  • `qwen_tts_audio_batch` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/engine/executor/handler_tts.rs:4449
  • `qwen_tts_finalize_request` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/engine/executor/handler_tts.rs:4553
  • `saturating_atomic_sub` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/izwi-core/src/engine/metrics.rs:1410
  • `project_paged_state_input` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/engine/request/state_binding.rs:236
  • `provider_auto_preferred` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/izwi-core/src/kernels/cuda/fp8.rs:61
  • `conv_decode` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/kernels/cuda/gdn.rs:106
  • `recurrent_decode` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/kernels/cuda/gdn.rs:190
  • `conv_span` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/kernels/cuda/gdn.rs:282
  • `recurrent_span` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/kernels/cuda/gdn.rs:353
  • `route` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/kernels/cuda/moe.rs:461
  • `fp8_gate_up` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/kernels/cuda/moe.rs:514
  • `fp8_down` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/kernels/cuda/moe.rs:579
  • `qk_norm_rope` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/kernels/cuda/rope.rs:124
  • `validate` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. (×2) — crates/izwi-core/src/kv/v2/contract.rs:298, crates/izwi-core/src/kv/v2/contract.rs:882
  • `require` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×2) — crates/izwi-core/src/models/architectures/fish_drama3/config.rs:468, crates/izwi-core/src/models/architectures/nemotron_transcribe/config.rs:417
  • `trunk_config` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/fish_drama3/config.rs:669
  • `trace_timings` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/izwi-core/src/models/architectures/fish_s2/retained.rs:1102
  • `retained_preparation_geometry_for_features` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:833
  • `prepare_prompt_artifact_batch_from_features` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:1230
  • `expand_audio_tokens` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×2) — crates/izwi-core/src/models/architectures/granite_speech/asr/runtime.rs:1402, crates/izwi-core/src/models/architectures/granite_speech/asr/runtime.rs:1414
  • `prepared_from_phonemes` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/kokoro/mod.rs:779
  • `reply_request` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/lfm3_audio/model.rs:349
  • `check_release_config` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/maya2/config.rs:270
  • `validate` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/maya2/text/tn.rs:401
  • `ctc_geometry` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/nemotron_transcribe/checkpoint.rs:463
  • `tokenize_prompt` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/nemotron_transcribe/prompt.rs:362
  • `prepare_audio_prompt_embeddings` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/izwi-core/src/models/architectures/qwen3/asr/mod.rs:3044

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
M1 · Documentation (README)6.8 / 10Strong✓ Tool-verified

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.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation8.0 / 10Strong✓ Tool-verified

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.

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

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.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

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.

P2 · Observability9.5 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 9/11 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/izwi-desktop`, `crates/izwi-serving-protocol`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

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.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P5 · DR & Backup7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/izwi-desktop/src/app/downloads.rs:93

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

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.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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.

R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

R10 · Code Duplication5.2 / 10Adequate✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 72 duplicated blocks under ui/src/features/ have copies in at least two of the sibling directories chat, diarization, dictation, models, speech-text, studio (+5 more sibling(s) not listed) — 31 of them are reported below, and 41 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 72 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 72 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 72 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:139
  • 27 duplicated blocks under ui/src/ have copies in at least two of the sibling directories app, components, features, hooks, shared, utils — 12 of them are reported below, and 15 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 27 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 27 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 27 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — ui/src/components/DiarizationReviewWorkspace.tsx:188
  • ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:139 · ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:190 — the two spans are one implementation copied and then locally edited — 860 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:139
  • ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:128 · ui/src/features/voice-studio/components/DesignVoiceDialog.tsx:76 — the two spans are one implementation copied and then locally edited — 868 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:128
  • ui/src/components/DiarizationReviewWorkspace.tsx:188 · ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:115 — the two spans are one implementation copied and then locally edited — 759 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/components/DiarizationReviewWorkspace.tsx:188
  • ui/src/utils/diarizationExport.ts:33 · ui/src/utils/transcriptionExport.ts:30 — the two spans are one implementation copied and then locally edited — 780 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/utils/diarizationExport.ts:33
  • ui/src/components/ui/dialog.tsx:10 · ui/src/components/ui/sheet.tsx:11 — the two spans are one implementation copied and then locally edited — 490 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/components/ui/dialog.tsx:10
  • ui/src/features/diarization/components/DiarizationRecordDetail.tsx:300 · ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:249 — the two spans are one implementation copied and then locally edited — 328 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/features/diarization/components/DiarizationRecordDetail.tsx:300
  • ui/src/features/diarization/components/NewDiarizationModal.tsx:448 · ui/src/features/transcription/components/NewTranscriptionModal.tsx:478 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/diarization/components/NewDiarizationModal.tsx:448
  • ui/src/features/speech-text/hooks/useSpeechTextRecord.ts:41 · ui/src/features/text-to-speech/hooks/useTextToSpeechRecord.ts:16 — the two spans are one implementation copied and then locally edited — 371 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/features/speech-text/hooks/useSpeechTextRecord.ts:41
  • ui/src/features/text-to-speech/route.tsx:556 · ui/src/features/transcription/route.tsx:898 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/text-to-speech/route.tsx:556
  • ui/src/features/voices/route.tsx:146 · ui/src/hooks/usePolledCursorHistory.ts:92 — the two spans are one implementation copied and then locally edited — 361 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/features/voices/route.tsx:146
  • ui/src/shared/api/chat.ts:687 · ui/src/shared/api/chat.ts:831 — the two spans are one implementation copied and then locally edited — 245 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/shared/api/chat.ts:687
  • ui/src/features/settings/route.tsx:828 · ui/src/features/settings/route.tsx:883 · ui/src/features/settings/route.tsx:978 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — ui/src/features/settings/route.tsx:828
  • ui/src/features/diarization/route.tsx:100 · ui/src/features/transcription/route.tsx:412 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — ui/src/features/diarization/route.tsx:100
  • ui/src/features/studio/components/StudioVoicePicker.tsx:182 · ui/src/features/voice/components/VoiceSettingsSheet.tsx:254 — the two spans are one implementation copied and then locally edited — 179 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/features/studio/components/StudioVoicePicker.tsx:182
  • ui/src/features/voice/realtime/support.ts:1240 · ui/src/shared/audioUpload.ts:196 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/voice/realtime/support.ts:1240
  • ui/src/app/providers/AppUpdateProvider.tsx:361 · ui/src/app/providers/ModelCatalogProvider.tsx:1175 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/app/providers/AppUpdateProvider.tsx:361
  • ui/src/features/diarization/components/DiarizationRecordDetail.tsx:548 · ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:467 · ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:504 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/diarization/components/DiarizationRecordDetail.tsx:548
  • ui/src/app/providers/ModelCatalogProvider.tsx:1175 · ui/src/features/voice/useVoicePreferences.ts:238 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/app/providers/ModelCatalogProvider.tsx:1175
  • ui/src/features/voice/realtime/support.ts:471 · ui/src/shared/audioUpload.ts:1 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/voice/realtime/support.ts:471
  • ui/src/components/ui/dropdown-menu.tsx:48 · ui/src/components/ui/dropdown-menu.tsx:84 — the two spans are one implementation copied and then locally edited — 179 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/components/ui/dropdown-menu.tsx:48
  • ui/src/features/text-to-speech/support.ts:49 · ui/src/features/transcription/playground/support.ts:158 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/text-to-speech/support.ts:49
  • ui/src/shared/api/audio.ts:2896 · ui/src/shared/api/audio.ts:3024 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/shared/api/audio.ts:2896
  • ui/src/components/DiarizationExportDialog.tsx:73 · ui/src/features/transcription/components/TranscriptionExportDialog.tsx:52 — the two spans are one implementation copied and then locally edited — 170 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/components/DiarizationExportDialog.tsx:73
  • ui/src/features/diarization/components/NewDiarizationModal.tsx:906 · ui/src/features/diarization/components/NewDiarizationModal.tsx:937 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — ui/src/features/diarization/components/NewDiarizationModal.tsx:906
  • ui/src/features/settings/route.tsx:555 · ui/src/features/settings/route.tsx:586 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/settings/route.tsx:555
  • ui/src/features/settings/route.tsx:672 · ui/src/features/settings/route.tsx:705 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/settings/route.tsx:672
  • ui/src/shared/api/audio.ts:1542 · ui/src/shared/api/audio.ts:3153 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/shared/api/audio.ts:1542
  • ui/src/shared/api/audio.ts:1416 · ui/src/shared/api/audio.ts:1471 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/shared/api/audio.ts:1416
  • ui/src/shared/api/audio.ts:1749 · ui/src/shared/api/audio.ts:2551 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/shared/api/audio.ts:1749
  • ui/src/shared/api/audio.ts:2463 · ui/src/shared/api/audio.ts:2496 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/shared/api/audio.ts:2463
  • ui/src/features/diarization/components/NewDiarizationModal.tsx:236 · ui/src/features/transcription/components/NewTranscriptionModal.tsx:183 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/features/diarization/components/NewDiarizationModal.tsx:236
  • ui/src/shared/api/audio.ts:2214 · ui/src/shared/api/audio.ts:2408 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/shared/api/audio.ts:2214
  • ui/src/shared/api/audio.ts:3224 · ui/src/shared/api/audio.ts:3291 · ui/src/shared/api/audio.ts:3346 · ui/src/shared/api/audio.ts:3419 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — ui/src/shared/api/audio.ts:3224
  • ui/src/features/diarization/components/NewDiarizationModal.tsx:756 · ui/src/features/transcription/components/NewTranscriptionModal.tsx:673 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — ui/src/features/diarization/components/NewDiarizationModal.tsx:756
  • ui/src/shared/api/audio.ts:2110 · ui/src/shared/api/audio.ts:2183 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — ui/src/shared/api/audio.ts:2110
  • ui/src/features/chat/playground/support.ts:349 · ui/src/features/chat/playground/support.ts:405 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — ui/src/features/chat/playground/support.ts:349
  • ui/src/features/diarization/components/DiarizationRecordDetail.tsx:413 · ui/src/features/diarization/components/DiarizationRecordDetail.tsx:432 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — ui/src/features/diarization/components/DiarizationRecordDetail.tsx:413
  • ui/src/features/transcription/playground/support.ts:80 · ui/src/utils/diarizationSummary.ts:3 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — ui/src/features/transcription/playground/support.ts:80

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity7.0 / 10Strong✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • NewTextToSpeechModal has cyclomatic complexity 96 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:144
  • (anonymous) has cyclomatic complexity 84 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/voice/useVoiceSession.ts:613
  • isVoiceRealtimeV2ServerEnvelope has cyclomatic complexity 83 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/voice/realtime/support.ts:664
  • AssistantMessage has cyclomatic complexity 68 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/chat/components/messages/AssistantMessage.tsx:87
  • NewDiarizationModal has cyclomatic complexity 57 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/diarization/components/NewDiarizationModal.tsx:137
  • SettingsPage has cyclomatic complexity 51 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/settings/route.tsx:462
  • ChatPlayground has cyclomatic complexity 49 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/chat/components/ChatPlayground.tsx:167
  • normalizeVoiceRealtimeV2Event has cyclomatic complexity 49 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/voice/realtime/support.ts:842
  • NewTranscriptionModal has cyclomatic complexity 46 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/transcription/components/NewTranscriptionModal.tsx:121
  • isVoiceRealtimeServerEvent has cyclomatic complexity 46 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/voice/realtime/support.ts:1017
  • DiarizationRecordDetail has cyclomatic complexity 43 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/diarization/components/DiarizationRecordDetail.tsx:66
  • CloneVoiceDialog has cyclomatic complexity 42 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:134
  • TextToSpeechRecordDetail has cyclomatic complexity 42 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:126
  • TranscriptionRecordDetail has cyclomatic complexity 41 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:176
  • renderComposer has cyclomatic complexity 41 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/chat/components/ChatPlayground.tsx:1669
  • parseUserMessageDisplayFromContentParts has cyclomatic complexity 39 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/chat/playground/support.ts:760
  • TranscriptionPage has cyclomatic complexity 39 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/transcription/route.tsx:96
  • ModelListRow has cyclomatic complexity 38 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/models/components/ModelListRow.tsx:186
  • TranscriptionReviewWorkspace has cyclomatic complexity 37 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:80
  • AppShell has cyclomatic complexity 36 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/app/layouts/AppLayout.tsx:149
  • DictationSettingsView has cyclomatic complexity 36 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/dictation/route.tsx:271
  • VoicesPage has cyclomatic complexity 31 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/voices/route.tsx:118
  • SetupChecklist has cyclomatic complexity 29 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/dictation/components/SetupChecklist.tsx:119
  • (anonymous) has cyclomatic complexity 27 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/app/providers/AppUpdateProvider.tsx:135
  • FirstRunOnboarding has cyclomatic complexity 27 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/app/onboarding/FirstRunOnboarding.tsx:210
  • VoicePage has cyclomatic complexity 26 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/voice/route.tsx:73
  • DiarizationReviewWorkspace has cyclomatic complexity 26 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/components/DiarizationReviewWorkspace.tsx:165
  • MyModelsPage has cyclomatic complexity 26 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/models/route.tsx:153
  • (anonymous) has cyclomatic complexity 26 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:552
  • documentTitleForLocation has cyclomatic complexity 26 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/app/router/routePresentation.ts:27
  • aggregateRawSpeakerSummaries has cyclomatic complexity 25 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:205
  • NotificationItem has cyclomatic complexity 25 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/app/providers/NotificationItem.tsx:51
  • startStream has cyclomatic complexity 24 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/shared/api/audio.ts:1821
  • parseVoiceAgentSettings has cyclomatic complexity 24 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/voice/agentSettings.ts:104
  • RuntimeCard has cyclomatic complexity 23 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/app/layouts/RuntimeCard.tsx:25
  • getModelProviderLabel has cyclomatic complexity 23 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/models/catalog/modelMetadata.ts:44
  • SpeechTextUploadProgress has cyclomatic complexity 22 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/speech-text/components/SpeechTextUploadProgress.tsx:62
  • (anonymous) has cyclomatic complexity 22 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/components/DiarizationQualityPanel.tsx:95
  • (anonymous) has cyclomatic complexity 21 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/transcription/components/NewTranscriptionModal.tsx:308
  • ScriptParagraph has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — ui/src/features/studio/components/ScriptParagraph.tsx:95
R3 · Large Files3.8 / 10Weak✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • ui/src/shared/api/audio.ts has 3146 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/shared/api/audio.ts:1
  • ui/src/features/chat/components/ChatPlayground.tsx has 2276 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/chat/components/ChatPlayground.tsx:1
  • ui/src/features/voice/useVoiceSession.ts has 1289 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/voice/useVoiceSession.ts:1
  • ui/src/features/transcription/route.tsx has 1218 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/transcription/route.tsx:1
  • ui/src/features/voice/realtime/support.ts has 1214 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/voice/realtime/support.ts:1
  • ui/src/app/providers/ModelCatalogProvider.tsx has 1134 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/app/providers/ModelCatalogProvider.tsx:1
  • ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx has 1103 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:1
  • ui/src/features/settings/route.tsx has 1094 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/settings/route.tsx:1
  • ui/src/features/diarization/components/NewDiarizationModal.tsx has 967 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/diarization/components/NewDiarizationModal.tsx:1
  • ui/src/shared/api/chat.ts has 877 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/shared/api/chat.ts:1
  • ui/src/features/transcription/components/NewTranscriptionModal.tsx has 865 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/transcription/components/NewTranscriptionModal.tsx:1
  • ui/src/types.ts has 839 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/types.ts:1
  • ui/src/features/dictation/route.tsx has 837 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/dictation/route.tsx:1
  • ui/src/app/onboarding/FirstRunOnboarding.tsx has 764 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/app/onboarding/FirstRunOnboarding.tsx:1
  • ui/src/features/voice-studio/components/CloneVoiceDialog.tsx has 759 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:1
  • ui/src/features/voice/components/VoiceSettingsSheet.tsx has 735 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/voice/components/VoiceSettingsSheet.tsx:1
  • ui/src/features/voices/route.tsx has 716 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/voices/route.tsx:1
  • ui/src/features/models/catalog/modelMetadata.ts has 704 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/models/catalog/modelMetadata.ts:1
  • ui/src/features/text-to-speech/route.tsx has 636 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/text-to-speech/route.tsx:1
  • ui/src/components/DiarizationReviewWorkspace.tsx has 629 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/components/DiarizationReviewWorkspace.tsx:1
  • ui/src/features/studio/components/StudioEditor.tsx has 610 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/studio/components/StudioEditor.tsx:1
  • ui/src/features/diarization/components/DiarizationRecordDetail.tsx has 557 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/diarization/components/DiarizationRecordDetail.tsx:1
  • ui/src/features/models/route.tsx has 538 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/models/route.tsx:1
  • ui/src/app/layouts/AppLayout.tsx has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/app/layouts/AppLayout.tsx:1
  • ui/src/features/transcription/components/TranscriptionRecordDetail.tsx has 519 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:1
  • ui/src/features/transcription/components/TranscriptionHistoryTable.tsx has 517 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/transcription/components/TranscriptionHistoryTable.tsx:1
  • ui/src/app/onboarding/firstRunPlan.ts has 495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/app/onboarding/firstRunPlan.ts:1
  • ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx has 486 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:1
  • ui/src/features/voice-studio/components/DesignVoiceDialog.tsx has 482 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/voice-studio/components/DesignVoiceDialog.tsx:1
  • ui/src/features/voice/components/VoiceAgentSettings.tsx has 474 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/voice/components/VoiceAgentSettings.tsx:1
  • ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx has 458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx:1
  • ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx has 453 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:1
  • ui/src/features/studio/components/ScriptParagraph.tsx has 451 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/studio/components/ScriptParagraph.tsx:1
  • ui/src/features/text-to-speech/components/DialogueEditor.tsx has 416 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/text-to-speech/components/DialogueEditor.tsx:1
  • ui/src/features/transcription/transcript.ts has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ui/src/features/transcription/transcript.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.7 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×6) — ui/src/components/GenerationStats.tsx:1, ui/src/utils/useDownloadIndicator.ts:1, ui/src/components/ui/Waveform.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness8.2 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code9.3 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • 1 file(s) (~22 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
  • Unreachable from the 16 application, 6 tooling and 114 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (16 application, 6 tooling, 114 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×5) — ui/src/components/GenerationStats.tsx, ui/src/utils/useDownloadIndicator.ts, ui/src/components/ui/Waveform.tsx, …
  • Nothing imports this binding — it is safe to review for removal. (×10) — ui/src/app/analytics/client.ts:12, ui/src/features/chat/playground/support.ts:189, ui/src/features/text-to-speech/support.ts:52, …

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

S1 · Web-Security Posture9.5 / 10Exemplary✓ Tool-verified

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (crates/izwi-serving-worker/src/main.rs:436)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • Set: Content-Security-Policy, Referrer-Policy, X-Content-Type-Options, X-Frame-Options. Missing: Strict-Transport-Security — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−0.5 on this card.) The server: `axum::serve(` (crates/izwi-serving-worker/src/main.rs:436).

What to do

  • Add Strict-Transport-Security beside the headers the Rust server already sets.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document2.7 / 10Weak✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `session_spec` is public, takes a document from its caller (line 86) and hands it to `merge`, which calls itself at line 126 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `merge` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/izwi-server/src/app/media_stream.rs:126
  • `write_python_json` is public and takes `value: &Value` from its caller, and it calls itself at line 19 with a piece of the document (and at line 31) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `write_python_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/izwi-model-catalog/src/chat/tools/json.rs:19

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness4.2 / 10Weak✓ Tool-verified

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

  • `std::mem::forget(permit)` (line 1914) takes `permit` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-serving-worker/src/lib.rs:1914
  • `std::mem::forget(permit)` (line 2015) takes `permit` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-serving-worker/src/lib.rs:2015
  • `metrics` (line 775) is a `TtsRequestMetrics` released by `complete()` only on the path that reaches line 807; the `return` on line 809 leaves before that with a success value, and on that path `TtsRequestMetrics` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/runtime/tts.rs:775
  • `std::mem::forget(residency_lease)` (line 383) takes `residency_lease` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/runtime/service/driver.rs:383
  • `std::mem::forget(job)` (line 386) takes `job` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/runtime/service/driver.rs:386
  • `std::mem::forget(engine_session)` (line 517) takes `engine_session` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/runtime/asr/realtime_session.rs:517
  • `std::mem::forget(cleanup)` (line 520) takes `cleanup` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/runtime/asr/realtime_session.rs:520
  • `completions` (line 535) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 579; the `return` on line 561 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/voxtral/lm.rs:535
  • `reference_completions` (line 873) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/voxtral/lm.rs:873
  • `std::mem::forget(graph)` (line 295) takes `graph` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/models/architectures/qwen38/decode_graph.rs:295
  • `std::mem::forget(self.table.take())` (line 297) takes `self.table.take()` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/models/architectures/qwen38/decode_graph.rs:297
  • `scratch` (line 937) is a `StateOutputs` this function owns and never releases: no `publish()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateOutputs` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen38/decode_graph.rs:937
  • `completions` (line 643) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 671; the `return` on line 671 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/qwen38/mtp.rs:643
  • `std::mem::forget(std::mem::take(&mut self.graph))` (line 116) takes `std::mem::take(&mut self.graph)` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/models/architectures/qwen38/step_graph.rs:116
  • `std::mem::forget(self.table.take())` (line 117) takes `self.table.take()` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/models/architectures/qwen38/step_graph.rs:117
  • `std::mem::forget(self.step.take())` (line 118) takes `self.step.take()` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/models/architectures/qwen38/step_graph.rs:118
  • `scratch` (line 660) is a `StateOutputs` this function owns and never releases: no `publish()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateOutputs` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen38/step_graph.rs:660
  • `completions` (line 1518) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1542; the `return` on line 1542 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/qwen38/text.rs:1518
  • `completions` (line 1626) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1669; the `return` on line 1669 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/qwen38/text.rs:1626
  • `collector` (line 1633) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen38/text.rs:1633
  • `std::mem::forget(resources)` (line 1095) takes `resources` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/izwi-core/src/models/architectures/qwen38/native/loading.rs:1095
  • `scratch` (line 815) is a `StateOutputs` this function owns and never releases: no `publish()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateOutputs` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen36moe/decode_graph.rs:815
  • `completions` (line 310) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 340; the `return` on line 340 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/qwen36moe/mtp.rs:310
  • `scratch` (line 626) is a `StateOutputs` this function owns and never releases: no `publish()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateOutputs` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen36moe/step_graph.rs:626
  • `completions` (line 1935) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 2045; the `return` on line 1978 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/qwen36moe/text.rs:1935
  • `collector` (line 1946) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen36moe/text.rs:1946
  • `collector` (line 1994) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen36moe/text.rs:1994
  • `completions` (line 1052) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1122; the `return` on line 1103 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/qwen35/text.rs:1052
  • `collector` (line 1068) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen35/text.rs:1068
  • `completions` (line 3299) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen3/core.rs:3299
  • `reference_completions` (line 3555) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen3/core.rs:3555
  • `completions` (line 3877) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/qwen3/core.rs:3877
  • `completions` (line 1536) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1561; the `return` on line 1561 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/qwen3/tts/predictor.rs:1536
  • `completions` (line 1086) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1115; the `return` on line 1115 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/qwen3/tts/talker.rs:1086
  • `completions` (line 671) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 691; the `return` on line 691 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/lfm25_audio/audio_output.rs:671
  • `completions` (line 3278) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 3322; the `return` on line 3322 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/izwi-core/src/models/architectures/granite_speech/asr/runtime.rs:3278
  • `completions` (line 791) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/models/architectures/gemma3/core.rs:791
  • `state` (line 316) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — crates/izwi-core/src/models/architectures/chatterbox/s3gen.rs:316
  • `registry` (line 1735) is a `StateBackendRegistry` this function owns and never releases: no `require_compiled()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateBackendRegistry` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/kv/v2/runtime.rs:1735
  • `registry` (line 1776) is a `StateBackendRegistry` this function owns and never releases: no `require_compiled()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateBackendRegistry` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/izwi-core/src/kv/v2/runtime.rs:1776

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X2 · Cancellation propagation9.2 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 13/15 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `downloadAudioFile` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — ui/src/shared/api/audio.ts:1936
  • `updateSpeechTextJob` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — ui/src/shared/api/audio.ts:2619

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation7.5 / 10Strong✓ Tool-verified

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

  • `tracing::debug!` at line 4456 is called with an argument built by `steps.iter().map(|step|step.frames).sum::<usize>()` (line 4458), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::debug! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls. — crates/izwi-core/src/engine/executor/handler_tts.rs:4456

What to do

  • In Rust, hand the logger the value and let it format only what it writes: `debug!("rows: {:?}", rows)` or a field, `debug!(rows = ?rows, "loaded")` — `format_args!` and `?`/`%` fields defer the formatting. When the line needs a computed view (a `collect`, a `join`, a `serde_json::to_string`), put it behind `if log_enabled!(Level::Debug)` (`if tracing::enabled!(Level::DEBUG)` for tracing), which asks the target's own filter. The macros put their arguments behind the global maximum level only, so a collect or serialisation in the argument runs whenever any target is at debug, and the logger then drops this line.
X25 · Inert configuration knob7.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

  • `ModelCommands::Load.wait` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/app/cli.rs:700
  • `RuntimeTelemetrySnapshot.queue_wait_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:31
  • `RuntimeTelemetrySnapshot.queue_wait_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:32
  • `RuntimeTelemetrySnapshot.queue_wait_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:33
  • `RuntimeTelemetrySnapshot.prefill_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:34
  • `RuntimeTelemetrySnapshot.prefill_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:35
  • `RuntimeTelemetrySnapshot.prefill_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:36
  • `RuntimeTelemetrySnapshot.decode_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:37
  • `RuntimeTelemetrySnapshot.decode_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:38
  • `RuntimeTelemetrySnapshot.decode_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:39
  • `RuntimeTelemetrySnapshot.ttft_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:40
  • `RuntimeTelemetrySnapshot.ttft_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:41
  • `RuntimeTelemetrySnapshot.ttft_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:42
  • `RuntimeTelemetrySnapshot.end_to_end_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:43
  • `RuntimeTelemetrySnapshot.end_to_end_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:44
  • `RuntimeTelemetrySnapshot.end_to_end_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:45
  • `LoadedModelTelemetrySnapshot.family_diagnostics` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:77
  • `RuntimeLatencyStats.p50` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:219
  • `RuntimeLatencyStats.p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:220
  • `KernelPathTelemetrySnapshot.fused_attention_fallback_flash_compute_capability_unsupported_total` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/bench.rs:272
  • `FusedAttentionStatus.cuda_flash_attention_compiled` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-cli/src/commands/status.rs:59
  • `DTypeSelectionRequest.quantized` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/backends/device.rs:112
  • `TokenStats.prefill_time_ms` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/engine/types.rs:378
  • `FishS2RawConfig.torch_dtype` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/fish_s2/config.rs:36
  • `GraniteSpeechEncoderConfig.dropout` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:97
  • `GraniteSpeechProjectorConfig.attention_probs_dropout_prob` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:112
  • `GraniteSpeechProjectorConfig.hidden_dropout_prob` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:117
  • `GraniteSpeechProjectorConfig.use_qformer_text_input` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:130
  • `GraniteSpeechProjectorConfig.chunk_size_feed_forward` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:134
  • `GraniteSpeechProcessorConfigFile.processor_class` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:193
  • `GraniteSpeechAudioProcessorConfig.feature_extractor_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:199
  • `GraniteSpeechTokenizerConfig.processor_class` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:247
  • `GraniteSpeech5EncoderConfig.dropout` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech5/asr/config.rs:56
  • `GraniteSpeech5ProjectorConfig.use_qformer_text_input` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech5/asr/config.rs:82
  • `GraniteSpeech5AudioProcessorConfig.feature_extractor_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/granite_speech5/asr/config.rs:139
  • `KokoroPlbertConfig.dropout` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/kokoro/config.rs:24
  • `KokoroConfig.dropout` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/kokoro/config.rs:31
  • `Qwen3AsrConfig.support_languages` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/qwen3/asr/config.rs:18
  • `ThinkerConfig.audio_start_token_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/qwen3/asr/config.rs:71
  • `Qwen3TtsConfig.tokenizer_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/izwi-core/src/models/architectures/qwen3/tts/config.rs:11

What to do

  • Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
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.

X29 · Per-element action decided by a fixed element6.7 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

  • This loop runs once per element of `requests`, and the statement it guards acts on the element it is on — `requests[index]`. The test deciding whether that statement runs does not: `!Arc : : ptr_eq(& model_arc, & row_model.model_arc()) || row_params != cohort...` reads `requests[first_live]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 3702, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — crates/izwi-core/src/engine/executor/handler_tts.rs:3718

What to do

  • Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging3.9 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `info!` at line 360 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:360
  • `info!` at line 373 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:373
  • `warn!` at line 430 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:430
  • `warn!` at line 454 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:454
  • `info!` at line 472 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:472
  • `warn!` at line 544 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:544
  • `warn!` at line 550 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:550
  • `info!` at line 560 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:560
  • `warn!` at line 568 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:568
  • `warn!` at line 576 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:576
  • `warn!` at line 584 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:584
  • `info!` at line 607 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:607
  • `warn!` at line 613 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:613
  • `info!` at line 620 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:620
  • `warn!` at line 626 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:626
  • `info!` at line 643 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:643
  • `warn!` at line 657 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:657
  • `warn!` at line 662 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/actor.rs:662
  • `info!` at line 39 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:39
  • `info!` at line 106 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:106
  • `warn!` at line 123 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:123
  • `info!` at line 140 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:140
  • `info!` at line 155 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:155
  • `info!` at line 203 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:203
  • `warn!` at line 206 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:206
  • `warn!` at line 220 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:220
  • `debug!` at line 243 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:243
  • `warn!` at line 256 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:256
  • `warn!` at line 260 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:260
  • `info!` at line 280 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/mod.rs:280
  • `info!` at line 317 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/mod.rs:317
  • `info!` at line 322 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/mod.rs:322
  • `warn!` at line 327 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/mod.rs:327
  • `warn!` at line 439 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/mod.rs:439
  • `info!` at line 470 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/mod.rs:470
  • `warn!` at line 475 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/mod.rs:475
  • `info!` at line 85 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:85
  • `info!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:93
  • `info!` at line 158 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:158
  • `info!` at line 209 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:209

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.6 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • `table.order.remove(index)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `evict_expired_record` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/lib.rs:813
  • `table.records.get_mut(attempt_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `install_admission` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/lib.rs:921
  • `RequestDigest::new("cancel-tombstone")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `insert_cancel_tombstone` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/lib.rs:966
  • `lock_recover(&admission_slot).handoff.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `invoke` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/lib.rs:1613
  • `Response::builder().status(StatusCode::OK).header(axum::http::header::CONTENT_TYPE,NDJSON_MEDIA_TYPE).body(Body::from_stream(output))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `invoke` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/lib.rs:1705
  • `String::from_utf8(encoded)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `send_server_frame` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/realtime.rs:392
  • `terminal` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_asr_stage` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/realtime.rs:629
  • `stream.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `push_audio` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/realtime.rs:712
  • `terminal` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_tts_stage` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/realtime.rs:1051
  • `encode_realtime_audio_frame(*audio_sequence,is_final,payload)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `emit_audio_frame` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/realtime.rs:1169
  • `serde_json::to_string(&admitted)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `admit_session` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/realtime.rs:1418
  • `RequestDigest::new(format!("rt-{hash:016x}"))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `realtime_attempt_digest` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/realtime.rs:1459
  • `self.invocation.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `next_event` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-worker/src/runtime.rs:306
  • `permit` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `launch` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/actor.rs:413
  • `IncarnationId::new(uuid::Uuid::new_v4().simple().to_string())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `spawn_process` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/actor.rs:490
  • `node.worker(&self.worker_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `spawn_process` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/actor.rs:493
  • `DeploymentId::new(deployment_name.clone())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `from_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/autoscale.rs:324
  • `serde_json::to_string(worker_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `annotate_worker_line` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/lifecycle.rs:260
  • `digest[..8].try_into()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `for_worker` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/quarantine.rs:100
  • `tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `shutdown_requested` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/signals.rs:14
  • `autoscaler.deployment_mut(&deployment_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_autoscale_tick` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:91, crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:137
  • `slot.actor.node().worker(slot.worker_id())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `runtime_diagnostic` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/daemon/diagnostics.rs:90
  • `node.config().autoscaling.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/daemon/mod.rs:269
  • `rollout.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-supervisor/src/daemon/mod.rs:390
  • `frame[12..16].try_into()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `decode_realtime_audio_frame` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-protocol/src/realtime.rs:396
  • `frame[8..12].try_into()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `decode_realtime_audio_frame` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-protocol/src/realtime.rs:407
  • `self.inner.endpoint.join(path.trim_start_matches('/'))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `url` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-client/src/lib.rs:775
  • `std::thread::Builder::new().name("izwi-otlp-export".into()).spawn(move||export_loop(endpoint,service_name,interval,queued))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-serving-client/src/otlp.rs:62
  • `prepared.as_ref().map(|prepared|prepared.source_bytes.as_slice()).or(opaque_bytes.as_deref())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `ingest_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-server/src/media_ingest.rs:332
  • `records.order.pop_front()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `evict` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-server/src/speech_outcomes.rs:180
  • `self.temporary.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `path` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-server/src/speech_spool.rs:61
  • `self.temporary.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `reopen` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-server/src/speech_spool.rs:68
  • `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `acquire` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×3) — crates/izwi-server/src/state.rs:179, crates/izwi-server/src/state.rs:187, crates/izwi-server/src/state.rs:193
  • `diagnostics.private_runtime_path.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `maybe_delegate_to_private_cuda_runtime` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-server/src/roles/local.rs:538
  • `self.handle.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `shutdown` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-server/src/batch_runtime/worker.rs:1504
  • `self.handle.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `shutdown_for_process` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-server/src/batch_runtime/worker.rs:1523
  • `response_json_string.as_deref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `accept_durable_text_tts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/izwi-server/src/batch_runtime/store/acceptance.rs:532

What to do

  • Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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.

LensScoreRatingImpact
Code Health55.2Adequate — gated by D2, R3, X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture91.8ExemplarySolid.
Maturity84.1ExemplarySolid.
Readiness66.8Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security83.4Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling77.1Adequate — gated by DM2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100.0ExemplaryStrongest area.
Accessibility93.0ExemplarySolid.
Performance88.6ExemplarySolid.
Unscored — 3 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 — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 14 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 41 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.

  • 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 TypeScript 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. 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. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — AX6 reached only 13% of this repository's production lines — rust (471,985 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit -1 — compose exited without a cause this engine recognises) — Tool stalled (no output) after 00:08:15.0255120.; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source 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 field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • 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.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 3 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
  • D25 ADR Conformance — None of 1 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 2 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.
  • D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • 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
  • 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'.
  • P8 Schema migrations — SeaORM is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
  • P9 Domain vs controller coverage — coverage data present for 211 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • 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.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — X24 reached only 13% of this repository's production lines — rust (471,985 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. Rust's compiler refuses the unsynchronised version: a collection shared between a callback's thread and the waiting body must be `Sync`, which a `Vec`, `VecDeque` or `HashMap` is only behind a `Mutex`/`RwLock`, so the race this check looks for cannot be written in safe Rust. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 13% of this repository's production lines — rust (471,985 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 27 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
DM2 · Strongly-typed ids · Raw-primitive id despite a typed-id idiom · ×4
  • Raw-primitive id despite a typed-id idiom: TurnTrace.trace_id crates/izwi-server/src/app/agent_runtime.rs:566 — `TurnTrace.trace_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value.
  • Raw-primitive id despite a typed-id idiom: TurnTrace.span_id crates/izwi-server/src/app/agent_runtime.rs:567 — `TurnTrace.span_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value.
  • Raw-primitive id despite a typed-id idiom: Session.correlation_id crates/izwi-server/src/app/openai_realtime/connection.rs:92 — `Session.correlation_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value.
  • Raw-primitive id despite a typed-id idiom: Session.conversation_id crates/izwi-server/src/app/openai_realtime/connection.rs:97 — `Session.conversation_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value.
D14 · License Compliance · Banned license · ×2
  • Banned license: mp3lame-encoder — `mp3lame-encoder` 0.3.0 is published on crates.io under `LGPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository's REDACTED — so it is compiled by everything that builds this repository, not just by its test harness. The expression was read as SPDX, not as text: an `OR` is a choice and is only charged when every branch is banned, while an `AND` binds you to both operands and is charged when either is. Replace the crate, or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
  • Banned license: mp3lame-sys — `mp3lame-sys` 0.2.0 is published on crates.io under `LGPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository's REDACTED — so it is compiled by everything that builds this repository, not just by its test harness. The expression was read as SPDX, not as text: an `OR` is a choice and is only charged when every branch is banned, while an `AND` binds you to both operands and is charged when either is. Replace the crate, or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label ui/src/features/chat/components/ChatPlayground.tsx:1732 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AX9 · CQS / query purity · Query writes persistent state on the read path · ×1
  • Query writes persistent state on the read path: ModelDownloader.get_file_download_plans crates/izwi-core/src/artifacts/downloader.rs:3014 — `ModelDownloader.get_file_download_plans` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 3244 finding(s)
D3 · God Classes · MethodTooLong · ×198
  • MethodTooLong: Engine.retain_incremental_model_identity crates/izwi-core/src/engine/mod.rs:1795 — MethodTooLong — retain_incremental_model_identity runs 824 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 724 over it, 8.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: Scheduler.schedule_inner crates/izwi-core/src/engine/scheduler/mod.rs:1508 — MethodTooLong — schedule_inner runs 722 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 622 over it, 7.22× 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: ManagedKvCacheManager.prepare_inner crates/izwi-core/src/engine/cache/managed/prepare.rs:203 — MethodTooLong — prepare_inner runs 706 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 606 over it, 7.06× 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: NativeExecutor.transcribe_request_with_managed_cache crates/izwi-core/src/engine/executor/handler_asr.rs:496 — MethodTooLong — transcribe_request_with_managed_cache runs 640 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 540 over it, 6.40× 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: NativeExecutor.voxtral_realtime_batch_with_managed crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs:6 — MethodTooLong — voxtral_realtime_batch_with_managed runs 615 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 515 over it, 6.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: EngineCore.commit_executor_result crates/izwi-core/src/engine/core/commit.rs:122 — MethodTooLong — commit_executor_result runs 598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 498 over it, 5.98× 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: ModelLifecycleController.run_load_attempt_locked crates/izwi-core/src/runtime/lifecycle/load.rs:869 — MethodTooLong — run_load_attempt_locked runs 482 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 382 over it, 4.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NativeExecutor.execute_physical_batch crates/izwi-core/src/engine/executor.rs:3810 — MethodTooLong — execute_physical_batch runs 437 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 337 over it, 4.37× 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: BatchRuntimeStore.settle_reserved_speech_history_audio crates/izwi-server/src/batch_runtime/store/speech.rs:243 — MethodTooLong — settle_reserved_speech_history_audio runs 413 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 313 over it, 4.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: NativeExecutor.execution_profile crates/izwi-core/src/engine/executor.rs:3291 — MethodTooLong — execution_profile runs 406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 306 over it, 4.06× 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: NativeExecutor.qwen_tts_request_with_managed_cache crates/izwi-core/src/engine/executor/handler_tts.rs:2517 — MethodTooLong — qwen_tts_request_with_managed_cache runs 402 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 302 over it, 4.02× 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: NativeExecutor.asr_decode_batch_with_managed crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:122 — MethodTooLong — asr_decode_batch_with_managed runs 390 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 290 over it, 3.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: ModelLifecycleController.allocate_asr_state crates/izwi-core/src/runtime/lifecycle/load/state.rs:420 — MethodTooLong — allocate_asr_state runs 373 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 273 over it, 3.73× 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: NativeExecutor.qwen3_asr_sequence_request crates/izwi-core/src/engine/executor/handler_asr/qwen3.rs:6 — MethodTooLong — qwen3_asr_sequence_request runs 365 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 265 over it, 3.65× 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: NativeExecutor.vibevoice_asr_sequence_request_inner crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:54 — MethodTooLong — vibevoice_asr_sequence_request_inner runs 364 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 264 over it, 3.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: BatchRuntimeStore.accept_durable_text_tts crates/izwi-server/src/batch_runtime/store/acceptance.rs:149 — MethodTooLong — accept_durable_text_tts runs 356 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 256 over it, 3.56× 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: NativeExecutor.chat_request_with_managed_cache crates/izwi-core/src/engine/executor/handler_chat.rs:271 — MethodTooLong — chat_request_with_managed_cache runs 354 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 254 over it, 3.54× 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: BatchWorkerRunner.run_once crates/izwi-server/src/batch_runtime/worker.rs:661 — MethodTooLong — run_once runs 346 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 246 over it, 3.46× 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: PagedDecodeAttentionOp.metal_fwd crates/izwi-core/src/kernels/metal.rs:2267 — MethodTooLong — metal_fwd runs 342 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 242 over it, 3.42× 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: NativeExecutor.tts_decode_batch_with_managed crates/izwi-core/src/engine/executor/handler_tts.rs:3931 — MethodTooLong — tts_decode_batch_with_managed runs 341 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 241 over it, 3.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NativeExecutor.voxtral_realtime_staged_request_inner crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs:1145 — MethodTooLong — voxtral_realtime_staged_request_inner runs 330 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BatchRuntimeStore.publish_reserved_opaque_stage_artifact crates/izwi-server/src/batch_runtime/store/provider_writes.rs:629 — MethodTooLong — publish_reserved_opaque_stage_artifact runs 326 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 226 over it, 3.26× 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: EngineCore.commit_step crates/izwi-core/src/engine/core/step.rs:666 — MethodTooLong — commit_step runs 322 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 222 over it, 3.22× 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: NativeExecutor.whisper_asr_sequence_request crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:164 — MethodTooLong — whisper_asr_sequence_request runs 312 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 212 over it, 3.12× 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: NativeExecutor.nemotron_transcribe_batch_with_managed crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:105 — MethodTooLong — nemotron_transcribe_batch_with_managed runs 303 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 203 over it, 3.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.
  • + 173 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×185
  • FileTooLong: commands/bench.rs crates/izwi-cli/src/commands/bench.rs — FileTooLong — 4405 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 83 free functions. The bar is 500 significant lines; this is 3905 over it, 8.81× 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: engine/executor.rs crates/izwi-core/src/engine/executor.rs — FileTooLong — 4044 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 32 free functions. The bar is 500 significant lines; this is 3544 over it, 8.09× 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: kernels/metal.rs crates/izwi-core/src/kernels/metal.rs — FileTooLong — 3895 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 36 free functions. The bar is 500 significant lines; this is 3395 over it, 7.79× 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: executor/handler_tts.rs crates/izwi-core/src/engine/executor/handler_tts.rs — FileTooLong — 3686 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: NativeExecutor (771-4622). The bar is 500 significant lines; this is 3186 over it, 7.37× 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: voice_realtime/mod.rs crates/izwi-server/src/app/voice_realtime/mod.rs — FileTooLong — 3129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 2629 over it, 6.26× 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: scheduler/mod.rs crates/izwi-core/src/engine/scheduler/mod.rs — FileTooLong — 3080 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: Scheduler (2 blocks, 438-4627). The bar is 500 significant lines; this is 2580 over it, 6.16× 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: engine/mod.rs crates/izwi-core/src/engine/mod.rs — FileTooLong — 2945 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: Engine (2 blocks, 702-4082). The bar is 500 significant lines; this is 2445 over it, 5.89× 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: kernels/cuda.rs crates/izwi-core/src/kernels/cuda.rs — FileTooLong — 2876 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 63 free functions. The bar is 500 significant lines; this is 2376 over it, 5.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: REDACTED REDACTED — FileTooLong — 2556 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 2056 over it, 5.11× 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: runtime/coordinator.rs crates/izwi-core/src/runtime/coordinator.rs — FileTooLong — 2523 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2023 over it, 5.05× 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: api/audio.ts ui/src/shared/api/audio.ts — FileTooLong — 2504 significant lines (blank, comment-only and punctuation-only lines excluded), about 63% of them inside a single declaration: AudioApiClient (1185-3469). The bar is 500 significant lines; this is 2004 over it, 5.01× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: speech_history/handlers.rs crates/izwi-server/src/api/speech_history/handlers.rs — FileTooLong — 2490 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 65 free functions. The bar is 500 significant lines; this is 1990 over it, 4.98× 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: kv/accelerator.rs crates/izwi-core/src/backends/kv/accelerator.rs — FileTooLong — 2449 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: CandleAcceleratorKvArena (3 blocks, 749-2836). The bar is 500 significant lines; this is 1949 over it, 4.90× 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: artifacts/downloader.rs crates/izwi-core/src/artifacts/downloader.rs — FileTooLong — 2379 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: ModelDownloader (2 blocks, 1296-3490), declaring 42 free functions. The bar is 500 significant lines; this is 1879 over it, 4.76× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: lifecycle/asr_memory.rs crates/izwi-core/src/runtime/lifecycle/asr_memory.rs — FileTooLong — 2256 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 57 free functions. The bar is 500 significant lines; this is 1756 over it, 4.51× 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: api/openapi.rs crates/izwi-server/src/api/openapi.rs — FileTooLong — 2227 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 41 free functions. The bar is 500 significant lines; this is 1727 over it, 4.45× 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: engine/execution.rs crates/izwi-core/src/engine/execution.rs — FileTooLong — 2159 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1659 over it, 4.32× 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: service/asr_preparation.rs crates/izwi-core/src/runtime/service/asr_preparation.rs — FileTooLong — 2050 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: RuntimeService (96-2510). The bar is 500 significant lines; this is 1550 over it, 4.10× 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: service/tts_preparation.rs crates/izwi-core/src/runtime/service/tts_preparation.rs — FileTooLong — 2044 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 87% of them inside a single declaration: RuntimeService (383-2467). The bar is 500 significant lines; this is 1544 over it, 4.09× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/lib.rs crates/izwi-serving-worker/src/lib.rs — FileTooLong — 1845 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1345 over it, 3.69× 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: components/ChatPlayground.tsx ui/src/features/chat/components/ChatPlayground.tsx — FileTooLong — 1808 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: ChatPlayground (167-2397). The bar is 500 significant lines; this is 1308 over it, 3.62× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: runtime/diarization.rs crates/izwi-core/src/runtime/diarization.rs — FileTooLong — 1802 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 56 free functions. The bar is 500 significant lines; this is 1302 over it, 3.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: load/state.rs crates/izwi-core/src/runtime/lifecycle/load/state.rs — FileTooLong — 1787 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 100% of them inside a single declaration: ModelLifecycleController (7-2259). The bar is 500 significant lines; this is 1287 over it, 3.57× 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: engine/metrics.rs crates/izwi-core/src/engine/metrics.rs — FileTooLong — 1764 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 69 free functions. The bar is 500 significant lines; this is 1264 over it, 3.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: transcription/handlers.rs crates/izwi-server/src/api/transcription/handlers.rs — FileTooLong — 1741 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 1241 over it, 3.48× 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.
  • + 160 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×155
  • FunctionTooLong: ChatPlayground.ChatPlayground ui/src/features/chat/components/ChatPlayground.tsx:167 — FunctionTooLong — ChatPlayground runs 1682 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1582 over it, 16.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: izwi_server::api::openapi::add_scalar_navigation_paths crates/izwi-server/src/api/openapi.rs:118 — FunctionTooLong — izwi_server::api::openapi::add_scalar_navigation_paths runs 928 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 828 over it, 9.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.
  • FunctionTooLong: useVoiceSession.useVoiceSession ui/src/features/voice/useVoiceSession.ts:65 — FunctionTooLong — useVoiceSession runs 925 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 825 over it, 9.25× 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.
  • FunctionTooLong: route.TranscriptionPage ui/src/features/transcription/route.tsx:96 — FunctionTooLong — TranscriptionPage runs 919 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 819 over it, 9.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: NewTextToSpeechModal.NewTextToSpeechModal ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:144 — FunctionTooLong — NewTextToSpeechModal runs 830 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 730 over it, 8.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ModelCatalogProvider.ModelCatalogProvider ui/src/app/providers/ModelCatalogProvider.tsx:177 — FunctionTooLong — ModelCatalogProvider runs 717 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 617 over it, 7.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.
  • FunctionTooLong: NewDiarizationModal.NewDiarizationModal ui/src/features/diarization/components/NewDiarizationModal.tsx:137 — FunctionTooLong — NewDiarizationModal runs 713 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 613 over it, 7.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.
  • FunctionTooLong: NewTranscriptionModal.NewTranscriptionModal ui/src/features/transcription/components/NewTranscriptionModal.tsx:121 — FunctionTooLong — NewTranscriptionModal runs 631 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 531 over it, 6.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.
  • FunctionTooLong: route.SettingsPage ui/src/features/settings/route.tsx:462 — FunctionTooLong — SettingsPage runs 597 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 497 over it, 5.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: CloneVoiceDialog.CloneVoiceDialog ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:134 — FunctionTooLong — CloneVoiceDialog runs 520 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 420 over it, 5.20× 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.
  • FunctionTooLong: route.VoicesPage ui/src/features/voices/route.tsx:118 — FunctionTooLong — VoicesPage runs 518 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 418 over it, 5.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.
  • FunctionTooLong: FirstRunOnboarding.FirstRunOnboarding ui/src/app/onboarding/FirstRunOnboarding.tsx:210 — FunctionTooLong — FirstRunOnboarding runs 479 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 379 over it, 4.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.
  • FunctionTooLong: route.DictationSettingsView ui/src/features/dictation/route.tsx:271 — FunctionTooLong — DictationSettingsView runs 478 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 378 over it, 4.78× 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.
  • FunctionTooLong: route.TextToSpeechPage ui/src/features/text-to-speech/route.tsx:58 — FunctionTooLong — TextToSpeechPage runs 476 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 376 over it, 4.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.
  • FunctionTooLong: izwi_server::app::voice_realtime::spawn_turn_task crates/izwi-server/src/app/voice_realtime/mod.rs:1951 — FunctionTooLong — izwi_server::app::voice_realtime::spawn_turn_task runs 458 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 358 over it, 4.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.
  • FunctionTooLong: StudioEditor.StudioEditor ui/src/features/studio/components/StudioEditor.tsx:66 — FunctionTooLong — StudioEditor runs 439 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 339 over it, 4.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: izwi_server::api::speech_history::handlers::stream_record_creation crates/izwi-server/src/api/speech_history/handlers.rs:2295 — FunctionTooLong — izwi_server::api::speech_history::handlers::stream_record_creation runs 433 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 333 over it, 4.33× 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.
  • FunctionTooLong: DiarizationRecordDetail.DiarizationRecordDetail ui/src/features/diarization/components/DiarizationRecordDetail.tsx:66 — FunctionTooLong — DiarizationRecordDetail runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.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.
  • FunctionTooLong: DiarizationReviewWorkspace.DiarizationReviewWorkspace ui/src/components/DiarizationReviewWorkspace.tsx:165 — FunctionTooLong — DiarizationReviewWorkspace runs 426 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 326 over it, 4.26× 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.
  • FunctionTooLong: izwi_gateway::roles::gateway::gateway_state crates/izwi-gateway/src/roles/gateway.rs:203 — FunctionTooLong — izwi_gateway::roles::gateway::gateway_state runs 380 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 280 over it, 3.80× 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.
  • FunctionTooLong: DesignVoiceDialog.DesignVoiceDialog ui/src/features/voice-studio/components/DesignVoiceDialog.tsx:83 — FunctionTooLong — DesignVoiceDialog runs 361 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 261 over it, 3.61× 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.
  • FunctionTooLong: route.MyModelsPage ui/src/features/models/route.tsx:153 — FunctionTooLong — MyModelsPage runs 358 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 258 over it, 3.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.
  • FunctionTooLong: izwi_cli::commands::bench::print_asr_stage_timing_summary crates/izwi-cli/src/commands/bench.rs:4536 — FunctionTooLong — izwi_cli::commands::bench::print_asr_stage_timing_summary runs 357 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 257 over it, 3.57× 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.
  • FunctionTooLong: TranscriptionReviewWorkspace.TranscriptionReviewWorkspace ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:80 — FunctionTooLong — TranscriptionReviewWorkspace runs 327 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 227 over it, 3.27× 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.
  • FunctionTooLong: ScriptParagraph.ScriptParagraph ui/src/features/studio/components/ScriptParagraph.tsx:95 — FunctionTooLong — ScriptParagraph runs 326 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 226 over it, 3.26× 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.
  • + 130 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×125
  • Hotspot: ui/src/features/chat/components/ChatPlayground.tsx ui/src/features/chat/components/ChatPlayground.tsx:167 — ui/src/features/chat/components/ChatPlayground.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 280 in ChatPlayground.ChatPlayground at line 167. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- ui/src/features/chat/components/ChatPlayground.tsx`: 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: crates/izwi-core/src/engine/scheduler/mod.rs crates/izwi-core/src/engine/scheduler/mod.rs:1508 — crates/izwi-core/src/engine/scheduler/mod.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 159 in Scheduler::schedule_inner at line 1508. 3 of those changes were fix/bug commits, and the other 14 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/scheduler/mod.rs`: 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: crates/izwi-core/src/artifacts/downloader.rs crates/izwi-core/src/artifacts/downloader.rs:3193 — crates/izwi-core/src/artifacts/downloader.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in ModelDownloader::get_single_file_size_estimate at line 3193. 5 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/artifacts/downloader.rs`: 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: crates/izwi-model-catalog/src/catalog/variant.rs crates/izwi-model-catalog/src/catalog/variant.rs:674 — crates/izwi-model-catalog/src/catalog/variant.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in izwi_model_catalog::catalog::variant::resolve_by_heuristic at line 674. 4 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-model-catalog/src/catalog/variant.rs`: 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: ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:144 — ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 167 in NewTextToSpeechModal.NewTextToSpeechModal at line 144. 1 of those changes was a fix/bug commit, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx`: 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: crates/izwi-core/src/engine/mod.rs crates/izwi-core/src/engine/mod.rs:1795 — crates/izwi-core/src/engine/mod.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in Engine::retain_incremental_model_identity at line 1795. 4 of those changes were fix/bug commits, and the other 18 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/mod.rs`: 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: crates/izwi-core/src/runtime/lifecycle/load.rs crates/izwi-core/src/runtime/lifecycle/load.rs:869 — crates/izwi-core/src/runtime/lifecycle/load.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in ModelLifecycleController::run_load_attempt_locked at line 869. 6 of those changes were fix/bug commits, and the other 23 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/runtime/lifecycle/load.rs`: 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: crates/izwi-core/src/models/registry.rs crates/izwi-core/src/models/registry.rs:8062 — crates/izwi-core/src/models/registry.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in ModelRegistry::loaded_model_diagnostics at line 8062. 4 of those changes were fix/bug commits, and the other 29 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/models/registry.rs`: 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: ui/src/features/transcription/route.tsx ui/src/features/transcription/route.tsx:96 — ui/src/features/transcription/route.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 127 in route.TranscriptionPage at line 96. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- ui/src/features/transcription/route.tsx`: 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: crates/izwi-core/src/engine/executor/handler_asr.rs crates/izwi-core/src/engine/executor/handler_asr.rs:496 — crates/izwi-core/src/engine/executor/handler_asr.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in NativeExecutor::transcribe_request_with_managed_cache at line 496. 2 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/executor/handler_asr.rs`: 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: ui/src/app/providers/ModelCatalogProvider.tsx ui/src/app/providers/ModelCatalogProvider.tsx:177 — ui/src/app/providers/ModelCatalogProvider.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in ModelCatalogProvider.ModelCatalogProvider at line 177. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- ui/src/app/providers/ModelCatalogProvider.tsx`: 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: ui/src/features/transcription/components/NewTranscriptionModal.tsx ui/src/features/transcription/components/NewTranscriptionModal.tsx:121 — ui/src/features/transcription/components/NewTranscriptionModal.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in NewTranscriptionModal.NewTranscriptionModal at line 121. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- ui/src/features/transcription/components/NewTranscriptionModal.tsx`: 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: crates/izwi-core/src/engine/executor.rs crates/izwi-core/src/engine/executor.rs:3291 — crates/izwi-core/src/engine/executor.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in NativeExecutor::execution_profile at line 3291. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/executor.rs`: 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: ui/src/features/diarization/components/NewDiarizationModal.tsx ui/src/features/diarization/components/NewDiarizationModal.tsx:137 — ui/src/features/diarization/components/NewDiarizationModal.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 117 in NewDiarizationModal.NewDiarizationModal at line 137. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- ui/src/features/diarization/components/NewDiarizationModal.tsx`: 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: crates/izwi-core/src/engine/execution.rs crates/izwi-core/src/engine/execution.rs:2923 — crates/izwi-core/src/engine/execution.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in ExecutionReport::validate_against at line 2923. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/execution.rs`: 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: crates/izwi-server/src/app/voice_realtime/mod.rs crates/izwi-server/src/app/voice_realtime/mod.rs:3936 — crates/izwi-server/src/app/voice_realtime/mod.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in izwi_server::app::voice_realtime::map_typed_voice_event at line 3936. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-server/src/app/voice_realtime/mod.rs`: 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: crates/izwi-core/src/runtime/coordinator.rs crates/izwi-core/src/runtime/coordinator.rs:1805 — crates/izwi-core/src/runtime/coordinator.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in InferenceCoordinator::run_loaded_native_preparation_batch_in_parts at line 1805. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/runtime/coordinator.rs`: 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: crates/izwi-core/src/engine/executor/handler_tts.rs crates/izwi-core/src/engine/executor/handler_tts.rs:2517 — crates/izwi-core/src/engine/executor/handler_tts.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in NativeExecutor::qwen_tts_request_with_managed_cache at line 2517. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/executor/handler_tts.rs`: 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: crates/izwi-core/src/runtime/service.rs crates/izwi-core/src/runtime/service.rs:1062 — crates/izwi-core/src/runtime/service.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in izwi_core::runtime::service::bind_request_to_residency at line 1062. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/runtime/service.rs`: 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: crates/izwi-core/src/engine/executor/dispatch.rs crates/izwi-core/src/engine/executor/dispatch.rs:155 — crates/izwi-core/src/engine/executor/dispatch.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in NativeExecutor::execute_single_request at line 155. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/executor/dispatch.rs`: 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: ui/src/features/text-to-speech/route.tsx ui/src/features/text-to-speech/route.tsx:58 — ui/src/features/text-to-speech/route.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in route.TextToSpeechPage at line 58. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- ui/src/features/text-to-speech/route.tsx`: 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: crates/izwi-core/src/engine/executor/handler_chat.rs crates/izwi-core/src/engine/executor/handler_chat.rs:271 — crates/izwi-core/src/engine/executor/handler_chat.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in NativeExecutor::chat_request_with_managed_cache at line 271. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/executor/handler_chat.rs`: 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: crates/izwi-core/src/engine/request/state_binding.rs crates/izwi-core/src/engine/request/state_binding.rs:319 — crates/izwi-core/src/engine/request/state_binding.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 99 in EngineCoreRequest::validate_incremental_model_execution_preparation at line 319. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-core/src/engine/request/state_binding.rs`: 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: REDACTED REDACTED:142 — REDACTED changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in izwi_db::migrator::apply_migration at line 142. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- REDACTED`: 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: crates/izwi-server/src/api/tts_long_form.rs crates/izwi-server/src/api/tts_long_form.rs:1130 — crates/izwi-server/src/api/tts_long_form.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in izwi_server::api::tts_long_form::generate_speech_plan_stream_with_progress at line 1130. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 12:42:36 +02:00' --until='2026-11-14 12:42:36 +02:00' --full-history --no-merges -- crates/izwi-server/src/api/tts_long_form.rs`: 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.
  • + 100 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×63
  • Duplicated block (7 lines × 2) crates/izwi-cli/src/commands/bench.rs:1855 — crates/izwi-cli/src/commands/bench.rs:1855-1861 | crates/izwi-cli/src/commands/bench.rs:2517-2523 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:1855` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-cli/src/commands/bench.rs:1883 — crates/izwi-cli/src/commands/bench.rs:1883-1889 | crates/izwi-cli/src/commands/bench.rs:2221-2227 — both copies are in the same file, so extract the 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) crates/izwi-cli/src/commands/serve.rs:103 — crates/izwi-cli/src/commands/serve.rs:103-109 | crates/izwi-cli/src/commands/serve.rs:120-126 — both copies are in the same file, so extract the 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) crates/izwi-core/src/artifacts/downloader.rs:1858 — crates/izwi-core/src/artifacts/downloader.rs:1858-1864 | crates/izwi-core/src/artifacts/downloader.rs:1953-1959 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/artifacts/downloader.rs:1858` 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, `crates/izwi-core/src/artifacts/downloader.rs:1952` calls `join`, `exists` and `crates/izwi-core/src/artifacts/downloader.rs:1857` 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) crates/izwi-core/src/backends/kv/accelerator.rs:1193 — crates/izwi-core/src/backends/kv/accelerator.rs:1193-1199 | crates/izwi-core/src/backends/kv/cpu.rs:559-565 — before extracting anything, compare `crates/izwi-core/src/backends/kv/accelerator.rs` and `crates/izwi-core/src/backends/kv/cpu.rs` as WHOLE FILES: this scan already matched 9 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 `crates/izwi-core/src/backends/kv/accelerator.rs:1193` 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 first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&PagedKvPrefillArgs<'_>` in one and `PagedKvPrefillArgs<'_>` 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 (7 lines × 2) crates/izwi-core/src/engine/executor/dispatch.rs:1271 — crates/izwi-core/src/engine/executor/dispatch.rs:1271-1277 | crates/izwi-core/src/engine/executor/dispatch.rs:1306-1312 — both copies are in the same file, so extract the 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) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:165 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:165-171 | crates/izwi-core/src/engine/executor/fish_pending.rs:145-151 — before extracting anything, compare `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs` and `crates/izwi-core/src/engine/executor/fish_pending.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 83 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 `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:165` 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 first that the copies are not typed on the same thing: the declarations holding them bind `row` to `PendingFishDrama3Row` in one and `PendingFishCodec` 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 (7 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:463 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:463-469 | crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:480-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:463` 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:87 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:87-93 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:84-90 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:87` 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) crates/izwi-core/src/engine/executor/handler_chat.rs:868 — crates/izwi-core/src/engine/executor/handler_chat.rs:868-874 | crates/izwi-core/src/engine/executor/handler_chat.rs:1217-1223 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_chat.rs:868` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) crates/izwi-core/src/engine/mod.rs:3441 — crates/izwi-core/src/engine/mod.rs:3441-3447 | crates/izwi-core/src/engine/mod.rs:3470-3476 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/mod.rs:3441` 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) crates/izwi-core/src/kernels/cuda.rs:326 — crates/izwi-core/src/kernels/cuda.rs:326-332 | crates/izwi-core/src/kernels/cuda.rs:572-578 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/cuda.rs:341 — crates/izwi-core/src/kernels/cuda.rs:341-347 | crates/izwi-core/src/kernels/cuda.rs:587-593 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda.rs:341` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/kernels/cuda.rs:594` calls `checked_mul` and `crates/izwi-core/src/kernels/cuda.rs:348` 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 × 2) crates/izwi-core/src/kernels/cuda.rs:1244 — crates/izwi-core/src/kernels/cuda.rs:1244-1250 | crates/izwi-core/src/kernels/cuda.rs:1574-1580 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/cuda.rs:3096 — crates/izwi-core/src/kernels/cuda.rs:3096-3102 | crates/izwi-core/src/kernels/cuda.rs:3250-3256 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda.rs:3096` 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) crates/izwi-core/src/kernels/cuda/kquant.rs:130 — crates/izwi-core/src/kernels/cuda/kquant.rs:130-136 | crates/izwi-core/src/kernels/cuda/kquant.rs:224-230 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/cuda/kquant.rs:395 — crates/izwi-core/src/kernels/cuda/kquant.rs:395-401 | crates/izwi-core/src/kernels/cuda/kquant.rs:567-573 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/kquant.rs:395` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/cuda/moe.rs:482 — crates/izwi-core/src/kernels/cuda/moe.rs:482-488 | crates/izwi-core/src/kernels/cuda/moe.rs:546-552 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/moe.rs:482` 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) crates/izwi-core/src/kernels/cuda/moe.rs:884 — crates/izwi-core/src/kernels/cuda/moe.rs:884-891 | crates/izwi-core/src/kernels/cuda/moe.rs:907-913 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/cuda/moe.rs:1089 — crates/izwi-core/src/kernels/cuda/moe.rs:1089-1096 | crates/izwi-core/src/kernels/cuda/moe.rs:1112-1118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/izwi-core/src/kernels/cuda/moe.rs:1133 — crates/izwi-core/src/kernels/cuda/moe.rs:1133-1139 | crates/izwi-core/src/kernels/cuda/moe.rs:1153-1159 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/cuda/moe.rs:1408 — crates/izwi-core/src/kernels/cuda/moe.rs:1408-1414 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1324-1330 — 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) crates/izwi-core/src/kernels/depthwise_conv.rs:622 — crates/izwi-core/src/kernels/depthwise_conv.rs:622-628 | crates/izwi-core/src/kernels/relpos_attention.rs:1274-1280 — 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 lines × 2) crates/izwi-core/src/kernels/moe_relu2.rs:1416 — crates/izwi-core/src/kernels/moe_relu2.rs:1416-1422 | crates/izwi-core/src/kernels/moe_relu2.rs:1430-1436 — both copies are in the same file, so extract the 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) crates/izwi-core/src/runtime/adapters/loaded/bundle.rs:131 — crates/izwi-core/src/runtime/adapters/loaded/bundle.rs:131-137 | crates/izwi-core/src/runtime/adapters/loaded/bundle.rs:418-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/adapters/loaded/bundle.rs:131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 38 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×62
  • Duplicated block (8 lines × 2) crates/izwi-core/src/engine/cache/coordinator.rs:476 — crates/izwi-core/src/engine/cache/coordinator.rs:476-483 | crates/izwi-core/src/engine/cache/coordinator.rs:565-572 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `KvWindowReserveRequest` in one and `KvReserveRequest` 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 (8 lines × 2) crates/izwi-core/src/engine/cache/physical.rs:1231 — crates/izwi-core/src/engine/cache/physical.rs:1231-1238 | crates/izwi-core/src/runtime/service/tts_preparation.rs:316-323 — 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 (8 lines × 2) crates/izwi-core/src/engine/executor.rs:3664 — crates/izwi-core/src/engine/executor.rs:3664-3671 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:117-124 — 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:560 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:560-567 | crates/izwi-core/src/engine/executor/handler_tts.rs:4223-4230 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 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 (8 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:637 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:637-644 | crates/izwi-core/src/engine/executor/handler_tts.rs:3107-3114 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 128 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:637` 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 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:750 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:750-757 | crates/izwi-core/src/engine/executor/handler_tts.rs:3226-3233 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 128 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:750` 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:7 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:7-14 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:6-13 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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. 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 (8 lines × 2) crates/izwi-core/src/engine/executor/handler_tts.rs:1164 — crates/izwi-core/src/engine/executor/handler_tts.rs:1164-1171 | crates/izwi-core/src/engine/executor/handler_tts.rs:2334-2341 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:1164` 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 `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 (8 lines × 2) crates/izwi-core/src/engine/executor/handler_tts.rs:2859 — crates/izwi-core/src/engine/executor/handler_tts.rs:2859-2866 | crates/izwi-core/src/engine/executor/handler_tts.rs:4248-4255 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:2859` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) crates/izwi-core/src/kernels/cuda.rs:446 — crates/izwi-core/src/kernels/cuda.rs:446-453 | crates/izwi-core/src/kernels/cuda/gdn.rs:1199-1206 — 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) crates/izwi-core/src/kernels/cuda.rs:3125 — crates/izwi-core/src/kernels/cuda.rs:3125-3132 | crates/izwi-core/src/kernels/cuda.rs:3282-3289 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda.rs:3125` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/cuda.rs:3187 — crates/izwi-core/src/kernels/cuda.rs:3187-3194 | crates/izwi-core/src/kernels/cuda.rs:3416-3423 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda.rs:3187` 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) crates/izwi-core/src/kernels/cuda/gate.rs:15 — crates/izwi-core/src/kernels/cuda/gate.rs:15-22 | crates/izwi-core/src/kernels/cuda/norm.rs:17-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. 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 (8 lines × 2) crates/izwi-core/src/kernels/metal.rs:4718 — crates/izwi-core/src/kernels/metal.rs:4718-4725 | crates/izwi-core/src/kernels/metal.rs:4848-4855 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:4718` 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) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1337 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1337-1344 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1578-1585 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1337` 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) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1711 — crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1711-1718 | crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1941-1948 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `load` to `Qwen3AsrLoad` in one and `AlignerLoad` 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 (8 lines × 2) crates/izwi-core/src/runtime/lifecycle/load.rs:203 — crates/izwi-core/src/runtime/lifecycle/load.rs:203-210 | crates/izwi-model-catalog/src/catalog/metadata.rs:1023-1030 — 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) crates/izwi-core/src/runtime/service/asr_encoders.rs:706 — crates/izwi-core/src/runtime/service/asr_encoders.rs:706-713 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1024-1031 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:706` it begins part-way through the construct above it, so those 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 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:1669 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1669-1676 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2049-2056 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1669` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/runtime/service/asr_preparation.rs:1666` calls `Some`, `install_voxtral_asr_execution_model` and `crates/izwi-core/src/runtime/service/asr_preparation.rs:2048` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/izwi-gateway/src/app/realtime_translate.rs:656 — crates/izwi-gateway/src/app/realtime_translate.rs:656-663 | crates/izwi-gateway/src/app/realtime_translate.rs:898-905 — both copies are in the same file, so extract the 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 `crates/izwi-gateway/src/app/realtime_translate.rs:656` 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) crates/izwi-server/src/api/openai/audio/speech.rs:733 — crates/izwi-server/src/api/openai/audio/speech.rs:733-740 | crates/izwi-server/src/api/openai/audio/speech.rs:988-995 — both copies are in the same file, so extract the 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) crates/izwi-server/src/artifact_store.rs:711 — crates/izwi-server/src/artifact_store.rs:711-719 | crates/izwi-server/src/artifact_store.rs:772-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 `crates/izwi-server/src/artifact_store.rs:711` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/transcription_store.rs:532 — crates/izwi-server/src/transcription_store.rs:532-539 | crates/izwi-server/src/transcription_store.rs:1002-1009 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 × 2) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:726 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:726-733 | crates/izwi-core/src/engine/executor/handler_asr/granite_speech5.rs:78-85 — 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:726` 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) crates/izwi-core/src/kernels/cuda.rs:387 — crates/izwi-core/src/kernels/cuda.rs:387-394 | crates/izwi-core/src/kernels/cuda.rs:489-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 37 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×58
  • Duplicated block (9 lines × 2) crates/izwi-core/src/artifacts/downloader.rs:2012 — crates/izwi-core/src/artifacts/downloader.rs:2012-2020 | crates/izwi-core/src/artifacts/downloader.rs:2255-2263 — both copies are in the same file, so extract the 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) crates/izwi-core/src/backends/state/static_attention.rs:517 — crates/izwi-core/src/backends/state/static_attention.rs:517-525 | crates/izwi-core/src/backends/state/static_attention.rs:949-957 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/backends/state/static_attention.rs:517` it begins part-way through the construct above it, so those 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 lines × 2) crates/izwi-core/src/engine/executor/handler_asr.rs:1292 — crates/izwi-core/src/engine/executor/handler_asr.rs:1292-1300 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:239-247 — 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 `crates/izwi-core/src/engine/executor/handler_asr.rs:1292` 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:154 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:154-162 | crates/izwi-core/src/engine/executor/handler_chat.rs:785-793 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_chat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs: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.
  • Duplicated block (9 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:358 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:358-366 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:142-150 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:358` 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 (9 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:771 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:771-779 | crates/izwi-core/src/engine/executor/handler_tts.rs:3244-3252 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 128 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:771` 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) crates/izwi-core/src/engine/executor/handler_chat.rs:831 — crates/izwi-core/src/engine/executor/handler_chat.rs:831-839 | crates/izwi-core/src/engine/executor/handler_chat.rs:1191-1199 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_chat.rs:831` 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) crates/izwi-core/src/engine/executor/handler_maya1.rs:245 — crates/izwi-core/src/engine/executor/handler_maya1.rs:245-253 | crates/izwi-core/src/engine/executor/handler_maya2.rs:246-254 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_maya1.rs` and `crates/izwi-core/src/engine/executor/handler_maya2.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 373 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 `crates/izwi-core/src/engine/executor/handler_maya1.rs:245` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_maya1.rs:481 — crates/izwi-core/src/engine/executor/handler_maya1.rs:481-489 | crates/izwi-core/src/engine/executor/handler_tts.rs:4464-4472 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_maya1.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 114 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) crates/izwi-core/src/engine/executor/handler_tts.rs:3186 — crates/izwi-core/src/engine/executor/handler_tts.rs:3186-3194 | crates/izwi-core/src/engine/executor/handler_tts.rs:3447-3455 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:3186` 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) crates/izwi-core/src/engine/mod.rs:1904 — crates/izwi-core/src/engine/mod.rs:1904-1912 | crates/izwi-core/src/engine/mod.rs:2459-2467 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/mod.rs:1904` 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) crates/izwi-core/src/kernels/cuda.rs:539 — crates/izwi-core/src/kernels/cuda.rs:539-547 | crates/izwi-core/src/kernels/cuda/gdn.rs:960-968 — 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 `crates/izwi-core/src/kernels/cuda.rs:539` 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) crates/izwi-core/src/kernels/cuda.rs:577 — crates/izwi-core/src/kernels/cuda.rs:577-585 | crates/izwi-core/src/kernels/metal.rs:4855-4863 — before extracting anything, compare `crates/izwi-core/src/kernels/cuda.rs` and `crates/izwi-core/src/kernels/metal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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) crates/izwi-core/src/kernels/cuda/moe.rs:980 — crates/izwi-core/src/kernels/cuda/moe.rs:980-988 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1231-1239 — 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 `crates/izwi-core/src/kernels/cuda/moe.rs:980` 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) crates/izwi-core/src/kernels/cuda/sampling_device.rs:36 — crates/izwi-core/src/kernels/cuda/sampling_device.rs:36-44 | crates/izwi-core/src/kernels/cuda/sampling_device.rs:198-206 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/sampling_device.rs:36` 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) crates/izwi-core/src/kernels/metal.rs:2720 — crates/izwi-core/src/kernels/metal.rs:2720-2728 | crates/izwi-core/src/kernels/metal.rs:2766-2774 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:2720` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/kernels/metal.rs:2775` calls `get_function`, `map_err` and `crates/izwi-core/src/kernels/metal.rs:2729` 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) crates/izwi-core/src/kernels/metal.rs:3133 — crates/izwi-core/src/kernels/metal.rs:3133-3141 | crates/izwi-core/src/kernels/metal.rs:3179-3187 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:3133` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/kernels/metal.rs:3188` calls `get_function`, `map_err` and `crates/izwi-core/src/kernels/metal.rs:3142` 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) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1177 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1177-1185 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1236-1244 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal_qwen36moe.rs:1177` 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) crates/izwi-core/src/kernels/moe_relu2.rs:1584 — crates/izwi-core/src/kernels/moe_relu2.rs:1584-1592 | crates/izwi-core/src/kernels/moe_relu2.rs:1601-1609 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/moe_relu2.rs:1584` 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) crates/izwi-core/src/kernels/relpos_attention.rs:997 — crates/izwi-core/src/kernels/relpos_attention.rs:997-1005 | crates/izwi-core/src/kernels/transducer_greedy.rs:712-720 — before extracting anything, compare `crates/izwi-core/src/kernels/relpos_attention.rs` and `crates/izwi-core/src/kernels/transducer_greedy.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 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 `crates/izwi-core/src/kernels/relpos_attention.rs:997` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kv/v2/descriptor.rs:725 — crates/izwi-core/src/kv/v2/descriptor.rs:725-733 | crates/izwi-core/src/kv/v2/descriptor.rs:791-799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/kv/v2/descriptor.rs:725` 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) crates/izwi-core/src/kv/v2/runtime.rs:1745 — crates/izwi-core/src/kv/v2/runtime.rs:1745-1753 | crates/izwi-core/src/kv/v2/runtime.rs:1871-1879 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kv/v2/runtime.rs:1745` 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, `crates/izwi-core/src/kv/v2/runtime.rs:1870` calls `validate_for` and `crates/izwi-core/src/kv/v2/runtime.rs:1744` 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:856 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:856-866 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1213-1221 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:856` 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:879 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:879-887 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1808-1817 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:879` 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 (9 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:101 — crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:101-109 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:285-293 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:101` 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.
  • + 33 more in this group — see findings.md.
D2 · Cognitive Complexity · izwi_core · ×55
  • izwi_core::kernels::cuda::graphs_region::device::run (cognitive 48) crates/izwi-core/src/kernels/cuda/graphs_region.rs:238 — izwi_core::kernels::cuda::graphs_region::device::run has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 6, match/switch 3 (5 pts), loops 2 (4 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.
  • izwi_core::runtime::lifecycle::asr_memory::price_granite (cognitive 47) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:2615 — izwi_core::runtime::lifecycle::asr_memory::price_granite has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 7, loops 5 (7 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.
  • izwi_core::kernels::cuda::row_gemv::verify (cognitive 46) crates/izwi-core/src/kernels/cuda/row_gemv.rs:222 — izwi_core::kernels::cuda::row_gemv::verify has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 5 (15 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.
  • izwi_core::runtime::diarization::stabilize_word_speakers (cognitive 43) crates/izwi-core/src/runtime/diarization.rs:2214 — izwi_core::runtime::diarization::stabilize_word_speakers has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 3 (7 pts), boolean chains 3 (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.
  • izwi_core::runtime::lifecycle::load::invocation::plan_invocation_allocations (cognitive 43) crates/izwi-core/src/runtime/lifecycle/load/invocation.rs:54 — izwi_core::runtime::lifecycle::load::invocation::plan_invocation_allocations has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 5 (8 pts), match/switch 2 (6 pts), boolean chains 5 (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.
  • izwi_core::backends::kv::cpu::online_paged_decode (cognitive 42) crates/izwi-core/src/backends/kv/cpu.rs:839 — izwi_core::backends::kv::cpu::online_paged_decode has cognitive complexity 42 (threshold 15). Drivers by points: loops 10 (23 pts), if/else 7 (15 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 23). 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.
  • izwi_core::bin::kokoro_inspect::main (cognitive 42) crates/izwi-core/src/bin/kokoro_inspect.rs:5 — izwi_core::bin::kokoro_inspect::main has cognitive complexity 42 (threshold 15). Drivers by points: loops 10 (20 pts), if/else 4 (12 pts), match/switch 6 (10 pts) (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.
  • izwi_core::runtime::lifecycle::asr_memory::price_qwen3_chat_safetensors (cognitive 41) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:3324 — izwi_core::runtime::lifecycle::asr_memory::price_qwen3_chat_safetensors has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 3 (6 pts), boolean chains 4 (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.
  • izwi_core::kernels::cuda::fp8::verify_and_enable_tensor_core (cognitive 40) crates/izwi-core/src/kernels/cuda/fp8.rs:230 — izwi_core::kernels::cuda::fp8::verify_and_enable_tensor_core has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 8 (12 pts), match/switch 3 (7 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.
  • izwi_core::kernels::relpos_attention::reference (cognitive 38) crates/izwi-core/src/kernels/relpos_attention.rs:444 — izwi_core::kernels::relpos_attention::reference has cognitive complexity 38 (threshold 15). Drivers by points: loops 7 (24 pts), match/switch 2 (9 pts), if/else 3 (5 pts) (nesting depth added 26). 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.
  • izwi_core::kernels::transducer_greedy::select_step_reference (cognitive 36) crates/izwi-core/src/kernels/transducer_greedy.rs:221 — izwi_core::kernels::transducer_greedy::select_step_reference has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 4 (10 pts), boolean chains 3, loops 1 (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.
  • izwi_core::runtime::diarization::fallback_word_timings_with_segments (cognitive 36) crates/izwi-core/src/runtime/diarization.rs:1811 — izwi_core::runtime::diarization::fallback_word_timings_with_segments has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 6 (8 pts), match/switch 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.
  • izwi_core::runtime::lifecycle::asr_memory::price_qwen3_asr (cognitive 35) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1683 — izwi_core::runtime::lifecycle::asr_memory::price_qwen3_asr has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 7, 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.
  • izwi_core::runtime::service::bind_request_to_residency (cognitive 32) crates/izwi-core/src/runtime/service.rs:1062 — izwi_core::runtime::service::bind_request_to_residency has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 18, 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.
  • izwi_core::kernels::cuda::sampling::reference_probs (cognitive 31) crates/izwi-core/src/kernels/cuda/sampling.rs:152 — izwi_core::kernels::cuda::sampling::reference_probs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 4 (5 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.
  • izwi_core::runtime::lifecycle::asr_memory::price_vibevoice (cognitive 30) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:2900 — izwi_core::runtime::lifecycle::asr_memory::price_vibevoice has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (6 pts), boolean chains 4 (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.
  • izwi_core::engine::executor::physical_paged_cache_for_row (cognitive 26) crates/izwi-core/src/engine/executor.rs:599 — izwi_core::engine::executor::physical_paged_cache_for_row has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, boolean chains 11, match/switch 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.
  • izwi_core::runtime::lifecycle::asr_memory::price_qwen3_aligner (cognitive 25) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1922 — izwi_core::runtime::lifecycle::asr_memory::price_qwen3_aligner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (5 pts), boolean chains 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.
  • izwi_core::runtime::lifecycle::tts_memory::price_qwen3_tts (cognitive 25) crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:222 — izwi_core::runtime::lifecycle::tts_memory::price_qwen3_tts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, loops 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.
  • izwi_core::runtime::audio_io::decode_audio_bytes_symphonia_with_metadata (cognitive 24) crates/izwi-core/src/runtime/audio_io.rs:772 — izwi_core::runtime::audio_io::decode_audio_bytes_symphonia_with_metadata has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 5 (8 pts), boolean chains 3, 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.
  • izwi_core::text_segments::sentences::sentence_spans (cognitive 24) crates/izwi-core/src/text_segments/sentences.rs:63 — izwi_core::text_segments::sentences::sentence_spans has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, loops 3 (7 pts), match/switch 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.
  • izwi_core::kernels::cuda::try_cuda_paged_decode_graph (cognitive 22) crates/izwi-core/src/kernels/cuda.rs:1770 — izwi_core::kernels::cuda::try_cuda_paged_decode_graph has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, match/switch 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.
  • izwi_core::kernels::relpos_attention::exact_reference (cognitive 22) crates/izwi-core/src/kernels/relpos_attention.rs:514 — izwi_core::kernels::relpos_attention::exact_reference has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (15 pts), match/switch 1 (4 pts), if/else 1 (3 pts) (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.
  • izwi_core::runtime::lifecycle::asr_memory::price_aligner_tensors (cognitive 22) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:2011 — izwi_core::runtime::lifecycle::asr_memory::price_aligner_tensors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 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.
  • izwi_core::kernels::cuda::segment_graph::device::capture (cognitive 21) crates/izwi-core/src/kernels/cuda/segment_graph.rs:344 — izwi_core::kernels::cuda::segment_graph::device::capture has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (5 pts), boolean chains 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.
  • + 30 more in this group — see findings.md.
D2 · Cognitive Complexity · NativeExecutor · ×51
  • NativeExecutor::voxtral_realtime_batch_with_managed (cognitive 233) crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs:6 — NativeExecutor::voxtral_realtime_batch_with_managed has cognitive complexity 233 (threshold 15). Drivers by points: if/else 56 (122 pts), match/switch 20 (58 pts), loops 21 (48 pts), boolean chains 5 (nesting depth added 131). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeExecutor::qwen3_asr_sequence_request (cognitive 108) crates/izwi-core/src/engine/executor/handler_asr/qwen3.rs:6 — NativeExecutor::qwen3_asr_sequence_request has cognitive complexity 108 (threshold 15). Drivers by points: if/else 55 (94 pts), boolean chains 9, loops 2 (4 pts), match/switch 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeExecutor::qwen_tts_request_with_managed_cache (cognitive 103) crates/izwi-core/src/engine/executor/handler_tts.rs:2517 — NativeExecutor::qwen_tts_request_with_managed_cache has cognitive complexity 103 (threshold 15). Drivers by points: if/else 55 (89 pts), match/switch 7 (11 pts), loops 2 (3 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeExecutor::transcribe_request_with_managed_cache (cognitive 100) crates/izwi-core/src/engine/executor/handler_asr.rs:496 — NativeExecutor::transcribe_request_with_managed_cache has cognitive complexity 100 (threshold 15). Drivers by points: if/else 41 (78 pts), boolean chains 13, match/switch 6 (9 pts) (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.
  • NativeExecutor::asr_decode_batch_with_managed (cognitive 99) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:122 — NativeExecutor::asr_decode_batch_with_managed has cognitive complexity 99 (threshold 15). Drivers by points: if/else 47 (77 pts), loops 13 (17 pts), boolean chains 4, match/switch 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeExecutor::nemotron_transcribe_batch_with_managed (cognitive 95) crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:105 — NativeExecutor::nemotron_transcribe_batch_with_managed has cognitive complexity 95 (threshold 15). Drivers by points: if/else 36 (71 pts), loops 9 (16 pts), boolean chains 8 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeExecutor::vibevoice_asr_sequence_request_inner (cognitive 87) crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:54 — NativeExecutor::vibevoice_asr_sequence_request_inner has cognitive complexity 87 (threshold 15). Drivers by points: if/else 42 (66 pts), match/switch 7 (10 pts), boolean chains 7, loops 2 (4 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.
  • NativeExecutor::chat_request_with_managed_cache (cognitive 86) crates/izwi-core/src/engine/executor/handler_chat.rs:271 — NativeExecutor::chat_request_with_managed_cache has cognitive complexity 86 (threshold 15). Drivers by points: if/else 38 (58 pts), boolean chains 15, match/switch 5 (11 pts), loops 1 (2 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.
  • NativeExecutor::whisper_asr_sequence_request (cognitive 84) crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:164 — NativeExecutor::whisper_asr_sequence_request has cognitive complexity 84 (threshold 15). Drivers by points: if/else 46 (74 pts), loops 2 (4 pts), boolean chains 3, match/switch 2 (3 pts) (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.
  • NativeExecutor::lfm3_audio_batch_with_managed (cognitive 83) crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:99 — NativeExecutor::lfm3_audio_batch_with_managed has cognitive complexity 83 (threshold 15). Drivers by points: if/else 30 (60 pts), loops 8 (12 pts), boolean chains 6, match/switch 2 (5 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeExecutor::chatterbox_tts_batch_with_managed (cognitive 79) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:90 — NativeExecutor::chatterbox_tts_batch_with_managed has cognitive complexity 79 (threshold 15). Drivers by points: if/else 30 (60 pts), loops 7 (13 pts), boolean chains 6 (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.
  • NativeExecutor::tts_decode_batch_with_managed (cognitive 75) crates/izwi-core/src/engine/executor/handler_tts.rs:3931 — NativeExecutor::tts_decode_batch_with_managed has cognitive complexity 75 (threshold 15). Drivers by points: if/else 39 (63 pts), loops 8, boolean chains 2, match/switch 1 (2 pts) (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.
  • NativeExecutor::granite_speech_asr_sequence_request (cognitive 74) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:304 — NativeExecutor::granite_speech_asr_sequence_request has cognitive complexity 74 (threshold 15). Drivers by points: if/else 38 (62 pts), boolean chains 5, loops 2 (4 pts), match/switch 2 (3 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.
  • NativeExecutor::maya1_tts_batch_with_managed (cognitive 73) crates/izwi-core/src/engine/executor/handler_maya1.rs:101 — NativeExecutor::maya1_tts_batch_with_managed has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (55 pts), loops 7 (13 pts), boolean chains 5 (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.
  • NativeExecutor::maya2_tts_batch_with_managed (cognitive 73) crates/izwi-core/src/engine/executor/handler_maya2.rs:102 — NativeExecutor::maya2_tts_batch_with_managed has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (55 pts), loops 7 (13 pts), boolean chains 5 (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.
  • NativeExecutor::voxtral_tts_batch_with_managed (cognitive 69) crates/izwi-core/src/engine/executor/handler_tts.rs:1286 — NativeExecutor::voxtral_tts_batch_with_managed has cognitive complexity 69 (threshold 15). Drivers by points: if/else 31 (51 pts), loops 9 (10 pts), boolean chains 6, match/switch 1 (2 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.
  • NativeExecutor::execute_single_request (cognitive 65) crates/izwi-core/src/engine/executor/dispatch.rs:155 — NativeExecutor::execute_single_request has cognitive complexity 65 (threshold 15). Drivers by points: if/else 31 (45 pts), boolean chains 17, match/switch 3 (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.
  • NativeExecutor::lfm25_audio_asr_prefill_batch_with_managed (cognitive 63) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:555 — NativeExecutor::lfm25_audio_asr_prefill_batch_with_managed has cognitive complexity 63 (threshold 15). Drivers by points: if/else 24 (46 pts), loops 8 (11 pts), boolean chains 6 (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.
  • NativeExecutor::fish_s2_tts_batch_with_managed (cognitive 63) crates/izwi-core/src/engine/executor/handler_tts.rs:1723 — NativeExecutor::fish_s2_tts_batch_with_managed has cognitive complexity 63 (threshold 15). Drivers by points: if/else 26 (52 pts), boolean chains 6, loops 3 (5 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.
  • NativeExecutor::lfm25_audio_asr_decode_batch_with_managed (cognitive 61) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:851 — NativeExecutor::lfm25_audio_asr_decode_batch_with_managed has cognitive complexity 61 (threshold 15). Drivers by points: if/else 27 (47 pts), loops 9 (10 pts), boolean chains 4 (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.
  • NativeExecutor::fish_drama3_tts_batch_with_managed (cognitive 61) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:227 — NativeExecutor::fish_drama3_tts_batch_with_managed has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (43 pts), boolean chains 6, loops 3 (6 pts), match/switch 2 (6 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.
  • NativeExecutor::execution_profile (cognitive 56) crates/izwi-core/src/engine/executor.rs:3291 — NativeExecutor::execution_profile has cognitive complexity 56 (threshold 15). Drivers by points: if/else 29 (38 pts), boolean chains 9, match/switch 6 (9 pts) (nesting depth added 12). 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.
  • NativeExecutor::lfm25_audio_tts_prefill_batch_with_managed (cognitive 55) crates/izwi-core/src/engine/executor/handler_tts.rs:3031 — NativeExecutor::lfm25_audio_tts_prefill_batch_with_managed has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (42 pts), loops 7 (10 pts), boolean chains 3 (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.
  • NativeExecutor::whisper_asr_decode_batch_with_managed (cognitive 54) crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:563 — NativeExecutor::whisper_asr_decode_batch_with_managed has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (38 pts), loops 8 (9 pts), boolean chains 4, match/switch 2 (3 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.
  • NativeExecutor::chat_mixed_step_with_managed (cognitive 51) crates/izwi-core/src/engine/executor/handler_chat.rs:1119 — NativeExecutor::chat_mixed_step_with_managed has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 8, boolean chains 4, match/switch 2 (4 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.
  • + 26 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×50
  • Duplicated block (6 lines × 2) crates/izwi-cli/src/commands/bench.rs:2911 — crates/izwi-cli/src/commands/bench.rs:2911-2916 | crates/izwi-cli/src/commands/bench.rs:3083-3088 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:2911` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/backends/state/invocation.rs:1619 — crates/izwi-core/src/backends/state/invocation.rs:1619-1624 | crates/izwi-core/src/backends/state/static_attention.rs:1548-1553 — before extracting anything, compare `crates/izwi-core/src/backends/state/invocation.rs` and `crates/izwi-core/src/backends/state/static_attention.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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 `crates/izwi-core/src/backends/state/invocation.rs:1619` 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) crates/izwi-core/src/backends/state/tensor.rs:1148 — crates/izwi-core/src/backends/state/tensor.rs:1148-1153 | crates/izwi-core/src/engine/cache/physical.rs:1219-1224 — 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 `crates/izwi-core/src/backends/state/tensor.rs:1148` 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) crates/izwi-core/src/engine/core.rs:949 — crates/izwi-core/src/engine/core.rs:949-955 | crates/izwi-core/src/engine/core.rs:1053-1058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 `self` to `&mut` in one and `crate) fn add_realtime_asr_session( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) crates/izwi-core/src/engine/executor.rs:2165 — crates/izwi-core/src/engine/executor.rs:2165-2170 | crates/izwi-core/src/engine/executor.rs:2238-2243 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor.rs:2165` 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 first that the copies are not typed on the same thing: the declarations holding them bind `self` to `mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:433 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:433-438 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:445-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/izwi-core/src/engine/executor/handler_tts.rs:3441 — crates/izwi-core/src/engine/executor/handler_tts.rs:3441-3446 | crates/izwi-core/src/engine/executor/handler_tts.rs:3504-3509 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:3441` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/engine/executor/handler_tts.rs:3447` calls `with_capacity` and `crates/izwi-core/src/engine/executor/handler_tts.rs:3510` 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) crates/izwi-core/src/kernels/cuda.rs:2174 — crates/izwi-core/src/kernels/cuda.rs:2174-2179 | crates/izwi-core/src/kernels/cuda.rs:2204-2209 — both copies are in the same file, so extract the 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, `crates/izwi-core/src/kernels/cuda.rs:2180` calls `dims`, `dtype` and `crates/izwi-core/src/kernels/cuda.rs:2210` 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) crates/izwi-core/src/kernels/cuda/fp8.rs:1140 — crates/izwi-core/src/kernels/cuda/fp8.rs:1140-1145 | crates/izwi-core/src/kernels/cuda/fp8.rs:1477-1482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/izwi-core/src/kernels/cuda/rope.rs:518 — crates/izwi-core/src/kernels/cuda/rope.rs:518-523 | crates/izwi-core/src/kernels/cuda/rope.rs:620-625 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/rope.rs:518` 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) crates/izwi-core/src/kernels/metal.rs:4370 — crates/izwi-core/src/kernels/metal.rs:4370-4375 | crates/izwi-core/src/kernels/metal.rs:4491-4496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1988 — crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1988-1993 | crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:3355-3360 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1988` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-prometheus/src/lib.rs:174 — crates/izwi-prometheus/src/lib.rs:174-179 | crates/izwi-prometheus/src/lib.rs:267-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/izwi-server/src/api/openai/audio/speech.rs:870 — crates/izwi-server/src/api/openai/audio/speech.rs:870-875 | crates/izwi-server/src/api/openai/audio/speech.rs:902-907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:608 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:608-613 | crates/izwi-server/src/batch_runtime/store/provider_writes.rs:987-992 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/batch_runtime/store/provider_writes.rs:608` 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) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:668 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:668-673 | crates/izwi-server/src/batch_runtime/store/speech.rs:342-347 — before extracting anything, compare `crates/izwi-server/src/batch_runtime/store/provider_writes.rs` and `crates/izwi-server/src/batch_runtime/store/speech.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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 (6 lines × 2) crates/izwi-server/src/diarization_store.rs:509 — crates/izwi-server/src/diarization_store.rs:509-514 | crates/izwi-server/src/diarization_store.rs:836-841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `record` to `NewDiarizationRecord` in one and `CompleteDiarizationRecord` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) crates/izwi-server/src/speech_history_store.rs:715 — crates/izwi-server/src/speech_history_store.rs:715-720 | crates/izwi-server/src/speech_history_store.rs:753-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 `crates/izwi-server/src/speech_history_store.rs:715` 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) crates/izwi-core/src/backends/kv/accelerator.rs:2751 — crates/izwi-core/src/backends/kv/accelerator.rs:2751-2756 | crates/izwi-core/src/backends/kv/cpu.rs:692-697 — before extracting anything, compare `crates/izwi-core/src/backends/kv/accelerator.rs` and `crates/izwi-core/src/backends/kv/cpu.rs` as WHOLE FILES: this scan already matched 9 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 `crates/izwi-core/src/backends/kv/accelerator.rs:2751` 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) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:844 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:844-849 | crates/izwi-core/src/engine/executor/handler_asr/granite_speech5.rs:166-171 — 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) crates/izwi-core/src/kernels/cuda/rope.rs:240 — crates/izwi-core/src/kernels/cuda/rope.rs:240-245 | crates/izwi-core/src/kernels/cuda/rope.rs:369-374 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/rope.rs:240` 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) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1241 — crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1241-1246 | crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1263-1268 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1241` 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) crates/izwi-core/src/engine/config.rs:520 — crates/izwi-core/src/engine/config.rs:520-525 | crates/izwi-core/src/serve_runtime.rs:499-504 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:56 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:56-61 | crates/izwi-core/src/engine/executor/fish_pending.rs:31-36 — before extracting anything, compare `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs` and `crates/izwi-core/src/engine/executor/fish_pending.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 83 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 (6 lines × 2) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:242 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:242-247 | crates/izwi-core/src/engine/executor/fish_pending.rs:207-212 — before extracting anything, compare `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs` and `crates/izwi-core/src/engine/executor/fish_pending.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 83 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.
  • + 25 more in this group — see findings.md.
D1 · Cyclomatic Complexity · NativeExecutor · ×49
  • NativeExecutor::voxtral_realtime_batch_with_managed (cyclomatic 92) crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs:6 — NativeExecutor::voxtral_realtime_batch_with_managed has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::transcribe_request_with_managed_cache (cyclomatic 75) crates/izwi-core/src/engine/executor/handler_asr.rs:496 — NativeExecutor::transcribe_request_with_managed_cache has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::asr_decode_batch_with_managed (cyclomatic 62) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:122 — NativeExecutor::asr_decode_batch_with_managed 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.
  • NativeExecutor::chat_request_with_managed_cache (cyclomatic 61) crates/izwi-core/src/engine/executor/handler_chat.rs:271 — NativeExecutor::chat_request_with_managed_cache 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.
  • NativeExecutor::execute_single_request (cyclomatic 57) crates/izwi-core/src/engine/executor/dispatch.rs:155 — NativeExecutor::execute_single_request has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::qwen3_asr_sequence_request (cyclomatic 57) crates/izwi-core/src/engine/executor/handler_asr/qwen3.rs:6 — NativeExecutor::qwen3_asr_sequence_request has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::qwen_tts_request_with_managed_cache (cyclomatic 55) crates/izwi-core/src/engine/executor/handler_tts.rs:2517 — NativeExecutor::qwen_tts_request_with_managed_cache has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::vibevoice_asr_sequence_request_inner (cyclomatic 53) crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:54 — NativeExecutor::vibevoice_asr_sequence_request_inner has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::whisper_asr_sequence_request (cyclomatic 48) crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:164 — NativeExecutor::whisper_asr_sequence_request 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.
  • NativeExecutor::tts_decode_batch_with_managed (cyclomatic 48) crates/izwi-core/src/engine/executor/handler_tts.rs:3931 — NativeExecutor::tts_decode_batch_with_managed 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.
  • NativeExecutor::nemotron_transcribe_batch_with_managed (cyclomatic 47) crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:105 — NativeExecutor::nemotron_transcribe_batch_with_managed 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.
  • NativeExecutor::execution_profile (cyclomatic 46) crates/izwi-core/src/engine/executor.rs:3291 — NativeExecutor::execution_profile has cyclomatic complexity 46 (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.
  • NativeExecutor::lfm3_audio_batch_with_managed (cyclomatic 44) crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:99 — NativeExecutor::lfm3_audio_batch_with_managed has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::voxtral_tts_batch_with_managed (cyclomatic 43) crates/izwi-core/src/engine/executor/handler_tts.rs:1286 — NativeExecutor::voxtral_tts_batch_with_managed 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.
  • NativeExecutor::execute_physical_batch (cyclomatic 43) crates/izwi-core/src/engine/executor.rs:3810 — NativeExecutor::execute_physical_batch has cyclomatic complexity 43 (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.
  • NativeExecutor::granite_speech_asr_sequence_request (cyclomatic 40) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:304 — NativeExecutor::granite_speech_asr_sequence_request 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.
  • NativeExecutor::voxtral_realtime_staged_request_inner (cyclomatic 40) crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs:1145 — NativeExecutor::voxtral_realtime_staged_request_inner has cyclomatic complexity 40 (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.
  • NativeExecutor::chatterbox_tts_batch_with_managed (cyclomatic 39) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:90 — NativeExecutor::chatterbox_tts_batch_with_managed has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::lfm25_audio_asr_decode_batch_with_managed (cyclomatic 37) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:851 — NativeExecutor::lfm25_audio_asr_decode_batch_with_managed has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::whisper_asr_decode_batch_with_managed (cyclomatic 37) crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:563 — NativeExecutor::whisper_asr_decode_batch_with_managed has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeExecutor::lfm25_audio_asr_prefill_batch_with_managed (cyclomatic 36) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:555 — NativeExecutor::lfm25_audio_asr_prefill_batch_with_managed 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.
  • NativeExecutor::maya1_tts_batch_with_managed (cyclomatic 36) crates/izwi-core/src/engine/executor/handler_maya1.rs:101 — NativeExecutor::maya1_tts_batch_with_managed 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.
  • NativeExecutor::maya2_tts_batch_with_managed (cyclomatic 36) crates/izwi-core/src/engine/executor/handler_maya2.rs:102 — NativeExecutor::maya2_tts_batch_with_managed 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.
  • NativeExecutor::chat_decode_batch_with_managed (cyclomatic 35) crates/izwi-core/src/engine/executor/handler_chat.rs:737 — NativeExecutor::chat_decode_batch_with_managed 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.
  • NativeExecutor::voxtral_realtime_request (cyclomatic 34) crates/izwi-core/src/engine/executor/handler_asr/voxtral.rs:805 — NativeExecutor::voxtral_realtime_request 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.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×49
  • Duplicated block (10 lines × 2) crates/izwi-cli/src/commands/bench.rs:2330 — crates/izwi-cli/src/commands/bench.rs:2330-2339 | crates/izwi-cli/src/commands/bench.rs:2654-2663 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:2330` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-cli/src/commands/chat.rs:215 — crates/izwi-cli/src/commands/chat.rs:215-224 | crates/izwi-cli/src/commands/models.rs:326-335 — 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. 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) crates/izwi-cli/src/commands/tts.rs:717 — crates/izwi-cli/src/commands/tts.rs:717-726 | crates/izwi-server/src/api/studio/handlers.rs:1087-1096 — 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) crates/izwi-core/src/engine/cache/invocation.rs:629 — crates/izwi-core/src/engine/cache/invocation.rs:629-638 | crates/izwi-core/src/engine/cache/invocation_tensor.rs:861-870 — 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:558 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:558-567 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1140-1149 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:558` it begins part-way through the construct above it, so those 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) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:724 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:724-733 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1028-1037 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:724` 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, `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:736` calls `push` and `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1040` 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:65 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:65-74 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:62-71 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn commit( mut` in one and `super) fn commit(mut` 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 (10 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:265 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:265-274 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:263-272 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:265` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) crates/izwi-core/src/engine/executor/handler_maya1.rs:368 — crates/izwi-core/src/engine/executor/handler_maya1.rs:368-377 | crates/izwi-core/src/engine/executor/handler_maya2.rs:370-379 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_maya1.rs` and `crates/izwi-core/src/engine/executor/handler_maya2.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 373 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 `crates/izwi-core/src/engine/executor/handler_maya1.rs:368` 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) crates/izwi-core/src/engine/mod.rs:1977 — crates/izwi-core/src/engine/mod.rs:1977-1986 | crates/izwi-core/src/engine/mod.rs:2573-2582 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/mod.rs:1977` 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) crates/izwi-core/src/engine/scheduler/mod.rs:1106 — crates/izwi-core/src/engine/scheduler/mod.rs:1106-1115 | crates/izwi-core/src/engine/scheduler/mod.rs:1154-1163 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/scheduler/mod.rs:1106` it begins part-way through the construct above it, so those 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 (10 lines × 2) crates/izwi-core/src/kernels/cuda.rs:406 — crates/izwi-core/src/kernels/cuda.rs:406-415 | crates/izwi-core/src/kernels/cuda.rs:504-513 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda.rs:406` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/cuda.rs:436 — crates/izwi-core/src/kernels/cuda.rs:436-445 | crates/izwi-core/src/kernels/cuda.rs:529-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/kernels/cuda.rs:436` 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) crates/izwi-core/src/kernels/cuda/fp8.rs:570 — crates/izwi-core/src/kernels/cuda/fp8.rs:570-579 | crates/izwi-core/src/kernels/cuda/row_gemv.rs:229-238 — 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) crates/izwi-core/src/kernels/cuda/gdn.rs:818 — crates/izwi-core/src/kernels/cuda/gdn.rs:818-827 | crates/izwi-core/src/kernels/cuda/moe.rs:1355-1364 — 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) crates/izwi-core/src/kernels/depthwise_conv.rs:318 — crates/izwi-core/src/kernels/depthwise_conv.rs:318-327 | crates/izwi-core/src/kernels/relpos_attention.rs:963-972 — 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 `crates/izwi-core/src/kernels/depthwise_conv.rs:318` 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) crates/izwi-core/src/kernels/greedy.rs:106 — crates/izwi-core/src/kernels/greedy.rs:106-115 | crates/izwi-core/src/kernels/swiglu.rs:91-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/kernels/greedy.rs:106` 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, `crates/izwi-core/src/kernels/swiglu.rs:101` calls `div_ceil` and `crates/izwi-core/src/kernels/greedy.rs: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 (10 lines × 2) crates/izwi-core/src/kernels/metal.rs:4625 — crates/izwi-core/src/kernels/metal.rs:4625-4634 | crates/izwi-core/src/kernels/metal.rs:4845-4854 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:4625` 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) crates/izwi-core/src/kernels/metal.rs:4674 — crates/izwi-core/src/kernels/metal.rs:4674-4683 | crates/izwi-core/src/kernels/metal.rs:4715-4724 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:4674` 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) crates/izwi-core/src/kernels/moe_relu2.rs:1365 — crates/izwi-core/src/kernels/moe_relu2.rs:1365-1374 | crates/izwi-core/src/kernels/moe_relu2.rs:1463-1472 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/moe_relu2.rs:1365` 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) crates/izwi-core/src/kv/v2/resolved_domains.rs:339 — crates/izwi-core/src/kv/v2/resolved_domains.rs:339-348 | crates/izwi-core/src/kv/v2/resolved_domains.rs:353-362 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `spec` to `&StaticTensorDomainSpec` in one and `&TensorStateDomainSpec` 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 (10 lines × 2) crates/izwi-core/src/kv/v2/runtime.rs:1743 — crates/izwi-core/src/kv/v2/runtime.rs:1743-1752 | crates/izwi-core/src/kv/v2/runtime.rs:1954-1963 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kv/v2/runtime.rs:1743` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/diarization.rs:1224 — crates/izwi-core/src/models/registry.rs:4029-4038 | crates/izwi-core/src/runtime/diarization.rs:1224-1233 — 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) crates/izwi-core/src/runtime/audio_io.rs:554 — crates/izwi-core/src/runtime/audio_io.rs:554-563 | crates/izwi-core/src/runtime/audio_io.rs:636-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:395 — crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:395-404 | crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:507-516 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:395` 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.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×44
  • Duplicated block (11 lines × 2) crates/izwi-core/src/artifacts/downloader.rs:2931 — crates/izwi-core/src/artifacts/downloader.rs:2931-2941 | crates/izwi-core/src/artifacts/downloader.rs:2962-2972 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/artifacts/downloader.rs:2931` 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) crates/izwi-core/src/audio/codec.rs:219 — crates/izwi-core/src/audio/codec.rs:219-229 | crates/izwi-core/src/audio/codec.rs:303-313 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/audio/codec.rs:219` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/audio/codec.rs:263 — crates/izwi-core/src/audio/codec.rs:263-274 | crates/izwi-core/src/audio/codec.rs:350-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/audio/codec.rs:263` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/backends/state/invocation.rs:1631 — crates/izwi-core/src/backends/state/invocation.rs:1631-1641 | crates/izwi-core/src/backends/state/static_attention.rs:1560-1570 — before extracting anything, compare `crates/izwi-core/src/backends/state/invocation.rs` and `crates/izwi-core/src/backends/state/static_attention.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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. 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 (11 lines × 2) crates/izwi-core/src/engine/cache/managed/binding.rs:639 — crates/izwi-core/src/engine/cache/managed/binding.rs:639-649 | crates/izwi-core/src/engine/cache/managed/binding.rs:758-768 — both copies are in the same file, so extract the 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) crates/izwi-core/src/engine/cache/managed/capacity.rs:984 — crates/izwi-core/src/engine/cache/managed/capacity.rs:984-994 | crates/izwi-core/src/engine/cache/managed/capacity.rs:1049-1059 — both copies are in the same file, so extract the 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) crates/izwi-core/src/engine/executor.rs:3965 — crates/izwi-core/src/engine/executor.rs:3965-3975 | crates/izwi-core/src/engine/executor.rs:4093-4103 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor.rs:3965` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:141 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:141-151 | crates/izwi-core/src/engine/executor/handler_chat.rs:772-782 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_chat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:141` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:421 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:421-431 | crates/izwi-core/src/engine/executor/handler_chat.rs:943-953 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_chat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:421` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:250 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:250-260 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:245-255 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:257` calls `is_cancelled` and `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:262` 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 lines × 2) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:149 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:149-159 | crates/izwi-core/src/engine/executor/handler_tts.rs:4675-4685 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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. 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 (11 lines × 2) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:447 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:447-457 | crates/izwi-core/src/engine/executor/handler_tts.rs:1892-1902 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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 `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:447` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:606 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:606-616 | crates/izwi-core/src/engine/executor/handler_tts.rs:2045-2055 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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 `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:606` it begins part-way through the construct above it, so those 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 (11 lines × 2) crates/izwi-core/src/engine/mod.rs:2629 — crates/izwi-core/src/engine/mod.rs:2629-2639 | crates/izwi-core/src/engine/mod.rs:2696-2707 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/mod.rs:2629` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/izwi-core/src/kernels/cuda/kquant.rs:151 — crates/izwi-core/src/kernels/cuda/kquant.rs:151-161 | crates/izwi-core/src/kernels/cuda/kquant.rs:248-258 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/kquant.rs:151` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/izwi-core/src/kernels/cuda/moe.rs:1340 — crates/izwi-core/src/kernels/cuda/moe.rs:1340-1350 | crates/izwi-core/src/kernels/cuda/moe.rs:1427-1437 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/moe.rs:1340` 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) crates/izwi-core/src/kernels/cuda/rope.rs:99 — crates/izwi-core/src/kernels/cuda/rope.rs:99-109 | crates/izwi-core/src/kernels/cuda/rope.rs:290-300 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/numeric_check.rs:29 — crates/izwi-core/src/kernels/numeric_check.rs:29-39 | crates/izwi-core/src/models/architectures/qwen35/fast_path.rs:155-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. 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 (11 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:111 — crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:111-121 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:295-305 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/realtime.rs: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.
  • Duplicated block (11 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:311 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:311-321 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:628-638 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:311` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1325 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1325-1335 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1566-1576 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1325` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1738 — crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1738-1748 | crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:3425-3435 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1738` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/service/asr_preparation.rs:674 — crates/izwi-core/src/runtime/service/asr_preparation.rs:674-684 | crates/izwi-core/src/runtime/service/asr_preparation.rs:956-966 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:674` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/izwi-server/src/api/diarization/handlers.rs:251 — crates/izwi-server/src/api/diarization/handlers.rs:251-261 | crates/izwi-server/src/api/diarization/handlers.rs:318-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-server/src/api/diarization/handlers.rs:251` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/izwi-server/src/api/openai/audio/transcriptions.rs:1388 — crates/izwi-server/src/api/openai/audio/transcriptions.rs:1388-1398 | crates/izwi-server/src/api/transcript_alignment.rs:78-88 — 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 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.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×42
  • Duplicated block (12 lines × 2) crates/izwi-cli/src/error.rs:72 — crates/izwi-cli/src/error.rs:72-83 | crates/izwi-core/src/artifacts/downloader.rs:771-782 — 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 (12 lines × 2) crates/izwi-core/src/config.rs:97 — crates/izwi-core/src/config.rs:97-108 | crates/izwi-core/src/config.rs:302-313 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/config.rs:97` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/config.rs:110 — crates/izwi-core/src/config.rs:110-121 | crates/izwi-core/src/config.rs:315-326 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/config.rs:110` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/cache/offload.rs:144 — crates/izwi-core/src/engine/cache/offload.rs:144-155 | crates/izwi-core/src/engine/cache/offload.rs:177-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/engine/cache/offload.rs:144` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor.rs:3984 — crates/izwi-core/src/engine/executor.rs:3984-3995 | crates/izwi-core/src/engine/executor.rs:4001-4012 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor.rs:3984` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:414 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:414-425 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:181-192 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:414` it begins part-way through the construct above it, so those 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:434 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:434-445 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:433-444 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:434` 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 `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) crates/izwi-core/src/engine/executor/handler_chat.rs:879 — crates/izwi-core/src/engine/executor/handler_chat.rs:879-890 | crates/izwi-core/src/engine/executor/handler_chat.rs:1229-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/engine/executor/handler_chat.rs:1228` calls `state`, `is_some` and `crates/izwi-core/src/engine/executor/handler_chat.rs:878` 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 (12 lines × 2) crates/izwi-core/src/engine/executor/handler_maya1.rs:295 — crates/izwi-core/src/engine/executor/handler_maya1.rs:295-306 | crates/izwi-core/src/engine/executor/handler_maya2.rs:296-307 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_maya1.rs` and `crates/izwi-core/src/engine/executor/handler_maya2.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 373 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 `crates/izwi-core/src/engine/executor/handler_maya1.rs:295` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_maya1.rs:547 — crates/izwi-core/src/engine/executor/handler_maya1.rs:547-558 | crates/izwi-core/src/engine/executor/handler_maya2.rs:442-453 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_maya1.rs` and `crates/izwi-core/src/engine/executor/handler_maya2.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 373 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 `crates/izwi-core/src/engine/executor/handler_maya1.rs:547` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/izwi-core/src/kernels/cuda.rs:2136 — crates/izwi-core/src/kernels/cuda.rs:2136-2147 | crates/izwi-core/src/kernels/metal.rs:4772-4783 — before extracting anything, compare `crates/izwi-core/src/kernels/cuda.rs` and `crates/izwi-core/src/kernels/metal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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 lines × 2) crates/izwi-core/src/kernels/cuda.rs:3159 — crates/izwi-core/src/kernels/cuda.rs:3159-3170 | crates/izwi-core/src/kernels/cuda.rs:3318-3329 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda.rs:3159` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/cuda/moe.rs:892 — crates/izwi-core/src/kernels/cuda/moe.rs:892-903 | crates/izwi-core/src/kernels/cuda/moe.rs:1140-1151 — both copies are in the same file, so extract the 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, `crates/izwi-core/src/kernels/cuda/moe.rs:904` calls `arg` and `crates/izwi-core/src/kernels/cuda/moe.rs:1152` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) crates/izwi-core/src/kernels/metal.rs:2314 — crates/izwi-core/src/kernels/metal.rs:2314-2325 | crates/izwi-core/src/kernels/metal.rs:2860-2871 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:2314` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/izwi-core/src/kernels/relpos_attention.rs:913 — crates/izwi-core/src/kernels/relpos_attention.rs:913-924 | crates/izwi-core/src/kernels/transducer_greedy.rs:654-665 — before extracting anything, compare `crates/izwi-core/src/kernels/relpos_attention.rs` and `crates/izwi-core/src/kernels/transducer_greedy.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 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. 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 (12 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1119 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1119-1130 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1226-1237 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:817 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:817-828 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1101-1112 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:817` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/izwi-core/src/runtime/coordinator.rs:1295 — crates/izwi-core/src/runtime/coordinator.rs:1295-1306 | crates/izwi-core/src/runtime/coordinator.rs:1355-1366 — both copies are in the same file, so extract the 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 (12 lines × 2) crates/izwi-core/src/runtime/coordinator.rs:1606 — crates/izwi-core/src/runtime/coordinator.rs:1606-1617 | crates/izwi-core/src/runtime/coordinator.rs:1656-1667 — both copies are in the same file, so extract the 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 (12 lines × 2) crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:190 — crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:190-201 | crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:232-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (12 lines × 2) crates/izwi-core/src/runtime/service/asr_encoders.rs:585 — crates/izwi-core/src/runtime/service/asr_encoders.rs:585-596 | crates/izwi-core/src/runtime/service/asr_encoders.rs:928-939 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:585` 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 first that the copies are not typed on the same thing: the declarations holding them bind `rows` to `Vec<ParakeetEncoderPending>` in one and `Vec<NemotronEncoderPending>` 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) crates/izwi-core/src/runtime/service/asr_encoders.rs:730 — crates/izwi-core/src/runtime/service/asr_encoders.rs:730-741 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1047-1058 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:730` 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 lines × 2) crates/izwi-core/src/runtime/service/tts_preparation.rs:685 — crates/izwi-core/src/runtime/service/tts_preparation.rs:685-696 | crates/izwi-core/src/runtime/service/tts_preparation.rs:897-908 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:685` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/runtime/service/tts_preparation.rs:909` calls `clone` and `crates/izwi-core/src/runtime/service/tts_preparation.rs:697` 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 (12 lines × 2) crates/izwi-core/src/runtime/service/tts_preparation.rs:1776 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1776-1787 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1957-1968 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1776` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/izwi-core/src/runtime/speech_to_speech.rs:285 — crates/izwi-core/src/runtime/speech_to_speech.rs:285-296 | crates/izwi-core/src/runtime/speech_to_speech.rs:328-339 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/speech_to_speech.rs:285` 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.
  • + 17 more in this group — see findings.md.
D2 · Cognitive Complexity · izwi_server · ×40
  • izwi_server::api::tts_long_form::generate_speech_plan_stream_with_progress (cognitive 111) crates/izwi-server/src/api/tts_long_form.rs:1130 — izwi_server::api::tts_long_form::generate_speech_plan_stream_with_progress has cognitive complexity 111 (threshold 15). Drivers by points: if/else 34 (77 pts), match/switch 6 (17 pts), loops 5 (14 pts), boolean chains 3 (nesting depth added 63). 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.
  • izwi_server::api::openai::audio::transcriptions::parse_transcription_request (cognitive 69) crates/izwi-server/src/api/openai/audio/transcriptions.rs:952 — izwi_server::api::openai::audio::transcriptions::parse_transcription_request has cognitive complexity 69 (threshold 15). Drivers by points: if/else 17 (60 pts), match/switch 2 (7 pts), loops 1 (2 pts) (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.
  • izwi_server::api::speech_history::handlers::stream_record_creation (cognitive 68) crates/izwi-server/src/api/speech_history/handlers.rs:2295 — izwi_server::api::speech_history::handlers::stream_record_creation has cognitive complexity 68 (threshold 15). Drivers by points: if/else 23 (39 pts), match/switch 9 (24 pts), loops 3 (4 pts), boolean chains 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.
  • izwi_server::app::voice_realtime::handle_text_message (cognitive 59) crates/izwi-server/src/app/voice_realtime/mod.rs:1333 — izwi_server::app::voice_realtime::handle_text_message has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (51 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 31). 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.
  • izwi_server::api::openai::audio::transcriptions::transcribe (cognitive 49) crates/izwi-server/src/api/openai/audio/transcriptions.rs:394 — izwi_server::api::openai::audio::transcriptions::transcribe has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 14, match/switch 3 (6 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.
  • izwi_server::api::speech_history::durable::synthesize_fish_record (cognitive 47) crates/izwi-server/src/api/speech_history/durable.rs:192 — izwi_server::api::speech_history::durable::synthesize_fish_record has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 4 (8 pts), match/switch 4 (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.
  • izwi_server::app::voice_realtime::speak::speak_reply (cognitive 44) crates/izwi-server/src/app/voice_realtime/speak.rs:295 — izwi_server::app::voice_realtime::speak::speak_reply has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (35 pts), match/switch 3 (8 pts), loops 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.
  • izwi_server::app::voice_realtime::spawn_turn_task (cognitive 42) crates/izwi-server/src/app/voice_realtime/mod.rs:1951 — izwi_server::app::voice_realtime::spawn_turn_task has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 9 (15 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.
  • izwi_server::app::openai_realtime::respond::run_unified (cognitive 40) crates/izwi-server/src/app/openai_realtime/respond.rs:1422 — izwi_server::app::openai_realtime::respond::run_unified has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (25 pts), match/switch 6 (9 pts), boolean chains 3, loops 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.
  • izwi_server::api::speech_history::durable::replay_response (cognitive 39) crates/izwi-server/src/api/speech_history/durable.rs:674 — izwi_server::api::speech_history::durable::replay_response has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 5 (13 pts), loops 2 (3 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.
  • izwi_server::app::transcription_realtime::find_near_duplicate_span_range (cognitive 35) crates/izwi-server/src/app/transcription_realtime.rs:1935 — izwi_server::app::transcription_realtime::find_near_duplicate_span_range has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 4 (10 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.
  • izwi_server::api::openai::responses::handlers::build_input_messages (cognitive 34) crates/izwi-server/src/api/openai/responses/handlers.rs:887 — izwi_server::api::openai::responses::handlers::build_input_messages has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 4 (8 pts), boolean chains 2, loops 1 (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.
  • izwi_server::app::voice_realtime::handle_socket (cognitive 32) crates/izwi-server/src/app/voice_realtime/mod.rs:1207 — izwi_server::app::voice_realtime::handle_socket has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 5 (12 pts), 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.
  • izwi_server::api::openai::audio::align::parse_alignment_request (cognitive 31) crates/izwi-server/src/api/openai/audio/align.rs:173 — izwi_server::api::openai::audio::align::parse_alignment_request has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 1 (3 pts), loops 1 (2 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.
  • izwi_server::speech_spool::try_remove_stale_owner (cognitive 30) crates/izwi-server/src/speech_spool.rs:213 — izwi_server::speech_spool::try_remove_stale_owner has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 5 (6 pts), loops 2, 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.
  • izwi_server::api::speech_history::handlers::create_record (cognitive 29) crates/izwi-server/src/api/speech_history/handlers.rs:889 — izwi_server::api::speech_history::handlers::create_record has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 3 (7 pts), boolean chains 5 (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.
  • izwi_server::app::transcription_realtime::run_worker (cognitive 29) crates/izwi-server/src/app/transcription_realtime.rs:575 — izwi_server::app::transcription_realtime::run_worker has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 3 (8 pts), 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.
  • izwi_server::api::remote_audio::fetch_with_policy (cognitive 28) crates/izwi-server/src/api/remote_audio.rs:54 — izwi_server::api::remote_audio::fetch_with_policy has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 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.
  • izwi_server::app::openai_realtime::respond::agent_conversation (cognitive 27) crates/izwi-server/src/app/openai_realtime/respond.rs:1069 — izwi_server::app::openai_realtime::respond::agent_conversation has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 4 (10 pts), boolean chains 1, loops 1 (nesting depth added 16). 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.
  • izwi_server::api::admin::models::download_progress_stream (cognitive 26) crates/izwi-server/src/api/admin/models.rs:1022 — izwi_server::api::admin::models::download_progress_stream has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 3 (6 pts), boolean chains 2, 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.
  • izwi_server::api::openai::audio::speech::fish_file_speech (cognitive 26) crates/izwi-server/src/api/openai/audio/speech.rs:780 — izwi_server::api::openai::audio::speech::fish_file_speech has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 3 (6 pts), loops 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.
  • izwi_server::api::diarization::handlers::parse_create_request (cognitive 25) crates/izwi-server/src/api/diarization/handlers.rs:1028 — izwi_server::api::diarization::handlers::parse_create_request has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (3 pts), loops 1 (2 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.
  • izwi_server::app::voice_realtime::handle_binary_message (cognitive 25) crates/izwi-server/src/app/voice_realtime/mod.rs:1724 — izwi_server::app::voice_realtime::handle_binary_message has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, match/switch 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.
  • izwi_server::app::openai_realtime::session_config::parse_mcp_tool (cognitive 23) crates/izwi-server/src/app/openai_realtime/session_config.rs:556 — izwi_server::app::openai_realtime::session_config::parse_mcp_tool has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts), boolean chains 3, match/switch 2 (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.
  • izwi_server::api::transcription::handlers::parse_create_request (cognitive 22) crates/izwi-server/src/api/transcription/handlers.rs:1749 — izwi_server::api::transcription::handlers::parse_create_request has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (3 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.
  • + 15 more in this group — see findings.md.
X5 · Nullable reference types · Symbol treated as nullable, then dereferenced unguarded · ×40
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/lib.rs:813 — `table.order.remove(index)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `evict_expired_record` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/lib.rs:921 — `table.records.get_mut(attempt_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `install_admission` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/lib.rs:966 — `RequestDigest::new("cancel-tombstone")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `insert_cancel_tombstone` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/lib.rs:1613 — `lock_recover(&admission_slot).handoff.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `invoke` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/lib.rs:1705 — `Response::builder().status(StatusCode::OK).header(axum::http::header::CONTENT_TYPE,NDJSON_MEDIA_TYPE).body(Body::from_stream(output))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `invoke` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/realtime.rs:392 — `String::from_utf8(encoded)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `send_server_frame` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/realtime.rs:629 — `terminal` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_asr_stage` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/realtime.rs:712 — `stream.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `push_audio` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/realtime.rs:1051 — `terminal` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_tts_stage` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/realtime.rs:1169 — `encode_realtime_audio_frame(*audio_sequence,is_final,payload)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `emit_audio_frame` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/realtime.rs:1418 — `serde_json::to_string(&admitted)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `admit_session` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/realtime.rs:1459 — `RequestDigest::new(format!("rt-{hash:016x}"))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `realtime_attempt_digest` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-worker/src/runtime.rs:306 — `self.invocation.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `next_event` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/actor.rs:413 — `permit` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `launch` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/actor.rs:490 — `IncarnationId::new(uuid::Uuid::new_v4().simple().to_string())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `spawn_process` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/actor.rs:493 — `node.worker(&self.worker_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `spawn_process` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/autoscale.rs:324 — `DeploymentId::new(deployment_name.clone())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `from_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/lifecycle.rs:260 — `serde_json::to_string(worker_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `annotate_worker_line` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/quarantine.rs:100 — `digest[..8].try_into()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `for_worker` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/signals.rs:14 — `tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `shutdown_requested` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:91 — `autoscaler.deployment_mut(&deployment_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_autoscale_tick` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:137 — `autoscaler.deployment_mut(&deployment_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_autoscale_tick` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/daemon/diagnostics.rs:90 — `slot.actor.node().worker(slot.worker_id())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `runtime_diagnostic` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/daemon/mod.rs:269 — `node.config().autoscaling.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/izwi-serving-supervisor/src/daemon/mod.rs:390 — `rollout.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • + 15 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×39
  • ClassTooLong: Scheduler crates/izwi-core/src/engine/scheduler/mod.rs:438 — ClassTooLong — 2592 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 119 methods, 2 blocks, lines 438-4627. The bar is 400 significant lines; this is 2192 over it, 6.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Engine crates/izwi-core/src/engine/mod.rs:702 — ClassTooLong — 2046 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 76 methods, 2 blocks, lines 702-4082. The bar is 400 significant lines; this is 1646 over it, 5.12× 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: ChatPlayground ui/src/features/chat/components/ChatPlayground.tsx:1 — ClassTooLong — 1682 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 1282 over it, 4.21× 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: CandleAcceleratorKvArena crates/izwi-core/src/backends/kv/accelerator.rs:749 — ClassTooLong — 1680 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 3 blocks, lines 749-2836. The bar is 400 significant lines; this is 1280 over it, 4.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: AudioApiClient ui/src/shared/api/audio.ts:1185 — ClassTooLong — 1579 significant lines (blank, comment-only and punctuation-only lines excluded), 144 methods. The bar is 400 significant lines; this is 1179 over it, 3.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: ModelDownloader crates/izwi-core/src/artifacts/downloader.rs:1296 — ClassTooLong — 1557 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 38 methods, 2 blocks, lines 1296-3490. The bar is 400 significant lines; this is 1157 over it, 3.89× 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: StudioProjectStore REDACTED:362 — ClassTooLong — 1494 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 2 blocks, lines 362-2203. The bar is 400 significant lines; this is 1094 over it, 3.74× 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: NativeExecutor crates/izwi-core/src/engine/executor.rs:2802 — ClassTooLong — 1417 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 167 methods, 3 blocks, lines 2802-4862. The bar is 400 significant lines; this is 1017 over it, 3.54× 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: ModelVariant crates/izwi-model-catalog/src/catalog/metadata.rs:27 — ClassTooLong — 1297 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 75 methods, 4 blocks, lines 27-2061. The bar is 400 significant lines; this is 897 over it, 3.24× 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: InferenceCoordinator crates/izwi-core/src/runtime/coordinator.rs:768 — ClassTooLong — 1116 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 42 methods, 2 blocks, lines 768-2432. The bar is 400 significant lines; this is 716 over it, 2.79× 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: useVoiceSession ui/src/features/voice/useVoiceSession.ts:1 — ClassTooLong — 925 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 525 over it, 2.31× 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: InvocationStaticAttentionArena crates/izwi-core/src/backends/state/static_attention.rs:114 — ClassTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 2 blocks, lines 114-1254. The bar is 400 significant lines; this is 437 over it, 2.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: NewTextToSpeechModal ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:1 — ClassTooLong — 830 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 430 over it, 2.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Session crates/izwi-server/src/app/openai_realtime/connection.rs:90 — ClassTooLong — 826 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 35 methods, 2 blocks, lines 90-1515. The bar is 400 significant lines; this is 426 over it, 2.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.
  • ClassTooLong: InvocationTensorArena crates/izwi-core/src/backends/state/invocation.rs:119 — ClassTooLong — 787 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 44 methods, 2 blocks, lines 119-1201. The bar is 400 significant lines; this is 387 over it, 1.97× 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: KvCacheCoordinator crates/izwi-core/src/engine/cache/coordinator.rs:376 — ClassTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 28 methods, 2 blocks, lines 376-1579. The bar is 400 significant lines; this is 383 over it, 1.96× 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: ModelCatalogProvider ui/src/app/providers/ModelCatalogProvider.tsx:1 — ClassTooLong — 717 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 317 over it, 1.79× 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: NewDiarizationModal ui/src/features/diarization/components/NewDiarizationModal.tsx:1 — ClassTooLong — 713 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 313 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: BatchWorkerRunner crates/izwi-server/src/batch_runtime/worker.rs:576 — ClassTooLong — 672 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 2 blocks, lines 576-1477. The bar is 400 significant lines; this is 272 over it, 1.68× 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: TranscriptionStore crates/izwi-server/src/transcription_store.rs:289 — ClassTooLong — 661 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 2 blocks, lines 289-1150. The bar is 400 significant lines; this is 261 over it, 1.65× 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: SpeechHistoryStore crates/izwi-server/src/speech_history_store.rs:537 — ClassTooLong — 631 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 2 blocks, lines 537-1389. The bar is 400 significant lines; this is 231 over it, 1.58× 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: NewTranscriptionModal ui/src/features/transcription/components/NewTranscriptionModal.tsx:1 — ClassTooLong — 631 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 231 over it, 1.58× 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: Ledger crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:436 — ClassTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 35 methods, 2 blocks, lines 436-1384. The bar is 400 significant lines; this is 212 over it, 1.53× 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: RealtimeSession crates/izwi-serving-worker/src/realtime.rs:369 — ClassTooLong — 597 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 2 blocks, lines 369-1228. The bar is 400 significant lines; this is 197 over it, 1.49× 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: Session crates/izwi-server/src/api/openai/audio/speech_stream.rs:169 — ClassTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 169-928. The bar is 400 significant lines; this is 180 over it, 1.45× 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.
  • + 14 more in this group — see findings.md.
D31 · IaC & Container Security · Medium IaC · ×39
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×34
  • Duplicated block (13 lines × 2) crates/izwi-cli/src/commands/bench.rs:4162 — crates/izwi-cli/src/commands/bench.rs:4162-4174 | crates/izwi-cli/src/commands/bench.rs:4287-4299 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:4162` it begins part-way through the construct above it, so those 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) crates/izwi-cli/src/commands/serve.rs:89 — crates/izwi-cli/src/commands/serve.rs:89-101 | crates/izwi-cli/src/commands/serve.rs:162-174 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/serve.rs:89` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/backends/kv/accelerator.rs:1571 — crates/izwi-core/src/backends/kv/accelerator.rs:1571-1583 | crates/izwi-core/src/backends/kv/accelerator.rs:1692-1704 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/backends/kv/accelerator.rs:1571` 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, `crates/izwi-core/src/backends/kv/accelerator.rs:1691` calls `clone` and `crates/izwi-core/src/backends/kv/accelerator.rs:1570` 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 (13 lines × 2) crates/izwi-core/src/engine/executor/audio.rs:121 — crates/izwi-core/src/engine/executor/audio.rs:121-133 | crates/izwi-core/src/engine/executor/audio.rs:137-149 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/audio.rs: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 (13 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:586 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:586-598 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:448-460 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:586` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:238 — crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:238-250 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:243-255 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` and `crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 171 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 `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:238` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:259` calls `with_capacity` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:252` 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 (13 lines × 2) crates/izwi-core/src/engine/mod.rs:1568 — crates/izwi-core/src/engine/mod.rs:1568-1580 | crates/izwi-core/src/engine/mod.rs:1737-1749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/engine/scheduler/mod.rs:1683 — crates/izwi-core/src/engine/scheduler/mod.rs:1683-1695 | crates/izwi-core/src/engine/scheduler/mod.rs:1769-1781 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/scheduler/mod.rs:1683` 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.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/kernels/cuda.rs:1372 — crates/izwi-core/src/kernels/cuda.rs:1372-1384 | crates/izwi-core/src/kernels/cuda.rs:1535-1547 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda.rs:1372` 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) crates/izwi-core/src/kernels/cuda/gdn.rs:222 — crates/izwi-core/src/kernels/cuda/gdn.rs:222-234 | crates/izwi-core/src/kernels/cuda/gdn.rs:427-439 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/metal.rs:4648 — crates/izwi-core/src/kernels/metal.rs:4648-4660 | crates/izwi-core/src/kernels/metal.rs:4789-4801 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:4648` 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 (13 lines × 2) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1389 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1389-1401 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1497-1509 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/relpos_attention.rs:936 — crates/izwi-core/src/kernels/relpos_attention.rs:936-948 | crates/izwi-core/src/kernels/transducer_greedy.rs:671-683 — before extracting anything, compare `crates/izwi-core/src/kernels/relpos_attention.rs` and `crates/izwi-core/src/kernels/transducer_greedy.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 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 `crates/izwi-core/src/kernels/relpos_attention.rs:936` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:207 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:207-219 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1195-1207 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:219 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:219-231 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:863-875 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:219` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1857 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1857-1869 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:2041-2053 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1857` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/runtime/request.rs:463 — crates/izwi-core/src/runtime/request.rs:463-475 | crates/izwi-core/src/runtime/request.rs:487-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/request.rs:463` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/runtime/service/asr_encoders.rs:1235 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1235-1247 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1968-1980 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1235` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/service/asr_encoders.rs:1463 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1463-1475 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1726-1738 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1463` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/runtime/service/tts_preparation.rs:1232 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1232-1244 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1582-1594 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1232` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/runtime/service/tts_preparation.rs:1245` calls `clone` and `crates/izwi-core/src/runtime/service/tts_preparation.rs:1595` 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 (13 lines × 2) crates/izwi-gateway/src/app/remote_chat_dispatch.rs:263 — crates/izwi-gateway/src/app/remote_chat_dispatch.rs:263-275 | crates/izwi-gateway/src/app/remote_chat_dispatch.rs:325-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 `crates/izwi-gateway/src/app/remote_chat_dispatch.rs:263` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/izwi-gateway/src/gateway.rs:1426 — crates/izwi-gateway/src/gateway.rs:1426-1438 | crates/izwi-server/src/api/router.rs:85-97 — 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 `crates/izwi-gateway/src/gateway.rs:1426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/izwi-server/src/batch_runtime/worker.rs:1057 — crates/izwi-server/src/batch_runtime/worker.rs:1057-1069 | crates/izwi-server/src/batch_runtime/worker.rs:1101-1113 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/batch_runtime/worker.rs:1057` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/persistence/mod.rs:390 — crates/izwi-server/src/persistence/mod.rs:390-402 | crates/izwi-server/src/persistence/mod.rs:484-496 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/persistence/mod.rs:390` 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, `crates/izwi-server/src/persistence/mod.rs:483` calls `clone` and `crates/izwi-server/src/persistence/mod.rs:389` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:259 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:259-271 | crates/izwi-core/src/engine/executor/handler_tts.rs:1742-1754 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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 `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:259` 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.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×31
  • Duplicated block (5 lines × 2) crates/izwi-core/src/audio/preprocessing.rs:319 — crates/izwi-core/src/audio/preprocessing.rs:319-326 | crates/izwi-core/src/models/architectures/lfm25_audio/preprocessor.rs:213-217 — 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 `crates/izwi-core/src/audio/preprocessing.rs:319` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/backends/state/invocation.rs:1075 — crates/izwi-core/src/backends/state/invocation.rs:1075-1079 | crates/izwi-core/src/backends/state/invocation.rs:1140-1144 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/backends/state/invocation.rs:1075` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:217 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:217-221 | crates/izwi-core/src/engine/executor/fish_pending.rs:197-201 — before extracting anything, compare `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs` and `crates/izwi-core/src/engine/executor/fish_pending.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 83 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 `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:217` 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) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:302 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:302-306 | crates/izwi-core/src/engine/executor/fish_pending.rs:269-273 — before extracting anything, compare `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs` and `crates/izwi-core/src/engine/executor/fish_pending.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 83 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 `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:302` 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) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:600 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:600-604 | crates/izwi-core/src/engine/executor/handler_tts.rs:2039-2043 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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 `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:600` 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 × 2) crates/izwi-core/src/engine/scheduler/mod.rs:4408 — crates/izwi-core/src/engine/scheduler/mod.rs:4408-4412 | crates/izwi-core/src/engine/scheduler/mod.rs:4446-4450 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/scheduler/mod.rs:4408` 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) crates/izwi-core/src/kernels/cuda/moe.rs:864 — crates/izwi-core/src/kernels/cuda/moe.rs:864-868 | crates/izwi-core/src/kernels/cuda/moe.rs:1066-1070 — both copies are in the same file, so extract the 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, `crates/izwi-core/src/kernels/cuda/moe.rs:1071` calls `Some` and `crates/izwi-core/src/kernels/cuda/moe.rs:869` 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 (5 lines × 2) crates/izwi-core/src/kernels/cuda/sampling.rs:182 — crates/izwi-core/src/kernels/cuda/sampling.rs:182-187 | crates/izwi-core/src/kernels/cuda/sampling.rs:243-247 — both copies are in the same file, so extract the 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) crates/izwi-core/src/runtime/service.rs:750 — crates/izwi-core/src/runtime/service.rs:750-754 | crates/izwi-core/src/runtime/service.rs:908-912 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service.rs:750` 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) crates/izwi-gateway/src/gateway.rs:152 — crates/izwi-gateway/src/gateway.rs:152-156 | crates/izwi-server/src/local_security.rs:501-506 — 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 `crates/izwi-gateway/src/gateway.rs: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.
  • Duplicated block (5 lines × 2) crates/izwi-serving-supervisor/src/lifecycle.rs:472 — crates/izwi-serving-supervisor/src/lifecycle.rs:472-476 | crates/izwi-serving-supervisor/src/lifecycle.rs:537-542 — both copies are in the same file, so extract the 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 `crates/izwi-serving-supervisor/src/lifecycle.rs:472` 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 × 2) crates/izwi-core/src/engine/executor/audio.rs:376 — crates/izwi-core/src/engine/executor/audio.rs:376-380 | crates/izwi-core/src/models/architectures/whisper/asr/mod.rs:3899-3903 — 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) crates/izwi-core/src/kernels/cuda/split_decode.rs:425 — crates/izwi-core/src/kernels/cuda/split_decode.rs:425-429 | crates/izwi-core/src/models/architectures/qwen38/text.rs:6132-6136 — 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) crates/izwi-server/src/voice_observation_store.rs:340 — crates/izwi-server/src/voice_observation_store.rs:340-344 | crates/izwi-server/src/voice_store.rs:734-738 — 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) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:71 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:71-75 | crates/izwi-core/src/engine/executor/fish_pending.rs:45-52 — before extracting anything, compare `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs` and `crates/izwi-core/src/engine/executor/fish_pending.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 83 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. 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 (5 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:209 — crates/izwi-core/src/runtime/service/asr_preparation.rs:209-214 | crates/izwi-core/src/runtime/service/asr_preparation.rs:444-448 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:209` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_asr/voxtral_offline.rs:448 — crates/izwi-core/src/engine/executor/handler_asr/voxtral_offline.rs:448-452 | crates/izwi-core/src/engine/executor/handler_tts.rs:4400-4404 — 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 `crates/izwi-core/src/engine/executor/handler_asr/voxtral_offline.rs: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.
  • Duplicated block (5 lines × 2) crates/izwi-core/src/kernels/mamba2.rs:592 — crates/izwi-core/src/kernels/mamba2.rs:592-596 | crates/izwi-core/src/kernels/race_sampler.rs:216-220 — 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 `crates/izwi-core/src/kernels/mamba2.rs:592` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/metal.rs:3242 — crates/izwi-core/src/kernels/metal.rs:3242-3246 | crates/izwi-core/src/kernels/metal.rs:3367-3371 — both copies are in the same file, so extract the 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, `crates/izwi-core/src/kernels/metal.rs:3248` calls `shape`, `elem_count`, `saturating_mul` and `crates/izwi-core/src/kernels/metal.rs:3373` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/lfm3_live.rs:328 — crates/izwi-core/src/engine/executor/handler_asr/lfm3_live.rs:328-332 | crates/izwi-core/src/engine/executor/handler_asr/lfm3_live.rs:354-358 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/greedy.rs:245 — crates/izwi-core/src/kernels/greedy.rs:245-249 | crates/izwi-core/src/kernels/penalized_topk.rs:421-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 `crates/izwi-core/src/kernels/greedy.rs:245` 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) crates/izwi-core/src/kernels/cuda/kquant.rs:389 — crates/izwi-core/src/kernels/cuda/kquant.rs:389-393 | crates/izwi-core/src/kernels/cuda/kquant.rs:561-565 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/kquant.rs:389` 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) crates/izwi-core/src/runtime/service/asr_encoders.rs:779 — crates/izwi-core/src/runtime/service/asr_encoders.rs:779-783 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1102-1106 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:779` 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) crates/izwi-core/src/kernels/cuda.rs:208 — crates/izwi-core/src/kernels/cuda.rs:208-212 | crates/izwi-core/src/kernels/cuda.rs:244-248 — both copies are in the same file, so extract the 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) crates/izwi-core/src/kernels/cuda/moe.rs:820 — crates/izwi-core/src/kernels/cuda/moe.rs:820-824 | crates/izwi-core/src/kernels/cuda/moe.rs:1001-1005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 6 more in this group — see findings.md.
D1 · Cyclomatic Complexity · izwi_server · ×30
  • izwi_server::app::voice_realtime::map_typed_voice_event (cyclomatic 49) crates/izwi-server/src/app/voice_realtime/mod.rs:3936 — izwi_server::app::voice_realtime::map_typed_voice_event has cyclomatic complexity 49 (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.
  • izwi_server::api::tts_long_form::generate_speech_plan_stream_with_progress (cyclomatic 47) crates/izwi-server/src/api/tts_long_form.rs:1130 — izwi_server::api::tts_long_form::generate_speech_plan_stream_with_progress 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.
  • izwi_server::api::openai::audio::transcriptions::parse_transcription_request (cyclomatic 39) crates/izwi-server/src/api/openai/audio/transcriptions.rs:952 — izwi_server::api::openai::audio::transcriptions::parse_transcription_request has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • izwi_server::api::openai::audio::transcriptions::transcribe (cyclomatic 38) crates/izwi-server/src/api/openai/audio/transcriptions.rs:394 — izwi_server::api::openai::audio::transcriptions::transcribe has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • izwi_server::api::speech_history::handlers::stream_record_creation (cyclomatic 33) crates/izwi-server/src/api/speech_history/handlers.rs:2295 — izwi_server::api::speech_history::handlers::stream_record_creation 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.
  • izwi_server::app::voice_realtime::handle_text_message (cyclomatic 33) crates/izwi-server/src/app/voice_realtime/mod.rs:1333 — izwi_server::app::voice_realtime::handle_text_message 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.
  • izwi_server::app::openai_realtime::respond::run_unified (cyclomatic 32) crates/izwi-server/src/app/openai_realtime/respond.rs:1422 — izwi_server::app::openai_realtime::respond::run_unified 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.
  • izwi_server::api::speech_history::durable::synthesize_fish_record (cyclomatic 26) crates/izwi-server/src/api/speech_history/durable.rs:192 — izwi_server::api::speech_history::durable::synthesize_fish_record 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.
  • izwi_server::api::diarization::handlers::parse_create_request (cyclomatic 25) crates/izwi-server/src/api/diarization/handlers.rs:1028 — izwi_server::api::diarization::handlers::parse_create_request 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.
  • izwi_server::app::voice_realtime::spawn_turn_task (cyclomatic 25) crates/izwi-server/src/app/voice_realtime/mod.rs:1951 — izwi_server::app::voice_realtime::spawn_turn_task 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.
  • izwi_server::api::openai::responses::handlers::build_input_messages (cyclomatic 23) crates/izwi-server/src/api/openai/responses/handlers.rs:887 — izwi_server::api::openai::responses::handlers::build_input_messages 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.
  • izwi_server::roles::local::run_local (cyclomatic 23) crates/izwi-server/src/roles/local.rs:34 — izwi_server::roles::local::run_local has cyclomatic complexity 23 (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.
  • izwi_server::speech_spool::try_remove_stale_owner (cyclomatic 22) crates/izwi-server/src/speech_spool.rs:213 — izwi_server::speech_spool::try_remove_stale_owner 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.
  • izwi_server::api::speech_history::durable::replay_response (cyclomatic 21) crates/izwi-server/src/api/speech_history/durable.rs:674 — izwi_server::api::speech_history::durable::replay_response 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.
  • izwi_server::app::openai_realtime::session_config::parse_mcp_tool (cyclomatic 21) crates/izwi-server/src/app/openai_realtime/session_config.rs:556 — izwi_server::app::openai_realtime::session_config::parse_mcp_tool 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.
  • izwi_server::api::speech_history::handlers::create_record (cyclomatic 20) crates/izwi-server/src/api/speech_history/handlers.rs:889 — izwi_server::api::speech_history::handlers::create_record 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.
  • izwi_server::api::transcription::handlers::parse_create_request (cyclomatic 20) crates/izwi-server/src/api/transcription/handlers.rs:1749 — izwi_server::api::transcription::handlers::parse_create_request 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.
  • izwi_server::app::voice_realtime::handle_socket (cyclomatic 20) crates/izwi-server/src/app/voice_realtime/mod.rs:1207 — izwi_server::app::voice_realtime::handle_socket 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.
  • izwi_server::app::voice_realtime::handle_binary_message (cyclomatic 20) crates/izwi-server/src/app/voice_realtime/mod.rs:1724 — izwi_server::app::voice_realtime::handle_binary_message 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.
  • izwi_server::app::openai_realtime::connection::run_session (cyclomatic 18) crates/izwi-server/src/app/openai_realtime/connection.rs:230 — izwi_server::app::openai_realtime::connection::run_session 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.
  • izwi_server::app::openai_realtime::events::parse_client_event (cyclomatic 18) crates/izwi-server/src/app/openai_realtime/events.rs:189 — izwi_server::app::openai_realtime::events::parse_client_event has cyclomatic complexity 18 (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.
  • izwi_server::app::voice_realtime::speak::speak_reply (cyclomatic 18) crates/izwi-server/src/app/voice_realtime/speak.rs:295 — izwi_server::app::voice_realtime::speak::speak_reply 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.
  • izwi_server::api::openai::audio::speech::fish_file_speech (cyclomatic 17) crates/izwi-server/src/api/openai/audio/speech.rs:780 — izwi_server::api::openai::audio::speech::fish_file_speech 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.
  • izwi_server::api::remote_audio::fetch_with_policy (cyclomatic 17) crates/izwi-server/src/api/remote_audio.rs:54 — izwi_server::api::remote_audio::fetch_with_policy 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.
  • izwi_server::api::tts_policy::validate_speech_voice (cyclomatic 17) crates/izwi-server/src/api/tts_policy.rs:52 — izwi_server::api::tts_policy::validate_speech_voice has cyclomatic complexity 17 (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.
  • + 5 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Unfinished branch · ×28
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/engine/executor/dispatch.rs:1568 — `finish_scheduled_execution` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/engine/executor/handler_tts.rs:2834 — `qwen_tts_request_with_managed_cache` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/engine/executor/handler_tts.rs:4125 — `tts_decode_batch_with_managed` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/engine/executor/handler_tts.rs:4449 — `qwen_tts_audio_batch` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/engine/executor/handler_tts.rs:4553 — `qwen_tts_finalize_request` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/engine/request/state_binding.rs:236 — `project_paged_state_input` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/kernels/cuda/gdn.rs:106 — `conv_decode` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/kernels/cuda/gdn.rs:190 — `recurrent_decode` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/kernels/cuda/gdn.rs:282 — `conv_span` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/kernels/cuda/gdn.rs:353 — `recurrent_span` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/kernels/cuda/moe.rs:461 — `route` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/kernels/cuda/moe.rs:514 — `fp8_gate_up` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/kernels/cuda/moe.rs:579 — `fp8_down` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/kernels/cuda/rope.rs:124 — `qk_norm_rope` does real work, but one of its branches is `bail!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/fish_drama3/config.rs:468 — `require` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/fish_drama3/config.rs:669 — `trunk_config` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:833 — `retained_preparation_geometry_for_features` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:1230 — `prepare_prompt_artifact_batch_from_features` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/granite_speech/asr/runtime.rs:1402 — `expand_audio_tokens` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/granite_speech/asr/runtime.rs:1414 — `expand_audio_tokens` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/kokoro/mod.rs:779 — `prepared_from_phonemes` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/lfm3_audio/model.rs:349 — `reply_request` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/maya2/config.rs:270 — `check_release_config` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/maya2/text/tn.rs:401 — `validate` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/izwi-core/src/models/architectures/nemotron_transcribe/checkpoint.rs:463 — `ctc_geometry` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • + 3 more in this group — see findings.md.
X18 · Disposal-pattern correctness · Explicit release owed and not made on every path · ×28
  • Explicit release owed and not made on every path crates/izwi-core/src/runtime/tts.rs:775 — `metrics` (line 775) is a `TtsRequestMetrics` released by `complete()` only on the path that reaches line 807; the `return` on line 809 leaves before that with a success value, and on that path `TtsRequestMetrics` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/voxtral/lm.rs:535 — `completions` (line 535) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 579; the `return` on line 561 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/voxtral/lm.rs:873 — `reference_completions` (line 873) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen38/decode_graph.rs:937 — `scratch` (line 937) is a `StateOutputs` this function owns and never releases: no `publish()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateOutputs` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen38/mtp.rs:643 — `completions` (line 643) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 671; the `return` on line 671 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen38/step_graph.rs:660 — `scratch` (line 660) is a `StateOutputs` this function owns and never releases: no `publish()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateOutputs` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen38/text.rs:1518 — `completions` (line 1518) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1542; the `return` on line 1542 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen38/text.rs:1626 — `completions` (line 1626) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1669; the `return` on line 1669 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen38/text.rs:1633 — `collector` (line 1633) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen36moe/decode_graph.rs:815 — `scratch` (line 815) is a `StateOutputs` this function owns and never releases: no `publish()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateOutputs` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen36moe/mtp.rs:310 — `completions` (line 310) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 340; the `return` on line 340 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen36moe/step_graph.rs:626 — `scratch` (line 626) is a `StateOutputs` this function owns and never releases: no `publish()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `StateOutputs` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen36moe/text.rs:1935 — `completions` (line 1935) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 2045; the `return` on line 1978 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen36moe/text.rs:1946 — `collector` (line 1946) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen36moe/text.rs:1994 — `collector` (line 1994) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen35/text.rs:1052 — `completions` (line 1052) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1122; the `return` on line 1103 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen35/text.rs:1068 — `collector` (line 1068) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen3/core.rs:3299 — `completions` (line 3299) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen3/core.rs:3555 — `reference_completions` (line 3555) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen3/core.rs:3877 — `completions` (line 3877) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen3/tts/predictor.rs:1536 — `completions` (line 1536) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1561; the `return` on line 1561 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/qwen3/tts/talker.rs:1086 — `completions` (line 1086) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 1115; the `return` on line 1115 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/lfm25_audio/audio_output.rs:671 — `completions` (line 671) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 691; the `return` on line 691 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/granite_speech/asr/runtime.rs:3278 — `completions` (line 3278) is a `KvWriteCompletionCollector` released by `drain()` only on the path that reaches line 3322; the `return` on line 3322 leaves before that with a success value, and on that path `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path crates/izwi-core/src/models/architectures/gemma3/core.rs:791 — `completions` (line 791) is a `KvWriteCompletionCollector` this function owns and never releases: no `drain()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `KvWriteCompletionCollector` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×27
  • Duplicated block (14 lines × 2) crates/izwi-core/src/backends/kv/accelerator.rs:1000 — crates/izwi-core/src/backends/kv/accelerator.rs:1000-1013 | crates/izwi-core/src/backends/kv/cpu.rs:156-169 — before extracting anything, compare `crates/izwi-core/src/backends/kv/accelerator.rs` and `crates/izwi-core/src/backends/kv/cpu.rs` as WHOLE FILES: this scan already matched 9 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 (14 lines × 2) crates/izwi-core/src/engine/cache/physical.rs:1151 — crates/izwi-core/src/engine/cache/physical.rs:1151-1164 | crates/izwi-core/src/runtime/lifecycle/load/invocation.rs:149-162 — 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 `crates/izwi-core/src/engine/cache/physical.rs:1151` 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) crates/izwi-core/src/engine/executor/audio.rs:849 — crates/izwi-core/src/engine/executor/audio.rs:849-862 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:762-775 — before extracting anything, compare `crates/izwi-core/src/engine/executor/audio.rs` and `crates/izwi-core/src/runtime/asr/speaker_attribution.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 `crates/izwi-core/src/engine/executor/audio.rs:849` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:503 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:503-516 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:503-516 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 (14 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:285 — crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:285-298 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:475-488 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:285` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) crates/izwi-core/src/engine/executor/handler_maya1.rs:67 — crates/izwi-core/src/engine/executor/handler_maya1.rs:67-80 | crates/izwi-core/src/engine/executor/handler_maya2.rs:68-81 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_maya1.rs` and `crates/izwi-core/src/engine/executor/handler_maya2.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 373 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. 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 (14 lines × 2) crates/izwi-core/src/kernels/mamba2.rs:611 — crates/izwi-core/src/kernels/mamba2.rs:611-624 | crates/izwi-core/src/kernels/mamba2.rs:692-705 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/mamba2.rs:611` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/izwi-core/src/kernels/metal.rs:4688 — crates/izwi-core/src/kernels/metal.rs:4688-4701 | crates/izwi-core/src/kernels/metal.rs:4728-4741 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:4688` 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 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:924 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:924-937 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1124-1137 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:924` 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) crates/izwi-core/src/runtime/coordinator.rs:2172 — crates/izwi-core/src/runtime/coordinator.rs:2172-2185 | crates/izwi-core/src/runtime/coordinator.rs:2228-2241 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/coordinator.rs:2172` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/service/asr_encoders.rs:1499 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1499-1512 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1762-1775 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1499` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:581 — crates/izwi-core/src/runtime/service/asr_preparation.rs:581-594 | crates/izwi-core/src/runtime/service/asr_preparation.rs:843-856 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:581` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/service/asr_preparation.rs:1162 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1162-1175 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2217-2230 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1162` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:1321 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1321-1334 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2330-2343 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1321` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/api/internal/health.rs:188 — crates/izwi-server/src/api/internal/health.rs:188-201 | crates/izwi-server/src/roles/local.rs:584-597 — 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 (14 lines × 2) crates/izwi-server/src/speech_history_store.rs:1088 — crates/izwi-server/src/speech_history_store.rs:1088-1101 | crates/izwi-server/src/speech_history_store.rs:1305-1318 — both copies are in the same file, so extract the 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) crates/izwi-server/src/state.rs:551 — crates/izwi-server/src/state.rs:551-564 | crates/izwi-server/src/state.rs:662-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-server/src/state.rs:551` it begins part-way through the construct above it, so those 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 × 2) crates/izwi-core/src/kernels/cuda/fp8.rs:453 — crates/izwi-core/src/kernels/cuda/fp8.rs:453-466 | crates/izwi-core/src/kernels/cuda/fp8.rs:511-524 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/fp8.rs:453` 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:28 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:28-41 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1026-1039 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:28` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/audio.rs:1498 — crates/izwi-core/src/engine/executor/audio.rs:1498-1511 | crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:2450-2463 — 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 `crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:2450` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/voice_store.rs:357 — crates/izwi-server/src/voice_store.rs:357-371 | crates/izwi-server/src/voice_store.rs:391-404 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/voice_store.rs:357` 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) crates/izwi-server/src/api/speech_history/handlers.rs:2388 — crates/izwi-server/src/api/speech_history/handlers.rs:2388-2402 | crates/izwi-server/src/api/speech_history/handlers.rs:2421-2434 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/api/speech_history/handlers.rs:2388` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-cli/src/commands/bench.rs:1811 — crates/izwi-cli/src/commands/bench.rs:1811-1824 | crates/izwi-cli/src/commands/bench.rs:2122-2135 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:1811` it begins part-way through the construct above it, so those 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, `crates/izwi-cli/src/commands/bench.rs:2138` calls `tts_model_is_final_only` and `crates/izwi-cli/src/commands/bench.rs:1827` 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 (14 lines × 2) crates/izwi-core/src/engine/cache/physical.rs:736 — crates/izwi-core/src/engine/cache/physical.rs:736-749 | crates/izwi-core/src/engine/cache/physical.rs:886-899 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/cache/physical.rs:736` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/izwi-server/src/artifact_store.rs:1026 — crates/izwi-server/src/artifact_store.rs:1026-1039 | crates/izwi-server/src/artifact_store.rs:1086-1099 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/artifact_store.rs:1026` it begins part-way through the construct above it, so those 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 `write` to `ArtifactWrite` in one and `ArtifactFileWrite` 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.
  • + 2 more in this group — see findings.md.
D1 · Cyclomatic Complexity · izwi_core · ×24
  • izwi_core::runtime::service::bind_request_to_residency (cyclomatic 32) crates/izwi-core/src/runtime/service.rs:1062 — izwi_core::runtime::service::bind_request_to_residency has cyclomatic complexity 32 (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.
  • izwi_core::kernels::cuda::graphs_region::device::run (cyclomatic 30) crates/izwi-core/src/kernels/cuda/graphs_region.rs:238 — izwi_core::kernels::cuda::graphs_region::device::run 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.
  • izwi_core::runtime::lifecycle::asr_memory::price_granite (cyclomatic 30) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:2615 — izwi_core::runtime::lifecycle::asr_memory::price_granite 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.
  • izwi_core::runtime::audio_io::decode_audio_bytes_symphonia_with_metadata (cyclomatic 29) crates/izwi-core/src/runtime/audio_io.rs:772 — izwi_core::runtime::audio_io::decode_audio_bytes_symphonia_with_metadata has cyclomatic complexity 29 (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.
  • izwi_core::engine::executor::physical_paged_cache_for_row (cyclomatic 28) crates/izwi-core/src/engine/executor.rs:599 — izwi_core::engine::executor::physical_paged_cache_for_row 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.
  • izwi_core::kernels::cuda::fp8::verify_and_enable_tensor_core (cyclomatic 26) crates/izwi-core/src/kernels/cuda/fp8.rs:230 — izwi_core::kernels::cuda::fp8::verify_and_enable_tensor_core has cyclomatic complexity 26 (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.
  • izwi_core::runtime::lifecycle::load::invocation::plan_invocation_allocations (cyclomatic 25) crates/izwi-core/src/runtime/lifecycle/load/invocation.rs:54 — izwi_core::runtime::lifecycle::load::invocation::plan_invocation_allocations 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.
  • izwi_core::kernels::relpos_attention::cuda_impl::run (cyclomatic 24) crates/izwi-core/src/kernels/relpos_attention.rs:1030 — izwi_core::kernels::relpos_attention::cuda_impl::run has cyclomatic complexity 24 (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.
  • izwi_core::runtime::lifecycle::asr_memory::price_qwen3_asr (cyclomatic 23) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1683 — izwi_core::runtime::lifecycle::asr_memory::price_qwen3_asr 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.
  • izwi_core::backends::kv::accelerator::validate_config (cyclomatic 22) crates/izwi-core/src/backends/kv/accelerator.rs:2918 — izwi_core::backends::kv::accelerator::validate_config has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • izwi_core::runtime::diarization::fallback_word_timings_with_segments (cyclomatic 22) crates/izwi-core/src/runtime/diarization.rs:1811 — izwi_core::runtime::diarization::fallback_word_timings_with_segments 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.
  • izwi_core::bin::kokoro_inspect::main (cyclomatic 21) crates/izwi-core/src/bin/kokoro_inspect.rs:5 — izwi_core::bin::kokoro_inspect::main has cyclomatic complexity 21 (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.
  • izwi_core::engine::executor::loaded_native_batch_support (cyclomatic 20) crates/izwi-core/src/engine/executor.rs:3113 — izwi_core::engine::executor::loaded_native_batch_support 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.
  • izwi_core::kernels::cuda::launch_cuda_paged_decode_one_pass_into (cyclomatic 19) crates/izwi-core/src/kernels/cuda.rs:1990 — izwi_core::kernels::cuda::launch_cuda_paged_decode_one_pass_into has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • izwi_core::kernels::depthwise_conv::cuda_impl::run (cyclomatic 19) crates/izwi-core/src/kernels/depthwise_conv.rs:372 — izwi_core::kernels::depthwise_conv::cuda_impl::run has cyclomatic complexity 19 (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.
  • izwi_core::text_segments::sentences::sentence_spans (cyclomatic 19) crates/izwi-core/src/text_segments/sentences.rs:63 — izwi_core::text_segments::sentences::sentence_spans has cyclomatic complexity 19 (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.
  • izwi_core::backends::kv::cpu::online_paged_decode (cyclomatic 18) crates/izwi-core/src/backends/kv/cpu.rs:839 — izwi_core::backends::kv::cpu::online_paged_decode has cyclomatic complexity 18 (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.
  • izwi_core::kernels::transducer_greedy::select_step_reference (cyclomatic 18) crates/izwi-core/src/kernels/transducer_greedy.rs:221 — izwi_core::kernels::transducer_greedy::select_step_reference 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.
  • izwi_core::runtime::lifecycle::asr_memory::price_qwen3_chat_safetensors (cyclomatic 18) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:3324 — izwi_core::runtime::lifecycle::asr_memory::price_qwen3_chat_safetensors 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.
  • izwi_core::runtime::diarization::stabilize_word_speakers (cyclomatic 17) crates/izwi-core/src/runtime/diarization.rs:2214 — izwi_core::runtime::diarization::stabilize_word_speakers 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.
  • izwi_core::engine::cache::managed::capacity::plan_managed_state_capacity_with_policy (cyclomatic 16) crates/izwi-core/src/engine/cache/managed/capacity.rs:10 — izwi_core::engine::cache::managed::capacity::plan_managed_state_capacity_with_policy 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.
  • izwi_core::kernels::cuda::paged_decode_attention_with_graph (cyclomatic 16) crates/izwi-core/src/kernels/cuda.rs:1516 — izwi_core::kernels::cuda::paged_decode_attention_with_graph 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.
  • izwi_core::kernels::cuda::sampling::reference_probs (cyclomatic 16) crates/izwi-core/src/kernels/cuda/sampling.rs:152 — izwi_core::kernels::cuda::sampling::reference_probs 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.
  • izwi_core::runtime::lifecycle::asr_memory::price_vibevoice (cyclomatic 16) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:2900 — izwi_core::runtime::lifecycle::asr_memory::price_vibevoice 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.
X25 · Inert configuration knob · Configuration option is read nowhere · ×23
  • Configuration option is read nowhere crates/izwi-cli/src/app/cli.rs:700 — `ModelCommands::Load.wait` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-cli/src/commands/bench.rs:77 — `LoadedModelTelemetrySnapshot.family_diagnostics` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-cli/src/commands/bench.rs:219 — `RuntimeLatencyStats.p50` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-cli/src/commands/bench.rs:272 — `KernelPathTelemetrySnapshot.fused_attention_fallback_flash_compute_capability_unsupported_total` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/backends/device.rs:112 — `DTypeSelectionRequest.quantized` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/engine/types.rs:378 — `TokenStats.prefill_time_ms` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/fish_s2/config.rs:36 — `FishS2RawConfig.torch_dtype` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:97 — `GraniteSpeechEncoderConfig.dropout` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:112 — `GraniteSpeechProjectorConfig.attention_probs_dropout_prob` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:117 — `GraniteSpeechProjectorConfig.hidden_dropout_prob` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:130 — `GraniteSpeechProjectorConfig.use_qformer_text_input` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:134 — `GraniteSpeechProjectorConfig.chunk_size_feed_forward` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:193 — `GraniteSpeechProcessorConfigFile.processor_class` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:199 — `GraniteSpeechAudioProcessorConfig.feature_extractor_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech/asr/config.rs:247 — `GraniteSpeechTokenizerConfig.processor_class` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech5/asr/config.rs:56 — `GraniteSpeech5EncoderConfig.dropout` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech5/asr/config.rs:82 — `GraniteSpeech5ProjectorConfig.use_qformer_text_input` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/granite_speech5/asr/config.rs:139 — `GraniteSpeech5AudioProcessorConfig.feature_extractor_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/kokoro/config.rs:24 — `KokoroPlbertConfig.dropout` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/kokoro/config.rs:31 — `KokoroConfig.dropout` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/qwen3/asr/config.rs:18 — `Qwen3AsrConfig.support_languages` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/qwen3/asr/config.rs:71 — `ThinkerConfig.audio_start_token_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/izwi-core/src/models/architectures/qwen3/tts/config.rs:11 — `Qwen3TtsConfig.tokenizer_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×22
  • Edited copy of a member (13 corresponding lines) crates/izwi-core/src/kernels/cuda/gdn.rs:681 — crates/izwi-core/src/kernels/cuda/gdn.rs:681-693 | crates/izwi-core/src/kernels/cuda/rope.rs:571-583 — 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) crates/izwi-server/src/voice_observation_store.rs:192 — crates/izwi-server/src/voice_observation_store.rs:192-204 | crates/izwi-server/src/voice_observation_store.rs:206-218 — 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) crates/izwi-core/src/engine/executor.rs:2715 — crates/izwi-core/src/engine/executor.rs:2715-2727 | crates/izwi-core/src/engine/executor.rs:2728-2740 — 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) crates/izwi-core/src/engine/executor.rs:2164 — crates/izwi-core/src/engine/executor.rs:2164-2177 | crates/izwi-core/src/engine/executor.rs:2237-2249 — 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:41 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:41-53 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:40-52 — 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) crates/izwi-server/src/api/speech_history/durable.rs:821 — crates/izwi-core/src/models/architectures/fish_drama3/artifacts.rs:279-291 | crates/izwi-server/src/api/speech_history/durable.rs:821-835 — 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) crates/izwi-server/src/voice_observation_store.rs:55 — crates/izwi-server/src/voice_observation_store.rs:55-67 | crates/izwi-server/src/voice_store.rs:244-287 — 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) crates/izwi-server/src/lib.rs:119 — crates/izwi-server/src/lib.rs:119-133 | crates/izwi-server/src/lib.rs:163-175 — 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) crates/izwi-core/src/engine/executor/handler_maya1.rs:30 — crates/izwi-core/src/engine/executor/handler_maya1.rs:30-42 | crates/izwi-core/src/engine/executor/handler_maya2.rs:31-43 — 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) crates/izwi-core/src/engine/cache/invocation.rs:331 — crates/izwi-core/src/engine/cache/invocation.rs:331-345 | crates/izwi-core/src/engine/cache/invocation_tensor.rs:481-493 — 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) crates/izwi-core/src/runtime/lifecycle/load.rs:200 — crates/izwi-core/src/runtime/lifecycle/load.rs:200-213 | crates/izwi-model-catalog/src/catalog/metadata.rs:1020-1032 — 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) crates/izwi-server/src/batch_runtime/worker.rs:1499 — crates/izwi-server/src/batch_runtime/worker.rs:1499-1511 | crates/izwi-server/src/batch_runtime/worker.rs:1518-1536 — 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) crates/izwi-server/src/app/voice_realtime/turn.rs:224 — crates/izwi-server/src/app/voice_realtime/turn.rs:224-237 | crates/izwi-server/src/batch_runtime/worker.rs:346-358 — 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) crates/izwi-core/src/engine/executor/audio.rs:815 — crates/izwi-core/src/engine/executor/audio.rs:815-827 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:731-743 — 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) crates/izwi-gateway/src/gateway_fleet/fleet.rs:217 — crates/izwi-gateway/src/gateway_fleet/fleet.rs:217-229 | crates/izwi-gateway/src/gateway_fleet/fleet.rs:239-259 — 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) crates/izwi-core/src/kv/v2/runtime.rs:1407 — crates/izwi-core/src/kv/v2/runtime.rs:1407-1419 | crates/izwi-core/src/kv/v2/runtime.rs:1425-1437 — 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) crates/izwi-core/src/engine/executor/audio.rs:798 — crates/izwi-core/src/engine/executor/audio.rs:798-810 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:717-729 — 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) crates/izwi-db/src/schema_contract.rs:772 — crates/izwi-db/src/schema_contract.rs:772-791 | crates/izwi-server/src/diarization_store.rs:1077-1089 — 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) crates/izwi-server/src/persistence/mod.rs:124 — crates/izwi-server/src/persistence/mod.rs:124-136 | crates/izwi-server/src/persistence/mod.rs:141-155 — 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) crates/izwi-server/src/api/tts_long_form.rs:574 — crates/izwi-core/src/models/architectures/fish_drama3/chunking.rs:470-482 | crates/izwi-server/src/api/tts_long_form.rs:574-589 — 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) crates/izwi-audio-codec/src/lib.rs:94 — crates/izwi-audio-codec/src/lib.rs:94-106 | crates/izwi-audio-codec/src/lib.rs:122-134 — 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) crates/izwi-server/src/api/voice/handlers.rs:193 — crates/izwi-server/src/api/voice/handlers.rs:193-205 | crates/izwi-server/src/api/voice/handlers.rs:227-241 — 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.
D3 · God Classes · TooManyMethods · ×21
  • TooManyMethods: RuntimeService crates/izwi-core/src/runtime/service.rs:1010 — TooManyMethods — 247 methods, declared across 22 files: asr/transcribe.rs (39), service/observability.rs (37), service/lifecycle.rs (27), runtime/chat.rs (23), +18 more file(s). The bar is 30 methods; this is 217 over it, 8.23× 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: EngineCoreRequest crates/izwi-core/src/engine/request.rs:1094 — TooManyMethods — 214 methods, declared across 9 files: request/tts_preparation.rs (55), request/asr_preparation.rs (42), request/payloads.rs (35), request/constructors.rs (24), +5 more file(s). The bar is 30 methods; this is 184 over it, 7.13× 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: NativeExecutor crates/izwi-core/src/engine/executor.rs:2802 — TooManyMethods — 167 methods, declared across 26 files: executor/dispatch.rs (32), executor/handler_tts.rs (23), executor/audio.rs (13), executor/handler_chat.rs (11), +22 more file(s). The bar is 30 methods; this is 137 over it, 5.57× 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: AudioApiClient ui/src/shared/api/audio.ts:1185 — TooManyMethods — 144 methods. The bar is 30 methods; this is 114 over it, 4.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EngineCore crates/izwi-core/src/engine/core.rs:604 — TooManyMethods — 133 methods, declared across 8 files: core/release.rs (30), engine/core.rs (25), core/plan.rs (24), core/managed_state.rs (17), +4 more file(s). The bar is 30 methods; this is 103 over it, 4.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Scheduler crates/izwi-core/src/engine/scheduler/mod.rs:438 — TooManyMethods — 119 methods. The bar is 30 methods; this is 89 over it, 3.97× 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: ModelLifecycleController crates/izwi-core/src/runtime/lifecycle/controller.rs:126 — TooManyMethods — 104 methods, declared across 9 files: lifecycle/controller.rs (28), load/state.rs (22), load/admission.rs (17), lifecycle/load.rs (14), +5 more file(s). The bar is 30 methods; this is 74 over it, 3.47× 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: BatchRuntimeStore crates/izwi-server/src/batch_runtime/store/mod.rs:71 — TooManyMethods — 100 methods, declared across 12 files: store/queue.rs (24), store/media.rs (14), store/provider_writes.rs (9), store/speech.rs (9), +8 more file(s). The bar is 30 methods; this is 70 over it, 3.33× 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: Engine crates/izwi-core/src/engine/mod.rs:702 — TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× 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: ModelVariant crates/izwi-model-catalog/src/catalog/metadata.rs:27 — TooManyMethods — 75 methods, declared across 4 files: catalog/metadata.rs (67), catalog/cuda_support.rs (4), catalog/variant.rs (3), catalog/prefix_reuse.rs (1). The bar is 30 methods; this is 45 over it, 2.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: InvocationTensorArena crates/izwi-core/src/backends/state/invocation.rs:119 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: InferenceCoordinator crates/izwi-core/src/runtime/coordinator.rs:768 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ManagedKvCacheManager crates/izwi-core/src/engine/cache/managed.rs:421 — TooManyMethods — 39 methods, declared across 7 files: managed/prefix.rs (9), managed/capacity.rs (7), managed/finalize.rs (7), cache/managed.rs (6), +3 more file(s). The bar is 30 methods; this is 9 over it, 1.30× 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: ModelDownloader crates/izwi-core/src/artifacts/downloader.rs:1296 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: InvocationStaticAttentionArena crates/izwi-core/src/backends/state/static_attention.rs:114 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.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.
  • TooManyMethods: Ledger crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:436 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× 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: Session crates/izwi-server/src/app/openai_realtime/connection.rs:90 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× 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: StudioProjectStore REDACTED:362 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: ResourceAuthority crates/izwi-core/src/engine/resources.rs:633 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RuntimeTelemetryCollector crates/izwi-core/src/runtime/telemetry/metrics.rs:616 — 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: ModelManager crates/izwi-core/src/model/manager.rs:20 — 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.
D3 · God Classes · TooManyFields · ×21
  • TooManyFields: EngineCoreRequest crates/izwi-core/src/engine/request.rs:1094 — TooManyFields — 61 stored fields beside 214 methods. The bar is 30 stored fields; this is 31 over it, 2.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: EngineCoreConfig crates/izwi-core/src/engine/config.rs:78 — TooManyFields — 60 stored fields beside 10 methods. The bar is 30 stored fields; this is 30 over it, 2.00× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: EngineRuntimeTelemetrySnapshot crates/izwi-core/src/runtime/telemetry/metrics.rs:322 — TooManyFields — 52 stored fields. The bar is 30 stored fields; this is 22 over it, 1.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: EngineBatchMetricsSnapshot crates/izwi-core/src/engine/metrics.rs:1417 — TooManyFields — 43 stored fields. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: RuntimeTelemetryCollector crates/izwi-core/src/runtime/telemetry/metrics.rs:616 — TooManyFields — 41 stored fields beside 32 methods. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: CandleAcceleratorKvArena crates/izwi-core/src/backends/kv/accelerator.rs:749 — TooManyFields — 40 stored fields beside 23 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ServerTuning crates/izwi-server/src/env_config.rs:496 — TooManyFields — 39 stored fields beside 1 method. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Model crates/izwi-server/src/entity/mod.rs:221 — TooManyFields — 39 stored fields. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: EngineCore crates/izwi-core/src/engine/core.rs:604 — TooManyFields — 38 stored fields beside 133 methods. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: GatewayArgs crates/izwi-gateway/src/cli.rs:54 — TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AsrStageTimings crates/izwi-cli/src/commands/bench.rs:397 — TooManyFields — 36 stored fields. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: DiarizationRecord crates/izwi-server/src/diarization_store.rs:146 — TooManyFields — 36 stored fields. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: KernelPathTelemetrySnapshot crates/izwi-cli/src/commands/bench.rs:224 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: TtsStageTimings crates/izwi-cli/src/commands/bench.rs:358 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AppState crates/izwi-server/src/state.rs:448 — TooManyFields — 34 stored fields beside 11 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: RuntimeTelemetrySnapshot crates/izwi-core/src/runtime/telemetry/metrics.rs:578 — TooManyFields — 34 stored fields. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: EngineConfig crates/izwi-core/src/config.rs:771 — TooManyFields — 33 stored fields beside 4 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: NewDiarizationRecord crates/izwi-server/src/diarization_store.rs:197 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Model crates/izwi-server/src/entity/mod.rs:178 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ServeRuntimeConfig crates/izwi-core/src/serve_runtime.rs:63 — TooManyFields — 31 stored fields beside 3 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ServeRuntimeConfigOverrides crates/izwi-core/src/serve_runtime.rs:316 — TooManyFields — 31 stored fields beside 2 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D2 · Cognitive Complexity · izwi_cli · ×20
  • izwi_cli::commands::bench::print_asr_stage_timing_summary (cognitive 82) crates/izwi-cli/src/commands/bench.rs:4536 — izwi_cli::commands::bench::print_asr_stage_timing_summary has cognitive complexity 82 (threshold 15). Drivers by points: if/else 73 (80 pts), boolean chains 1, loops 1 (nesting depth added 7). 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.
  • izwi_cli::commands::status::show_status (cognitive 76) crates/izwi-cli/src/commands/status.rs:100 — izwi_cli::commands::status::show_status has cognitive complexity 76 (threshold 15). Drivers by points: if/else 34 (69 pts), match/switch 1 (4 pts), loops 1 (3 pts) (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.
  • izwi_cli::commands::tts::build_request_body (cognitive 41) crates/izwi-cli/src/commands/tts.rs:497 — izwi_cli::commands::tts::build_request_body has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 3 (5 pts), boolean chains 4, 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.
  • izwi_cli::commands::bench::print_tts_stage_timing_summary (cognitive 38) crates/izwi-cli/src/commands/bench.rs:4344 — izwi_cli::commands::bench::print_tts_stage_timing_summary has cognitive complexity 38 (threshold 15). Drivers by points: if/else 36 (37 pts), loops 1 (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.
  • izwi_cli::commands::pull::execute (cognitive 33) crates/izwi-cli/src/commands/pull.rs:36 — izwi_cli::commands::pull::execute has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (31 pts), match/switch 1 (2 pts) (nesting depth added 22). 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.
  • izwi_cli::commands::bench::bench_asr (cognitive 32) crates/izwi-cli/src/commands/bench.rs:2428 — izwi_cli::commands::bench::bench_asr has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 2, 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.
  • izwi_cli::commands::bench::bench_chat (cognitive 24) crates/izwi-cli/src/commands/bench.rs:1796 — izwi_cli::commands::bench::bench_chat has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 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.
  • izwi_cli::commands::bench::print_asr_decode_profile_summary (cognitive 24) crates/izwi-cli/src/commands/bench.rs:4975 — izwi_cli::commands::bench::print_asr_decode_profile_summary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22 (23 pts), loops 1 (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.
  • izwi_cli::commands::bench::bench_tts (cognitive 21) crates/izwi-cli/src/commands/bench.rs:2101 — izwi_cli::commands::bench::bench_tts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 2, match/switch 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.
  • izwi_cli::commands::pull::wait_for_download_stream (cognitive 21) crates/izwi-cli/src/commands/pull.rs:166 — izwi_cli::commands::pull::wait_for_download_stream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 pts), 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.
  • izwi_cli::commands::serve::configure_server_command (cognitive 21) crates/izwi-cli/src/commands/serve.rs:199 — izwi_cli::commands::serve::configure_server_command has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 pts), loops 2 (3 pts), match/switch 1 (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.
  • izwi_cli::commands::bench::print_runtime_delta (cognitive 18) crates/izwi-cli/src/commands/bench.rs:5097 — izwi_cli::commands::bench::print_runtime_delta has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 2 (4 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.
  • izwi_cli::commands::chat::execute (cognitive 18) crates/izwi-cli/src/commands/chat.rs:51 — izwi_cli::commands::chat::execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (5 pts), boolean chains 1, 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.
  • izwi_cli::commands::models::route_capability_labels (cognitive 18) crates/izwi-cli/src/commands/models.rs:209 — izwi_cli::commands::models::route_capability_labels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
  • izwi_cli::commands::pull::wait_for_download_poll (cognitive 18) crates/izwi-cli/src/commands/pull.rs:242 — izwi_cli::commands::pull::wait_for_download_poll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), boolean chains 1, 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.
  • izwi_cli::commands::bench::handle_chat_stream_event (cognitive 17) crates/izwi-cli/src/commands/bench.rs:3245 — izwi_cli::commands::bench::handle_chat_stream_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, 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.
  • izwi_cli::commands::serve::execute (cognitive 17) crates/izwi-cli/src/commands/serve.rs:21 — izwi_cli::commands::serve::execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (nesting depth added 7). 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.
  • izwi_cli::commands::bench::bench_manifest (cognitive 16) crates/izwi-cli/src/commands/bench.rs:1531 — izwi_cli::commands::bench::bench_manifest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 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.
  • izwi_cli::commands::bench::has_repeated_text_pattern (cognitive 16) crates/izwi-cli/src/commands/bench.rs:3632 — izwi_cli::commands::bench::has_repeated_text_pattern 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.
  • izwi_cli::commands::serve::resolve_macos_desktop_bundle (cognitive 16) crates/izwi-cli/src/commands/serve.rs:470 — izwi_cli::commands::serve::resolve_macos_desktop_bundle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×20
  • Duplicated block (8 lines × 3) crates/izwi-core/src/backends/device.rs:744 — crates/izwi-core/src/backends/device.rs:744-751 | crates/izwi-core/src/engine/executor.rs:944-951 | crates/izwi-core/src/runtime/service.rs:233-240 — 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `&(dyn Any + Send)` in one and `&(dyn std::any::Any + Send)` 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 (8 lines × 3) crates/izwi-core/src/backends/kv/cpu.rs:474 — crates/izwi-core/src/backends/kv/cpu.rs:474-482 | crates/izwi-core/src/backends/kv/cpu.rs:650-657 | crates/izwi-core/src/backends/state/static_attention.rs:1008-1016 — 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 `crates/izwi-core/src/backends/kv/cpu.rs:474` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:633 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:633-640 | crates/izwi-core/src/engine/executor/handler_chat.rs:981-988 | crates/izwi-core/src/engine/executor/handler_chat.rs:1389-1396 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_chat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:633` 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 × 3) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:254 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:254-261 | crates/izwi-core/src/engine/executor/handler_maya1.rs:248-255 | crates/izwi-core/src/engine/executor/handler_maya2.rs:249-256 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:254` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:253` calls `as_mut` and `crates/izwi-core/src/engine/executor/handler_maya1.rs:247` 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 × 3) crates/izwi-core/src/engine/executor/handler_tts.rs:3186 — crates/izwi-core/src/engine/executor/handler_tts.rs:3186-3193 | crates/izwi-core/src/engine/executor/handler_tts.rs:3447-3454 | crates/izwi-core/src/engine/executor/handler_tts.rs:3509-3516 — 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:3186` 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, `crates/izwi-core/src/engine/executor/handler_tts.rs:3444` calls `with_capacity` and `crates/izwi-core/src/engine/executor/handler_tts.rs:3506` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) crates/izwi-core/src/kernels/cuda.rs:606 — crates/izwi-core/src/kernels/cuda.rs:606-613 | crates/izwi-core/src/kernels/cuda.rs:716-723 | crates/izwi-core/src/kernels/metal.rs:4892-4899 — before extracting anything, compare `crates/izwi-core/src/kernels/cuda.rs` and `crates/izwi-core/src/kernels/metal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/kernels/cuda.rs:714` calls `checked_mul` and `crates/izwi-core/src/kernels/cuda.rs:605` 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 × 3) crates/izwi-core/src/kernels/cuda/fp8.rs:244 — crates/izwi-core/src/kernels/cuda/fp8.rs:244-251 | crates/izwi-core/src/kernels/cuda/fp8.rs:439-446 | crates/izwi-core/src/kernels/cuda/fp8.rs:497-504 — 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 `crates/izwi-core/src/kernels/cuda/fp8.rs:244` 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 × 3) crates/izwi-core/src/kernels/cuda/moe.rs:801 — crates/izwi-core/src/kernels/cuda/moe.rs:801-808 | crates/izwi-core/src/kernels/cuda/moe.rs:982-989 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1233-1240 — 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 (8 lines × 3) crates/izwi-core/src/kernels/metal.rs:4353 — crates/izwi-core/src/kernels/metal.rs:4353-4360 | crates/izwi-core/src/kernels/metal.rs:4472-4479 | crates/izwi-core/src/kernels/metal.rs:4957-4964 — 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 `crates/izwi-core/src/kernels/metal.rs:4353` 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 × 3) crates/izwi-core/src/kernels/metal.rs:4628 — crates/izwi-core/src/kernels/metal.rs:4628-4635 | crates/izwi-core/src/kernels/metal.rs:4677-4684 | crates/izwi-core/src/kernels/metal.rs:4765-4772 — 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 `crates/izwi-core/src/kernels/metal.rs:4628` 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, `crates/izwi-core/src/kernels/metal.rs:4636` calls `dims2`, `ok` and `crates/izwi-core/src/kernels/metal.rs:4685` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:555 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:555-562 | crates/izwi-server/src/batch_runtime/store/provider_writes.rs:637-644 | crates/izwi-server/src/batch_runtime/store/speech.rs:253-260 — before extracting anything, compare `crates/izwi-server/src/batch_runtime/store/provider_writes.rs` and `crates/izwi-server/src/batch_runtime/store/speech.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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 (8 lines × 3) crates/izwi-server/src/diarization_store.rs:343 — crates/izwi-server/src/diarization_store.rs:343-350 | crates/izwi-server/src/speech_history_store.rs:628-635 | crates/izwi-server/src/transcription_store.rs:382-389 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/speech_history_store.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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 (8 lines × 3) crates/izwi-server/src/api/openai/audio/speech.rs:1899 — crates/izwi-server/src/api/openai/audio/speech.rs:1899-1906 | crates/izwi-server/src/api/speech_history/handlers.rs:3131-3138 | crates/izwi-server/src/api/studio/handlers.rs:1287-1294 — before extracting anything, compare `crates/izwi-server/src/api/openai/audio/speech.rs` and `crates/izwi-server/src/api/speech_history/handlers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 × 3) crates/izwi-server/src/diarization_store.rs:49 — crates/izwi-server/src/diarization_store.rs:49-56 | crates/izwi-server/src/speech_history_store.rs:288-295 | crates/izwi-server/src/transcription_store.rs:51-58 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/speech_history_store.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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 (8 lines × 3) crates/izwi-cli/src/commands/bench.rs:2863 — crates/izwi-cli/src/commands/bench.rs:2863-2871 | crates/izwi-cli/src/commands/bench.rs:3042-3050 | crates/izwi-cli/src/commands/bench.rs:3200-3207 — 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 `crates/izwi-cli/src/commands/bench.rs:2863` 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, `crates/izwi-cli/src/commands/bench.rs:2861` calls `String`, `to_string` and `crates/izwi-cli/src/commands/bench.rs:3040` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:96 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:96-103 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:105-112 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:111-118 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 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. 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 lines × 3) crates/izwi-core/src/kernels/moe_relu2.rs:1545 — crates/izwi-core/src/kernels/moe_relu2.rs:1545-1552 | crates/izwi-core/src/kernels/moe_relu2.rs:1563-1570 | crates/izwi-core/src/kernels/moe_relu2.rs:1596-1603 — 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 `crates/izwi-core/src/kernels/moe_relu2.rs:1545` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:287 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:287-294 | crates/izwi-core/src/engine/executor/fish_pending.rs:254-261 | crates/izwi-core/src/engine/executor/long_form.rs:143-150 — before extracting anything, compare `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs` and `crates/izwi-core/src/engine/executor/fish_pending.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 83 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. 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 lines × 3) crates/izwi-core/src/runtime/service/tts_preparation.rs:533 — crates/izwi-core/src/runtime/service/tts_preparation.rs:533-540 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1783-1790 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1964-1971 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:533` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/batch_runtime/store/queue.rs:820 — crates/izwi-server/src/batch_runtime/store/queue.rs:820-827 | crates/izwi-server/src/batch_runtime/store/queue.rs:1191-1198 | crates/izwi-server/src/batch_runtime/store/queue.rs:1822-1829 — 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 `crates/izwi-server/src/batch_runtime/store/queue.rs:820` 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.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×17
  • Edited copy of a member (7 corresponding lines) crates/izwi-core/src/backends/kv/cpu.rs:1189 — crates/izwi-core/src/backends/kv/cpu.rs:1189-1195 | crates/izwi-core/src/backends/kv/cpu.rs:1209-1215 — 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) crates/izwi-server/src/roles/local.rs:512 — crates/izwi-server/src/roles/local.rs:512-518 | crates/izwi-server/src/state.rs:833-839 — 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) crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:451 — crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:451-457 | crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:527-539 — 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) crates/izwi-dictation/src/capture.rs:113 — crates/izwi-dictation/src/capture.rs:113-119 | crates/izwi-dictation/src/controller.rs:246-252 — 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) crates/izwi-server/src/state.rs:823 — crates/izwi-core/src/models/architectures/qwen38/chat.rs:388-400 | crates/izwi-server/src/state.rs:823-829 — 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) crates/izwi-server/src/saved_voice_store.rs:770 — crates/izwi-core/src/models/architectures/maya1/prompt.rs:122-129 | crates/izwi-server/src/saved_voice_store.rs:770-776 — 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) crates/izwi-core/src/backends/state/invocation.rs:1610 — crates/izwi-core/src/backends/state/invocation.rs:1610-1616 | crates/izwi-core/src/backends/state/static_attention.rs:1539-1545 — 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) crates/izwi-core/src/kv/v2/runtime.rs:815 — crates/izwi-core/src/kv/v2/runtime.rs:815-821 | crates/izwi-core/src/models/architectures/lfm2/physical.rs:74-84 — 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) crates/izwi-core/src/runtime/asr.rs:814 — crates/izwi-core/src/models/architectures/fish_s2/weights.rs:491-497 | crates/izwi-core/src/runtime/asr.rs:814-821 — 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) crates/izwi-core/src/kernels/metal_kquant_mv.rs:86 — crates/izwi-core/src/kernels/metal_kquant_mv.rs:86-92 | crates/izwi-core/src/models/architectures/fish_drama3/linear.rs:134-140 — 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) crates/izwi-core/src/backends/state/mod.rs:628 — crates/izwi-core/src/backends/state/mod.rs:628-634 | crates/izwi-core/src/kv/v2/resolved_domains.rs:428-434 — 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) crates/izwi-core/src/backends/types.rs:77 — crates/izwi-core/src/backends/types.rs:77-83 | crates/izwi-serving-protocol/src/types.rs:116-123 — 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) crates/izwi-core/src/engine/cache/invocation.rs:260 — crates/izwi-core/src/engine/cache/invocation.rs:260-266 | crates/izwi-core/src/engine/cache/invocation_tensor.rs:427-434 — 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) crates/izwi-core/src/engine/cache/physical.rs:1078 — crates/izwi-core/src/engine/cache/physical.rs:1078-1084 | crates/izwi-core/src/engine/cache/retained_static_attention.rs:689-699 — 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) crates/izwi-model-catalog/src/catalog/variant.rs:1150 — crates/izwi-core/src/models/architectures/lfm25_audio/mod.rs:58-65 | crates/izwi-model-catalog/src/catalog/variant.rs:1150-1156 — 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) crates/izwi-cli/src/app/cli.rs:151 — crates/izwi-cli/src/app/cli.rs:151-157 | crates/izwi-cli/src/config.rs:516-523 — 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) crates/izwi-gateway/src/lifecycle.rs:134 — crates/izwi-gateway/src/lifecycle.rs:134-141 | crates/izwi-server/src/batch_runtime/worker.rs:264-270 — 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×17
  • Duplicated block (16 lines × 2) crates/izwi-core/src/artifacts/downloader.rs:2780 — crates/izwi-core/src/artifacts/downloader.rs:2780-2795 | crates/izwi-core/src/artifacts/downloader.rs:2807-2822 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/artifacts/downloader.rs:2780` 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) crates/izwi-core/src/backends/kv/accelerator.rs:1319 — crates/izwi-core/src/backends/kv/accelerator.rs:1319-1334 | crates/izwi-core/src/backends/kv/accelerator.rs:1467-1482 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/backends/kv/accelerator.rs:1319` 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) crates/izwi-core/src/engine/cache/managed/prepare.rs:552 — crates/izwi-core/src/engine/cache/managed/prepare.rs:552-567 | crates/izwi-core/src/engine/cache/managed/prepare.rs:587-602 — both copies are in the same file, so extract the 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) crates/izwi-core/src/engine/executor/handler_asr.rs:731 — crates/izwi-core/src/engine/executor/handler_asr.rs:731-746 | crates/izwi-core/src/engine/executor/handler_asr.rs:1064-1079 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_asr.rs:731` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/izwi-core/src/kernels/cuda.rs:600 — crates/izwi-core/src/kernels/cuda.rs:600-615 | crates/izwi-core/src/kernels/metal.rs:4886-4901 — before extracting anything, compare `crates/izwi-core/src/kernels/cuda.rs` and `crates/izwi-core/src/kernels/metal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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 `crates/izwi-core/src/kernels/cuda.rs:600` 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) crates/izwi-core/src/kernels/cuda/gdn.rs:810 — crates/izwi-core/src/kernels/cuda/gdn.rs:810-825 | crates/izwi-core/src/kernels/cuda/gdn.rs:945-960 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/gdn.rs:810` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1970 — crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1970-1985 | crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:3337-3352 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1970` 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 first that the copies are not typed on the same thing: the declarations holding them bind `load` to `AlignerLoad` in one and `Qwen3ChatLoad` 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, `crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1967` calls `starts_with` and `crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:3336` 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 (16 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:1547 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1547-1562 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2162-2177 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1547` 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) crates/izwi-gateway/src/gateway.rs:1409 — crates/izwi-gateway/src/gateway.rs:1409-1424 | crates/izwi-server/src/api/router.rs:68-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-gateway/src/gateway.rs:1409` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-server/src/api/router.rs:67` calls `uri` and `crates/izwi-gateway/src/gateway.rs:1408` 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 (16 lines × 2) crates/izwi-gateway/src/shutdown.rs:14 — crates/izwi-gateway/src/shutdown.rs:14-29 | crates/izwi-gateway/src/shutdown.rs:47-62 — both copies are in the same file, so extract the 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) crates/izwi-serving-client/src/realtime.rs:546 — crates/izwi-serving-client/src/realtime.rs:546-561 | crates/izwi-serving-client/src/realtime.rs:621-636 — both copies are in the same file, so extract the 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 `crates/izwi-serving-client/src/realtime.rs:546` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-serving-worker/src/realtime.rs:650 — crates/izwi-serving-worker/src/realtime.rs:650-665 | crates/izwi-serving-worker/src/realtime.rs:1053-1068 — both copies are in the same file, so extract the 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 `crates/izwi-serving-worker/src/realtime.rs:650` 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) crates/izwi-core/src/kernels/metal.rs:2743 — crates/izwi-core/src/kernels/metal.rs:2743-2758 | crates/izwi-core/src/kernels/metal.rs:3156-3171 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:2743` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/izwi-core/src/kernels/cuda/moe.rs:802 — crates/izwi-core/src/kernels/cuda/moe.rs:802-817 | crates/izwi-core/src/kernels/cuda/moe.rs:983-998 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/moe.rs:802` 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) crates/izwi-core/src/backends/state/invocation.rs:161 — crates/izwi-core/src/backends/state/invocation.rs:161-176 | crates/izwi-core/src/backends/state/static_attention.rs:249-265 — before extracting anything, compare `crates/izwi-core/src/backends/state/invocation.rs` and `crates/izwi-core/src/backends/state/static_attention.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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 `crates/izwi-core/src/backends/state/invocation.rs:161` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/metal.rs:2588 — crates/izwi-core/src/kernels/metal.rs:2588-2603 | crates/izwi-core/src/kernels/metal.rs:3013-3028 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:2588` 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) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:736 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:736-751 | crates/izwi-server/src/batch_runtime/store/speech.rs:415-430 — before extracting anything, compare `crates/izwi-server/src/batch_runtime/store/provider_writes.rs` and `crates/izwi-server/src/batch_runtime/store/speech.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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 `crates/izwi-server/src/batch_runtime/store/provider_writes.rs:736` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×17
  • Duplicated block (15 lines × 2) crates/izwi-cli/src/commands/align.rs:56 — crates/izwi-cli/src/commands/align.rs:56-70 | crates/izwi-cli/src/commands/transcribe.rs:66-80 — 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 `crates/izwi-cli/src/commands/align.rs:56` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-cli/src/commands/bench.rs:1984 — crates/izwi-cli/src/commands/bench.rs:1984-1998 | crates/izwi-cli/src/commands/bench.rs:2324-2338 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:1984` 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, `crates/izwi-cli/src/commands/bench.rs:2322` calls `print_tts_stage_timing_summary` and `crates/izwi-cli/src/commands/bench.rs:1982` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) crates/izwi-core/src/backends/kv/mod.rs:587 — crates/izwi-core/src/backends/kv/mod.rs:587-601 | crates/izwi-core/src/backends/kv/mod.rs:619-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn seal(mut` in one and `crate) fn drain(mut` 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 (15 lines × 2) crates/izwi-core/src/engine/execution_group.rs:944 — crates/izwi-core/src/engine/execution_group.rs:944-958 | crates/izwi-core/src/engine/execution_group.rs:1029-1043 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/execution_group.rs:944` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/engine/execution_group.rs:1044` calls `drop` and `crates/izwi-core/src/engine/execution_group.rs:959` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) crates/izwi-core/src/engine/executor/audio.rs:451 — crates/izwi-core/src/engine/executor/audio.rs:451-465 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:280-294 — before extracting anything, compare `crates/izwi-core/src/engine/executor/audio.rs` and `crates/izwi-core/src/runtime/asr/speaker_attribution.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 (15 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:705 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:705-719 | crates/izwi-core/src/engine/executor/handler_tts.rs:3165-3179 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 128 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 (15 lines × 2) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:736 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:736-750 | crates/izwi-core/src/engine/executor/handler_tts.rs:2196-2210 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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 `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:736` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/izwi-core/src/engine/executor/handler_maya1.rs:188 — crates/izwi-core/src/engine/executor/handler_maya1.rs:188-202 | crates/izwi-core/src/engine/executor/handler_maya2.rs:189-203 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_maya1.rs` and `crates/izwi-core/src/engine/executor/handler_maya2.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 373 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 `crates/izwi-core/src/engine/executor/handler_maya1.rs:188` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) crates/izwi-core/src/engine/executor/handler_tts.rs:2733 — crates/izwi-core/src/engine/executor/handler_tts.rs:2733-2747 | crates/izwi-core/src/engine/executor/handler_tts.rs:2986-3000 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:2733` it begins part-way through the construct above it, so those 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) crates/izwi-core/src/runtime/coordinator.rs:2156 — crates/izwi-core/src/runtime/coordinator.rs:2156-2170 | crates/izwi-core/src/runtime/coordinator.rs:2212-2226 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/coordinator.rs:2156` 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 (15 lines × 2) crates/izwi-core/src/runtime/service/tts_preparation.rs:471 — crates/izwi-core/src/runtime/service/tts_preparation.rs:471-485 | crates/izwi-core/src/runtime/service/tts_preparation.rs:661-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/service/tts_preparation.rs:471` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/speech_to_speech.rs:269 — crates/izwi-core/src/runtime/speech_to_speech.rs:269-283 | crates/izwi-core/src/runtime/speech_to_speech.rs:312-326 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/speech_to_speech.rs:269` 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) crates/izwi-server/src/app/voice_realtime/mod.rs:2145 — crates/izwi-server/src/app/voice_realtime/mod.rs:2145-2159 | crates/izwi-server/src/app/voice_realtime/mod.rs:2408-2422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) crates/izwi-server/src/app/voice_realtime/mod.rs:2496 — crates/izwi-server/src/app/voice_realtime/mod.rs:2496-2510 | crates/izwi-server/src/app/voice_realtime/mod.rs:2523-2538 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/app/voice_realtime/mod.rs:2496` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:756 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:756-770 | crates/izwi-server/src/batch_runtime/store/provider_writes.rs:937-951 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/batch_runtime/store/provider_writes.rs:756` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/izwi-gateway/src/app/realtime_translate.rs:854 — crates/izwi-gateway/src/app/realtime_translate.rs:854-868 | crates/izwi-gateway/src/app/realtime_translate.rs:907-921 — both copies are in the same file, so extract the 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 `crates/izwi-gateway/src/app/realtime_translate.rs:854` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) crates/izwi-desktop/src/app/install.rs:299 — crates/izwi-desktop/src/app/install.rs:299-313 | crates/izwi-desktop/src/app/install.rs:357-371 — both copies are in the same file, so extract the 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 `crates/izwi-desktop/src/app/install.rs:299` it begins part-way through the construct above it, so those 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 · Duplicated block (9 lines × 3) · ×17
  • Duplicated block (9 lines × 3) crates/izwi-cli/src/commands/bench.rs:4345 — crates/izwi-cli/src/commands/bench.rs:4345-4353 | crates/izwi-cli/src/commands/bench.rs:4537-4545 | crates/izwi-cli/src/commands/bench.rs:4976-4984 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `samples` to `&[TtsStageTimings]` in one and `&[AsrStageTimings]` 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 lines × 3) crates/izwi-core/src/engine/cache/offload.rs:141 — crates/izwi-core/src/engine/cache/offload.rs:141-149 | crates/izwi-core/src/engine/cache/offload.rs:174-182 | crates/izwi-core/src/engine/cache/prefix.rs:276-284 — 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 `crates/izwi-core/src/engine/cache/offload.rs:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/izwi-core/src/engine/executor.rs:3987 — crates/izwi-core/src/engine/executor.rs:3987-3995 | crates/izwi-core/src/engine/executor.rs:4004-4012 | crates/izwi-core/src/engine/executor.rs:4022-4030 — 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 `crates/izwi-core/src/engine/executor.rs:3987` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:705 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:705-713 | crates/izwi-core/src/engine/executor/handler_tts.rs:3165-3173 | crates/izwi-core/src/engine/executor/handler_tts.rs:3568-3576 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 128 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 × 3) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:709 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:709-717 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:971-980 | crates/izwi-core/src/engine/executor/handler_tts.rs:3169-3177 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 128 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:709` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/resources.rs:1253 — crates/izwi-core/src/engine/resources.rs:1253-1261 | crates/izwi-core/src/engine/resources.rs:1348-1356 | crates/izwi-core/src/engine/resources.rs:1390-1398 — 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 `crates/izwi-core/src/engine/resources.rs:1253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/izwi-core/src/kernels/cuda.rs:983 — crates/izwi-core/src/kernels/cuda.rs:983-991 | crates/izwi-core/src/kernels/cuda.rs:2724-2732 | crates/izwi-core/src/kernels/cuda.rs:2903-2911 — 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 `crates/izwi-core/src/kernels/cuda.rs:983` 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 × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:178 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:178-186 | crates/izwi-core/src/runtime/adapters/loaded/chat.rs:167-175 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1164-1172 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:925 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:925-933 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1125-1133 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:368-376 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/realtime.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:925` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1115 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1115-1123 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1249-1257 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1222-1230 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1115` 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 × 3) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:236 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:236-244 | crates/izwi-core/src/engine/executor/handler_maya1.rs:231-239 | crates/izwi-core/src/engine/executor/handler_maya2.rs:232-240 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:236` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:44 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:44-52 | crates/izwi-core/src/engine/executor/handler_chat.rs:93-101 | crates/izwi-core/src/engine/executor/handler_tts.rs:708-716 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_chat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:708` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/api/saved_voices/handlers.rs:239 — crates/izwi-server/src/api/saved_voices/handlers.rs:239-247 | crates/izwi-server/src/api/speech_history/handlers.rs:3121-3129 | crates/izwi-server/src/api/studio/handlers.rs:1277-1285 — `crates/izwi-server/src/api/speech_history/handlers.rs` and `crates/izwi-server/src/api/studio/handlers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 3) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:200 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:200-210 | crates/izwi-core/src/engine/executor/handler_maya1.rs:198-206 | crates/izwi-core/src/engine/executor/handler_maya2.rs:199-207 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:200` it begins part-way through the construct above it, so those 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) crates/izwi-core/src/runtime/service/asr_preparation.rs:135 — crates/izwi-core/src/runtime/service/asr_preparation.rs:135-145 | crates/izwi-core/src/runtime/service/asr_preparation.rs:387-395 | crates/izwi-core/src/runtime/service/asr_preparation.rs:648-658 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) crates/izwi-core/src/engine/cache/physical.rs:1015 — crates/izwi-core/src/engine/cache/physical.rs:1015-1023 | crates/izwi-core/src/engine/cache/physical.rs:1025-1033 | crates/izwi-core/src/engine/cache/physical.rs:1045-1054 — 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 `crates/izwi-core/src/engine/cache/physical.rs:1015` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/service/asr_preparation.rs:197 — crates/izwi-core/src/runtime/service/asr_preparation.rs:197-205 | crates/izwi-core/src/runtime/service/asr_preparation.rs:432-440 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1649-1657 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:197` 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.
X25 · Inert configuration knob · Configuration option is only ever logged · ×17
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:31 — `RuntimeTelemetrySnapshot.queue_wait_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:32 — `RuntimeTelemetrySnapshot.queue_wait_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:33 — `RuntimeTelemetrySnapshot.queue_wait_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:34 — `RuntimeTelemetrySnapshot.prefill_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:35 — `RuntimeTelemetrySnapshot.prefill_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:36 — `RuntimeTelemetrySnapshot.prefill_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:37 — `RuntimeTelemetrySnapshot.decode_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:38 — `RuntimeTelemetrySnapshot.decode_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:39 — `RuntimeTelemetrySnapshot.decode_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:40 — `RuntimeTelemetrySnapshot.ttft_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:41 — `RuntimeTelemetrySnapshot.ttft_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:42 — `RuntimeTelemetrySnapshot.ttft_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:43 — `RuntimeTelemetrySnapshot.end_to_end_ms_avg` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:44 — `RuntimeTelemetrySnapshot.end_to_end_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:45 — `RuntimeTelemetrySnapshot.end_to_end_ms_p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/bench.rs:220 — `RuntimeLatencyStats.p95` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/izwi-cli/src/commands/status.rs:59 — `FusedAttentionStatus.cuda_flash_attention_compiled` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×16
  • Edited copy of a member (10 corresponding lines) crates/izwi-prometheus/src/lib.rs:266 — crates/izwi-prometheus/src/lib.rs:266-275 | crates/izwi-prometheus/src/lib.rs:335-346 — 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) REDACTED:3158 — REDACTED:3158-3168 | crates/izwi-server/src/voice_store.rs:645-654 — 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) crates/izwi-gateway/src/app/openai_realtime_proxy.rs:131 — crates/izwi-gateway/src/app/openai_realtime_proxy.rs:131-141 | crates/izwi-server/src/api/openai/realtime.rs:64-73 — 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) crates/izwi-core/src/runtime/adapters/loaded/bundle.rs:128 — crates/izwi-core/src/runtime/adapters/loaded/bundle.rs:128-137 | crates/izwi-core/src/runtime/adapters/loaded/bundle.rs:415-424 — 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) crates/izwi-core/src/engine/executor/long_form.rs:71 — crates/izwi-core/src/engine/executor/long_form.rs:71-80 | crates/izwi-core/src/engine/executor/long_form.rs:83-92 — 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) crates/izwi-core/src/runtime/asr/realtime_session.rs:917 — crates/izwi-core/src/runtime/asr/realtime_session.rs:917-926 | crates/izwi-dictation/src/audio.rs:36-46 — 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) crates/izwi-server/src/diarization_store.rs:288 — crates/izwi-server/src/diarization_store.rs:288-297 | crates/izwi-server/src/transcription_store.rs:304-313 — 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) crates/izwi-serving-worker/src/realtime.rs:162 — crates/izwi-serving-worker/src/realtime.rs:162-171 | crates/izwi-gateway/src/app/realtime_relay.rs:260-269 — 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) crates/izwi-core/src/kernels/cuda/row_gemv.rs:323 — crates/izwi-core/src/kernels/cuda/row_gemv.rs:323-334 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:203-212 — 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) crates/izwi-core/src/backends/state/tensor.rs:1011 — crates/izwi-core/src/backends/state/tensor.rs:1011-1020 | crates/izwi-core/src/engine/cache/retained_static_attention.rs:479-488 — 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) crates/izwi-db/src/storage_layout.rs:389 — crates/izwi-core/src/models/architectures/whisper/asr/mod.rs:3912-3921 | crates/izwi-db/src/storage_layout.rs:389-398 — 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) crates/izwi-server/src/roles/local.rs:629 — crates/izwi-server/src/roles/local.rs:629-640 | crates/izwi-core/src/serve_runtime.rs:628-637 — 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) crates/izwi-db/src/raw.rs:190 — crates/izwi-db/src/raw.rs:190-199 | crates/izwi-server/src/app/mcp.rs:123-134 — 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) crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:877 — crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:877-886 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:494-503 — 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) scripts/bench/run-voice-realtime-load.py:304 — scripts/bench/run-voice-realtime-load.py:304-315 | scripts/bench/run-voice-realtime-load.py:429-438 — 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) scripts/fixtures/generate_chatterbox_clone_reference.py:96 — scripts/fixtures/generate_chatterbox_clone_reference.py:96-106 | scripts/fixtures/generate_chatterbox_reference.py:118-127 — 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 (11 corresponding lines) · ×15
  • Edited copy of a member (11 corresponding lines) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:72 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:72-88 | crates/izwi-core/src/engine/executor/handler_tts.rs:718-728 — 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) crates/izwi-gateway/src/gateway_security.rs:127 — crates/izwi-gateway/src/gateway_security.rs:127-137 | crates/izwi-gateway/src/gateway_security.rs:143-153 — 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) crates/izwi-core/src/kernels/cuda/kquant.rs:129 — crates/izwi-core/src/kernels/cuda/kquant.rs:129-139 | crates/izwi-core/src/kernels/cuda/kquant.rs:223-234 — 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) crates/izwi-core/src/runtime/audio_io.rs:1376 — crates/izwi-core/src/runtime/audio_io.rs:1376-1386 | crates/izwi-core/src/runtime/audio_io.rs:1396-1414 — 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) crates/izwi-core/src/engine/scheduler/mod.rs:1271 — crates/izwi-core/src/engine/scheduler/mod.rs:1271-1281 | crates/izwi-core/src/engine/scheduler/mod.rs:1291-1302 — 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) crates/izwi-server/src/app/voice_realtime/mod.rs:4221 — crates/izwi-server/src/app/voice_realtime/mod.rs:4221-4236 | crates/izwi-server/src/app/voice_realtime/mod.rs:4238-4248 — 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) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:110 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:110-120 | crates/izwi-server/src/api/transcript_alignment.rs:116-126 — 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) crates/izwi-core/src/runtime/telemetry/metrics.rs:1282 — crates/izwi-core/src/runtime/telemetry/metrics.rs:1282-1292 | crates/izwi-core/src/runtime/telemetry/metrics.rs:1326-1336 — 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) crates/izwi-core/src/runtime/asr/realtime_session.rs:512 — crates/izwi-core/src/runtime/asr/realtime_session.rs:512-522 | crates/izwi-core/src/runtime/service/driver.rs:378-388 — 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) crates/izwi-cli/src/commands/list.rs:113 — crates/izwi-cli/src/commands/list.rs:113-123 | crates/izwi-cli/src/commands/models.rs:185-195 — 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) crates/izwi-core/src/audio/resampling.rs:59 — crates/izwi-core/src/audio/resampling.rs:59-69 | crates/izwi-core/src/models/architectures/maya2/ecapa.rs:303-314 — 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) crates/izwi-core/src/backends/kv/accelerator.rs:3240 — crates/izwi-core/src/backends/kv/accelerator.rs:3240-3250 | crates/izwi-core/src/backends/kv/cpu.rs:1114-1124 — 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) crates/izwi-server/src/speech_history_store.rs:1054 — crates/izwi-server/src/speech_history_store.rs:1054-1065 | crates/izwi-server/src/transcription_store.rs:789-799 — 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) crates/izwi-core/src/runtime/lifecycle/load.rs:411 — crates/izwi-core/src/runtime/lifecycle/load.rs:411-421 | crates/izwi-core/src/runtime/lifecycle/qwen38_memory.rs:81-91 — 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) crates/izwi-server/src/api/onboarding/handlers.rs:16 — crates/izwi-server/src/api/onboarding/handlers.rs:16-27 | crates/izwi-server/src/api/preferences/handlers.rs:19-29 — 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.
D2 · Cognitive Complexity · izwi_gateway · ×14
  • izwi_gateway::app::realtime_translate::run_translate_session (cognitive 90) crates/izwi-gateway/src/app/realtime_translate.rs:287 — izwi_gateway::app::realtime_translate::run_translate_session has cognitive complexity 90 (threshold 15). Drivers by points: if/else 16 (52 pts), match/switch 12 (36 pts), loops 2 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • izwi_gateway::roles::gateway::gateway_state (cognitive 79) crates/izwi-gateway/src/roles/gateway.rs:203 — izwi_gateway::roles::gateway::gateway_state has cognitive complexity 79 (threshold 15). Drivers by points: if/else 27 (45 pts), match/switch 6 (15 pts), loops 8 (13 pts), boolean chains 6 (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.
  • izwi_gateway::api::openai::chat::completions::to_core_messages_with_media (cognitive 50) crates/izwi-gateway/src/api/openai/chat/completions.rs:51 — izwi_gateway::api::openai::chat::completions::to_core_messages_with_media has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (42 pts), boolean chains 5, match/switch 1 (2 pts), loops 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.
  • izwi_gateway::app::chat::spawn_started_remote_chat_stream (cognitive 31) crates/izwi-gateway/src/app/chat.rs:950 — izwi_gateway::app::chat::spawn_started_remote_chat_stream has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 4 (9 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.
  • izwi_gateway::app::realtime_translate::handle_invocation_event (cognitive 28) crates/izwi-gateway/src/app/realtime_translate.rs:781 — izwi_gateway::app::realtime_translate::handle_invocation_event has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 5 (10 pts) (nesting depth added 17). 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.
  • izwi_gateway::app::chat_content::resolve_media_source (cognitive 23) crates/izwi-gateway/src/app/chat_content.rs:274 — izwi_gateway::app::chat_content::resolve_media_source has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (2 pts), boolean chains 1, match/switch 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.
  • izwi_gateway::api::openai::chat::stream::render_chat_stream (cognitive 22) crates/izwi-gateway/src/api/openai/chat/stream.rs:136 — izwi_gateway::api::openai::chat::stream::render_chat_stream has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 1 (2 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.
  • izwi_gateway::worker_registry::validate_status (cognitive 22) crates/izwi-gateway/src/worker_registry.rs:1176 — izwi_gateway::worker_registry::validate_status has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 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.
  • izwi_gateway::app::realtime_relay::run_relay_session (cognitive 21) crates/izwi-gateway/src/app/realtime_relay.rs:309 — izwi_gateway::app::realtime_relay::run_relay_session has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 11 (15 pts), if/else 5 (6 pts) (nesting depth added 5). 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.
  • izwi_gateway::roles::gateway::validate_gateway_limits (cognitive 20) crates/izwi-gateway/src/roles/gateway.rs:882 — izwi_gateway::roles::gateway::validate_gateway_limits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, loops 1 (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.
  • izwi_gateway::app::realtime_relay::read_client_actions (cognitive 18) crates/izwi-gateway/src/app/realtime_relay.rs:781 — izwi_gateway::app::realtime_relay::read_client_actions has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 4 (8 pts), loops 1 (nesting depth added 10). 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.
  • izwi_gateway::api::request_context::attach_enterprise_request_context_with_hooks (cognitive 17) crates/izwi-gateway/src/api/request_context.rs:484 — izwi_gateway::api::request_context::attach_enterprise_request_context_with_hooks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 3 (4 pts), boolean chains 1 (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.
  • izwi_gateway::app::realtime_translate::read_public_actions (cognitive 16) crates/izwi-gateway/src/app/realtime_translate.rs:1217 — izwi_gateway::app::realtime_translate::read_public_actions has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 3 (6 pts), loops 1 (nesting depth added 9). 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.
  • izwi_gateway::gateway_principal_keys::load_manifest (cognitive 16) crates/izwi-gateway/src/gateway_principal_keys.rs:148 — izwi_gateway::gateway_principal_keys::load_manifest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×14
  • Duplicated block (10 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:337 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:337-346 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:121-130 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:192-201 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:337` 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 × 3) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:610 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:610-619 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:526-535 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:524-533 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/whisper.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 110 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:610` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:366 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:366-375 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:434-443 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:508-517 — 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:366` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:788 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:788-797 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:530-539 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:531-540 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) crates/izwi-core/src/kernels/cuda.rs:2080 — crates/izwi-core/src/kernels/cuda.rs:2080-2089 | crates/izwi-core/src/kernels/cuda.rs:3158-3167 | crates/izwi-core/src/kernels/cuda.rs:3317-3326 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/izwi-core/src/kernels/cuda.rs:2319 — crates/izwi-core/src/kernels/cuda.rs:2319-2328 | crates/izwi-core/src/kernels/metal.rs:4397-4406 | crates/izwi-core/src/kernels/metal.rs:4516-4525 — before extracting anything, compare `crates/izwi-core/src/kernels/cuda.rs` and `crates/izwi-core/src/kernels/metal.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) crates/izwi-core/src/kernels/cuda/gdn.rs:1033 — crates/izwi-core/src/kernels/cuda/gdn.rs:1033-1043 | crates/izwi-core/src/kernels/cuda/gdn.rs:1118-1128 | crates/izwi-core/src/kernels/cuda/gdn.rs:1227-1236 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:925 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:925-934 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1125-1134 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1259-1268 — 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:925` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/service/asr_encoders.rs:727 — crates/izwi-core/src/runtime/service/asr_encoders.rs:727-736 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1044-1053 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1267-1276 — 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:727` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/service/asr_preparation.rs:920 — crates/izwi-core/src/runtime/service/asr_preparation.rs:920-929 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2001-2010 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2160-2169 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:920` 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 × 3) crates/izwi-server/src/app/openai_realtime/respond.rs:719 — crates/izwi-server/src/app/openai_realtime/respond.rs:719-728 | crates/izwi-server/src/app/openai_realtime/respond.rs:766-775 | crates/izwi-server/src/app/openai_realtime/respond.rs:841-850 — 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 `crates/izwi-server/src/app/openai_realtime/respond.rs:719` 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 (10 lines × 3) crates/izwi-cli/src/commands/bench.rs:2280 — crates/izwi-cli/src/commands/bench.rs:2280-2289 | crates/izwi-cli/src/commands/bench.rs:2296-2305 | crates/izwi-cli/src/commands/bench.rs:2612-2621 — 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 `crates/izwi-cli/src/commands/bench.rs:2280` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-cli/src/commands/align.rs:67 — crates/izwi-cli/src/commands/align.rs:67-76 | crates/izwi-cli/src/commands/diarize.rs:175-184 | crates/izwi-cli/src/commands/transcribe.rs:77-86 — 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.
  • Duplicated block (10 lines × 3) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:268 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:268-277 | crates/izwi-core/src/engine/executor/fish_pending.rs:234-243 | crates/izwi-core/src/engine/executor/long_form.rs:123-132 — before extracting anything, compare `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs` and `crates/izwi-core/src/engine/executor/fish_pending.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 83 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 `crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:268` 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.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×13
  • Edited copy of a member (12 corresponding lines) crates/izwi-core/src/kernels/cuda/gate.rs:55 — crates/izwi-core/src/kernels/cuda/gate.rs:55-66 | crates/izwi-core/src/kernels/cuda/norm.rs:48-61 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-core/src/kernels/cuda/split_decode.rs:513 — crates/izwi-core/src/kernels/cuda/split_decode.rs:513-524 | crates/izwi-core/src/kernels/moe_relu2.rs:1308-1319 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-core/src/kv/v2/runtime.rs:247 — crates/izwi-core/src/kv/v2/runtime.rs:247-258 | crates/izwi-core/src/kv/v2/runtime.rs:984-997 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-core/src/backends/device_thread.rs:270 — crates/izwi-core/src/backends/device_thread.rs:270-281 | crates/izwi-core/src/models/shared/memory/metal.rs:396-412 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-server/src/saved_voice_store.rs:575 — crates/izwi-server/src/saved_voice_store.rs:575-586 | crates/izwi-server/src/saved_voice_store.rs:593-608 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-serving-supervisor/src/actor.rs:605 — crates/izwi-serving-supervisor/src/actor.rs:605-616 | crates/izwi-serving-supervisor/src/actor.rs:618-629 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-serving-supervisor/src/lifecycle.rs:142 — crates/izwi-serving-supervisor/src/lifecycle.rs:142-157 | crates/izwi-serving-supervisor/src/lifecycle.rs:212-223 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-core/src/config.rs:51 — crates/izwi-core/src/config.rs:51-62 | crates/izwi-core/src/config.rs:256-267 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-desktop/src/app/dictation/mod.rs:943 — crates/izwi-desktop/src/app/dictation/mod.rs:943-956 | crates/izwi-desktop/src/app/dictation/mod.rs:959-970 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-model-catalog/src/catalog/metadata.rs:1168 — crates/izwi-model-catalog/src/catalog/metadata.rs:1168-1181 | crates/izwi-model-catalog/src/catalog/metadata.rs:1234-1245 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-server/src/batch_runtime/store/retention.rs:410 — crates/izwi-server/src/batch_runtime/store/retention.rs:410-421 | crates/izwi-server/src/speech_history_store.rs:977-1027 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-core/src/engine/request.rs:1065 — crates/izwi-core/src/engine/request.rs:1065-1077 | crates/izwi-core/src/models/registry.rs:1053-1064 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) crates/izwi-asr-toolkit/src/lib.rs:1084 — crates/izwi-asr-toolkit/src/lib.rs:1084-1098 | crates/izwi-core/src/models/architectures/qwen3/asr/word_units.rs:119-130 — These two members are one piece of code written twice and then edited apart: 12 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 · Duplicated block (7 lines × 3) · ×13
  • Duplicated block (7 lines × 3) crates/izwi-cli/src/commands/bench.rs:4379 — crates/izwi-cli/src/commands/bench.rs:4379-4385 | crates/izwi-cli/src/commands/bench.rs:4605-4611 | crates/izwi-cli/src/commands/bench.rs:4996-5002 — 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 `crates/izwi-cli/src/commands/bench.rs:4379` 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 first that the copies are not typed on the same thing: the declarations holding them bind `samples` to `&[TtsStageTimings]` in one and `&[AsrStageTimings]` 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 (7 lines × 3) crates/izwi-core/src/backends/kv/accelerator.rs:2641 — crates/izwi-core/src/backends/kv/accelerator.rs:2641-2647 | crates/izwi-core/src/backends/kv/accelerator.rs:2675-2681 | crates/izwi-core/src/backends/kv/accelerator.rs:2691-2697 — 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 (7 lines × 3) crates/izwi-core/src/engine/executor.rs:4609 — crates/izwi-core/src/engine/executor.rs:4609-4615 | crates/izwi-core/src/engine/executor.rs:4719-4725 | crates/izwi-core/src/engine/executor.rs:4807-4813 — 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 (7 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:969 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:969-975 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1016-1022 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1073-1079 — 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:969` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:132 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:132-138 | crates/izwi-core/src/engine/executor/handler_maya1.rs:141-147 | crates/izwi-core/src/engine/executor/handler_maya2.rs:142-148 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:132` 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) crates/izwi-core/src/engine/executor/handler_tts.rs:995 — crates/izwi-core/src/engine/executor/handler_tts.rs:995-1001 | crates/izwi-core/src/engine/executor/handler_tts.rs:1162-1168 | crates/izwi-core/src/engine/executor/handler_tts.rs:2332-2338 — 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:995` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/counter_noise.rs:127 — crates/izwi-core/src/kernels/counter_noise.rs:127-134 | crates/izwi-core/src/kernels/penalized_topk.rs:451-458 | crates/izwi-core/src/kernels/race_sampler.rs:625-631 — 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 `crates/izwi-core/src/kernels/counter_noise.rs:127` 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 (7 lines × 3) crates/izwi-core/src/kernels/mamba2.rs:1021 — crates/izwi-core/src/kernels/mamba2.rs:1021-1027 | crates/izwi-core/src/kernels/moe_relu2.rs:1532-1538 | crates/izwi-core/src/kernels/moe_relu2.rs:1550-1556 — before extracting anything, compare `crates/izwi-core/src/kernels/mamba2.rs` and `crates/izwi-core/src/kernels/moe_relu2.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 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 (7 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/descriptor.rs:168 — crates/izwi-core/src/runtime/adapters/loaded/descriptor.rs:168-174 | crates/izwi-core/src/runtime/adapters/loaded/descriptor.rs:234-240 | crates/izwi-core/src/runtime/adapters/loaded/descriptor.rs:352-358 — 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 `crates/izwi-core/src/runtime/adapters/loaded/descriptor.rs:168` 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) crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:308 — crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:308-314 | crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:394-400 | crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:506-512 — 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 `crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:308` 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 (7 lines × 3) crates/izwi-core/src/runtime/service/asr_preparation.rs:919 — crates/izwi-core/src/runtime/service/asr_preparation.rs:919-925 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1175-1181 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2159-2165 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:919` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:115 — crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:115-121 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:299-305 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:438-446 — 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. 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 × 3) crates/izwi-gateway/src/app/chat_content.rs:93 — crates/izwi-gateway/src/app/chat_content.rs:93-99 | crates/izwi-gateway/src/app/chat_content.rs:112-118 | crates/izwi-gateway/src/app/chat_content.rs:174-180 — 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 `crates/izwi-gateway/src/app/chat_content.rs:93` 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/izwi-cli/src/commands/tts.rs:702 — crates/izwi-cli/src/commands/tts.rs:702-729 | crates/izwi-dictation/src/audio.rs:61-80 | crates/izwi-server/src/api/studio/handlers.rs:1049-1115 | crates/izwi-server/src/speech_history_store.rs:128-164 — 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) crates/izwi-core/src/backends/device.rs:743 — crates/izwi-core/src/backends/device.rs:743-751 | crates/izwi-core/src/engine/executor.rs:943-951 | crates/izwi-core/src/runtime/lifecycle/unload.rs:19-27 | crates/izwi-core/src/runtime/service.rs:232-240 — 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) crates/izwi-core/src/engine/cache/offload.rs:138 — crates/izwi-core/src/engine/cache/offload.rs:138-157 | crates/izwi-core/src/engine/cache/offload.rs:162-191 | crates/izwi-core/src/engine/cache/prefix.rs:273-290 | crates/izwi-core/src/engine/cache/prefix.rs:576-614 — 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) crates/izwi-core/src/engine/executor/dispatch.rs:696 — crates/izwi-core/src/engine/executor/dispatch.rs:696-715 | crates/izwi-core/src/engine/executor/dispatch.rs:783-810 | crates/izwi-core/src/engine/executor/dispatch.rs:817-840 | crates/izwi-core/src/engine/executor/dispatch.rs:968-995 — 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:127 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:127-653 | crates/izwi-core/src/engine/executor/handler_chat.rs:742-1001 | crates/izwi-core/src/engine/executor/handler_chat.rs:1124-1409 | crates/izwi-core/src/engine/executor/handler_tts.rs:3936-4377 — 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) crates/izwi-core/src/kernels/cuda/fp8.rs:230 — crates/izwi-core/src/kernels/cuda/fp8.rs:230-395 | crates/izwi-core/src/kernels/cuda/fp8.rs:428-484 | crates/izwi-core/src/kernels/cuda/fp8.rs:489-541 | crates/izwi-core/src/kernels/cuda/moe.rs:235-328 — 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) crates/izwi-core/src/kernels/cuda/gdn.rs:221 — crates/izwi-core/src/kernels/cuda/gdn.rs:221-245 | crates/izwi-core/src/kernels/cuda/gdn.rs:426-459 | crates/izwi-core/src/kernels/cuda/gdn.rs:569-613 | crates/izwi-core/src/kernels/cuda/gdn.rs:634-676 — 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) crates/izwi-core/src/kernels/cuda/moe.rs:792 — crates/izwi-core/src/kernels/cuda/moe.rs:792-963 | crates/izwi-core/src/kernels/cuda/moe.rs:978-1216 | crates/izwi-core/src/kernels/mamba2.rs:997-1055 | crates/izwi-core/src/kernels/moe_relu2.rs:1489-1619 — 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:107 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:107-250 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:100-218 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:427-531 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1100-1241 — 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) crates/izwi-core/src/runtime/asr/realtime_push.rs:122 — crates/izwi-core/src/runtime/asr/realtime_push.rs:122-161 | crates/izwi-core/src/runtime/service/asr_encoders.rs:525-741 | crates/izwi-core/src/runtime/service/asr_encoders.rs:884-1058 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1168-1283 — 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) crates/izwi-core/src/runtime/service/asr_encoders.rs:1123 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1123-1166 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1307-1363 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1570-1627 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1833-1883 — 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) crates/izwi-server/src/api/diarization/handlers.rs:1028 — crates/izwi-server/src/api/diarization/handlers.rs:1028-1265 | crates/izwi-server/src/api/openai/audio/align.rs:173-274 | crates/izwi-server/src/api/openai/audio/transcriptions.rs:952-1227 | crates/izwi-server/src/api/transcription/handlers.rs:1749-1947 — 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 (17 corresponding lines) · ×12
  • Edited copy of a member (17 corresponding lines) crates/izwi-core/src/kernels/relpos_attention.rs:932 — crates/izwi-core/src/kernels/relpos_attention.rs:932-948 | crates/izwi-core/src/kernels/transducer_greedy.rs:667-683 — 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) crates/izwi-core/src/runtime/lifecycle/load/checkpoint.rs:472 — crates/izwi-core/src/runtime/lifecycle/load/checkpoint.rs:472-492 | crates/izwi-core/src/runtime/lifecycle/qwen36moe_memory.rs:253-269 — 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) crates/izwi-serving-protocol/src/identity.rs:19 — crates/izwi-serving-protocol/src/identity.rs:19-35 | crates/izwi-serving-protocol/src/identity.rs:187-206 — 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) crates/izwi-server/src/state.rs:173 — crates/izwi-server/src/state.rs:173-201 | crates/izwi-server/src/state.rs:207-223 — 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) crates/izwi-server/src/env_config.rs:651 — crates/izwi-server/src/env_config.rs:651-668 | crates/izwi-server/src/env_config.rs:832-848 — 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) crates/izwi-core/src/engine/scheduler/mod.rs:3168 — crates/izwi-core/src/engine/scheduler/mod.rs:3168-3188 | crates/izwi-core/src/engine/scheduler/mod.rs:3340-3356 — 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) crates/izwi-core/src/kv/v2/runtime.rs:1365 — crates/izwi-core/src/kv/v2/runtime.rs:1365-1381 | crates/izwi-core/src/kv/v2/runtime.rs:1385-1401 — 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) crates/izwi-server/src/api/admin/models.rs:828 — crates/izwi-server/src/api/admin/models.rs:828-844 | crates/izwi-server/src/api/admin/models.rs:850-866 — 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) crates/izwi-core/src/engine/scheduler/mod.rs:2658 — crates/izwi-core/src/engine/scheduler/mod.rs:2658-2674 | crates/izwi-core/src/engine/scheduler/mod.rs:2702-2719 — 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) crates/izwi-core/src/runtime/coordinator.rs:3117 — crates/izwi-core/src/runtime/coordinator.rs:3117-3133 | crates/izwi-core/src/runtime/coordinator.rs:3135-3151 — 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) crates/izwi-model-catalog/src/catalog/variant.rs:1068 — crates/izwi-model-catalog/src/catalog/variant.rs:1068-1084 | crates/izwi-model-catalog/src/catalog/variant.rs:1086-1102 — 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) crates/izwi-server/src/batch_runtime/store/idempotency.rs:400 — crates/izwi-server/src/batch_runtime/store/idempotency.rs:400-419 | crates/izwi-server/src/batch_runtime/store/quota.rs:128-144 — 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 · Duplicated block (17 lines × 2) · ×12
  • Duplicated block (17 lines × 2) crates/izwi-core/src/engine/executor.rs:4044 — crates/izwi-core/src/engine/executor.rs:4044-4060 | crates/izwi-core/src/engine/executor.rs:4310-4326 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor.rs:4044` 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) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:608 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:608-624 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:522-538 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/whisper.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 110 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:608` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:311 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:311-327 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:310-326 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:311` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/resources.rs:1342 — crates/izwi-core/src/engine/resources.rs:1342-1358 | crates/izwi-core/src/engine/resources.rs:1384-1400 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/resources.rs:1342` it begins part-way through the construct above it, so those 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 (17 lines × 2) crates/izwi-core/src/kernels/cuda/moe.rs:1362 — crates/izwi-core/src/kernels/cuda/moe.rs:1362-1378 | crates/izwi-core/src/kernels/cuda/moe.rs:1449-1465 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/moe.rs:1362` 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) crates/izwi-core/src/kernels/metal.rs:2663 — crates/izwi-core/src/kernels/metal.rs:2663-2679 | crates/izwi-core/src/kernels/metal.rs:3090-3106 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:2663` 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:341 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:341-357 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:811-827 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:341` it begins part-way through the construct above it, so those 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 (17 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:423 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:423-439 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:621-637 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:423` 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) crates/izwi-gateway/src/app/realtime_translate.rs:180 — crates/izwi-gateway/src/app/realtime_translate.rs:180-196 | crates/izwi-server/src/app/transcription_realtime.rs:195-211 — 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 (17 lines × 2) crates/izwi-serving-client/src/realtime.rs:597 — crates/izwi-serving-client/src/realtime.rs:597-613 | crates/izwi-serving-client/src/realtime.rs:672-688 — both copies are in the same file, so extract the 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 `crates/izwi-serving-client/src/realtime.rs:597` 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 (17 lines × 2) crates/izwi-core/src/kernels/cuda/fp8.rs:435 — crates/izwi-core/src/kernels/cuda/fp8.rs:435-451 | crates/izwi-core/src/kernels/cuda/fp8.rs:493-509 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/fp8.rs:435` 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) crates/izwi-server/src/api/openapi.rs:1962 — crates/izwi-server/src/api/openapi.rs:1962-1982 | crates/izwi-server/src/api/openapi.rs:1985-2001 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×12
  • Duplicated block (6 lines × 3) crates/izwi-core/src/engine/executor/dispatch.rs:784 — crates/izwi-core/src/engine/executor/dispatch.rs:784-789 | crates/izwi-core/src/engine/executor/dispatch.rs:818-823 | crates/izwi-core/src/engine/executor/dispatch.rs:969-974 — 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 `crates/izwi-core/src/engine/executor/dispatch.rs:784` 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) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:319 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:319-324 | crates/izwi-core/src/engine/executor/handler_maya1.rs:309-314 | crates/izwi-core/src/engine/executor/handler_maya2.rs:310-316 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:319` 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) crates/izwi-core/src/kernels/cuda/moe.rs:839 — crates/izwi-core/src/kernels/cuda/moe.rs:839-847 | crates/izwi-core/src/kernels/moe_relu2.rs:1584-1589 | crates/izwi-core/src/kernels/moe_relu2.rs:1601-1606 — 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 `crates/izwi-core/src/kernels/cuda/moe.rs:839` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) crates/izwi-core/src/runtime/service/asr_preparation.rs:143 — crates/izwi-core/src/runtime/service/asr_preparation.rs:143-148 | crates/izwi-core/src/runtime/service/asr_preparation.rs:393-398 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1613-1618 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs: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 (6 lines × 3) crates/izwi-server/src/diarization_store.rs:406 — crates/izwi-server/src/diarization_store.rs:406-412 | crates/izwi-server/src/saved_voice_store.rs:256-262 | crates/izwi-server/src/transcription_store.rs:444-449 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/saved_voice_store.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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 (6 lines × 3) crates/izwi-core/src/engine/metrics.rs:2510 — crates/izwi-core/src/engine/metrics.rs:2510-2515 | crates/izwi-core/src/runtime/telemetry/metrics.rs:1557-1562 | crates/izwi-core/src/runtime/telemetry/metrics.rs:1564-1569 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `values` to `&VecDeque<f64>` in one and `&[f64]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 3) crates/izwi-core/src/runtime/lifecycle/load.rs:84 — crates/izwi-core/src/runtime/lifecycle/load.rs:84-89 | crates/izwi-desktop/src/app/dictation/mod.rs:479-484 | crates/izwi-serving-supervisor/src/daemon/mod.rs:540-545 — 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) crates/izwi-server/src/diarization_store.rs:1346 — crates/izwi-server/src/diarization_store.rs:1346-1351 | crates/izwi-server/src/transcription_store.rs:1618-1623 | crates/izwi-server/src/transcription_store.rs:1625-1630 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/transcription_store.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 176 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 (6 lines × 3) crates/izwi-core/src/runtime/service/tts_preparation.rs:621 — crates/izwi-core/src/runtime/service/tts_preparation.rs:621-626 | crates/izwi-core/src/runtime/service/tts_preparation.rs:816-821 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1535-1545 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) crates/izwi-core/src/artifacts/downloader.rs:1393 — crates/izwi-core/src/artifacts/downloader.rs:1393-1399 | crates/izwi-core/src/artifacts/downloader.rs:1445-1450 | crates/izwi-core/src/artifacts/downloader.rs:2990-2996 — 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 `crates/izwi-core/src/artifacts/downloader.rs:1393` it begins part-way through the construct above it, so those 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 (6 lines × 3) crates/izwi-server/src/diarization_store.rs:371 — crates/izwi-server/src/diarization_store.rs:371-376 | crates/izwi-server/src/speech_history_store.rs:658-663 | crates/izwi-server/src/transcription_store.rs:410-415 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/speech_history_store.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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 `crates/izwi-server/src/diarization_store.rs:371` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/mamba2.rs:675 — crates/izwi-core/src/kernels/mamba2.rs:675-680 | crates/izwi-core/src/kernels/mamba2.rs:741-746 | crates/izwi-core/src/kernels/qk_norm_rope.rs:304-309 — before extracting anything, compare `crates/izwi-core/src/kernels/mamba2.rs` and `crates/izwi-core/src/kernels/qk_norm_rope.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/kernels/qk_norm_rope.rs:310` calls `set_output_buffer`, `Some` and `crates/izwi-core/src/kernels/mamba2.rs:747` 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×12
  • Duplicated block (5 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:287 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:287-291 | crates/izwi-core/src/engine/executor/handler_chat.rs:831-835 | crates/izwi-core/src/engine/executor/handler_chat.rs:1191-1195 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_chat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs: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 × 3) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:726 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:726-730 | crates/izwi-core/src/engine/executor/handler_asr/granite.rs:846-850 | crates/izwi-core/src/engine/executor/handler_asr/granite_speech5.rs:78-82 — 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. 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, `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:845` calls `granite_decode_stop_reason`, `as_ref` and `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:725` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) crates/izwi-core/src/kernels/cuda.rs:1097 — crates/izwi-core/src/kernels/cuda.rs:1097-1101 | crates/izwi-core/src/models/architectures/qwen36moe/text.rs:2786-2790 | crates/izwi-core/src/models/architectures/qwen36moe/text.rs:3663-3667 — 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) crates/izwi-core/src/kernels/cuda/gate.rs:15 — crates/izwi-core/src/kernels/cuda/gate.rs:15-19 | crates/izwi-core/src/kernels/cuda/norm.rs:17-21 | crates/izwi-core/src/kernels/cuda/rope.rs:67-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/kernels/cuda/gate.rs:15` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) crates/izwi-core/src/kernels/cuda/moe.rs:811 — crates/izwi-core/src/kernels/cuda/moe.rs:811-815 | crates/izwi-core/src/kernels/cuda/moe.rs:992-996 | crates/izwi-core/src/kernels/cuda/moe.rs:1331-1335 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/izwi-core/src/kernels/cuda/sampling_device.rs:74 — crates/izwi-core/src/kernels/cuda/sampling_device.rs:74-82 | crates/izwi-core/src/kernels/cuda/sampling_device.rs:96-100 | crates/izwi-core/src/kernels/cuda/sampling_device.rs:170-174 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/kernels/cuda/sampling_device.rs:74` 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) crates/izwi-core/src/runtime/coordinator.rs:1567 — crates/izwi-core/src/runtime/coordinator.rs:1567-1571 | crates/izwi-core/src/runtime/coordinator.rs:1607-1611 | crates/izwi-core/src/runtime/coordinator.rs:1657-1661 — 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 `crates/izwi-core/src/runtime/coordinator.rs:1567` 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 × 3) crates/izwi-server/src/chat_store.rs:909 — crates/izwi-server/src/chat_store.rs:909-913 | crates/izwi-server/src/voice_store.rs:717-721 | crates/izwi-server/src/voice_store.rs:723-727 — 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) crates/izwi-core/src/kernels/moe_relu2.rs:1414 — crates/izwi-core/src/kernels/moe_relu2.rs:1414-1419 | crates/izwi-core/src/kernels/moe_relu2.rs:1428-1433 | crates/izwi-core/src/kernels/moe_relu2.rs:1523-1527 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/izwi-core/src/kernels/metal.rs:2487 — crates/izwi-core/src/kernels/metal.rs:2487-2491 | crates/izwi-core/src/kernels/metal.rs:2600-2605 | crates/izwi-core/src/kernels/metal.rs:3025-3030 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/izwi-core/src/engine/executor/handler_asr.rs:339 — crates/izwi-core/src/engine/executor/handler_asr.rs:339-343 | crates/izwi-core/src/engine/executor/handler_chat.rs:59-63 | crates/izwi-core/src/engine/executor/handler_tts.rs:336-340 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chat.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 83 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 `crates/izwi-core/src/engine/executor/handler_asr.rs:339` 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 × 3) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1198 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1198-1202 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1276-1280 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1347-1351 — 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.
X18 · Disposal-pattern correctness · Owned value's release suppressed and never restored · ×12
  • Owned value's release suppressed and never restored crates/izwi-serving-worker/src/lib.rs:1914 — `std::mem::forget(permit)` (line 1914) takes `permit` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-serving-worker/src/lib.rs:2015 — `std::mem::forget(permit)` (line 2015) takes `permit` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/runtime/service/driver.rs:383 — `std::mem::forget(residency_lease)` (line 383) takes `residency_lease` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/runtime/service/driver.rs:386 — `std::mem::forget(job)` (line 386) takes `job` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/runtime/asr/realtime_session.rs:517 — `std::mem::forget(engine_session)` (line 517) takes `engine_session` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/runtime/asr/realtime_session.rs:520 — `std::mem::forget(cleanup)` (line 520) takes `cleanup` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/models/architectures/qwen38/decode_graph.rs:295 — `std::mem::forget(graph)` (line 295) takes `graph` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/models/architectures/qwen38/decode_graph.rs:297 — `std::mem::forget(self.table.take())` (line 297) takes `self.table.take()` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/models/architectures/qwen38/step_graph.rs:116 — `std::mem::forget(std::mem::take(&mut self.graph))` (line 116) takes `std::mem::take(&mut self.graph)` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/models/architectures/qwen38/step_graph.rs:117 — `std::mem::forget(self.table.take())` (line 117) takes `self.table.take()` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/models/architectures/qwen38/step_graph.rs:118 — `std::mem::forget(self.step.take())` (line 118) takes `self.step.take()` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
  • Owned value's release suppressed and never restored crates/izwi-core/src/models/architectures/qwen38/native/loading.rs:1095 — `std::mem::forget(resources)` (line 1095) takes `resources` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×11
  • Edited copy of a member (16 corresponding lines) crates/izwi-prometheus/src/lib.rs:290 — crates/izwi-prometheus/src/lib.rs:290-305 | crates/izwi-prometheus/src/lib.rs:348-369 — 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) crates/izwi-core/src/kv/v2/runtime.rs:262 — crates/izwi-core/src/kv/v2/runtime.rs:262-281 | crates/izwi-core/src/kv/v2/runtime.rs:964-979 — 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) crates/izwi-core/src/runtime/diarization.rs:151 — crates/izwi-core/src/runtime/diarization.rs:151-172 | crates/izwi-core/src/runtime/service.rs:903-918 — 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) crates/izwi-core/src/engine/executor/handler_tts.rs:159 — crates/izwi-core/src/engine/executor/handler_tts.rs:159-174 | crates/izwi-core/src/engine/executor/handler_tts.rs:204-221 — 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) crates/izwi-core/src/kv/v2/resolved_domains.rs:366 — crates/izwi-core/src/kv/v2/resolved_domains.rs:366-381 | crates/izwi-core/src/kv/v2/resolved_domains.rs:385-400 — 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) crates/izwi-core/src/engine/executor.rs:2642 — crates/izwi-core/src/engine/executor.rs:2642-2661 | crates/izwi-core/src/engine/executor/long_form.rs:117-132 — 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) crates/izwi-core/src/runtime/asr/speaker_attribution.rs:362 — crates/izwi-core/src/models/registry.rs:4068-4087 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:362-377 — 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) crates/izwi-core/src/engine/cache/retained_static_attention.rs:290 — crates/izwi-core/src/engine/cache/retained_static_attention.rs:290-305 | crates/izwi-core/src/engine/cache/retained_static_attention.rs:310-329 — 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) crates/izwi-core/src/runtime/asr.rs:1242 — crates/izwi-core/src/runtime/asr.rs:1242-1258 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:7-22 — 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) crates/izwi-core/src/audio/preprocessing.rs:410 — crates/izwi-core/src/audio/preprocessing.rs:410-425 | crates/izwi-core/src/audio/preprocessing.rs:427-442 — 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) crates/izwi-server/src/api/diarization/handlers.rs:196 — crates/izwi-server/src/api/diarization/handlers.rs:196-214 | crates/izwi-server/src/api/studio/handlers.rs:373-388 — 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.
D2 · Cognitive Complexity · EngineCore · ×10
  • EngineCore::commit_executor_result (cognitive 161) crates/izwi-core/src/engine/core/commit.rs:122 — EngineCore::commit_executor_result has cognitive complexity 161 (threshold 15). Drivers by points: if/else 65 (126 pts), match/switch 14 (25 pts), boolean chains 10 (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • EngineCore::commit_step (cognitive 133) crates/izwi-core/src/engine/core/step.rs:666 — EngineCore::commit_step has cognitive complexity 133 (threshold 15). Drivers by points: if/else 43 (114 pts), loops 6 (12 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 79). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • EngineCore::prepare_step_for (cognitive 70) crates/izwi-core/src/engine/core/step.rs:291 — EngineCore::prepare_step_for has cognitive complexity 70 (threshold 15). Drivers by points: if/else 19 (26 pts), match/switch 7 (19 pts), boolean chains 15, loops 7 (10 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.
  • EngineCore::form_physical_batches (cognitive 53) crates/izwi-core/src/engine/core/formation.rs:754 — EngineCore::form_physical_batches has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (38 pts), match/switch 2 (6 pts), loops 3 (5 pts), boolean chains 4 (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.
  • EngineCore::begin_execution_plan (cognitive 49) crates/izwi-core/src/engine/core/plan.rs:260 — EngineCore::begin_execution_plan has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 2 (7 pts), boolean chains 6, match/switch 4 (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.
  • EngineCore::work_cost (cognitive 33) crates/izwi-core/src/engine/core/formation.rs:221 — EngineCore::work_cost has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 5, match/switch 3 (5 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.
  • EngineCore::execute_and_commit_prepared_with_progress (cognitive 24) crates/izwi-core/src/engine/core/step.rs:20 — EngineCore::execute_and_commit_prepared_with_progress has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 5 (14 pts), loops 7, if/else 1 (2 pts), boolean chains 1 (nesting depth added 10). 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.
  • EngineCore::rollback_schedule_state (cognitive 21) crates/izwi-core/src/engine/core/plan.rs:594 — EngineCore::rollback_schedule_state has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 pts), 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.
  • EngineCore::load_retained_state_with_rows (cognitive 17) crates/izwi-core/src/engine/core/managed_state.rs:436 — EngineCore::load_retained_state_with_rows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3 (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, 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.
  • EngineCore::register_prepared_physical_dispatch (cognitive 16) crates/izwi-core/src/engine/core/formation.rs:614 — EngineCore::register_prepared_physical_dispatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, match/switch 1 (2 pts), 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.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×10
  • Edited copy of a member (14 corresponding lines) crates/izwi-model-catalog/src/catalog/metadata.rs:1570 — crates/izwi-model-catalog/src/catalog/metadata.rs:1570-1585 | crates/izwi-model-catalog/src/catalog/metadata.rs:1588-1601 — 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) crates/izwi-core/src/engine/scheduler/mod.rs:4430 — crates/izwi-core/src/engine/scheduler/mod.rs:4430-4443 | crates/izwi-core/src/engine/scheduler/mod.rs:4468-4481 — 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) crates/izwi-core/src/runtime/asr/realtime_session.rs:118 — crates/izwi-core/src/runtime/asr/realtime_session.rs:118-131 | crates/izwi-core/src/runtime/asr/realtime_session.rs:133-146 — 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) crates/izwi-core/src/kernels/numeric_check.rs:49 — crates/izwi-core/src/kernels/numeric_check.rs:49-67 | crates/izwi-core/src/models/architectures/qwen38/lm_head.rs:201-214 — 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) crates/izwi-server/src/api/transcription/unified_write.rs:72 — crates/izwi-server/src/api/transcription/unified_write.rs:72-85 | crates/izwi-server/src/api/transcription/unified_write.rs:91-104 — 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) crates/izwi-serving-supervisor/src/signals.rs:26 — crates/izwi-serving-supervisor/src/signals.rs:26-40 | crates/izwi-serving-supervisor/src/signals.rs:43-56 — 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) crates/izwi-core/src/engine/cache/coordinator.rs:1335 — crates/izwi-core/src/engine/cache/coordinator.rs:1335-1348 | crates/izwi-core/src/engine/cache/coordinator.rs:1376-1389 — 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) crates/izwi-server/src/api/transcription/handlers.rs:1999 — crates/izwi-server/src/api/transcription/handlers.rs:1999-2012 | crates/izwi-server/src/api/transcription/handlers.rs:2014-2028 — 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) crates/izwi-server/src/api/studio/handlers.rs:832 — crates/izwi-server/src/api/studio/handlers.rs:832-845 | crates/izwi-server/src/api/studio/handlers.rs:851-864 — 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) crates/izwi-cli/src/commands/serve.rs:637 — crates/izwi-cli/src/commands/serve.rs:637-650 | crates/izwi-desktop/src/app/server.rs:811-826 — 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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×10
  • Edited copy of a member (15 corresponding lines) crates/izwi-server/src/api/openai/audio/voices.rs:309 — crates/izwi-server/src/api/openai/audio/voices.rs:309-323 | crates/izwi-server/src/api/openai/batches/mod.rs:286-304 — 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) crates/izwi-gateway/src/gateway_security.rs:356 — crates/izwi-gateway/src/gateway_security.rs:356-370 | crates/izwi-gateway/src/gateway_security.rs:374-391 — 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) crates/izwi-gateway/src/gateway_fleet/fleet.rs:262 — crates/izwi-gateway/src/gateway_fleet/fleet.rs:262-276 | crates/izwi-gateway/src/gateway_fleet/fleet.rs:286-307 — 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) crates/izwi-server/src/api/openai/audio/transcriptions.rs:1428 — crates/izwi-server/src/api/openai/audio/transcriptions.rs:1428-1442 | crates/izwi-server/src/api/openai/audio/transcriptions.rs:1448-1468 — 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) crates/izwi-core/src/engine/cache/managed/capacity.rs:609 — crates/izwi-core/src/engine/cache/managed/capacity.rs:609-624 | crates/izwi-core/src/engine/cache/managed/capacity.rs:1113-1127 — 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) crates/izwi-server/src/app/transcription_realtime.rs:1761 — crates/izwi-server/src/app/transcription_realtime.rs:1761-1775 | crates/izwi-server/src/app/transcription_realtime.rs:1777-1791 — 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) crates/izwi-core/src/runtime/request.rs:461 — crates/izwi-core/src/runtime/request.rs:461-475 | crates/izwi-core/src/runtime/request.rs:485-499 — 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) crates/izwi-core/src/model/manager.rs:437 — crates/izwi-core/src/model/manager.rs:437-451 | crates/izwi-core/src/model/manager.rs:525-544 — 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) crates/izwi-server/src/batch_runtime/store/acceptance.rs:129 — crates/izwi-server/src/batch_runtime/store/acceptance.rs:129-143 | crates/izwi-server/src/batch_runtime/store/idempotency.rs:120-134 — 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) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:177 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:177-191 | crates/izwi-core/src/engine/executor.rs:1279-1293 — 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 (9 corresponding lines) · ×10
  • Edited copy of a member (9 corresponding lines) crates/izwi-core/src/kernels/cuda/sampling.rs:261 — crates/izwi-core/src/kernels/cuda/sampling.rs:261-269 | crates/izwi-core/src/kernels/cuda/sampling.rs:318-326 — 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) crates/izwi-core/src/backends/state/mod.rs:672 — crates/izwi-core/src/backends/state/mod.rs:672-684 | crates/izwi-core/src/backends/state/mod.rs:925-933 — 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:6 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:6-14 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:5-13 — 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) crates/izwi-core/src/engine/cache/physical.rs:1230 — crates/izwi-core/src/engine/cache/physical.rs:1230-1238 | crates/izwi-core/src/runtime/service/tts_preparation.rs:315-323 — 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) crates/izwi-core/src/engine/resources.rs:22 — crates/izwi-core/src/engine/resources.rs:22-30 | crates/izwi-core/src/engine/resources.rs:32-40 — 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) crates/izwi-gateway/src/gateway_fleet/mod.rs:163 — crates/izwi-gateway/src/gateway_fleet/mod.rs:163-171 | crates/izwi-db/src/storage_layout.rs:28-36 — 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) crates/izwi-core/src/engine/cache/managed/prefix.rs:85 — crates/izwi-core/src/engine/cache/managed/prefix.rs:85-93 | crates/izwi-core/src/models/architectures/vibevoice/asr.rs:2880-2889 — 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) crates/izwi-core/src/kernels/cuda.rs:287 — crates/izwi-core/src/kernels/cuda.rs:287-295 | crates/izwi-core/src/kernels/metal.rs:4917-4925 — 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) crates/izwi-gateway/src/shutdown.rs:87 — crates/izwi-gateway/src/shutdown.rs:87-95 | crates/izwi-serving-worker/src/main.rs:721-730 — 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) crates/izwi-server/src/batch_runtime/types.rs:241 — crates/izwi-server/src/batch_runtime/types.rs:241-250 | REDACTED:79-87 — 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.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×10
  • Edited copy of a member (8 corresponding lines) crates/izwi-core/src/kernels/metal.rs:2690 — crates/izwi-core/src/kernels/metal.rs:2690-2697 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:26-33 — 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) crates/izwi-server/src/transcription_store.rs:1515 — crates/izwi-server/src/transcription_store.rs:1515-1522 | crates/izwi-server/src/voice_observation_store.rs:331-338 — 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) crates/izwi-core/src/engine/cache/physical.rs:112 — crates/izwi-core/src/engine/cache/physical.rs:112-119 | crates/izwi-core/src/engine/cache/retained_static_attention.rs:81-89 — 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) crates/izwi-core/src/kernels/cuda/fp8.rs:400 — crates/izwi-core/src/kernels/cuda/fp8.rs:400-407 | crates/izwi-core/src/kernels/cuda/moe.rs:223-230 — 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) crates/izwi-core/src/backends/kv/accelerator.rs:968 — crates/izwi-core/src/backends/kv/accelerator.rs:968-975 | crates/izwi-core/src/backends/kv/cpu.rs:146-153 — 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) crates/izwi-core/src/kernels/greedy.rs:54 — crates/izwi-core/src/kernels/greedy.rs:54-61 | crates/izwi-core/src/kernels/race_sampler.rs:111-118 — 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) crates/izwi-core/src/kernels/residual_norm.rs:23 — crates/izwi-core/src/kernels/residual_norm.rs:23-30 | crates/izwi-core/src/kernels/swiglu.rs:10-17 — 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) crates/izwi-core/src/engine/cache/invocation.rs:347 — crates/izwi-core/src/engine/cache/invocation.rs:347-354 | crates/izwi-core/src/engine/cache/invocation_tensor.rs:495-502 — 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) crates/izwi-core/src/engine/executor.rs:3026 — crates/izwi-core/src/engine/executor.rs:3026-3033 | crates/izwi-core/src/engine/executor/handler_tts.rs:295-302 — 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) scripts/fixtures/generate_chatterbox_reference.py:102 — scripts/fixtures/generate_chatterbox_reference.py:102-109 | scripts/fixtures/generate_maya1_reference.py: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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×10
  • Duplicated block (12 lines × 3) crates/izwi-cli/src/commands/bench.rs:2088 — crates/izwi-cli/src/commands/bench.rs:2088-2099 | crates/izwi-cli/src/commands/bench.rs:2415-2426 | crates/izwi-cli/src/commands/bench.rs:2740-2751 — 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 `crates/izwi-cli/src/commands/bench.rs:2088` 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 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:586 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:586-597 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:408-419 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:448-459 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:586` it begins part-way through the construct above it, so those 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 × 3) crates/izwi-core/src/model/manager.rs:306 — crates/izwi-core/src/model/manager.rs:306-317 | crates/izwi-core/src/model/manager.rs:345-356 | crates/izwi-core/src/model/manager.rs:526-537 — 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 `crates/izwi-core/src/model/manager.rs:306` 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, `crates/izwi-core/src/model/manager.rs:318` calls `Some` and `crates/izwi-core/src/model/manager.rs:357` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:239 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:239-250 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:520-531 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1230-1241 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/realtime.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:239` 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 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:594 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:594-605 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:774-785 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:977-988 — 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 (12 lines × 3) crates/izwi-core/src/runtime/service/asr_preparation.rs:1553 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1553-1564 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1777-1788 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2168-2179 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1553` 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 lines × 3) crates/izwi-core/src/runtime/service/tts_preparation.rs:1232 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1232-1243 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1582-1593 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1910-1921 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1232` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/runtime/service/tts_preparation.rs:1244` calls `clone` and `crates/izwi-core/src/runtime/service/tts_preparation.rs:1922` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:767 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:767-778 | crates/izwi-core/src/engine/executor/handler_tts.rs:1621-1632 | crates/izwi-core/src/engine/executor/handler_tts.rs:2223-2234 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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 lines × 3) crates/izwi-core/src/engine/executor/handler_asr.rs:347 — crates/izwi-core/src/engine/executor/handler_asr.rs:347-358 | crates/izwi-core/src/engine/executor/handler_chat.rs:67-78 | crates/izwi-core/src/engine/executor/handler_tts.rs:344-355 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chat.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 83 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 `crates/izwi-core/src/engine/executor/handler_asr.rs:347` it begins part-way through the construct above it, so those 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 × 3) crates/izwi-server/src/app/voice_realtime/mod.rs:2145 — crates/izwi-server/src/app/voice_realtime/mod.rs:2145-2156 | crates/izwi-server/src/app/voice_realtime/mod.rs:2408-2419 | crates/izwi-server/src/app/voice_realtime/mod.rs:2426-2437 — 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 `crates/izwi-server/src/app/voice_realtime/mod.rs:2145` 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 · Duplicated block (11 lines × 3) · ×10
  • Duplicated block (11 lines × 3) crates/izwi-core/src/engine/executor.rs:4046 — crates/izwi-core/src/engine/executor.rs:4046-4056 | crates/izwi-core/src/engine/executor.rs:4064-4074 | crates/izwi-core/src/engine/executor.rs:4312-4322 — 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 `crates/izwi-core/src/engine/executor.rs:4046` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:521 — crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:521-531 | crates/izwi-core/src/engine/executor/handler_chat.rs:1136-1146 | crates/izwi-core/src/engine/executor/handler_tts.rs:3941-3951 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:453 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:453-463 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:651-661 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1532-1542 — 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:453` 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 × 3) crates/izwi-core/src/runtime/service/asr_preparation.rs:1531 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1531-1541 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1776-1787 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1957-1968 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1531` it begins part-way through the construct above it, so those 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 × 3) crates/izwi-core/src/kernels/depthwise_conv.rs:66 — crates/izwi-core/src/kernels/depthwise_conv.rs:66-76 | crates/izwi-core/src/kernels/relpos_attention.rs:784-794 | crates/izwi-core/src/kernels/transducer_greedy.rs:373-383 — before extracting anything, compare `crates/izwi-core/src/kernels/relpos_attention.rs` and `crates/izwi-core/src/kernels/transducer_greedy.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 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 (11 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:221 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:221-232 | crates/izwi-core/src/runtime/adapters/loaded/chat.rs:202-217 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:114-124 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:221` 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 (11 lines × 3) crates/izwi-cli/src/commands/bench.rs:2025 — crates/izwi-cli/src/commands/bench.rs:2025-2035 | crates/izwi-cli/src/commands/bench.rs:2364-2374 | crates/izwi-cli/src/commands/bench.rs:2689-2699 — 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 `crates/izwi-cli/src/commands/bench.rs:2025` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-cli/src/commands/bench.rs:1841 — crates/izwi-cli/src/commands/bench.rs:1841-1851 | crates/izwi-cli/src/commands/bench.rs:2167-2177 | crates/izwi-cli/src/commands/bench.rs:2502-2512 — 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 (11 lines × 3) crates/izwi-core/src/engine/executor/dispatch.rs:703 — crates/izwi-core/src/engine/executor/dispatch.rs:703-713 | crates/izwi-core/src/engine/executor/dispatch.rs:790-800 | crates/izwi-core/src/engine/executor/dispatch.rs:975-985 — 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 `crates/izwi-core/src/engine/executor/dispatch.rs:703` 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 × 3) crates/izwi-core/src/runtime/service/asr_encoders.rs:1013 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1013-1023 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1491-1501 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1754-1764 — 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1013` 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.
D5 · Coupling · Off the main sequence · ×10
  • Off the main sequence: izwi-db — izwi-db: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: izwi-env — izwi-env: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
  • Off the main sequence: izwi-prometheus — izwi-prometheus: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: izwi-vad — izwi-vad: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: izwi-model-catalog — izwi-model-catalog: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: izwi-agent — izwi-agent: abstractness 0.09, instability 0.00, distance 0.91 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: izwi-audio-codec — izwi-audio-codec: abstractness 0.11, instability 0.00, distance 0.89 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: izwi-serving-protocol — izwi-serving-protocol: abstractness 0.00, instability 0.14, distance 0.86 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: izwi-serving-client — izwi-serving-client: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: izwi-hooks — izwi-hooks: abstractness 0.23, instability 0.00, distance 0.77 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
D1 · Cyclomatic Complexity · izwi_cli · ×9
  • izwi_cli::commands::bench::print_asr_stage_timing_summary (cyclomatic 76) crates/izwi-cli/src/commands/bench.rs:4536 — izwi_cli::commands::bench::print_asr_stage_timing_summary has cyclomatic complexity 76 (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.
  • izwi_cli::commands::bench::print_tts_stage_timing_summary (cyclomatic 38) crates/izwi-cli/src/commands/bench.rs:4344 — izwi_cli::commands::bench::print_tts_stage_timing_summary has cyclomatic complexity 38 (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.
  • izwi_cli::commands::status::show_status (cyclomatic 38) crates/izwi-cli/src/commands/status.rs:100 — izwi_cli::commands::status::show_status has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • izwi_cli::commands::tts::build_request_body (cyclomatic 28) crates/izwi-cli/src/commands/tts.rs:497 — izwi_cli::commands::tts::build_request_body 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.
  • izwi_cli::commands::bench::bench_asr (cyclomatic 24) crates/izwi-cli/src/commands/bench.rs:2428 — izwi_cli::commands::bench::bench_asr 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.
  • izwi_cli::commands::bench::print_asr_decode_profile_summary (cyclomatic 24) crates/izwi-cli/src/commands/bench.rs:4975 — izwi_cli::commands::bench::print_asr_decode_profile_summary has cyclomatic complexity 24 (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.
  • izwi_cli::commands::bench::bench_tts (cyclomatic 20) crates/izwi-cli/src/commands/bench.rs:2101 — izwi_cli::commands::bench::bench_tts 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.
  • izwi_cli::commands::models::route_capability_labels (cyclomatic 19) crates/izwi-cli/src/commands/models.rs:209 — izwi_cli::commands::models::route_capability_labels has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • izwi_cli::commands::bench::bench_chat (cyclomatic 17) crates/izwi-cli/src/commands/bench.rs:1796 — izwi_cli::commands::bench::bench_chat 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.
D1 · Cyclomatic Complexity · izwi_gateway · ×9
  • izwi_gateway::roles::gateway::gateway_state (cyclomatic 42) crates/izwi-gateway/src/roles/gateway.rs:203 — izwi_gateway::roles::gateway::gateway_state has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • izwi_gateway::app::realtime_translate::run_translate_session (cyclomatic 41) crates/izwi-gateway/src/app/realtime_translate.rs:287 — izwi_gateway::app::realtime_translate::run_translate_session 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.
  • izwi_gateway::api::openai::chat::completions::to_core_messages_with_media (cyclomatic 24) crates/izwi-gateway/src/api/openai/chat/completions.rs:51 — izwi_gateway::api::openai::chat::completions::to_core_messages_with_media 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.
  • izwi_gateway::app::chat::spawn_started_remote_chat_stream (cyclomatic 21) crates/izwi-gateway/src/app/chat.rs:950 — izwi_gateway::app::chat::spawn_started_remote_chat_stream 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.
  • izwi_gateway::roles::gateway::validate_gateway_limits (cyclomatic 20) crates/izwi-gateway/src/roles/gateway.rs:882 — izwi_gateway::roles::gateway::validate_gateway_limits 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.
  • izwi_gateway::app::realtime_relay::run_relay_session (cyclomatic 18) crates/izwi-gateway/src/app/realtime_relay.rs:309 — izwi_gateway::app::realtime_relay::run_relay_session has cyclomatic complexity 18 (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.
  • izwi_gateway::worker_registry::validate_status (cyclomatic 18) crates/izwi-gateway/src/worker_registry.rs:1176 — izwi_gateway::worker_registry::validate_status 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.
  • izwi_gateway::app::openai_realtime_proxy::relay (cyclomatic 17) crates/izwi-gateway/src/app/openai_realtime_proxy.rs:559 — izwi_gateway::app::openai_realtime_proxy::relay has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • izwi_gateway::app::openai_realtime_proxy::relay_session (cyclomatic 16) crates/izwi-gateway/src/app/openai_realtime_proxy.rs:424 — izwi_gateway::app::openai_realtime_proxy::relay_session has cyclomatic complexity 16 (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.
D2 · Cognitive Complexity · ModelLifecycleController · ×9
  • ModelLifecycleController::run_load_attempt_locked (cognitive 65) crates/izwi-core/src/runtime/lifecycle/load.rs:869 — ModelLifecycleController::run_load_attempt_locked has cognitive complexity 65 (threshold 15). Drivers by points: if/else 39 (52 pts), match/switch 6 (11 pts), boolean chains 1, loops 1 (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.
  • ModelLifecycleController::allocate_asr_state (cognitive 59) crates/izwi-core/src/runtime/lifecycle/load/state.rs:420 — ModelLifecycleController::allocate_asr_state has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (48 pts), match/switch 3 (8 pts), boolean chains 3 (nesting depth added 31). 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.
  • ModelLifecycleController::fit_invocation_decoder_context (cognitive 32) crates/izwi-core/src/runtime/lifecycle/load/invocation.rs:426 — ModelLifecycleController::fit_invocation_decoder_context has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (30 pts), loops 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.
  • ModelLifecycleController::allocate_chat_state (cognitive 22) crates/izwi-core/src/runtime/lifecycle/load/state.rs:10 — ModelLifecycleController::allocate_chat_state has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (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.
  • ModelLifecycleController::allocate_lfm25_audio_state (cognitive 22) crates/izwi-core/src/runtime/lifecycle/load/state.rs:1049 — ModelLifecycleController::allocate_lfm25_audio_state has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (7 pts), loops 1 (2 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.
  • ModelLifecycleController::reserve_model_resources (cognitive 19) crates/izwi-core/src/runtime/lifecycle/load/admission.rs:1177 — ModelLifecycleController::reserve_model_resources has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), match/switch 1 (2 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.
  • ModelLifecycleController::load_granite_speech_state_publications (cognitive 17) crates/izwi-core/src/runtime/lifecycle/load/state.rs:153 — ModelLifecycleController::load_granite_speech_state_publications has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (3 pts), boolean chains 2, 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.
  • ModelLifecycleController::ensure_model_budget_before_load (cognitive 16) crates/izwi-core/src/runtime/lifecycle/load/admission.rs:460 — ModelLifecycleController::ensure_model_budget_before_load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 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.
  • ModelLifecycleController::allocate_qwen_tts_state (cognitive 16) crates/izwi-core/src/runtime/lifecycle/load/state.rs:1470 — ModelLifecycleController::allocate_qwen_tts_state has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (4 pts), match/switch 1 (3 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.
D35 · Change Coupling · Change coupling · ×9
  • Change coupling: publish.rs ↔ metadata.rs crates/izwi-core/src/runtime/lifecycle/publish.rs:1 — `crates/izwi-core/src/runtime/lifecycle/publish.rs` and `crates/izwi-model-catalog/src/catalog/metadata.rs` change together 74% of the time (14 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `cf4c72ec` Wire Fish S2 metadata loading into runtime (at that commit the file was still `crates/izwi-core/src/catalog/metadata.rs`); `e6e081ce` Register Fish Audio S2 Pro catalog metadata (at that commit the file was still `crates/izwi-core/src/catalog/metadata.rs`); `45edf84c` Add Granite Speech catalog metadata (at that commit the file was still `crates/izwi-core/src/catalog/metadata.rs`) — run `git show` on any of them.
  • Change coupling: completions.rs ↔ handlers.rs crates/izwi-server/src/api/openai/chat/completions.rs:1 — `crates/izwi-server/src/api/openai/chat/completions.rs` and `crates/izwi-server/src/api/openai/responses/handlers.rs` change together 74% of the time (14 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `58d60355` fix(server): let streamed chat responses complete; `529f2df6` Wire multimodal chat inputs through server routes; `bbdc2747` Add Qwen3.5 multimodal runtime — run `git show` on any of them.
  • Change coupling: metadata.rs ↔ types.ts crates/izwi-model-catalog/src/catalog/metadata.rs:1 — `crates/izwi-model-catalog/src/catalog/metadata.rs` and `ui/src/types.ts` change together 68% of the time (25 of the 37 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 25 shared commits counted here, the most recent 3 are `e2ee03ae` Serve Qwen3.6-35B-A3B-FP8 instead of Qwen3.5-35B-A3B-FP8 (#217) (at that commit the file was still `crates/izwi-core/src/catalog/metadata.rs`); `e6e081ce` Register Fish Audio S2 Pro catalog metadata (at that commit the file was still `crates/izwi-core/src/catalog/metadata.rs`); `45edf84c` Add Granite Speech catalog metadata (at that commit the file was still `crates/izwi-core/src/catalog/metadata.rs`) — run `git show` on any of them.
  • Change coupling: route.tsx ↔ route.tsx ui/src/features/chat/route.tsx:1 — `ui/src/features/chat/route.tsx` and `ui/src/features/models/route.tsx` change together 57% of the time (16 of the 28 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `b94e96dc` refactor(ui): normalize feature route ownership; `c834a89b` refactor: add LFM2.5 1.2B Instruct/Thinking GGUF chat model support w… (at that commit the files were still `ui/src/pages/ChatPage.tsx` and `ui/src/pages/MyModelsPage.tsx`); `dad411ff` refactor: retire legacy Qwen3 chat variants and switch default model … (at that commit the files were still `ui/src/pages/ChatPage.tsx` and `ui/src/pages/MyModelsPage.tsx`) — run `git show` on any of them.
  • Change coupling: handlers.rs ↔ completions.rs crates/izwi-server/src/api/chat/handlers.rs:1 — `crates/izwi-server/src/api/chat/handlers.rs` and `crates/izwi-server/src/api/openai/chat/completions.rs` 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; 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 `58d60355` fix(server): let streamed chat responses complete; `529f2df6` Wire multimodal chat inputs through server routes; `bbdc2747` Add Qwen3.5 multimodal runtime — run `git show` on any of them.
  • Change coupling: variant.rs ↔ types.ts crates/izwi-model-catalog/src/catalog/variant.rs:1 — `crates/izwi-model-catalog/src/catalog/variant.rs` and `ui/src/types.ts` change together 54% of the time (20 of the 37 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `e2ee03ae` Serve Qwen3.6-35B-A3B-FP8 instead of Qwen3.5-35B-A3B-FP8 (#217) (at that commit the file was still `crates/izwi-core/src/catalog/variant.rs`); `e6e081ce` Register Fish Audio S2 Pro catalog metadata (at that commit the file was still `crates/izwi-core/src/catalog/variant.rs`); `45edf84c` Add Granite Speech catalog metadata (at that commit the file was still `crates/izwi-core/src/catalog/variant.rs`) — run `git show` on any of them.
  • Change coupling: modelMetadata.ts ↔ routeModelCatalog.ts ui/src/features/models/catalog/modelMetadata.ts:1 — `ui/src/features/models/catalog/modelMetadata.ts` and `ui/src/features/models/catalog/routeModelCatalog.ts` change together 53% of the time (8 of the 15 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `e2ee03ae` Serve Qwen3.6-35B-A3B-FP8 instead of Qwen3.5-35B-A3B-FP8 (#217); `e6e081ce` Register Fish Audio S2 Pro catalog metadata; `45edf84c` Add Granite Speech catalog metadata — run `git show` on any of them.
  • Change coupling: route.tsx ↔ route.tsx ui/src/features/text-to-speech/route.tsx:1 — `ui/src/features/text-to-speech/route.tsx` and `ui/src/features/transcription/route.tsx` change together 51% of the time (18 of the 35 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `a5daa02b` feat(ui): replace table pagination with load more; `8cec16ed` feat(ui): add paginated history navigation for transcription diarizat…; `bcd2f1e4` refactor(ui): add portal support for history drawers and convert dele… — run `git show` on any of them.
  • Change coupling: variant.rs ↔ route.tsx crates/izwi-model-catalog/src/catalog/variant.rs:1 — `crates/izwi-model-catalog/src/catalog/variant.rs` and `ui/src/features/models/route.tsx` change together 51% of the time (19 of the 37 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 19 shared commits counted here, the most recent 3 are `e2ee03ae` Serve Qwen3.6-35B-A3B-FP8 instead of Qwen3.5-35B-A3B-FP8 (#217) (at that commit the file was still `crates/izwi-core/src/catalog/variant.rs`); `d0ea419f` speech: surface lfm25 audio across speech routes (at that commit the file was still `crates/izwi-core/src/catalog/variant.rs`); `c0ba35f7` refactor: remove legacy LFM2-Audio-1.5B variant support in favor of L… (at that commit the files were still `crates/izwi-core/src/catalog/variant.rs` and `ui/src/pages/MyModelsPage.tsx`) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×9
  • Edited copy of a member (24 corresponding lines) crates/izwi-server/src/saved_voice_store.rs:712 — crates/izwi-server/src/saved_voice_store.rs:712-735 | crates/izwi-server/src/saved_voice_store.rs:737-764 — 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.
  • Edited copy of a member (24 corresponding lines) crates/izwi-core/src/kernels/moe_relu2.rs:232 — crates/izwi-core/src/kernels/moe_relu2.rs:232-255 | crates/izwi-core/src/kernels/moe_relu2.rs:259-288 — 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.
  • Edited copy of a member (24 corresponding lines) crates/izwi-core/src/kv/resolved.rs:273 — crates/izwi-core/src/kv/resolved.rs:273-300 | crates/izwi-core/src/kv/v2/resolved.rs:347-370 — 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.
  • Edited copy of a member (24 corresponding lines) crates/izwi-core/src/engine/mod.rs:3599 — crates/izwi-core/src/engine/mod.rs:3599-3624 | crates/izwi-core/src/engine/mod.rs:3985-4008 — 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.
  • Edited copy of a member (24 corresponding lines) crates/izwi-gateway/src/shutdown.rs:13 — crates/izwi-gateway/src/shutdown.rs:13-44 | crates/izwi-gateway/src/shutdown.rs:46-69 — 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.
  • Edited copy of a member (24 corresponding lines) crates/izwi-core/src/backends/state/invocation.rs:557 — crates/izwi-core/src/backends/state/invocation.rs:557-583 | crates/izwi-core/src/backends/state/invocation.rs:590-613 — 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.
  • Edited copy of a member (24 corresponding lines) crates/izwi-server/src/api/jobs/handlers.rs:69 — crates/izwi-server/src/api/jobs/handlers.rs:69-92 | crates/izwi-server/src/api/jobs/handlers.rs:98-124 — 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.
  • Edited copy of a member (24 corresponding lines) crates/izwi-server/src/api/openai/audio/transcriptions.rs:1727 — crates/izwi-server/src/api/openai/audio/transcriptions.rs:1727-1751 | crates/izwi-server/src/api/openai/audio/transcriptions.rs:1757-1780 — 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.
  • Edited copy of a member (24 corresponding lines) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:402 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:402-425 | crates/izwi-server/src/batch_runtime/store/provider_writes.rs:523-548 — 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 · Duplicated block (22 lines × 2) · ×9
  • Duplicated block (22 lines × 2) crates/izwi-core/src/kernels/metal.rs:2767 — crates/izwi-core/src/kernels/metal.rs:2767-2788 | crates/izwi-core/src/kernels/metal.rs:3180-3201 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:2767` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:134 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:134-155 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1120-1141 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 after the matched lines, `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:158` calls `scalar_execution_profile` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1145` 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 (22 lines × 2) crates/izwi-core/src/runtime/audio_io.rs:532 — crates/izwi-core/src/runtime/audio_io.rs:532-553 | crates/izwi-core/src/runtime/audio_io.rs:606-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/audio_io.rs:532` 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) crates/izwi-core/src/runtime/service/asr_preparation.rs:142 — crates/izwi-core/src/runtime/service/asr_preparation.rs:142-163 | crates/izwi-core/src/runtime/service/asr_preparation.rs:392-413 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:1105 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1105-1126 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2359-2380 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1105` 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 (22 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:1287 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1287-1308 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2293-2314 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1287` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/service/tts_preparation.rs:1880 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1880-1901 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2076-2097 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1880` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/api/speech_history/handlers.rs:2421 — crates/izwi-server/src/api/speech_history/handlers.rs:2421-2442 | crates/izwi-server/src/api/speech_history/handlers.rs:2807-2828 — both copies are in the same file, so extract the 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 (22 lines × 2) crates/izwi-server/src/batch_runtime/store/queue.rs:917 — crates/izwi-server/src/batch_runtime/store/queue.rs:917-938 | crates/izwi-server/src/batch_runtime/store/queue.rs:1012-1037 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/batch_runtime/store/queue.rs:917` 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 · Duplicated block (21 lines × 2) · ×9
  • Duplicated block (21 lines × 2) crates/izwi-cli/src/commands/bench.rs:2157 — crates/izwi-cli/src/commands/bench.rs:2157-2177 | crates/izwi-cli/src/commands/bench.rs:2492-2512 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:2157` 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 (21 lines × 2) crates/izwi-core/src/artifacts/downloader.rs:648 — crates/izwi-core/src/artifacts/downloader.rs:648-668 | crates/izwi-core/src/artifacts/downloader.rs:681-701 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/artifacts/downloader.rs:648` 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 (21 lines × 2) crates/izwi-core/src/bin/kokoro_inspect.rs:15 — crates/izwi-core/src/bin/kokoro_inspect.rs:15-35 | crates/izwi-core/src/bin/kokoro_inspect.rs:78-98 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/bin/kokoro_inspect.rs: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 (21 lines × 2) crates/izwi-core/src/engine/core.rs:1120 — crates/izwi-core/src/engine/core.rs:1120-1140 | crates/izwi-core/src/engine/core.rs:1168-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/engine/core.rs:1120` 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 (21 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:441 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:441-461 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:639-659 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:441` 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 (21 lines × 2) crates/izwi-core/src/runtime/service/asr_encoders.rs:649 — crates/izwi-core/src/runtime/service/asr_encoders.rs:649-669 | crates/izwi-core/src/runtime/service/asr_encoders.rs:985-1005 — both copies are in the same file, so extract the 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, `crates/izwi-core/src/runtime/service/asr_encoders.rs:672` calls `as_deref` and `crates/izwi-core/src/runtime/service/asr_encoders.rs:1008` 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 (21 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:446 — crates/izwi-core/src/runtime/service/asr_preparation.rs:446-466 | crates/izwi-core/src/runtime/service/asr_preparation.rs:739-759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/service/asr_preparation.rs:446` 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:447 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:447-467 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:446-466 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:447` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1440 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1440-1460 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1551-1571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · EngineCore · ×8
  • EngineCore::commit_executor_result (cyclomatic 88) crates/izwi-core/src/engine/core/commit.rs:122 — EngineCore::commit_executor_result has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • EngineCore::prepare_step_for (cyclomatic 54) crates/izwi-core/src/engine/core/step.rs:291 — EngineCore::prepare_step_for has cyclomatic complexity 54 (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.
  • EngineCore::begin_execution_plan (cyclomatic 51) crates/izwi-core/src/engine/core/plan.rs:260 — EngineCore::begin_execution_plan has cyclomatic complexity 51 (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.
  • EngineCore::commit_step (cyclomatic 49) crates/izwi-core/src/engine/core/step.rs:666 — EngineCore::commit_step has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • EngineCore::work_cost (cyclomatic 27) crates/izwi-core/src/engine/core/formation.rs:221 — EngineCore::work_cost has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • EngineCore::form_physical_batches (cyclomatic 27) crates/izwi-core/src/engine/core/formation.rs:754 — EngineCore::form_physical_batches has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • EngineCore::execute_and_commit_prepared_with_progress (cyclomatic 18) crates/izwi-core/src/engine/core/step.rs:20 — EngineCore::execute_and_commit_prepared_with_progress has cyclomatic complexity 18 (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.
  • EngineCore::commit_incremental_stream_progress (cyclomatic 16) crates/izwi-core/src/engine/core/delivery.rs:41 — EngineCore::commit_incremental_stream_progress 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.
D1 · Cyclomatic Complexity · RuntimeService · ×8
  • RuntimeService::coordinator_job_for_request (cyclomatic 32) crates/izwi-core/src/runtime/service/execution.rs:188 — RuntimeService::coordinator_job_for_request 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.
  • RuntimeService::run_streaming_request_after_admission (cyclomatic 22) crates/izwi-core/src/runtime/service/execution.rs:824 — RuntimeService::run_streaming_request_after_admission 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.
  • RuntimeService::prepare_whisper_asr_shape_for_binding (cyclomatic 21) crates/izwi-core/src/runtime/service/asr_preparation.rs:351 — RuntimeService::prepare_whisper_asr_shape_for_binding has cyclomatic complexity 21 (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.
  • RuntimeService::diarize_with_transcript_input (cyclomatic 18) crates/izwi-core/src/runtime/diarization.rs:837 — RuntimeService::diarize_with_transcript_input 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.
  • RuntimeService::transcribe_in_chunk_rows (cyclomatic 17) crates/izwi-core/src/runtime/asr/chunk_rows.rs:373 — RuntimeService::transcribe_in_chunk_rows has cyclomatic complexity 17 (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.
  • RuntimeService::build_chat_request_with_params_and_config (cyclomatic 16) crates/izwi-core/src/runtime/chat.rs:206 — RuntimeService::build_chat_request_with_params_and_config 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.
  • RuntimeService::prepare_qwen3_asr_shape_for_binding (cyclomatic 16) crates/izwi-core/src/runtime/service/asr_preparation.rs:97 — RuntimeService::prepare_qwen3_asr_shape_for_binding has cyclomatic complexity 16 (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.
  • RuntimeService::prepare_vibevoice_asr_shape_for_binding (cyclomatic 16) crates/izwi-core/src/runtime/service/asr_preparation.rs:612 — RuntimeService::prepare_vibevoice_asr_shape_for_binding has cyclomatic complexity 16 (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.
D2 · Cognitive Complexity · ManagedKvCacheManager · ×8
  • ManagedKvCacheManager::prepare_inner (cognitive 243) crates/izwi-core/src/engine/cache/managed/prepare.rs:203 — ManagedKvCacheManager::prepare_inner has cognitive complexity 243 (threshold 15). Drivers by points: if/else 84 (185 pts), match/switch 12 (30 pts), boolean chains 18, loops 4 (10 pts) (nesting depth added 125). 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.
  • ManagedKvCacheManager::finalize (cognitive 103) crates/izwi-core/src/engine/cache/managed/finalize.rs:6 — ManagedKvCacheManager::finalize has cognitive complexity 103 (threshold 15). Drivers by points: if/else 35 (68 pts), match/switch 7 (17 pts), loops 7 (11 pts), boolean chains 7 (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.
  • ManagedKvCacheManager::probe_managed_prefix (cognitive 26) crates/izwi-core/src/engine/cache/managed/prefix.rs:545 — ManagedKvCacheManager::probe_managed_prefix has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (5 pts), match/switch 1 (2 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.
  • ManagedKvCacheManager::fit_portable_logical_token_reach (cognitive 25) crates/izwi-core/src/engine/cache/managed/capacity.rs:802 — ManagedKvCacheManager::fit_portable_logical_token_reach has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 6 (8 pts), loops 1 (2 pts), boolean chains 1 (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.
  • ManagedKvCacheManager::bind_model_state_with_capacity_policy (cognitive 23) crates/izwi-core/src/engine/cache/managed/binding.rs:552 — ManagedKvCacheManager::bind_model_state_with_capacity_policy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 3 (4 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.
  • ManagedKvCacheManager::run_host_offload_tick (cognitive 21) crates/izwi-core/src/engine/cache/managed/prefix.rs:666 — ManagedKvCacheManager::run_host_offload_tick has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ManagedKvCacheManager::prepare_unload_model_with_runtime_owners (cognitive 18) crates/izwi-core/src/engine/cache/managed/finalize.rs:526 — ManagedKvCacheManager::prepare_unload_model_with_runtime_owners has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4 (5 pts), boolean chains 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.
  • ManagedKvCacheManager::prepare_with_admission (cognitive 16) crates/izwi-core/src/engine/cache/managed/prepare.rs:149 — ManagedKvCacheManager::prepare_with_admission has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 1 (3 pts), match/switch 1 (3 pts), boolean chains 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.
D2 · Cognitive Complexity · ModelDownloader · ×8
  • ModelDownloader::get_single_file_size_estimate (cognitive 73) crates/izwi-core/src/artifacts/downloader.rs:3193 — ModelDownloader::get_single_file_size_estimate has cognitive complexity 73 (threshold 15). Drivers by points: if/else 44 (47 pts), match/switch 7 (15 pts), boolean chains 11 (nesting depth added 11). 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.
  • ModelDownloader::get_file_download_plans (cognitive 46) crates/izwi-core/src/artifacts/downloader.rs:3014 — ModelDownloader::get_file_download_plans has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 3 (4 pts), match/switch 2 (4 pts), boolean chains 2 (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.
  • ModelDownloader::is_downloaded (cognitive 41) crates/izwi-core/src/artifacts/downloader.rs:1776 — ModelDownloader::is_downloaded has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 25, if/else 8 (10 pts), match/switch 3 (6 pts) (nesting depth added 5). 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.
  • ModelDownloader::get_model_file_specs (cognitive 38) crates/izwi-core/src/artifacts/downloader.rs:2709 — ModelDownloader::get_model_file_specs has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (31 pts), match/switch 2 (4 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.
  • ModelDownloader::get_model_files (cognitive 30) crates/izwi-core/src/artifacts/downloader.rs:2403 — ModelDownloader::get_model_files has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (10 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 13). 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.
  • ModelDownloader::download_with_progress (cognitive 20) crates/izwi-core/src/artifacts/downloader.rs:2250 — ModelDownloader::download_with_progress has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (2 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.
  • ModelDownloader::fetch_resumable (cognitive 19) crates/izwi-core/src/artifacts/downloader.rs:1556 — ModelDownloader::fetch_resumable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (5 pts), boolean chains 2, 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.
  • ModelDownloader::download (cognitive 19) crates/izwi-core/src/artifacts/downloader.rs:2011 — ModelDownloader::download has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, 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.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×8
  • Edited copy of a member (26 corresponding lines) crates/izwi-server/src/saved_voice_store.rs:241 — crates/izwi-server/src/saved_voice_store.rs:241-283 | crates/izwi-server/src/transcription_store.rs:434-459 — 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) crates/izwi-server/src/speech_history_store.rs:917 — crates/izwi-server/src/speech_history_store.rs:917-944 | crates/izwi-server/src/transcription_store.rs:648-673 — 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) crates/izwi-core/src/runtime/service/tts_preparation.rs:123 — crates/izwi-core/src/runtime/service/tts_preparation.rs:123-150 | crates/izwi-core/src/runtime/service/tts_preparation.rs:161-186 — 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) crates/izwi-core/src/engine/executor.rs:1330 — crates/izwi-core/src/engine/executor.rs:1330-1355 | crates/izwi-core/src/engine/executor.rs:1435-1463 — 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) crates/izwi-core/src/artifacts/downloader.rs:1436 — crates/izwi-core/src/artifacts/downloader.rs:1436-1461 | crates/izwi-core/src/artifacts/downloader.rs:2980-3011 — 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) crates/izwi-core/src/backends/kv/accelerator.rs:3017 — crates/izwi-core/src/backends/kv/accelerator.rs:3017-3042 | crates/izwi-core/src/backends/kv/cpu.rs:1085-1112 — 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) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:492 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:492-517 | crates/izwi-server/src/batch_runtime/store/queue.rs:1050-1083 — 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) crates/izwi-server/src/batch_runtime/store/jobs.rs:168 — crates/izwi-server/src/batch_runtime/store/jobs.rs:168-194 | crates/izwi-server/src/batch_runtime/store/jobs.rs:201-226 — 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 · Duplicated block (20 lines × 2) · ×8
  • Duplicated block (20 lines × 2) crates/izwi-core/src/backends/kv/accelerator.rs:2144 — crates/izwi-core/src/backends/kv/accelerator.rs:2144-2163 | crates/izwi-core/src/backends/kv/cpu.rs:212-231 — before extracting anything, compare `crates/izwi-core/src/backends/kv/accelerator.rs` and `crates/izwi-core/src/backends/kv/cpu.rs` as WHOLE FILES: this scan already matched 9 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 `crates/izwi-core/src/backends/kv/accelerator.rs:2144` 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 (20 lines × 2) crates/izwi-core/src/engine/cache/managed/prepare.rs:493 — crates/izwi-core/src/engine/cache/managed/prepare.rs:493-512 | crates/izwi-core/src/engine/cache/managed/prepare.rs:520-539 — both copies are in the same file, so extract the 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, `crates/izwi-core/src/engine/cache/managed/prepare.rs:514` calls `record_prefix_rejection` and `crates/izwi-core/src/engine/cache/managed/prepare.rs:541` 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 (20 lines × 2) crates/izwi-core/src/engine/executor.rs:4642 — crates/izwi-core/src/engine/executor.rs:4642-4661 | crates/izwi-core/src/engine/executor.rs:4756-4775 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor.rs:4642` 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 (20 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:518 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:518-537 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:519-538 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:518` 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) crates/izwi-core/src/kernels/greedy.rs:114 — crates/izwi-core/src/kernels/greedy.rs:114-133 | crates/izwi-core/src/kernels/race_sampler.rs:224-243 — 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 `crates/izwi-core/src/kernels/greedy.rs:114` 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 (20 lines × 2) crates/izwi-core/src/kv/v2/runtime.rs:1449 — crates/izwi-core/src/kv/v2/runtime.rs:1449-1468 | crates/izwi-core/src/kv/v2/runtime.rs:1523-1542 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kv/v2/runtime.rs:1449` it begins part-way through the construct above it, so those exact lines 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 × 2) crates/izwi-core/src/kernels/cuda/moe.rs:914 — crates/izwi-core/src/kernels/cuda/moe.rs:914-933 | crates/izwi-core/src/kernels/cuda/moe.rs:1161-1180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/izwi-server/src/batch_runtime/store/jobs.rs:170 — crates/izwi-server/src/batch_runtime/store/jobs.rs:170-190 | crates/izwi-server/src/batch_runtime/store/jobs.rs:203-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×8
  • Duplicated block (19 lines × 2) crates/izwi-core/src/engine/executor.rs:1337 — crates/izwi-core/src/engine/executor.rs:1337-1355 | crates/izwi-core/src/engine/executor.rs:1445-1463 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor.rs:1337` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/izwi-core/src/kernels/metal.rs:1798 — crates/izwi-core/src/kernels/metal.rs:1798-1816 | crates/izwi-core/src/kernels/metal.rs:2123-2141 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:1798` 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 (19 lines × 2) crates/izwi-core/src/kernels/metal.rs:4394 — crates/izwi-core/src/kernels/metal.rs:4394-4412 | crates/izwi-core/src/kernels/metal.rs:4513-4531 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:4394` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:327 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:327-345 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1108-1126 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs: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.
  • Duplicated block (19 lines × 2) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1086 — crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1086-1104 | crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1122-1140 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1086` 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 first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn gguf_host_joined(&mut` in one and `super) fn gguf_host_rows(&mut` 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 (19 lines × 2) crates/izwi-core/src/runtime/service/tts_preparation.rs:1467 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1467-1485 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1641-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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1467` 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 (19 lines × 2) crates/izwi-gateway/src/app/realtime_translate.rs:672 — crates/izwi-gateway/src/app/realtime_translate.rs:672-690 | crates/izwi-gateway/src/app/realtime_translate.rs:848-866 — both copies are in the same file, so extract the 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 `crates/izwi-gateway/src/app/realtime_translate.rs:672` 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 (19 lines × 2) crates/izwi-server/src/api/diarization/handlers.rs:1247 — crates/izwi-server/src/api/diarization/handlers.rs:1247-1265 | crates/izwi-server/src/api/transcription/handlers.rs:1929-1947 — `crates/izwi-server/src/api/diarization/handlers.rs` and `crates/izwi-server/src/api/transcription/handlers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-server/src/api/diarization/handlers.rs:1247` 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.
D2 · Cognitive Complexity · izwi_serving_worker · ×7
  • izwi_serving_worker::run_invocation (cognitive 45) crates/izwi-serving-worker/src/lib.rs:1711 — izwi_serving_worker::run_invocation has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (29 pts), match/switch 5 (11 pts), boolean chains 4, loops 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.
  • izwi_serving_worker::invoke (cognitive 36) crates/izwi-serving-worker/src/lib.rs:1319 — izwi_serving_worker::invoke has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (26 pts), match/switch 6, boolean chains 3, 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, 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.
  • izwi_serving_worker::realtime::reader_task (cognitive 29) crates/izwi-serving-worker/src/realtime.rs:308 — izwi_serving_worker::realtime::reader_task has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 3 (9 pts), loops 1 (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.
  • izwi_serving_worker::run (cognitive 22) crates/izwi-serving-worker/src/main.rs:118 — izwi_serving_worker::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 4, boolean chains 1 (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.
  • izwi_serving_worker::runtime::warm_up_chat_runtime (cognitive 21) crates/izwi-serving-worker/src/runtime.rs:31 — izwi_serving_worker::runtime::warm_up_chat_runtime has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (5 pts), boolean chains 3, 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.
  • izwi_serving_worker::runtime::warm_up_tts_runtime (cognitive 20) crates/izwi-serving-worker/src/runtime.rs:597 — izwi_serving_worker::runtime::warm_up_tts_runtime has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), boolean chains 3, 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.
  • izwi_serving_worker::realtime::admit_session (cognitive 18) crates/izwi-serving-worker/src/realtime.rs:1295 — izwi_serving_worker::realtime::admit_session has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, match/switch 5 (6 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.
D2 · Cognitive Complexity · RuntimeService · ×7
  • RuntimeService::coordinator_job_for_request (cognitive 44) crates/izwi-core/src/runtime/service/execution.rs:188 — RuntimeService::coordinator_job_for_request has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 11, match/switch 3 (5 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.
  • RuntimeService::run_streaming_request_after_admission (cognitive 31) crates/izwi-core/src/runtime/service/execution.rs:824 — RuntimeService::run_streaming_request_after_admission has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 6 (12 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.
  • RuntimeService::build_chat_request_with_params_and_config (cognitive 28) crates/izwi-core/src/runtime/chat.rs:206 — RuntimeService::build_chat_request_with_params_and_config has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RuntimeService::diarize_with_transcript_input (cognitive 26) crates/izwi-core/src/runtime/diarization.rs:837 — RuntimeService::diarize_with_transcript_input has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (2 pts) (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.
  • RuntimeService::prepare_whisper_asr_shape_for_binding (cognitive 20) crates/izwi-core/src/runtime/service/asr_preparation.rs:351 — RuntimeService::prepare_whisper_asr_shape_for_binding has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 10 (12 pts), if/else 6, boolean chains 2 (nesting depth added 2). 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.
  • RuntimeService::transcribe_in_chunk_rows (cognitive 18) crates/izwi-core/src/runtime/asr/chunk_rows.rs:373 — RuntimeService::transcribe_in_chunk_rows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, match/switch 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.
  • RuntimeService::push_engine_realtime_operation (cognitive 16) crates/izwi-core/src/runtime/asr/realtime.rs:519 — RuntimeService::push_engine_realtime_operation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 5 (6 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · izwi_desktop · ×7
  • izwi_desktop::app::window::handle_run_event (cognitive 26) crates/izwi-desktop/src/app/window.rs:49 — izwi_desktop::app::window::handle_run_event has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (26 pts) (nesting depth added 16). 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.
  • izwi_desktop::app::dictation::live::run (cognitive 24) crates/izwi-desktop/src/app/dictation/live.rs:111 — izwi_desktop::app::dictation::live::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 3 (8 pts), 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.
  • izwi_desktop::app::server::spawn_server_monitor (cognitive 19) crates/izwi-desktop/src/app/server.rs:357 — izwi_desktop::app::server::spawn_server_monitor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), 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.
  • izwi_desktop::app::run (cognitive 17) crates/izwi-desktop/src/app/mod.rs:68 — izwi_desktop::app::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, match/switch 5 (6 pts), boolean chains 1 (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.
  • izwi_desktop::app::dictation::dictation_update_settings (cognitive 17) crates/izwi-desktop/src/app/dictation/mod.rs:846 — izwi_desktop::app::dictation::dictation_update_settings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (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.
  • izwi_desktop::app::install::ensure_macos_cli_links (cognitive 17) crates/izwi-desktop/src/app/install.rs:418 — izwi_desktop::app::install::ensure_macos_cli_links has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (2 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.
  • izwi_desktop::app::dictation::check_model (cognitive 16) crates/izwi-desktop/src/app/dictation/mod.rs:310 — izwi_desktop::app::dictation::check_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (6 pts), boolean chains 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.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×7
  • Edited copy of a member (32 corresponding lines) crates/izwi-core/src/kernels/mamba2.rs:118 — crates/izwi-core/src/kernels/mamba2.rs:118-154 | crates/izwi-core/src/kernels/mamba2.rs:378-409 — 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) crates/izwi-core/src/engine/scheduler/mod.rs:1102 — crates/izwi-core/src/engine/scheduler/mod.rs:1102-1143 | crates/izwi-core/src/engine/scheduler/mod.rs:1150-1181 — 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) crates/izwi-core/src/kernels/cuda/kquant.rs:382 — crates/izwi-core/src/kernels/cuda/kquant.rs:382-413 | crates/izwi-core/src/kernels/cuda/kquant.rs:553-592 — 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) crates/izwi-core/src/artifacts/downloader.rs:642 — crates/izwi-core/src/artifacts/downloader.rs:642-673 | crates/izwi-core/src/artifacts/downloader.rs:675-706 — 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) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:131 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:131-162 | crates/izwi-core/src/engine/executor/fish_pending.rs:109-142 — 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) crates/izwi-server/src/speech_history_store.rs:1786 — crates/izwi-server/src/speech_history_store.rs:1786-1818 | crates/izwi-server/src/transcription_store.rs:1676-1707 — 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) crates/izwi-server/src/api/openapi.rs:1770 — crates/izwi-server/src/api/openapi.rs:1770-1801 | crates/izwi-server/src/api/openapi.rs:1810-1851 — 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 (6 corresponding lines) · ×7
  • Edited copy of a member (6 corresponding lines) crates/izwi-core/src/env/mod.rs:168 — crates/izwi-core/src/env/mod.rs:168-173 | crates/izwi-server/src/app/openai_realtime/profiles.rs:159-165 — 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) crates/izwi-desktop/src/app/updater.rs:458 — crates/izwi-desktop/src/app/updater.rs:458-463 | crates/izwi-server/src/roles/local.rs:487-495 — 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) crates/izwi-serving-client/src/otlp.rs:75 — crates/izwi-core/src/models/architectures/maya2/text/lang.rs:29-34 | crates/izwi-serving-client/src/otlp.rs:75-81 — 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) crates/izwi-server/src/api/openai/audio/voices.rs:279 — crates/izwi-server/src/api/openai/audio/voices.rs:279-284 | crates/izwi-server/src/app/voice_realtime/turn.rs:74-79 — 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) crates/izwi-model-catalog/src/chat/tools/schema.rs:45 — crates/izwi-core/src/models/architectures/nemotron_transcribe/checkpoint.rs:343-348 | crates/izwi-model-catalog/src/chat/tools/schema.rs:45-50 — 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) crates/izwi-asr-toolkit/src/lib.rs:1104 — crates/izwi-asr-toolkit/src/lib.rs:1104-1109 | crates/izwi-core/src/text_segments/sentences.rs:37-45 — 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) scripts/fixtures/generate_lfm25_reference.py:215 — scripts/fixtures/generate_lfm25_reference.py:215-220 | scripts/fixtures/generate_lfm3_reference.py:283-288 — 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 · Duplicated block (18 lines × 2) · ×7
  • Duplicated block (18 lines × 2) crates/izwi-core/src/artifacts/downloader.rs:2719 — crates/izwi-core/src/artifacts/downloader.rs:2719-2736 | crates/izwi-core/src/artifacts/downloader.rs:2750-2767 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/artifacts/downloader.rs:2719` 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) crates/izwi-core/src/kernels/metal.rs:2499 — crates/izwi-core/src/kernels/metal.rs:2499-2516 | crates/izwi-core/src/kernels/metal.rs:2659-2676 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:2499` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:375 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:375-392 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs: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.
  • Duplicated block (18 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1453 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1453-1470 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1689-1706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1453` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/izwi-core/src/runtime/chat.rs:429 — crates/izwi-core/src/runtime/chat.rs:429-446 | crates/izwi-core/src/runtime/chat.rs:509-526 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/chat.rs:429` 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, `crates/izwi-core/src/runtime/chat.rs:428` calls `sized_budget_chat_config` and `crates/izwi-core/src/runtime/chat.rs:508` 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 (18 lines × 2) REDACTED:1461 — REDACTED:1461-1478 | REDACTED:1485-1503 — both copies are in the same file, so extract the 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 `REDACTED:1461` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:573 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:573-590 | crates/izwi-server/src/batch_runtime/store/provider_writes.rs:788-805 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/batch_runtime/store/provider_writes.rs: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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×7
  • Duplicated block (11–12 lines × 2) crates/izwi-core/src/engine/scheduler/mod.rs:3913 — crates/izwi-core/src/engine/scheduler/mod.rs:3913-3923 | crates/izwi-core/src/engine/scheduler/mod.rs:4048-4059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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–12 lines × 2) crates/izwi-core/src/kernels/cuda.rs:689 — crates/izwi-core/src/kernels/cuda.rs:689-699 | crates/izwi-core/src/kernels/cuda.rs:2291-2302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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, `crates/izwi-core/src/kernels/cuda.rs:699` calls `contiguous`, `ok` and `crates/izwi-core/src/kernels/cuda.rs:2302` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11–12 lines × 2) crates/izwi-core/src/kernels/greedy.rs:66 — crates/izwi-core/src/kernels/greedy.rs:66-77 | crates/izwi-core/src/models/architectures/nemotron_transcribe/decoder/mod.rs:1125-1135 — 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 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–12 lines × 2) crates/izwi-core/src/runtime/service/tts_preparation.rs:1446 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1446-1456 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1619-1630 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1446` 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–12 lines × 2) crates/izwi-db/src/schema_contract.rs:707 — crates/izwi-db/src/schema_contract.rs:707-717 | crates/izwi-db/src/schema_contract.rs:751-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-db/src/schema_contract.rs:704` calls `is_empty`, `Ok` and `crates/izwi-db/src/schema_contract.rs:749` 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–12 lines × 2) crates/izwi-server/src/diarization_store.rs:630 — crates/izwi-server/src/diarization_store.rs:630-641 | crates/izwi-server/src/transcription_store.rs:596-606 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/transcription_store.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 176 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 `crates/izwi-server/src/diarization_store.rs:630` 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 first that the copies are not typed on the same thing: the declarations holding them bind `update` to `UpdateDiarizationSummary` in one and `UpdateTranscriptionSummary` 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 (11–12 lines × 2) crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:466 — crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:466-476 | crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:581-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:466` 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, `crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:477` calls `borrow` and `crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:593` 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.
IC1 · Incompleteness & stubs · Empty method body · ×7
  • Empty method body — does nothing with its inputs crates/izwi-cli/src/style.rs:63 — `success` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/izwi-cli/src/style.rs:67 — `warning` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/izwi-cli/src/style.rs:71 — `info` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/izwi-cli/src/style.rs:75 — `step` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/izwi-cli/src/style.rs:81 — `print_error` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/izwi-core/src/engine/metrics.rs:1410 — `saturating_atomic_sub` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/izwi-core/src/models/architectures/fish_s2/retained.rs:1102 — `trace_timings` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
D1 · Cyclomatic Complexity · ModelDownloader · ×6
  • ModelDownloader::get_single_file_size_estimate (cyclomatic 100) crates/izwi-core/src/artifacts/downloader.rs:3193 — ModelDownloader::get_single_file_size_estimate has cyclomatic complexity 100 (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.
  • ModelDownloader::is_downloaded (cyclomatic 58) crates/izwi-core/src/artifacts/downloader.rs:1776 — ModelDownloader::is_downloaded has cyclomatic complexity 58 (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.
  • ModelDownloader::get_model_files (cyclomatic 38) crates/izwi-core/src/artifacts/downloader.rs:2403 — ModelDownloader::get_model_files has cyclomatic complexity 38 (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.
  • ModelDownloader::get_model_file_specs (cyclomatic 24) crates/izwi-core/src/artifacts/downloader.rs:2709 — ModelDownloader::get_model_file_specs 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.
  • ModelDownloader::get_file_download_plans (cyclomatic 23) crates/izwi-core/src/artifacts/downloader.rs:3014 — ModelDownloader::get_file_download_plans 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.
  • ModelDownloader::fetch_resumable (cyclomatic 17) crates/izwi-core/src/artifacts/downloader.rs:1556 — ModelDownloader::fetch_resumable 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.
D2 · Cognitive Complexity · izwi_serving_supervisor · ×6
  • izwi_serving_supervisor::daemon::run (cognitive 89) crates/izwi-serving-supervisor/src/daemon/mod.rs:102 — izwi_serving_supervisor::daemon::run has cognitive complexity 89 (threshold 15). Drivers by points: if/else 30 (56 pts), match/switch 6 (15 pts), loops 7 (13 pts), boolean chains 5 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • izwi_serving_supervisor::daemon::rollout_driver::execute_blue_green (cognitive 29) crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:313 — izwi_serving_supervisor::daemon::rollout_driver::execute_blue_green has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (21 pts), match/switch 4 (7 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.
  • izwi_serving_supervisor::daemon::autoscale_driver::run_autoscale_tick (cognitive 22) crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:51 — izwi_serving_supervisor::daemon::autoscale_driver::run_autoscale_tick has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (4 pts), 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.
  • izwi_serving_supervisor::daemon::autoscale_driver::admit_pending_workers (cognitive 20) crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:167 — izwi_serving_supervisor::daemon::autoscale_driver::admit_pending_workers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (3 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.
  • izwi_serving_supervisor::daemon::rollout_driver::execute_recreate (cognitive 19) crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:536 — izwi_serving_supervisor::daemon::rollout_driver::execute_recreate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (6 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.
  • izwi_serving_supervisor::daemon::autoscale_driver::sync_autoscaler (cognitive 17) crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:17 — izwi_serving_supervisor::daemon::autoscale_driver::sync_autoscaler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 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.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×6
  • Edited copy of a member (23 corresponding lines) crates/izwi-core/src/backends/kv/cpu.rs:310 — crates/izwi-core/src/backends/kv/cpu.rs:310-336 | crates/izwi-core/src/backends/kv/cpu.rs:338-360 — 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) crates/izwi-core/src/audio/preprocessing.rs:382 — crates/izwi-core/src/audio/preprocessing.rs:382-407 | crates/izwi-core/src/models/architectures/lfm25_audio/preprocessor.rs:266-288 — 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) crates/izwi-core/src/kv/v2/runtime.rs:1860 — crates/izwi-core/src/kv/v2/runtime.rs:1860-1885 | crates/izwi-core/src/kv/v2/runtime.rs:1946-1968 — 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) crates/izwi-server/src/saved_voice_store.rs:375 — crates/izwi-server/src/saved_voice_store.rs:375-399 | crates/izwi-server/src/transcription_store.rs:1127-1149 — 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) crates/izwi-core/src/backends/kv/accelerator.rs:999 — crates/izwi-core/src/backends/kv/accelerator.rs:999-1026 | crates/izwi-core/src/backends/kv/cpu.rs:155-177 — 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) crates/izwi-gateway/src/app/realtime_translate.rs:926 — crates/izwi-gateway/src/app/realtime_translate.rs:926-952 | crates/izwi-server/src/app/transcription_realtime.rs:853-875 — 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 copy of a member (25 corresponding lines) · ×6
  • Edited copy of a member (25 corresponding lines) crates/izwi-gateway/src/app/audio_proxy.rs:139 — crates/izwi-gateway/src/app/audio_proxy.rs:139-163 | crates/izwi-gateway/src/app/openai_realtime_proxy.rs:150-178 — 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) crates/izwi-core/src/engine/executor/audio.rs:835 — crates/izwi-core/src/engine/executor/audio.rs:835-862 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:751-775 — 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) crates/izwi-core/src/kv/v2/runtime.rs:1806 — crates/izwi-core/src/kv/v2/runtime.rs:1806-1836 | crates/izwi-core/src/kv/v2/runtime.rs:1914-1938 — 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) crates/izwi-core/src/engine/cache/invocation_tensor.rs:279 — crates/izwi-core/src/engine/cache/invocation_tensor.rs:279-303 | crates/izwi-core/src/engine/cache/invocation_tensor.rs:316-340 — 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) crates/izwi-core/src/runtime/chat.rs:418 — crates/izwi-core/src/runtime/chat.rs:418-446 | crates/izwi-core/src/runtime/chat.rs:502-526 — 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) crates/izwi-server/src/api/speech_history/handlers.rs:859 — crates/izwi-server/src/api/speech_history/handlers.rs:859-887 | crates/izwi-server/src/api/transcription/handlers.rs:333-357 — 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 (21 corresponding lines) · ×6
  • Edited copy of a member (21 corresponding lines) crates/izwi-model-catalog/src/chat/tools/grammar.rs:234 — crates/izwi-model-catalog/src/chat/tools/grammar.rs:234-254 | crates/izwi-model-catalog/src/chat/tools/grammar.rs:296-326 — 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.
  • Edited copy of a member (21 corresponding lines) crates/izwi-server/src/batch_runtime/store/jobs.rs:228 — crates/izwi-server/src/batch_runtime/store/jobs.rs:228-248 | crates/izwi-server/src/batch_runtime/store/workers.rs:221-241 — 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.
  • Edited copy of a member (21 corresponding lines) crates/izwi-core/src/kernels/cuda/kquant.rs:278 — crates/izwi-core/src/kernels/cuda/kquant.rs:278-303 | crates/izwi-core/src/kernels/cuda/kquant.rs:306-326 — 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.
  • Edited copy of a member (21 corresponding lines) crates/izwi-core/src/engine/execution_group.rs:702 — crates/izwi-core/src/engine/execution_group.rs:702-723 | crates/izwi-core/src/engine/execution_group.rs:728-748 — 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.
  • Edited copy of a member (21 corresponding lines) crates/izwi-server/src/batch_runtime/store/artifacts.rs:71 — crates/izwi-server/src/batch_runtime/store/artifacts.rs:71-91 | crates/izwi-server/src/batch_runtime/store/artifacts.rs:135-189 — 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.
  • Edited copy of a member (21 corresponding lines) crates/izwi-model-catalog/src/catalog/variant.rs:1038 — crates/izwi-model-catalog/src/catalog/variant.rs:1038-1066 | crates/izwi-model-catalog/src/catalog/variant.rs:1104-1124 — 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 copy of a member (19 corresponding lines) · ×6
  • Edited copy of a member (19 corresponding lines) crates/izwi-server/src/api/tts_policy.rs:610 — crates/izwi-core/src/models/architectures/fish_drama3/model/budget.rs:41-59 | crates/izwi-server/src/api/tts_policy.rs:610-633 — 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) crates/izwi-gateway/src/app/audio_proxy.rs:113 — crates/izwi-gateway/src/app/audio_proxy.rs:113-131 | crates/izwi-gateway/src/app/openai_realtime_proxy.rs:352-372 — 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) crates/izwi-core/src/engine/executor.rs:2181 — crates/izwi-core/src/engine/executor.rs:2181-2201 | crates/izwi-core/src/engine/executor.rs:2206-2224 — 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) crates/izwi-server/src/transcription_store.rs:1546 — crates/izwi-server/src/transcription_store.rs:1546-1566 | crates/izwi-server/src/transcription_store.rs:1568-1586 — 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) crates/izwi-core/src/kv/v2/descriptor.rs:282 — crates/izwi-core/src/kv/v2/descriptor.rs:282-302 | crates/izwi-core/src/kv/v2/runtime.rs:1992-2010 — 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) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:66 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:66-87 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:427-445 — 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 · Edited copy of a member (20 corresponding lines) · ×6
  • Edited copy of a member (20 corresponding lines) crates/izwi-core/src/runtime/adapters/loaded/chat.rs:62 — crates/izwi-core/src/runtime/adapters/loaded/chat.rs:62-81 | crates/izwi-core/src/runtime/adapters/loaded/chat.rs:83-105 — 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) crates/izwi-core/src/engine/mod.rs:3440 — crates/izwi-core/src/engine/mod.rs:3440-3461 | crates/izwi-core/src/engine/mod.rs:3469-3488 — 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) crates/izwi-core/src/backends/kv/accelerator.rs:1564 — crates/izwi-core/src/backends/kv/accelerator.rs:1564-1583 | crates/izwi-core/src/backends/kv/accelerator.rs:1683-1704 — 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) crates/izwi-gateway/src/app/realtime_wire.rs:104 — crates/izwi-gateway/src/app/realtime_wire.rs:104-123 | crates/izwi-server/src/app/voice_realtime/mod.rs:127-147 — 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) crates/izwi-core/src/backends/device.rs:199 — crates/izwi-core/src/backends/device.rs:199-218 | crates/izwi-core/src/backends/device.rs:228-247 — 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) crates/izwi-server/src/app/transcription_realtime.rs:890 — crates/izwi-server/src/app/transcription_realtime.rs:890-909 | crates/izwi-server/src/app/transcription_realtime.rs:1338-1366 — 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.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/izwi-core/src/kernels/metal_fp8_gemm.rs:488 — crates/izwi-core/src/kernels/metal_fp8_gemm.rs:488-493 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1002-1007 | crates/izwi-core/src/kernels/moe_relu2.rs:1114-1119 — 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.
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/izwi-gateway/src/gateway_fleet/mod.rs:222 — crates/izwi-gateway/src/gateway_fleet/mod.rs:222-228 | crates/izwi-gateway/src/gateway_security.rs:438-444 | crates/izwi-model-catalog/src/chat/tools/grammar.rs:131-136 — 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.
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/izwi-core/src/kernels/f16_weight_linear.rs:343 — crates/izwi-core/src/kernels/f16_weight_linear.rs:343-348 | crates/izwi-core/src/models/architectures/qwen3/core.rs:2566-2571 | crates/izwi-core/src/models/architectures/qwen36moe/text.rs:1008-1013 — 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.
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/izwi-core/src/kernels/metal_fp8_gemm.rs:468 — crates/izwi-core/src/kernels/metal_fp8_gemm.rs:468-473 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:982-987 | crates/izwi-core/src/kernels/moe_relu2.rs:1094-1099 — 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.
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:431 — crates/izwi-core/src/models/architectures/fish_drama3/codec/workspace.rs:333-338 | crates/izwi-core/src/models/architectures/fish_s2/workspace.rs:333-338 | crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:431-436 — 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.
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/izwi-gateway/src/gateway.rs:1658 — crates/izwi-gateway/src/gateway.rs:1658-1664 | crates/izwi-server/src/api/internal/probes.rs:334-340 | crates/izwi-server/src/persistence/mod.rs:824-829 — 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 · Duplicated block (11 lines × 4) · ×6
  • Duplicated block (11 lines × 4) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:175 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:175-185 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:271-281 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:577-587 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1161-1171 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:270` calls `scalar_execution_profile` and `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:174` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 4) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:237 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:237-247 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:205-215 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:518-528 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1228-1238 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/realtime.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:237` 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 × 4) crates/izwi-core/src/runtime/service/tts_preparation.rs:1201 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1201-1211 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1390-1400 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1551-1561 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1719-1729 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1201` 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 × 4) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:135 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:135-145 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:206-216 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:472-485 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1121-1131 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs: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. 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 × 4) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:179 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:179-189 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:355-365 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:170-180 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:354-364 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs: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.
  • Duplicated block (11 lines × 4) crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:317 — crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:317-327 | crates/izwi-core/src/engine/executor/handler_maya1.rs:288-298 | crates/izwi-core/src/engine/executor/handler_maya2.rs:289-299 | crates/izwi-core/src/engine/executor/handler_tts.rs:1536-1546 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 93 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.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×6
  • Duplicated block (9 lines × 4) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:195 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:195-203 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:371-379 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:186-194 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:370-378 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:195` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/izwi-core/src/kernels/cuda/gdn.rs:230 — crates/izwi-core/src/kernels/cuda/gdn.rs:230-238 | crates/izwi-core/src/kernels/cuda/gdn.rs:435-443 | crates/izwi-core/src/kernels/cuda/gdn.rs:587-595 | crates/izwi-core/src/kernels/cuda/gdn.rs:649-657 — 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.
  • Duplicated block (9 lines × 4) crates/izwi-core/src/runtime/asr/realtime_push.rs:146 — crates/izwi-core/src/runtime/asr/realtime_push.rs:146-155 | crates/izwi-core/src/runtime/service/asr_encoders.rs:728-736 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1045-1053 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1268-1276 — 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 `crates/izwi-core/src/runtime/asr/realtime_push.rs:146` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/izwi-server/src/api/diarization/handlers.rs:1029 — crates/izwi-server/src/api/diarization/handlers.rs:1029-1037 | crates/izwi-server/src/api/openai/audio/align.rs:174-182 | crates/izwi-server/src/api/openai/audio/transcriptions.rs:954-962 | crates/izwi-server/src/api/transcription/handlers.rs:1750-1758 — `crates/izwi-server/src/api/diarization/handlers.rs` and `crates/izwi-server/src/api/transcription/handlers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-server/src/api/diarization/handlers.rs:1029` 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 × 4) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:714 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:714-722 | crates/izwi-core/src/engine/executor/handler_chatterbox.rs:231-239 | crates/izwi-core/src/engine/executor/handler_maya1.rs:226-234 | crates/izwi-core/src/engine/executor/handler_maya2.rs:227-235 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 55 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:714` 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, `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:723` calls `with_capacity` and `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:240` 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 × 4) crates/izwi-core/src/tokenizer.rs:805 — crates/izwi-core/src/models/architectures/qwen35/chat.rs:2236-2244 | crates/izwi-core/src/models/architectures/qwen36moe/exec.rs:2890-2898 | crates/izwi-core/src/models/architectures/qwen38/chat.rs:3897-3905 | crates/izwi-core/src/tokenizer.rs:805-813 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×6
  • Low cohesion: GatewayState (LCOM4 9) crates/izwi-gateway/src/gateway.rs:58 — GatewayState's methods fall into 9 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 9 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: EngineCoreRequest (LCOM4 6) crates/izwi-core/src/engine/request.rs:1094 — EngineCoreRequest's methods fall into 6 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 6 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: ModelLifecycleController (LCOM4 4) crates/izwi-core/src/runtime/lifecycle/controller.rs:126 — ModelLifecycleController'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.
  • Low cohesion: RuntimeRequestContext (LCOM4 4) crates/izwi-core/src/runtime/types.rs:16 — RuntimeRequestContext'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.
  • Low cohesion: FleetCoordinator (LCOM4 4) crates/izwi-gateway/src/app/fleet_coordinator.rs:128 — FleetCoordinator'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.
  • Low cohesion: CuttableStream (LCOM4 4) crates/izwi-serving-worker/src/test_support.rs:542 — CuttableStream'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.
R4 · Test Coverage · No test reaches this file · ×6
  • No test reaches this file ui/src/components/GenerationStats.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file ui/src/utils/useDownloadIndicator.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file ui/src/components/ui/Waveform.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file ui/src/components/ui/accordion.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file ui/src/components/ui/scroll-area.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file vercel.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
D1 · Cyclomatic Complexity · izwi_serving_worker · ×5
  • izwi_serving_worker::invoke (cyclomatic 32) crates/izwi-serving-worker/src/lib.rs:1319 — izwi_serving_worker::invoke has cyclomatic complexity 32 (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.
  • izwi_serving_worker::run_invocation (cyclomatic 31) crates/izwi-serving-worker/src/lib.rs:1711 — izwi_serving_worker::run_invocation 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.
  • izwi_serving_worker::run (cyclomatic 22) crates/izwi-serving-worker/src/main.rs:118 — izwi_serving_worker::run 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.
  • izwi_serving_worker::realtime::admit_session (cyclomatic 19) crates/izwi-serving-worker/src/realtime.rs:1295 — izwi_serving_worker::realtime::admit_session has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • izwi_serving_worker::realtime::reader_task (cyclomatic 18) crates/izwi-serving-worker/src/realtime.rs:308 — izwi_serving_worker::realtime::reader_task 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/izwi-core/src/backends/state/mod.rs:500 — crates/izwi-core/src/backends/state/mod.rs:500-604 | crates/izwi-core/src/models/architectures/fish_s2/physical.rs:309-345 | crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:2137-2177 | crates/izwi-core/src/models/architectures/qwen3/asr/mod.rs:800-842 | crates/izwi-core/src/models/architectures/vibevoice/mod.rs:833-871 | crates/izwi-core/src/models/architectures/voxtral/mod.rs:620-658 — 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:127 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:127-653 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:264-553 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:856-1210 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:338-569 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:337-570 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:568-856 — 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) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:309 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:309-637 | crates/izwi-core/src/engine/executor/handler_asr/lfm3_live.rs:410-562 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:60-507 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:169-551 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:104-424 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:110-491 — 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) crates/izwi-core/src/kernels/cuda.rs:927 — crates/izwi-core/src/kernels/cuda.rs:927-1007 | crates/izwi-core/src/kernels/cuda.rs:2572-2641 | crates/izwi-core/src/kernels/cuda.rs:2687-2748 | crates/izwi-core/src/kernels/cuda.rs:2856-2928 | crates/izwi-core/src/kernels/cuda.rs:2998-3066 | crates/izwi-core/src/kernels/cuda.rs:3506-3554 — 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) crates/izwi-core/src/kv/v2/descriptor.rs:711 — crates/izwi-core/src/kv/v2/descriptor.rs:711-738 | crates/izwi-core/src/models/architectures/fish_s2/physical.rs:309-345 | crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:2137-2177 | crates/izwi-core/src/models/architectures/qwen3/asr/mod.rs:800-842 | crates/izwi-core/src/models/architectures/vibevoice/mod.rs:833-871 | crates/izwi-core/src/models/architectures/voxtral/mod.rs:620-658 — 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 · Edited copy of a member (5 corresponding lines) · ×5
  • Edited copy of a member (5 corresponding lines) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:571 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:571-577 | crates/izwi-core/src/engine/executor/handler_tts.rs:2016-2020 — 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) crates/izwi-core/src/engine/executor.rs:1123 — crates/izwi-core/src/engine/executor.rs:1123-1128 | crates/izwi-core/src/models/architectures/qwen35/chat.rs:91-95 — 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) crates/izwi-core/src/runtime/lifecycle/controller.rs:284 — crates/izwi-core/src/models/architectures/voxtral/tts/voice.rs:118-122 | crates/izwi-core/src/runtime/lifecycle/controller.rs:284-288 — 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) scripts/fixtures/fish_drama3_fixture_common.py:742 — scripts/fixtures/fish_drama3_fixture_common.py:742-747 | scripts/fixtures/generate_fish_drama3_slices.py:187-191 — 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) scripts/fixtures/generate_fish_drama3_goldens.py:168 — scripts/fixtures/generate_fish_drama3_goldens.py:168-175 | scripts/fixtures/generate_fish_drama3_tiny.py:251-255 — 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.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×5
  • Edited copy of a member (4 corresponding lines) crates/izwi-server/src/diarization_store.rs:1217 — crates/izwi-server/src/diarization_store.rs:1217-1220 | REDACTED:3195-3198 — 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) crates/izwi-desktop/src/app/dictation/mod.rs:141 — crates/izwi-desktop/src/app/dictation/mod.rs:141-144 | crates/izwi-dictation/src/hotkey.rs:142-145 — 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) crates/izwi-core/src/config.rs:410 — crates/izwi-core/src/config.rs:410-413 | crates/izwi-core/src/kv/v2/contract.rs:868-871 — 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) scripts/bench/run-voice-realtime-load.py:218 — scripts/bench/run-voice-realtime-load.py:218-224 | scripts/bench/run-serving-benchmark.py:135-138 — 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) scripts/bench/run-mixed-load.py:72 — scripts/bench/run-mixed-load.py:72-75 | scripts/bench/run-telephony-accuracy.py:52-55 — 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×5
  • Duplicated block (23 lines × 2) crates/izwi-core/src/kernels/cuda.rs:1852 — crates/izwi-core/src/kernels/cuda.rs:1852-1874 | crates/izwi-core/src/kernels/cuda.rs:1947-1969 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda.rs:1852` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/kernels/residual_norm.rs:304 — crates/izwi-core/src/kernels/residual_norm.rs:304-326 | crates/izwi-core/src/kernels/swiglu.rs:125-147 — before extracting anything, compare `crates/izwi-core/src/kernels/residual_norm.rs` and `crates/izwi-core/src/kernels/swiglu.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `crates/izwi-core/src/kernels/residual_norm.rs:304` 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 (23 lines × 2) crates/izwi-server/src/api/openapi.rs:1771 — crates/izwi-server/src/api/openapi.rs:1771-1793 | crates/izwi-server/src/api/openapi.rs:1811-1833 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/api/openapi.rs:1771` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) crates/izwi-server/src/app/transcription_realtime.rs:389 — crates/izwi-server/src/app/transcription_realtime.rs:389-411 | crates/izwi-server/src/app/voice_realtime/mod.rs:1208-1230 — 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 (23 lines × 2) scripts/fixtures/generate_fish_drama3_slices.py:394 — scripts/fixtures/generate_fish_drama3_slices.py:394-416 | scripts/fixtures/generate_fish_drama3_tiny.py:838-860 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×5
  • Duplicated block (16–17 lines × 2) crates/izwi-core/src/backends/state/static_attention.rs:498 — crates/izwi-core/src/backends/state/static_attention.rs:498-513 | crates/izwi-core/src/backends/state/static_attention.rs:923-939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (16–17 lines × 2) crates/izwi-core/src/kernels/cuda/moe.rs:843 — crates/izwi-core/src/kernels/cuda/moe.rs:843-859 | crates/izwi-core/src/kernels/cuda/moe.rs:1018-1033 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/kernels/cuda/moe.rs:841` calls `arg` and `crates/izwi-core/src/kernels/cuda/moe.rs:1017` 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 (16–17 lines × 2) crates/izwi-core/src/kernels/metal.rs:3038 — crates/izwi-core/src/kernels/metal.rs:3038-3053 | crates/izwi-core/src/kernels/metal.rs:3086-3102 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/metal.rs:3086` it begins part-way through the construct above it, so those 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 (16–17 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1790 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1790-1806 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1967-1982 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1790` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) crates/izwi-server/src/api/openai/audio/align.rs:205 — crates/izwi-server/src/api/openai/audio/align.rs:205-220 | crates/izwi-server/src/api/openai/audio/transcriptions.rs:986-1002 — before extracting anything, compare `crates/izwi-server/src/api/openai/audio/align.rs` and `crates/izwi-server/src/api/openai/audio/transcriptions.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 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 `crates/izwi-server/src/api/openai/audio/align.rs: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:328 — crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:328-339 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:361-373 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` and `crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 171 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 `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:328` 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 (12–13 lines × 2) crates/izwi-core/src/engine/scheduler/mod.rs:1770 — crates/izwi-core/src/engine/scheduler/mod.rs:1770-1782 | crates/izwi-core/src/engine/scheduler/mod.rs:2111-2122 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/scheduler/mod.rs:1770` it begins part-way through the construct above it, so those 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.
  • Duplicated block (12–13 lines × 2) crates/izwi-core/src/kernels/cuda/fp8.rs:603 — crates/izwi-core/src/kernels/cuda/fp8.rs:603-614 | crates/izwi-core/src/models/architectures/qwen38/fast_path.rs:226-238 — 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 `crates/izwi-core/src/kernels/cuda/fp8.rs:603` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:822 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:822-833 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1413-1425 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:822` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-prometheus/src/lib.rs:291 — crates/izwi-prometheus/src/lib.rs:291-302 | crates/izwi-prometheus/src/lib.rs:349-361 — both copies are in the same file, so extract the 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 `crates/izwi-prometheus/src/lib.rs:291` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×5
  • Duplicated block (12 lines × 4) crates/izwi-core/src/engine/executor.rs:4150 — crates/izwi-core/src/engine/executor.rs:4150-4161 | crates/izwi-core/src/engine/executor.rs:4167-4178 | crates/izwi-core/src/engine/executor.rs:4184-4195 | crates/izwi-core/src/engine/executor.rs:4201-4212 — 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 `crates/izwi-core/src/engine/executor.rs:4150` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 4) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:455 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:455-466 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:610-621 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:790-801 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:993-1004 — 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:455` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 4) crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:204 — crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:204-215 | crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:217-228 | crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:285-296 | crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:299-310 — 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. 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 (12 lines × 4) crates/izwi-server/src/diarization_store.rs:1362 — crates/izwi-server/src/diarization_store.rs:1362-1373 | crates/izwi-server/src/saved_voice_store.rs:778-790 | crates/izwi-server/src/speech_history_store.rs:1727-1738 | crates/izwi-server/src/transcription_store.rs:1533-1544 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/saved_voice_store.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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 lines × 4) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:460 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:460-471 | crates/izwi-core/src/engine/executor/handler_maya1.rs:532-543 | crates/izwi-core/src/engine/executor/handler_maya2.rs:427-438 | crates/izwi-core/src/engine/executor/handler_tts.rs:4536-4547 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:460` 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 · Duplicated block (10 lines × 5) · ×5
  • Duplicated block (10 lines × 5) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:668 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:668-677 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:849-858 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1053-1062 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1417-1426 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1679-1688 — 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:668` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:865` calls `snac_batching_enabled` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:681` 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 × 5) crates/izwi-core/src/engine/executor.rs:2849 — crates/izwi-core/src/engine/executor.rs:2849-2858 | crates/izwi-core/src/engine/executor/dispatch.rs:852-861 | crates/izwi-core/src/engine/executor/dispatch.rs:893-902 | crates/izwi-core/src/engine/executor/dispatch.rs:933-942 | crates/izwi-core/src/engine/executor/dispatch.rs:1007-1016 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/engine/executor.rs:2849` 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 × 5) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:511 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:511-520 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:667-676 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:848-857 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1052-1061 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1416-1425 — 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:511` it begins part-way through the construct above it, so those exact lines 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 × 5) crates/izwi-cli/src/commands/bench.rs:2280 — crates/izwi-cli/src/commands/bench.rs:2280-2289 | crates/izwi-cli/src/commands/bench.rs:2296-2305 | crates/izwi-cli/src/commands/bench.rs:2312-2321 | crates/izwi-cli/src/commands/bench.rs:2612-2621 | crates/izwi-cli/src/commands/bench.rs:2628-2637 — 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 `crates/izwi-cli/src/commands/bench.rs:2280` it begins part-way through the construct above it, so those exact lines 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 × 5) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:165 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:165-174 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:181-190 | crates/izwi-core/src/engine/executor/handler_maya1.rs:172-181 | crates/izwi-core/src/engine/executor/handler_maya2.rs:173-182 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:198-207 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:165` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×5
  • Duplicated block (8 lines × 4) crates/izwi-core/src/kernels/cuda/fp8.rs:281 — crates/izwi-core/src/kernels/cuda/fp8.rs:281-288 | crates/izwi-core/src/kernels/cuda/fp8.rs:468-475 | crates/izwi-core/src/kernels/cuda/fp8.rs:526-533 | crates/izwi-core/src/kernels/cuda/moe.rs:315-322 — 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 `crates/izwi-core/src/kernels/cuda/fp8.rs:281` 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, `crates/izwi-core/src/kernels/cuda/fp8.rs:290` calls `name` and `crates/izwi-core/src/kernels/cuda/fp8.rs:477` 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 × 4) crates/izwi-server/src/diarization_store.rs:1375 — crates/izwi-server/src/diarization_store.rs:1375-1382 | crates/izwi-server/src/saved_voice_store.rs:792-799 | crates/izwi-server/src/speech_history_store.rs:1740-1747 | crates/izwi-server/src/transcription_store.rs:1632-1639 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/saved_voice_store.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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 (8 lines × 4) crates/izwi-core/src/backends/device.rs:744 — crates/izwi-core/src/backends/device.rs:744-751 | crates/izwi-core/src/engine/executor.rs:944-951 | crates/izwi-core/src/runtime/lifecycle/unload.rs:20-27 | crates/izwi-core/src/runtime/service.rs:233-240 — 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `&(dyn Any + Send)` in one and `&(dyn std::any::Any + Send)` 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 (8 lines × 4) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:291 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:291-298 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:618-625 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:933-940 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:160-167 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:291` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/izwi-server/src/batch_runtime/store/queue.rs:819 — crates/izwi-server/src/batch_runtime/store/queue.rs:819-826 | crates/izwi-server/src/batch_runtime/store/queue.rs:937-944 | crates/izwi-server/src/batch_runtime/store/queue.rs:1036-1043 | crates/izwi-server/src/batch_runtime/store/queue.rs:1190-1197 — 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 `crates/izwi-server/src/batch_runtime/store/queue.rs:819` 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.
D1 · Cyclomatic Complexity · Scheduler · ×4
  • Scheduler::schedule_inner (cyclomatic 159) crates/izwi-core/src/engine/scheduler/mod.rs:1508 — Scheduler::schedule_inner has cyclomatic complexity 159 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Scheduler::prepare_realtime_stage_outcome (cyclomatic 30) crates/izwi-core/src/engine/scheduler/mod.rs:2721 — Scheduler::prepare_realtime_stage_outcome has cyclomatic complexity 30 (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.
  • Scheduler::decode_token_quanta (cyclomatic 20) crates/izwi-core/src/engine/scheduler/mod.rs:4288 — Scheduler::decode_token_quanta 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.
  • Scheduler::update_after_step (cyclomatic 16) crates/izwi-core/src/engine/scheduler/mod.rs:2587 — Scheduler::update_after_step 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.
D1 · Cyclomatic Complexity · ManagedKvCacheManager · ×4
  • ManagedKvCacheManager::prepare_inner (cyclomatic 114) crates/izwi-core/src/engine/cache/managed/prepare.rs:203 — ManagedKvCacheManager::prepare_inner has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ManagedKvCacheManager::finalize (cyclomatic 54) crates/izwi-core/src/engine/cache/managed/finalize.rs:6 — ManagedKvCacheManager::finalize has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ManagedKvCacheManager::bind_model_state_with_capacity_policy (cyclomatic 17) crates/izwi-core/src/engine/cache/managed/binding.rs:552 — ManagedKvCacheManager::bind_model_state_with_capacity_policy 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.
  • ManagedKvCacheManager::fit_portable_logical_token_reach (cyclomatic 16) crates/izwi-core/src/engine/cache/managed/capacity.rs:802 — ManagedKvCacheManager::fit_portable_logical_token_reach 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.
D1 · Cyclomatic Complexity · EngineCoreRequest · ×4
  • EngineCoreRequest::validate_incremental_model_execution_preparation (cyclomatic 99) crates/izwi-core/src/engine/request/state_binding.rs:319 — EngineCoreRequest::validate_incremental_model_execution_preparation has cyclomatic complexity 99 (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.
  • EngineCoreRequest::canonicalize_direct_payloads_with_limits (cyclomatic 20) crates/izwi-core/src/engine/request/payloads.rs:248 — EngineCoreRequest::canonicalize_direct_payloads_with_limits 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.
  • EngineCoreRequest::bind_execution_adapter (cyclomatic 19) crates/izwi-core/src/engine/request/state_binding.rs:818 — EngineCoreRequest::bind_execution_adapter has cyclomatic complexity 19 (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.
  • EngineCoreRequest::project_auxiliary_state_spans (cyclomatic 17) crates/izwi-core/src/engine/request/state_binding.rs:55 — EngineCoreRequest::project_auxiliary_state_spans 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.
D2 · Cognitive Complexity · Scheduler · ×4
  • Scheduler::schedule_inner (cognitive 252) crates/izwi-core/src/engine/scheduler/mod.rs:1508 — Scheduler::schedule_inner has cognitive complexity 252 (threshold 15). Drivers by points: if/else 97 (167 pts), boolean chains 57, match/switch 7 (15 pts), loops 10 (13 pts) (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scheduler::prepare_realtime_stage_outcome (cognitive 33) crates/izwi-core/src/engine/scheduler/mod.rs:2721 — Scheduler::prepare_realtime_stage_outcome has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 12, match/switch 3 (5 pts) (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.
  • Scheduler::update_after_step (cognitive 25) crates/izwi-core/src/engine/scheduler/mod.rs:2587 — Scheduler::update_after_step has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 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.
  • Scheduler::decode_token_quanta (cognitive 23) crates/izwi-core/src/engine/scheduler/mod.rs:4288 — Scheduler::decode_token_quanta has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 9 (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.
D2 · Cognitive Complexity · EngineCoreRequest · ×4
  • EngineCoreRequest::validate_incremental_model_execution_preparation (cognitive 95) crates/izwi-core/src/engine/request/state_binding.rs:319 — EngineCoreRequest::validate_incremental_model_execution_preparation has cognitive complexity 95 (threshold 15). Drivers by points: if/else 30 (45 pts), boolean chains 39, match/switch 6 (11 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • EngineCoreRequest::canonicalize_direct_payloads_with_limits (cognitive 38) crates/izwi-core/src/engine/request/payloads.rs:248 — EngineCoreRequest::canonicalize_direct_payloads_with_limits has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 4, match/switch 1 (nesting depth added 19). 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.
  • EngineCoreRequest::project_auxiliary_state_spans (cognitive 25) crates/izwi-core/src/engine/request/state_binding.rs:55 — EngineCoreRequest::project_auxiliary_state_spans has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, 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.
  • EngineCoreRequest::bind_execution_adapter (cognitive 16) crates/izwi-core/src/engine/request/state_binding.rs:818 — EngineCoreRequest::bind_execution_adapter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, match/switch 7, loops 2. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RealtimeSession · ×4
  • RealtimeSession::run_tts_stage (cognitive 85) crates/izwi-serving-worker/src/realtime.rs:807 — RealtimeSession::run_tts_stage has cognitive complexity 85 (threshold 15). Drivers by points: if/else 21 (51 pts), match/switch 6 (19 pts), loops 3 (12 pts), boolean chains 3 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RealtimeSession::run_asr_stage (cognitive 41) crates/izwi-serving-worker/src/realtime.rs:475 — RealtimeSession::run_asr_stage has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 8 (22 pts), if/else 6 (12 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 23). 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.
  • RealtimeSession::next_audio (cognitive 20) crates/izwi-serving-client/src/realtime.rs:619 — RealtimeSession::next_audio has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RealtimeSession::next_event (cognitive 19) crates/izwi-serving-client/src/realtime.rs:544 — RealtimeSession::next_event has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · KvCacheCoordinator · ×4
  • KvCacheCoordinator::reserve (cognitive 69) crates/izwi-core/src/engine/cache/coordinator.rs:549 — KvCacheCoordinator::reserve has cognitive complexity 69 (threshold 15). Drivers by points: if/else 16 (45 pts), match/switch 3 (10 pts), loops 5 (9 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.
  • KvCacheCoordinator::complete_write_prefix (cognitive 25) crates/izwi-core/src/engine/cache/coordinator.rs:856 — KvCacheCoordinator::complete_write_prefix has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, loops 4 (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.
  • KvCacheCoordinator::stage_commit_with_prefix_updates (cognitive 20) crates/izwi-core/src/engine/cache/coordinator.rs:1042 — KvCacheCoordinator::stage_commit_with_prefix_updates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 8, boolean chains 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.
  • KvCacheCoordinator::reserve_window (cognitive 18) crates/izwi-core/src/engine/cache/coordinator.rs:472 — KvCacheCoordinator::reserve_window has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 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.
D2 · Cognitive Complexity · BatchRuntimeStore · ×4
  • BatchRuntimeStore::publish_reserved_opaque_stage_artifact (cognitive 25) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:629 — BatchRuntimeStore::publish_reserved_opaque_stage_artifact has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 4 (6 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.
  • BatchRuntimeStore::settle_reserved_speech_history_audio (cognitive 20) crates/izwi-server/src/batch_runtime/store/speech.rs:243 — BatchRuntimeStore::settle_reserved_speech_history_audio has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • BatchRuntimeStore::complete_stage (cognitive 18) crates/izwi-server/src/batch_runtime/store/queue.rs:770 — BatchRuntimeStore::complete_stage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), match/switch 1 (2 pts), boolean chains 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.
  • BatchRuntimeStore::accept_durable_job (cognitive 17) crates/izwi-server/src/batch_runtime/store/acceptance.rs:572 — BatchRuntimeStore::accept_durable_job has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 6, match/switch 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, 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/izwi-core/src/engine/executor.rs:2840 — crates/izwi-core/src/engine/executor.rs:2840-2891 | crates/izwi-core/src/engine/executor/dispatch.rs:847-881 | crates/izwi-core/src/engine/executor/dispatch.rs:888-921 | crates/izwi-core/src/engine/executor/dispatch.rs:928-961 | crates/izwi-core/src/engine/executor/dispatch.rs:1002-1036 — 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) crates/izwi-core/src/kernels/metal.rs:4468 — crates/izwi-core/src/kernels/metal.rs:4468-4531 | crates/izwi-core/src/kernels/metal.rs:4624-4671 | crates/izwi-core/src/kernels/metal.rs:4761-4816 | crates/izwi-core/src/kernels/metal.rs:4844-4907 | crates/izwi-core/src/kernels/metal.rs:4953-5065 — 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) crates/izwi-server/src/batch_runtime/store/queue.rs:774 — crates/izwi-server/src/batch_runtime/store/queue.rs:774-906 | crates/izwi-server/src/batch_runtime/store/queue.rs:912-946 | crates/izwi-server/src/batch_runtime/store/queue.rs:1008-1045 | crates/izwi-server/src/batch_runtime/store/queue.rs:1166-1219 | crates/izwi-server/src/batch_runtime/store/queue.rs:1790-1855 — 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) crates/izwi-server/src/chat_store.rs:915 — crates/izwi-server/src/chat_store.rs:915-927 | crates/izwi-server/src/diarization_store.rs:1479-1491 | crates/izwi-server/src/saved_voice_store.rs:809-823 | crates/izwi-server/src/speech_history_store.rs:1758-1770 | crates/izwi-server/src/transcription_store.rs:1649-1661 — 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 (47 corresponding lines) · ×4
  • Edited copy of a member (47 corresponding lines) crates/izwi-server/src/api/openai/audio/speech.rs:1847 — crates/izwi-server/src/api/openai/audio/speech.rs:1847-1897 | crates/izwi-server/src/api/speech_history/handlers.rs:2934-2980 — These two members are one piece of code written twice and then edited apart: 47 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 (47 corresponding lines) crates/izwi-core/src/kernels/cuda.rs:320 — crates/izwi-core/src/kernels/cuda.rs:320-366 | crates/izwi-core/src/kernels/cuda.rs:569-617 — These two members are one piece of code written twice and then edited apart: 47 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 (47 corresponding lines) crates/izwi-core/src/runtime/service/asr_encoders.rs:466 — crates/izwi-core/src/runtime/service/asr_encoders.rs:466-520 | crates/izwi-core/src/runtime/service/asr_encoders.rs:833-879 — These two members are one piece of code written twice and then edited apart: 47 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 (47 corresponding lines) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:164 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:164-211 | crates/izwi-core/src/engine/executor/fish_pending.rs:144-190 — These two members are one piece of code written twice and then edited apart: 47 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) · ×4
  • Edited copy of a member (22 corresponding lines) crates/izwi-core/src/engine/scheduler/mod.rs:4407 — crates/izwi-core/src/engine/scheduler/mod.rs:4407-4428 | crates/izwi-core/src/engine/scheduler/mod.rs:4445-4466 — 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) crates/izwi-server/src/api/transcription/unified_write.rs:111 — crates/izwi-server/src/api/transcription/unified_write.rs:111-133 | crates/izwi-server/src/api/transcription/unified_write.rs:139-160 — 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) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:78 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:78-99 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:75-96 — 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) crates/izwi-core/src/engine/cache/invocation.rs:628 — crates/izwi-core/src/engine/cache/invocation.rs:628-649 | crates/izwi-core/src/engine/cache/invocation_tensor.rs:860-883 — 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 copies of one member (3 members, 7+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/izwi-server/src/persistence/mod.rs:941 — crates/izwi-core/src/models/architectures/sortformer/diarization/nemo.rs:209-219 | crates/izwi-server/src/persistence/mod.rs:941-947 | crates/izwi-serving-supervisor/src/rollout.rs:760-766 — 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.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/izwi-server/src/diarization_store.rs:1279 — crates/izwi-server/src/diarization_store.rs:1279-1285 | crates/izwi-server/src/saved_voice_store.rs:801-807 | crates/izwi-server/src/speech_history_store.rs:1719-1725 — 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.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/izwi-server/src/api/media/handlers.rs:302 — crates/izwi-server/src/api/media/handlers.rs:302-308 | crates/izwi-server/src/api/speech_history/handlers.rs:3221-3227 | crates/izwi-server/src/api/transcription/handlers.rs:2277-2283 — 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.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/izwi-serving-worker/src/test_support.rs:561 — crates/izwi-serving-worker/src/test_support.rs:561-567 | crates/izwi-serving-worker/src/test_support.rs:575-581 | crates/izwi-serving-worker/src/test_support.rs:583-589 — 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.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 5+ corresponding lines) crates/izwi-gateway/src/roles/gateway_workers.rs:40 — crates/izwi-core/src/models/shared/noise.rs:20-24 | crates/izwi-gateway/src/roles/gateway_workers.rs:40-46 | crates/izwi-serving-supervisor/src/quarantine.rs:203-208 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 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, 5+ corresponding lines) crates/izwi-core/src/kernels/depthwise_conv.rs:292 — crates/izwi-core/src/kernels/depthwise_conv.rs:292-296 | crates/izwi-core/src/kernels/relpos_attention.rs:897-901 | crates/izwi-core/src/kernels/transducer_greedy.rs:640-644 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 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, 5+ corresponding lines) crates/izwi-core/src/engine/executor/audio.rs:406 — crates/izwi-core/src/engine/executor/audio.rs:406-410 | crates/izwi-core/src/models/registry.rs:4022-4026 | crates/izwi-core/src/runtime/diarization.rs:1217-1221 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 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, 5+ corresponding lines) scripts/fixtures/fish_drama3_fixture_common.py:159 — scripts/fixtures/fish_drama3_fixture_common.py:159-163 | scripts/fixtures/generate_fish_drama3_goldens.py:143-147 | scripts/fixtures/generate_nemotron_transcribe_tiny.py:238-242 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 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 · Duplicated block (18–19 lines × 2) · ×4
  • Duplicated block (18–19 lines × 2) crates/izwi-cli/src/commands/bench.rs:2205 — crates/izwi-cli/src/commands/bench.rs:2205-2223 | crates/izwi-cli/src/commands/bench.rs:2536-2553 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:2205` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-cli/src/commands/bench.rs:2203` calls `Some` and `crates/izwi-cli/src/commands/bench.rs:2535` 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 (18–19 lines × 2) crates/izwi-cli/src/commands/bench.rs:2257 — crates/izwi-cli/src/commands/bench.rs:2257-2275 | crates/izwi-cli/src/commands/bench.rs:2590-2607 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/bench.rs:2257` 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) crates/izwi-core/src/backends/kv/cpu.rs:463 — crates/izwi-core/src/backends/kv/cpu.rs:463-481 | crates/izwi-core/src/backends/kv/cpu.rs:639-656 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/backends/kv/cpu.rs:463` 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 first that the copies are not typed on the same thing: the declarations holding them bind `args` to `PagedKvDecodeArgs<'_>` in one and `PagedKvPrefillArgs<'_>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (18–19 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:690 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:690-707 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:950-968 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:690` it begins part-way through the construct above it, so those 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 · Duplicated block (16 lines × 3) · ×4
  • Duplicated block (16 lines × 3) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:492 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:492-507 | crates/izwi-core/src/engine/executor/handler_maya1.rs:562-577 | crates/izwi-core/src/engine/executor/handler_maya2.rs:457-472 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:492` it begins part-way through the construct above it, so those exact lines 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 × 3) crates/izwi-core/src/engine/executor/handler_maya1.rs:385 — crates/izwi-core/src/engine/executor/handler_maya1.rs:385-400 | crates/izwi-core/src/engine/executor/handler_maya1.rs:491-506 | crates/izwi-core/src/engine/executor/handler_maya2.rs:387-402 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_maya1.rs` and `crates/izwi-core/src/engine/executor/handler_maya2.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 373 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 `crates/izwi-core/src/engine/executor/handler_maya1.rs:385` it begins part-way through the construct above it, so those exact lines 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 × 3) crates/izwi-core/src/kernels/metal.rs:1634 — crates/izwi-core/src/kernels/metal.rs:1634-1649 | crates/izwi-core/src/kernels/metal.rs:1798-1813 | crates/izwi-core/src/kernels/metal.rs:2123-2138 — 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 `crates/izwi-core/src/kernels/metal.rs:1634` 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 × 3) crates/izwi-server/src/transcription_store.rs:821 — crates/izwi-server/src/transcription_store.rs:821-836 | crates/izwi-server/src/transcription_store.rs:920-935 | crates/izwi-server/src/transcription_store.rs:1102-1117 — 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 · Duplicated block (15–16 lines × 2) · ×4
  • Duplicated block (15–16 lines × 2) crates/izwi-cli/src/commands/models.rs:427 — crates/izwi-cli/src/commands/models.rs:427-441 | crates/izwi-cli/src/commands/rm.rs:15-30 — before extracting anything, compare `crates/izwi-cli/src/commands/models.rs` and `crates/izwi-cli/src/commands/rm.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `crates/izwi-cli/src/commands/models.rs:427` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/executor.rs:3171 — crates/izwi-core/src/engine/executor.rs:3171-3185 | crates/izwi-core/src/engine/executor.rs:3429-3444 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor.rs:3171` it begins part-way through the construct above it, so those 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 (15–16 lines × 2) crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:289 — crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:289-303 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:320-335 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` and `crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 171 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 `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs: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. 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–16 lines × 2) crates/izwi-server/src/api/openai/audio/speech.rs:1861 — crates/izwi-server/src/api/openai/audio/speech.rs:1861-1876 | crates/izwi-server/src/api/speech_history/handlers.rs:2948-2962 — before extracting anything, compare `crates/izwi-server/src/api/openai/audio/speech.rs` and `crates/izwi-server/src/api/speech_history/handlers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `crates/izwi-server/src/api/openai/audio/speech.rs:1861` 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×4
  • Duplicated block (13 lines × 3) crates/izwi-core/src/kernels/cuda.rs:995 — crates/izwi-core/src/kernels/cuda.rs:995-1007 | crates/izwi-core/src/kernels/cuda.rs:2736-2748 | crates/izwi-core/src/kernels/cuda.rs:2916-2928 — 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 `crates/izwi-core/src/kernels/cuda.rs:995` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) crates/izwi-core/src/runtime/asr/realtime_session.rs:1019 — crates/izwi-core/src/runtime/asr/realtime_session.rs:1019-1031 | crates/izwi-core/src/runtime/asr/realtime_session.rs:1111-1123 | crates/izwi-core/src/runtime/asr/realtime_session.rs:1171-1183 — 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. 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 `self` to `super) fn begin_engine_operation( &mut` in one and `super) fn begin_operation(&mut` 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 (13 lines × 3) crates/izwi-core/src/runtime/service/asr_encoders.rs:1210 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1210-1222 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1431-1443 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1695-1707 — 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1210` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 3) crates/izwi-core/src/runtime/service/tts_preparation.rs:1312 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1312-1324 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1798-1810 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1979-1991 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1312` 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×4
  • Duplicated block (10–11 lines × 2) crates/izwi-core/src/engine/core.rs:1096 — crates/izwi-core/src/engine/core.rs:1096-1106 | crates/izwi-core/src/engine/core.rs:1152-1161 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/core.rs:1096` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/tokenizer.rs:262 — crates/izwi-core/src/tokenizer.rs:262-271 | crates/izwi-core/src/tokenizer.rs:406-416 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/tokenizer.rs: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 (10–11 lines × 2) crates/izwi-server/src/diarization_store.rs:343 — crates/izwi-server/src/diarization_store.rs:343-352 | crates/izwi-server/src/transcription_store.rs:381-391 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/transcription_store.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 176 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 `crates/izwi-server/src/transcription_store.rs:381` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-serving-supervisor/src/lifecycle.rs:479 — crates/izwi-serving-supervisor/src/lifecycle.rs:479-488 | crates/izwi-serving-supervisor/src/lifecycle.rs:545-555 — both copies are in the same file, so extract the 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 `crates/izwi-serving-supervisor/src/lifecycle.rs:479` it begins part-way through the construct above it, so those 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 · Duplicated block (9–10 lines × 2) · ×4
  • Duplicated block (9–10 lines × 2) crates/izwi-core/src/engine/cache/coordinator.rs:766 — crates/izwi-core/src/engine/cache/coordinator.rs:766-774 | crates/izwi-core/src/engine/cache/coordinator.rs:1067-1076 — both copies are in the same file, so extract the 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–10 lines × 2) crates/izwi-core/src/kernels/metal.rs:2287 — crates/izwi-core/src/kernels/metal.rs:2287-2296 | crates/izwi-core/src/kernels/metal.rs:2833-2841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) crates/izwi-gateway/src/gateway_deployments.rs:428 — crates/izwi-gateway/src/gateway_deployments.rs:428-436 | crates/izwi-gateway/src/gateway_deployments.rs:441-450 — both copies are in the same file, so extract the 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 `crates/izwi-gateway/src/gateway_deployments.rs:428` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) crates/izwi-server/src/lib.rs:120 — crates/izwi-server/src/lib.rs:120-128 | crates/izwi-server/src/lib.rs:164-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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×4
  • Duplicated block (7–8 lines × 2) crates/izwi-core/src/backends/kv/accelerator.rs:2537 — crates/izwi-core/src/backends/kv/accelerator.rs:2537-2543 | crates/izwi-core/src/backends/kv/accelerator.rs:2588-2595 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/backends/kv/accelerator.rs:2537` it begins part-way through the construct above it, so those 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) crates/izwi-core/src/runtime/service/asr_preparation.rs:1460 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1460-1467 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1669-1675 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1460` it begins part-way through the construct above it, so those 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.
  • Duplicated block (7–8 lines × 2) crates/izwi-gateway/src/app/realtime_translate.rs:1188 — crates/izwi-gateway/src/app/realtime_translate.rs:1188-1194 | crates/izwi-serving-protocol/src/types.rs:1057-1064 — 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 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) crates/izwi-server/src/diarization_store.rs:407 — crates/izwi-server/src/diarization_store.rs:407-414 | crates/izwi-server/src/transcription_store.rs:445-451 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/transcription_store.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 176 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 `crates/izwi-server/src/diarization_store.rs:407` 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×4
  • Duplicated block (6 lines × 4) crates/izwi-cli/src/commands/tts.rs:715 — crates/izwi-cli/src/commands/tts.rs:715-720 | crates/izwi-dictation/src/audio.rs:64-69 | crates/izwi-server/src/api/studio/handlers.rs:1085-1090 | crates/izwi-server/src/speech_history_store.rs:141-146 — 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.
  • Duplicated block (6 lines × 4) crates/izwi-core/src/engine/cache/offload.rs:144 — crates/izwi-core/src/engine/cache/offload.rs:144-149 | crates/izwi-core/src/engine/cache/offload.rs:177-182 | crates/izwi-core/src/engine/cache/prefix.rs:279-284 | crates/izwi-core/src/engine/cache/prefix.rs:595-601 — 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 `crates/izwi-core/src/engine/cache/offload.rs:144` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/engine/mod.rs:1375 — crates/izwi-core/src/engine/mod.rs:1375-1380 | crates/izwi-core/src/models/registry.rs:4112-4117 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:792-797 | crates/izwi-core/src/runtime/service.rs:1323-1328 — 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.
  • Duplicated block (6 lines × 4) crates/izwi-core/src/runtime/fish_drama3_capacity.rs:76 — crates/izwi-core/src/runtime/fish_drama3_capacity.rs:76-81 | crates/izwi-core/src/runtime/lifecycle/asr_envelope.rs:438-443 | crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:144-149 | crates/izwi-core/src/runtime/lifecycle/fish_drama3_memory.rs:98-103 — 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.
IC1 · Incompleteness & stubs · Hollow method · ×4
  • Hollow method — returns a constant without doing the work crates/izwi-core/src/catalog/mixed_step.rs:28 — `certified_mixed_step` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/izwi-core/src/kernels/cuda/fp8.rs:61 — `provider_auto_preferred` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/izwi-core/src/kv/v2/contract.rs:298 — `validate` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/izwi-core/src/kv/v2/contract.rs:882 — `validate` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
D1 · Cyclomatic Complexity · izwi_serving_supervisor · ×3
  • izwi_serving_supervisor::daemon::run (cyclomatic 50) crates/izwi-serving-supervisor/src/daemon/mod.rs:102 — izwi_serving_supervisor::daemon::run has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • izwi_serving_supervisor::daemon::rollout_driver::execute_blue_green (cyclomatic 24) crates/izwi-serving-supervisor/src/daemon/rollout_driver.rs:313 — izwi_serving_supervisor::daemon::rollout_driver::execute_blue_green 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.
  • izwi_serving_supervisor::launch::build_child_launch_spec (cyclomatic 17) crates/izwi-serving-supervisor/src/launch.rs:134 — izwi_serving_supervisor::launch::build_child_launch_spec has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · ModelLifecycleController · ×3
  • ModelLifecycleController::run_load_attempt_locked (cyclomatic 49) crates/izwi-core/src/runtime/lifecycle/load.rs:869 — ModelLifecycleController::run_load_attempt_locked has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ModelLifecycleController::allocate_asr_state (cyclomatic 29) crates/izwi-core/src/runtime/lifecycle/load/state.rs:420 — ModelLifecycleController::allocate_asr_state 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.
  • ModelLifecycleController::fit_invocation_decoder_context (cyclomatic 17) crates/izwi-core/src/runtime/lifecycle/load/invocation.rs:426 — ModelLifecycleController::fit_invocation_decoder_context 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.
D1 · Cyclomatic Complexity · KvCacheCoordinator · ×3
  • KvCacheCoordinator::reserve (cyclomatic 35) crates/izwi-core/src/engine/cache/coordinator.rs:549 — KvCacheCoordinator::reserve 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.
  • KvCacheCoordinator::complete_write_prefix (cyclomatic 21) crates/izwi-core/src/engine/cache/coordinator.rs:856 — KvCacheCoordinator::complete_write_prefix has cyclomatic complexity 21 (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.
  • KvCacheCoordinator::stage_commit_with_prefix_updates (cyclomatic 17) crates/izwi-core/src/engine/cache/coordinator.rs:1042 — KvCacheCoordinator::stage_commit_with_prefix_updates 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.
D2 · Cognitive Complexity · izwi_db · ×3
  • izwi_db::migrator::apply_migration (cognitive 45) REDACTED:142 — izwi_db::migrator::apply_migration has cognitive complexity 45 (threshold 15). Drivers by points: loops 18 (37 pts), if/else 4 (7 pts), match/switch 1 (nesting depth added 22). 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.
  • izwi_db::migrator::replace_word (cognitive 26) REDACTED:308 — izwi_db::migrator::replace_word 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.
  • izwi_db::raw::parse_placeholders (cognitive 16) crates/izwi-db/src/raw.rs:104 — izwi_db::raw::parse_placeholders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · izwi_asr_toolkit · ×3
  • izwi_asr_toolkit::plan_audio_chunks (cognitive 40) crates/izwi-asr-toolkit/src/lib.rs:162 — izwi_asr_toolkit::plan_audio_chunks has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (37 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.
  • izwi_asr_toolkit::choose_longest_pause_split_point (cognitive 17) crates/izwi-asr-toolkit/src/lib.rs:905 — izwi_asr_toolkit::choose_longest_pause_split_point has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (5 pts), match/switch 2 (4 pts), 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.
  • izwi_asr_toolkit::dedupe_overlap_word_boundary (cognitive 17) crates/izwi-asr-toolkit/src/lib.rs:1123 — izwi_asr_toolkit::dedupe_overlap_word_boundary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · izwi_prometheus · ×3
  • izwi_prometheus::check_histograms (cognitive 30) crates/izwi-prometheus/src/lib.rs:518 — izwi_prometheus::check_histograms has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), 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.
  • izwi_prometheus::parse_exposition (cognitive 16) crates/izwi-prometheus/src/lib.rs:427 — izwi_prometheus::parse_exposition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (15 pts), 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.
  • izwi_prometheus::parse_labels (cognitive 16) crates/izwi-prometheus/src/lib.rs:484 — izwi_prometheus::parse_labels has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 2 (4 pts), loops 2 (3 pts) (nesting depth added 9). 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.
D3 · God Classes · TooManyFunctions · ×3
  • TooManyFunctions: izwi_core::engine::config crates/izwi-core/src/engine/config.rs:21 — TooManyFunctions — 56 free functions. The bar is 30 free functions; this is 26 over it, 1.87× 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.
  • TooManyFunctions: izwi_server::batch_runtime::store::sql crates/izwi-server/src/batch_runtime/store/sql.rs:9 — TooManyFunctions — 37 free functions. The bar is 30 free functions; this is 7 over it, 1.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.
  • TooManyFunctions: izwi_core::serve_runtime crates/izwi-core/src/serve_runtime.rs:444 — TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× 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.
D4 · Code Duplication · Near-duplicate member pair (39 shared lines) · ×3
  • Near-duplicate member pair (39 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:1400 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1400-1564 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1666-1810 — These two members are variants of one another: 39 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 (39 shared lines) crates/izwi-core/src/runtime/service/tts_preparation.rs:389 — crates/izwi-core/src/runtime/service/tts_preparation.rs:389-569 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1331-1485 — These two members are variants of one another: 39 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 (39 shared lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:107 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:107-250 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:177-363 — These two members are variants of one another: 39 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 · Near-duplicate member pair (35 shared lines) · ×3
  • Near-duplicate member pair (35 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:1400 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1400-1564 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1331-1485 — These two members are variants of one another: 35 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 (35 shared lines) crates/izwi-server/src/transcription_store.rs:464 — crates/izwi-server/src/transcription_store.rs:464-588 | crates/izwi-server/src/transcription_store.rs:967-1123 — These two members are variants of one another: 35 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 (35 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:1795 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1795-1945 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1958-2121 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×3
  • Edited copy of a member (29 corresponding lines) crates/izwi-cli/src/commands/bench.rs:4344 — crates/izwi-cli/src/commands/bench.rs:4344-4534 | crates/izwi-cli/src/commands/bench.rs:4975-5095 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) crates/izwi-core/src/kernels/moe_relu2.rs:1355 — crates/izwi-core/src/kernels/moe_relu2.rs:1355-1388 | crates/izwi-core/src/kernels/moe_relu2.rs:1453-1481 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) crates/izwi-core/src/runtime/audio_io.rs:1306 — crates/izwi-core/src/runtime/audio_io.rs:1306-1334 | crates/izwi-server/src/media_ingest.rs:932-960 — These two members are one piece of code written twice and then edited apart: 29 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 (83 corresponding lines) · ×3
  • Edited copy of a member (83 corresponding lines) crates/izwi-server/src/state.rs:529 — crates/izwi-server/src/state.rs:529-611 | crates/izwi-server/src/state.rs:618-724 — These two members are one piece of code written twice and then edited apart: 83 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 (83 corresponding lines) REDACTED:547 — REDACTED:547-629 | REDACTED:804-916 — These two members are one piece of code written twice and then edited apart: 83 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 (83 corresponding lines) crates/izwi-model-catalog/src/catalog/metadata.rs:776 — crates/izwi-model-catalog/src/catalog/metadata.rs:776-858 | crates/izwi-model-catalog/src/catalog/metadata.rs:862-964 — These two members are one piece of code written twice and then edited apart: 83 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 (40 corresponding lines) · ×3
  • Edited copy of a member (40 corresponding lines) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1386 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1386-1425 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1494-1534 — 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) crates/izwi-core/src/kernels/metal.rs:4673 — crates/izwi-core/src/kernels/metal.rs:4673-4712 | crates/izwi-core/src/kernels/metal.rs:4714-4753 — 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) scripts/fixtures/generate_lfm25_reference.py:231 — scripts/fixtures/generate_lfm25_reference.py:231-270 | scripts/fixtures/generate_lfm3_reference.py:299-345 — 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 (41 corresponding lines) · ×3
  • Edited copy of a member (41 corresponding lines) crates/izwi-core/src/kernels/cuda/gdn.rs:936 — crates/izwi-core/src/kernels/cuda/gdn.rs:936-976 | crates/izwi-core/src/kernels/cuda/moe.rs:1224-1270 — These two members are one piece of code written twice and then edited apart: 41 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 (41 corresponding lines) crates/izwi-core/src/engine/core.rs:1092 — crates/izwi-core/src/engine/core.rs:1092-1140 | crates/izwi-core/src/engine/core.rs:1148-1188 — These two members are one piece of code written twice and then edited apart: 41 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 (41 corresponding lines) crates/izwi-core/src/kv/v2/runtime.rs:1444 — crates/izwi-core/src/kv/v2/runtime.rs:1444-1484 | crates/izwi-core/src/kv/v2/runtime.rs:1518-1565 — These two members are one piece of code written twice and then edited apart: 41 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 (42 corresponding lines) · ×3
  • Edited copy of a member (42 corresponding lines) crates/izwi-cli/src/commands/list.rs:63 — crates/izwi-cli/src/commands/list.rs:63-111 | crates/izwi-cli/src/commands/models.rs:142-183 — These two members are one piece of code written twice and then edited apart: 42 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 (42 corresponding lines) crates/izwi-core/src/backends/kv/accelerator.rs:3050 — crates/izwi-core/src/backends/kv/accelerator.rs:3050-3092 | crates/izwi-core/src/backends/kv/accelerator.rs:3100-3141 — These two members are one piece of code written twice and then edited apart: 42 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 (42 corresponding lines) crates/izwi-core/src/runtime/coordinator.rs:2155 — crates/izwi-core/src/runtime/coordinator.rs:2155-2196 | crates/izwi-core/src/runtime/coordinator.rs:2211-2252 — These two members are one piece of code written twice and then edited apart: 42 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) · ×3
  • Edited copy of a member (30 corresponding lines) crates/izwi-cli/src/commands/bench.rs:2900 — crates/izwi-cli/src/commands/bench.rs:2900-2929 | crates/izwi-cli/src/commands/bench.rs:3072-3101 — 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) crates/izwi-core/src/kernels/cuda/kquant.rs:147 — crates/izwi-core/src/kernels/cuda/kquant.rs:147-176 | crates/izwi-core/src/kernels/cuda/kquant.rs:244-274 — 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) crates/izwi-server/src/batch_runtime/store/media.rs:507 — crates/izwi-server/src/batch_runtime/store/media.rs:507-540 | crates/izwi-server/src/batch_runtime/store/provider_writes.rs:1113-1142 — 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 copy of a member (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) crates/izwi-serving-supervisor/src/daemon/cli.rs:231 — crates/izwi-serving-supervisor/src/daemon/cli.rs:231-257 | crates/izwi-serving-supervisor/src/daemon/cli.rs:262-301 — 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.
  • Edited copy of a member (27 corresponding lines) crates/izwi-server/src/api/transcription/unified_read.rs:394 — crates/izwi-server/src/api/transcription/unified_read.rs:394-420 | crates/izwi-server/src/api/transcription/unified_write.rs:162-188 — 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.
  • Edited copy of a member (27 corresponding lines) crates/izwi-core/src/kernels/mod.rs:268 — crates/izwi-core/src/kernels/mod.rs:268-294 | crates/izwi-core/src/kernels/mod.rs:400-430 — 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 (34 corresponding lines) · ×3
  • Edited copy of a member (34 corresponding lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:2387 — crates/izwi-core/src/runtime/service/asr_preparation.rs:2387-2420 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2430-2466 — 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.
  • Edited copy of a member (34 corresponding lines) crates/izwi-cli/src/commands/list.rs:28 — crates/izwi-cli/src/commands/list.rs:28-61 | crates/izwi-cli/src/commands/models.rs:107-140 — 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.
  • Edited copy of a member (34 corresponding lines) crates/izwi-core/src/runtime/speech_to_speech.rs:263 — crates/izwi-core/src/runtime/speech_to_speech.rs:263-296 | crates/izwi-core/src/runtime/speech_to_speech.rs:306-339 — 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, 23+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 23+ corresponding lines) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:518 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:518-542 | crates/izwi-core/src/engine/executor/handler_maya1.rs:588-610 | crates/izwi-core/src/engine/executor/handler_maya2.rs:483-505 — 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) crates/izwi-core/src/engine/executor/handler_asr.rs:338 — crates/izwi-core/src/engine/executor/handler_asr.rs:338-360 | crates/izwi-core/src/engine/executor/handler_chat.rs:58-80 | crates/izwi-core/src/engine/executor/handler_tts.rs:335-357 — 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) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:92 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:92-118 | crates/izwi-core/src/engine/executor/handler_chat.rs:113-138 | crates/izwi-core/src/engine/executor/handler_tts.rs:746-768 — 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 (28 corresponding lines) · ×3
  • Edited copy of a member (28 corresponding lines) crates/izwi-cli/src/commands/bench.rs:4155 — crates/izwi-cli/src/commands/bench.rs:4155-4182 | crates/izwi-cli/src/commands/bench.rs:4280-4307 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) crates/izwi-asr-toolkit/src/lib.rs:1285 — crates/izwi-asr-toolkit/src/lib.rs:1285-1312 | crates/izwi-server/src/app/transcription_realtime.rs:1842-1877 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) crates/izwi-core/src/artifacts/downloader.rs:2914 — crates/izwi-core/src/artifacts/downloader.rs:2914-2941 | crates/izwi-core/src/artifacts/downloader.rs:2945-2972 — These two members are one piece of code written twice and then edited apart: 28 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, 16+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 16+ corresponding lines) crates/izwi-core/src/engine/executor/handler_asr.rs:441 — crates/izwi-core/src/engine/executor/handler_asr.rs:441-456 | crates/izwi-core/src/engine/executor/handler_asr.rs:465-485 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:142-161 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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, 16+ corresponding lines) crates/izwi-core/src/kernels/cuda/stretch_graphs.rs:103 — crates/izwi-core/src/kernels/cuda/stretch_graphs.rs:103-123 | crates/izwi-core/src/models/architectures/qwen3/decode_graph.rs:104-120 | crates/izwi-core/src/models/architectures/voxtral/decode_graph.rs:100-115 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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, 16+ corresponding lines) crates/izwi-core/src/engine/mod.rs:2832 — crates/izwi-core/src/engine/mod.rs:2832-2847 | crates/izwi-core/src/engine/mod.rs:2861-2876 | crates/izwi-core/src/engine/mod.rs:2922-2937 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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, 9+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/izwi-core/src/kernels/cuda/gate.rs:14 — crates/izwi-core/src/kernels/cuda/gate.rs:14-22 | crates/izwi-core/src/kernels/cuda/norm.rs:16-24 | crates/izwi-core/src/kernels/cuda/rope.rs:60-74 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/izwi-core/src/engine/metrics.rs:2518 — crates/izwi-core/src/engine/metrics.rs:2518-2528 | crates/izwi-core/src/runtime/telemetry/metrics.rs:1571-1579 | crates/izwi-core/src/runtime/telemetry/metrics.rs:1581-1589 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/izwi-core/src/kernels/cuda/sampling.rs:123 — crates/izwi-core/src/kernels/cuda/sampling.rs:123-131 | crates/izwi-core/src/kernels/cuda/sampling.rs:132-140 | crates/izwi-core/src/kernels/cuda/sampling_device.rs:8-16 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/izwi-core/src/kernels/transducer_greedy.rs:344 — crates/izwi-core/src/kernels/transducer_greedy.rs:344-353 | crates/izwi-core/src/models/architectures/granite_speech/asr/runtime.rs:425-434 | crates/izwi-core/src/runtime/service/chat_invocation.rs:68-78 — 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.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/izwi-core/src/serve_runtime.rs:536 — crates/izwi-core/src/serve_runtime.rs:536-545 | crates/izwi-desktop/src/app/mod.rs:308-319 | crates/izwi-desktop/src/app/updater.rs:417-428 — 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.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:301 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:301-310 | crates/izwi-core/src/engine/executor/fish_pending.rs:268-277 | crates/izwi-core/src/engine/executor/long_form.rs:162-173 — 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, 8+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/izwi-model-catalog/src/catalog/maya2.rs:278 — crates/izwi-core/src/models/architectures/maya1/config.rs:213-222 | crates/izwi-model-catalog/src/catalog/maya2.rs:278-287 | crates/izwi-server/src/api/openai/model_aliases.rs:12-19 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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, 8+ corresponding lines) crates/izwi-server/src/batch_api_store.rs:397 — crates/izwi-server/src/batch_api_store.rs:397-408 | crates/izwi-server/src/batch_runtime/store/media.rs:648-655 | crates/izwi-server/src/batch_runtime/store/speech.rs:832-841 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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, 8+ corresponding lines) crates/izwi-cli/src/commands/bench.rs:2839 — crates/izwi-cli/src/commands/bench.rs:2839-2846 | crates/izwi-server/src/api/diarization/handlers.rs:1292-1300 | crates/izwi-server/src/speech_history_store.rs:1749-1756 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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 · Duplicated block (31 lines × 2) · ×3
  • Duplicated block (31 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:433 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:433-463 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:200-230 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:433` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (31 lines × 2) crates/izwi-server/src/api/transcription/handlers.rs:1356 — crates/izwi-server/src/api/transcription/handlers.rs:1356-1386 | crates/izwi-server/src/api/transcription/handlers.rs:1396-1426 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/api/transcription/handlers.rs:1356` 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 (31 lines × 2) crates/izwi-core/src/runtime/service/asr_encoders.rs:526 — crates/izwi-core/src/runtime/service/asr_encoders.rs:526-556 | crates/izwi-core/src/runtime/service/asr_encoders.rs:885-915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `rows` to `Vec<ParakeetEncoderPending>` in one and `Vec<NemotronEncoderPending>` 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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×3
  • Duplicated block (25 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:541 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:541-565 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:542-566 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:541` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:684 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:684-708 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1068-1092 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:684` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (25 lines × 2) crates/izwi-core/src/kernels/cuda/gdn.rs:882 — crates/izwi-core/src/kernels/cuda/gdn.rs:882-906 | crates/izwi-core/src/kernels/cuda/gdn.rs:1007-1031 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/gdn.rs:882` 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 · Duplicated block (24 lines × 2) · ×3
  • Duplicated block (24 lines × 2) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:832 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:832-855 | crates/izwi-core/src/engine/executor/handler_tts.rs:2275-2298 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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 `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:832` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) crates/izwi-core/src/runtime/lifecycle/load/admission.rs:487 — crates/izwi-core/src/runtime/lifecycle/load/admission.rs:487-510 | crates/izwi-core/src/runtime/lifecycle/load/admission.rs:1195-1218 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/lifecycle/load/admission.rs:487` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) crates/izwi-server/src/persistence/mod.rs:440 — crates/izwi-server/src/persistence/mod.rs:440-463 | crates/izwi-server/src/persistence/mod.rs:537-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 `crates/izwi-server/src/persistence/mod.rs:440` 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.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×3
  • Duplicated block (17 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:696 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:696-712 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:899-915 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1080-1096 — 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:696` 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 × 3) crates/izwi-core/src/runtime/service/asr_encoders.rs:1406 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1406-1422 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1670-1686 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1915-1931 — 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1406` it begins part-way through the construct above it, so those exact lines 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 × 3) crates/izwi-server/src/api/diarization/handlers.rs:1303 — crates/izwi-server/src/api/diarization/handlers.rs:1303-1319 | crates/izwi-server/src/api/transcription/unified_read.rs:510-526 | crates/izwi-server/src/api/transcription/unified_read.rs:529-545 — 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `audio` to `StoredDiarizationAudio` in one and `StoredTranscriptionAudio` 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×3
  • Duplicated block (13–15 lines × 2) crates/izwi-core/src/engine/mod.rs:2594 — crates/izwi-core/src/engine/mod.rs:2594-2606 | crates/izwi-core/src/engine/mod.rs:2651-2665 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/mod.rs:2594` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–15 lines × 2) crates/izwi-core/src/kernels/cuda/moe.rs:869 — crates/izwi-core/src/kernels/cuda/moe.rs:869-883 | crates/izwi-core/src/kernels/cuda/moe.rs:1120-1132 — both copies are in the same file, so extract the 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–15 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1072 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1072-1084 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1176-1190 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1072` 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×3
  • Duplicated block (12–14 lines × 3) crates/izwi-core/src/engine/executor.rs:4577 — crates/izwi-core/src/engine/executor.rs:4577-4590 | crates/izwi-core/src/engine/executor.rs:4687-4700 | crates/izwi-core/src/engine/executor.rs:4793-4804 — 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 `crates/izwi-core/src/engine/executor.rs:4577` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/engine/executor.rs:4791` calls `abort_variant`, `is_err`, `unconfirmed` and `crates/izwi-core/src/engine/executor.rs:4577` 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 (12–14 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:184 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:184-195 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1170-1183 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:91-102 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:184` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:90` calls `as_str` and `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:183` 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 (12–14 lines × 3) crates/izwi-core/src/runtime/service/asr_encoders.rs:1440 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1440-1451 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1704-1715 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1949-1962 — 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1440` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/runtime/service/asr_encoders.rs:1452` calls `with_capacity` and `crates/izwi-core/src/runtime/service/asr_encoders.rs:1963` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×3
  • Duplicated block (12–13 lines × 4) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:224 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:224-236 | crates/izwi-core/src/engine/executor/handler_maya1.rs:219-231 | crates/izwi-core/src/engine/executor/handler_maya2.rs:220-232 | crates/izwi-core/src/engine/executor/handler_tts.rs:1408-1419 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:224` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:287 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:287-299 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:311-322 | crates/izwi-core/src/engine/executor/handler_maya1.rs:281-293 | crates/izwi-core/src/engine/executor/handler_maya2.rs:282-294 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:287` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:499 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:499-510 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:654-666 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:835-847 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1039-1051 — 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:499` 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×3
  • Duplicated block (11–13 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:1407 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1407-1417 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2015-2027 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1407` 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–13 lines × 2) crates/izwi-gateway/src/app/realtime_translate.rs:658 — crates/izwi-gateway/src/app/realtime_translate.rs:658-670 | crates/izwi-gateway/src/app/realtime_translate.rs:836-846 — both copies are in the same file, so extract the 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 `crates/izwi-gateway/src/app/realtime_translate.rs:658` 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–13 lines × 2) crates/izwi-server/src/api/openai/audio/transcriptions.rs:806 — crates/izwi-server/src/api/openai/audio/transcriptions.rs:806-816 | crates/izwi-server/src/api/transcription/handlers.rs:626-638 — 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 `crates/izwi-server/src/api/openai/audio/transcriptions.rs:806` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) crates/izwi-core/src/runtime/service/asr_preparation.rs:1532 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1532-1541 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1776-1787 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1957-1968 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2147-2156 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1532` 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 (10 lines × 4) crates/izwi-cli/src/commands/config.rs:155 — crates/izwi-cli/src/commands/config.rs:155-164 | crates/izwi-cli/src/commands/models.rs:429-438 | crates/izwi-cli/src/commands/pull.rs:61-70 | crates/izwi-cli/src/commands/rm.rs:18-27 — before extracting anything, compare `crates/izwi-cli/src/commands/models.rs` and `crates/izwi-cli/src/commands/rm.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `crates/izwi-cli/src/commands/config.rs:155` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:639 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:639-648 | crates/izwi-core/src/engine/executor/handler_chat.rs:987-996 | crates/izwi-core/src/engine/executor/handler_chat.rs:1395-1404 | crates/izwi-core/src/engine/executor/handler_tts.rs:4363-4372 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_chat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:639` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/engine/executor/handler_tts.rs:4362` calls `take_staged_stream_outputs` and `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:638` 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.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×3
  • Duplicated block (9 lines × 7) crates/izwi-core/src/engine/executor.rs:4221 — crates/izwi-core/src/engine/executor.rs:4221-4229 | crates/izwi-core/src/engine/executor.rs:4238-4246 | crates/izwi-core/src/engine/executor.rs:4255-4263 | crates/izwi-core/src/engine/executor.rs:4272-4280 | crates/izwi-core/src/engine/executor.rs:4289-4297 | crates/izwi-core/src/engine/executor.rs:4306-4314 | crates/izwi-core/src/engine/executor.rs:4324-4332 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/engine/executor.rs:4221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 7) crates/izwi-core/src/kernels/metal.rs:1662 — crates/izwi-core/src/kernels/metal.rs:1662-1671 | crates/izwi-core/src/kernels/metal.rs:1826-1835 | crates/izwi-core/src/kernels/metal.rs:1972-1981 | crates/izwi-core/src/kernels/metal.rs:2151-2160 | crates/izwi-core/src/kernels/metal.rs:2708-2717 | crates/izwi-core/src/kernels/metal.rs:3121-3130 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:177-185 — before extracting anything, compare `crates/izwi-core/src/kernels/metal.rs` and `crates/izwi-core/src/kernels/metal_paged_gqa.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 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 `crates/izwi-core/src/kernels/metal.rs:1662` 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 × 7) crates/izwi-core/src/runtime/service/asr_preparation.rs:107 — crates/izwi-core/src/runtime/service/asr_preparation.rs:107-115 | crates/izwi-core/src/runtime/service/asr_preparation.rs:361-369 | crates/izwi-core/src/runtime/service/asr_preparation.rs:622-630 | crates/izwi-core/src/runtime/service/asr_preparation.rs:884-894 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1800-1808 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2140-2150 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2435-2445 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×3
  • Duplicated block (7 lines × 4) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:614 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:614-620 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1181-1187 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:542-548 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:543-549 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:542` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/izwi-core/src/runtime/service/asr_encoders.rs:1169 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1169-1175 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1390-1396 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1654-1660 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1886-1892 — 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.
  • Duplicated block (7 lines × 4) crates/izwi-core/src/runtime/service/tts_preparation.rs:620 — crates/izwi-core/src/runtime/service/tts_preparation.rs:620-626 | crates/izwi-core/src/runtime/service/tts_preparation.rs:815-821 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1375-1382 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1534-1544 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:620` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×3
  • Duplicated block (5 lines × 4) crates/izwi-core/src/engine/executor/dispatch.rs:697 — crates/izwi-core/src/engine/executor/dispatch.rs:697-702 | crates/izwi-core/src/engine/executor/dispatch.rs:785-789 | crates/izwi-core/src/engine/executor/dispatch.rs:819-823 | crates/izwi-core/src/engine/executor/dispatch.rs:970-974 — 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 `crates/izwi-core/src/engine/executor/dispatch.rs:697` 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) crates/izwi-core/src/runtime/service/asr_preparation.rs:1211 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1211-1215 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2462-2466 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1198-1202 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2239-2243 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:2462` it begins part-way through the construct above it, so those exact lines 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) scripts/fixtures/fetch_fish_drama3_slices.py:111 — scripts/fixtures/fetch_fish_drama3_slices.py:111-115 | scripts/fixtures/generate_fish_drama3_reference.py:192-196 | scripts/fixtures/generate_fish_drama3_slices.py:122-126 | scripts/fixtures/generate_nemotron_transcribe_reference.py:136-141 — 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 4 call sites, so a change lands once. 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.
D1 · Cyclomatic Complexity · RealtimeSession · ×2
  • RealtimeSession::run_tts_stage (cyclomatic 39) crates/izwi-serving-worker/src/realtime.rs:807 — RealtimeSession::run_tts_stage has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • RealtimeSession::run_asr_stage (cyclomatic 29) crates/izwi-serving-worker/src/realtime.rs:475 — RealtimeSession::run_asr_stage has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · ManagedCacheReservation · ×2
  • ManagedCacheReservation::validate_for_row (cyclomatic 24) crates/izwi-core/src/engine/execution.rs:1624 — ManagedCacheReservation::validate_for_row 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.
  • ManagedCacheReservation::completed_write_receipt_inner (cyclomatic 24) crates/izwi-core/src/engine/execution.rs:1818 — ManagedCacheReservation::completed_write_receipt_inner 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.
D1 · Cyclomatic Complexity · Session · ×2
  • Session::handle (cyclomatic 24) crates/izwi-dictation/src/session.rs:166 — Session::handle has cyclomatic complexity 24 (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.
  • Session::plan_response (cyclomatic 16) crates/izwi-server/src/app/openai_realtime/connection.rs:1258 — Session::plan_response has cyclomatic complexity 16 (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.
D1 · Cyclomatic Complexity · BatchRuntimeStore · ×2
  • BatchRuntimeStore::publish_reserved_opaque_stage_artifact (cyclomatic 20) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:629 — BatchRuntimeStore::publish_reserved_opaque_stage_artifact 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.
  • BatchRuntimeStore::settle_reserved_speech_history_audio (cyclomatic 17) crates/izwi-server/src/batch_runtime/store/speech.rs:243 — BatchRuntimeStore::settle_reserved_speech_history_audio has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · RolloutPlan · ×2
  • RolloutPlan::validate (cyclomatic 19) crates/izwi-serving-supervisor/src/rollout.rs:491 — RolloutPlan::validate 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.
  • RolloutPlan::validate_shape (cyclomatic 17) crates/izwi-serving-supervisor/src/rollout.rs:372 — RolloutPlan::validate_shape has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · OwnedStepContext · ×2
  • OwnedStepContext::execute_prepared (cyclomatic 18) crates/izwi-core/src/engine/mod.rs:896 — OwnedStepContext::execute_prepared has cyclomatic complexity 18 (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.
  • OwnedStepContext::route_committed (cyclomatic 16) crates/izwi-core/src/engine/mod.rs:1197 — OwnedStepContext::route_committed 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.
D2 · Cognitive Complexity · BatchWorkerRunner · ×2
  • BatchWorkerRunner::run_once (cognitive 81) crates/izwi-server/src/batch_runtime/worker.rs:661 — BatchWorkerRunner::run_once has cognitive complexity 81 (threshold 15). Drivers by points: if/else 36 (63 pts), match/switch 8 (14 pts), boolean chains 3, loops 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.
  • BatchWorkerRunner::run_slot (cognitive 17) crates/izwi-server/src/batch_runtime/worker.rs:1267 — BatchWorkerRunner::run_slot has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 3 (6 pts), loops 1 (nesting depth added 9). 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.
D2 · Cognitive Complexity · ToolCallParser · ×2
  • ToolCallParser::step (cognitive 41) crates/izwi-model-catalog/src/chat/tools/parse.rs:315 — ToolCallParser::step has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 3 (6 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 22). 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.
  • ToolCallParser::step_params (cognitive 23) crates/izwi-model-catalog/src/chat/tools/parse.rs:435 — ToolCallParser::step_params has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · ManagedCacheReservation · ×2
  • ManagedCacheReservation::completed_write_receipt_inner (cognitive 38) crates/izwi-core/src/engine/execution.rs:1818 — ManagedCacheReservation::completed_write_receipt_inner has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 7, loops 3 (6 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.
  • ManagedCacheReservation::validate_for_row (cognitive 26) crates/izwi-core/src/engine/execution.rs:1624 — ManagedCacheReservation::validate_for_row has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, loops 2 (3 pts), match/switch 2 (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.
D2 · Cognitive Complexity · AudioCodec · ×2
  • AudioCodec::run_decoder_incremental (cognitive 36) crates/izwi-core/src/audio/codec.rs:282 — AudioCodec::run_decoder_incremental has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 6 (11 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AudioCodec::run_decoder (cognitive 31) crates/izwi-core/src/audio/codec.rs:208 — AudioCodec::run_decoder has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 7 (13 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.
D2 · Cognitive Complexity · RolloutPlan · ×2
  • RolloutPlan::validate (cognitive 34) crates/izwi-serving-supervisor/src/rollout.rs:491 — RolloutPlan::validate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 7 (10 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.
  • RolloutPlan::validate_shape (cognitive 17) crates/izwi-serving-supervisor/src/rollout.rs:372 — RolloutPlan::validate_shape has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, loops 1 (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.
D2 · Cognitive Complexity · izwi_dictation · ×2
  • izwi_dictation::controller::run (cognitive 28) crates/izwi-dictation/src/controller.rs:268 — izwi_dictation::controller::run has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 4 (10 pts), loops 3 (9 pts), if/else 2 (8 pts), boolean chains 1 (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.
  • izwi_dictation::portal::run (cognitive 28) crates/izwi-dictation/src/portal.rs:183 — izwi_dictation::portal::run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 4 (12 pts), loops 1 (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.
D2 · Cognitive Complexity · Ledger · ×2
  • Ledger::gguf_dense (cognitive 25) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:1003 — Ledger::gguf_dense has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 1 (nesting depth added 8). 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.
  • Ledger::var (cognitive 19) crates/izwi-core/src/runtime/lifecycle/asr_memory.rs:580 — Ledger::var has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1, match/switch 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.
D2 · Cognitive Complexity · GatewayDeploymentTable · ×2
  • GatewayDeploymentTable::apply_view (cognitive 24) crates/izwi-gateway/src/gateway_deployments.rs:240 — GatewayDeploymentTable::apply_view has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 pts), boolean chains 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.
  • GatewayDeploymentTable::approve_replica (cognitive 19) crates/izwi-gateway/src/gateway_deployments.rs:167 — GatewayDeploymentTable::approve_replica has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · Session · ×2
  • Session::on_append (cognitive 24) crates/izwi-server/src/app/openai_realtime/connection.rs:634 — Session::on_append has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (3 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.
  • Session::run (cognitive 20) crates/izwi-server/src/api/openai/audio/speech_stream.rs:298 — Session::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (6 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · OwnedStepContext · ×2
  • OwnedStepContext::execute_prepared (cognitive 23) crates/izwi-core/src/engine/mod.rs:896 — OwnedStepContext::execute_prepared has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 5 (14 pts), loops 6, if/else 1 (2 pts), boolean chains 1 (nesting depth added 10). 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.
  • OwnedStepContext::route_committed (cognitive 22) crates/izwi-core/src/engine/mod.rs:1197 — OwnedStepContext::route_committed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 3, match/switch 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.
D2 · Cognitive Complexity · SupervisedWorker · ×2
  • SupervisedWorker::wait_until_ready (cognitive 21) crates/izwi-serving-supervisor/src/lifecycle.rs:403 — SupervisedWorker::wait_until_ready has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (6 pts), 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.
  • SupervisedWorker::drain_and_stop (cognitive 18) crates/izwi-serving-supervisor/src/lifecycle.rs:496 — SupervisedWorker::drain_and_stop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BatchExecutor · ×2
  • BatchExecutor::run_lines (cognitive 19) crates/izwi-server/src/api/openai/batches/executor.rs:391 — BatchExecutor::run_lines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 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.
  • BatchExecutor::validate (cognitive 17) crates/izwi-server/src/api/openai/batches/executor.rs:310 — BatchExecutor::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (78 shared lines) · ×2
  • Near-duplicate member pair (78 shared lines) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:177 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:177-363 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:543-680 — These two members are variants of one another: 78 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 (78 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:1400 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1400-1564 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1578-1788 — These two members are variants of one another: 78 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 · Near-duplicate member pair (55 shared lines) · ×2
  • Near-duplicate member pair (55 shared lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1372 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1372-1546 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:177-363 — These two members are variants of one another: 55 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 (55 shared lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1372 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1372-1546 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:811-1001 — These two members are variants of one another: 55 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 · Near-duplicate member pair (53 shared lines) · ×2
  • Near-duplicate member pair (53 shared lines) crates/izwi-core/src/kernels/cuda/moe.rs:1318 — crates/izwi-core/src/kernels/cuda/moe.rs:1318-1394 | crates/izwi-core/src/kernels/cuda/moe.rs:1406-1481 — These two members are variants of one another: 53 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 (53 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:1133 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1133-1390 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2135-2380 — These two members are variants of one another: 53 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 · Near-duplicate member pair (49 shared lines) · ×2
  • Near-duplicate member pair (49 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:1133 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1133-1390 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1400-1564 — These two members are variants of one another: 49 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 (49 shared lines) crates/izwi-core/src/runtime/service/tts_preparation.rs:389 — crates/izwi-core/src/runtime/service/tts_preparation.rs:389-569 | crates/izwi-core/src/runtime/service/tts_preparation.rs:576-764 — These two members are variants of one another: 49 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 · Near-duplicate member pair (47 shared lines) · ×2
  • Near-duplicate member pair (47 shared lines) crates/izwi-core/src/runtime/service/tts_preparation.rs:389 — crates/izwi-core/src/runtime/service/tts_preparation.rs:389-569 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1666-1810 — These two members are variants of one another: 47 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 (47 shared lines) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1308 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1308-1473 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1544-1709 — These two members are variants of one another: 47 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 · Near-duplicate member pair (44 shared lines) · ×2
  • Near-duplicate member pair (44 shared lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1011 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1011-1137 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1372-1546 — These two members are variants of one another: 44 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 (44 shared lines) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:766 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:766-855 | crates/izwi-core/src/engine/executor/handler_tts.rs:2222-2298 — These two members are variants of one another: 44 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 · Near-duplicate member pair (37 shared lines) · ×2
  • Near-duplicate member pair (37 shared lines) crates/izwi-core/src/runtime/service/tts_preparation.rs:389 — crates/izwi-core/src/runtime/service/tts_preparation.rs:389-569 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1492-1659 — These two members are variants of one another: 37 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 (37 shared lines) crates/izwi-core/src/engine/executor/handler_maya1.rs:357 — crates/izwi-core/src/engine/executor/handler_maya1.rs:357-416 | crates/izwi-core/src/engine/executor/handler_maya2.rs:359-418 — These two members are variants of one another: 37 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 · Near-duplicate member pair (36 shared lines) · ×2
  • Near-duplicate member pair (36 shared lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1011 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1011-1137 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1153-1244 — These two members are variants of one another: 36 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 (36 shared lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1011 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1011-1137 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1192-1271 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (62 corresponding lines) · ×2
  • Edited copy of a member (62 corresponding lines) crates/izwi-server/src/media_ingest.rs:655 — crates/izwi-server/src/media_ingest.rs:655-716 | crates/izwi-server/src/media_ingest.rs:728-794 — 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.
  • Edited copy of a member (62 corresponding lines) crates/izwi-cli/src/commands/align.rs:16 — crates/izwi-cli/src/commands/align.rs:16-77 | crates/izwi-cli/src/commands/transcribe.rs:22-87 — 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 (44 corresponding lines) · ×2
  • Edited copy of a member (44 corresponding lines) crates/izwi-core/src/runtime/asr/realtime_session.rs:1018 — crates/izwi-core/src/runtime/asr/realtime_session.rs:1018-1061 | crates/izwi-core/src/runtime/asr/realtime_session.rs:1110-1168 — 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.
  • Edited copy of a member (44 corresponding lines) crates/izwi-core/src/audio/preprocessing.rs:306 — crates/izwi-core/src/audio/preprocessing.rs:306-362 | crates/izwi-core/src/models/architectures/lfm25_audio/preprocessor.rs:201-244 — 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 (49 corresponding lines) · ×2
  • Edited copy of a member (49 corresponding lines) crates/izwi-server/src/diarization_store.rs:628 — crates/izwi-server/src/diarization_store.rs:628-695 | crates/izwi-server/src/transcription_store.rs:594-642 — These two members are one piece of code written twice and then edited apart: 49 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 (49 corresponding lines) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:459 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:459-507 | crates/izwi-core/src/engine/executor/handler_tts.rs:4535-4585 — These two members are one piece of code written twice and then edited apart: 49 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) crates/izwi-server/src/batch_api_store.rs:267 — crates/izwi-server/src/batch_api_store.rs:267-302 | crates/izwi-server/src/file_store.rs:288-333 — 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) crates/izwi-core/src/kernels/relpos_attention.rs:962 — crates/izwi-core/src/kernels/relpos_attention.rs:962-1005 | crates/izwi-core/src/kernels/transducer_greedy.rs:685-720 — 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 (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) crates/izwi-server/src/api/openai/audio/transcriptions.rs:1387 — crates/izwi-server/src/api/openai/audio/transcriptions.rs:1387-1421 | crates/izwi-server/src/api/transcript_alignment.rs:77-112 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) crates/izwi-core/src/engine/mod.rs:3496 — crates/izwi-core/src/engine/mod.rs:3496-3536 | crates/izwi-core/src/engine/mod.rs:3562-3596 — These two members are one piece of code written twice and then edited apart: 35 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 (31 corresponding lines) · ×2
  • Edited copy of a member (31 corresponding lines) crates/izwi-core/src/backends/kv/accelerator.rs:2143 — crates/izwi-core/src/backends/kv/accelerator.rs:2143-2173 | crates/izwi-core/src/backends/kv/cpu.rs:211-244 — These two members are one piece of code written twice and then edited apart: 31 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 (31 corresponding lines) crates/izwi-cli/src/commands/models.rs:422 — crates/izwi-cli/src/commands/models.rs:422-452 | crates/izwi-cli/src/commands/rm.rs:6-45 — These two members are one piece of code written twice and then edited apart: 31 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, 20+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 20+ corresponding lines) crates/izwi-server/src/onboarding_store.rs:42 — crates/izwi-server/src/onboarding_store.rs:42-62 | crates/izwi-server/src/onboarding_store.rs:66-85 | crates/izwi-server/src/onboarding_store.rs:90-109 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) crates/izwi-gateway/src/api/openai/chat/dto.rs:199 — crates/izwi-gateway/src/api/openai/chat/dto.rs:199-222 | crates/izwi-serving-worker/src/lib.rs:2038-2061 | crates/izwi-serving-worker/src/test_support.rs:645-664 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 15+ corresponding lines) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:263 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:263-277 | crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:283-299 | crates/izwi-core/src/engine/executor/fish_pending.rs:228-243 | crates/izwi-core/src/engine/executor/fish_pending.rs:249-266 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 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.
  • Edited copies of one member (4 members, 15+ corresponding lines) crates/izwi-core/src/kernels/mod.rs:96 — crates/izwi-core/src/kernels/mod.rs:96-110 | crates/izwi-core/src/kernels/mod.rs:133-147 | crates/izwi-core/src/kernels/mod.rs:230-244 | crates/izwi-core/src/kernels/mod.rs:246-260 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 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, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) crates/izwi-core/src/kernels/penalized_topk.rs:301 — crates/izwi-core/src/kernels/penalized_topk.rs:301-313 | crates/izwi-core/src/models/architectures/lfm2/backbone.rs:128-139 | crates/izwi-core/src/models/shared/sampling.rs:2743-2755 — 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) crates/izwi-server/src/batch_api_store.rs:311 — crates/izwi-server/src/batch_api_store.rs:311-322 | crates/izwi-server/src/batch_api_store.rs:412-429 | crates/izwi-server/src/batch_api_store.rs:432-444 — 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.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 12+ corresponding lines) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:35 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:35-47 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:45-56 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:45-59 | crates/izwi-core/src/engine/executor/handler_tts.rs:98-111 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) crates/izwi-server/src/batch_api_store.rs:235 — crates/izwi-server/src/batch_api_store.rs:235-246 | crates/izwi-server/src/file_store.rs:262-280 | crates/izwi-server/src/saved_voice_store.rs:453-466 | crates/izwi-server/src/saved_voice_store.rs:513-524 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×2
  • Edited copy of a member (18 corresponding lines) crates/izwi-server/src/batch_runtime/store/artifacts.rs:496 — crates/izwi-server/src/batch_runtime/store/artifacts.rs:496-514 | crates/izwi-server/src/batch_runtime/store/provider_writes.rs:378-395 — 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) crates/izwi-asr-toolkit/src/lib.rs:1238 — crates/izwi-asr-toolkit/src/lib.rs:1238-1258 | crates/izwi-core/src/models/architectures/lfm25_audio/model.rs:2574-2591 — 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 copies of one member (4 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 14+ corresponding lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1311 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1311-1324 | crates/izwi-core/src/runtime/adapters/loaded/chat.rs:107-125 | crates/izwi-core/src/runtime/adapters/loaded/chat.rs:127-145 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1919-1935 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) crates/izwi-core/src/runtime/asr.rs:207 — crates/izwi-core/src/runtime/asr.rs:207-220 | crates/izwi-core/src/runtime/diarization.rs:452-468 | crates/izwi-core/src/runtime/speech_to_speech.rs:30-43 | crates/izwi-core/src/runtime/speech_to_speech.rs:65-78 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/izwi-core/src/kernels/metal_fp8_gemm.rs:476 — crates/izwi-core/src/kernels/metal_fp8_gemm.rs:476-486 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:990-1000 | crates/izwi-core/src/kernels/moe_relu2.rs:1102-1112 — 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.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/izwi-server/src/diarization_store.rs:1062 — crates/izwi-server/src/diarization_store.rs:1062-1072 | crates/izwi-server/src/saved_voice_store.rs:700-710 | crates/izwi-server/src/transcription_store.rs:1240-1252 — 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 (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:42 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:42-57 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:400-415 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:29-42 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/izwi-core/src/engine/executor.rs:1357 — crates/izwi-core/src/engine/executor.rs:1357-1370 | crates/izwi-core/src/engine/executor.rs:1403-1417 | crates/izwi-core/src/engine/executor.rs:1419-1433 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) crates/izwi-server/src/app/mcp.rs:261 — crates/izwi-core/src/models/architectures/maya2/text/lang.rs:58-60 | crates/izwi-server/src/app/mcp.rs:261-266 — 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) scripts/fixtures/generate_chatterbox_reference.py:78 — scripts/fixtures/generate_chatterbox_reference.py:78-80 | scripts/fixtures/generate_maya1_reference.py:86-88 — 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.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×2
  • Duplicated block (34 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:469 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:469-502 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:468-501 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:469` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (34 lines × 2) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:113 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:113-146 | crates/izwi-core/src/engine/executor/handler_tts.rs:4639-4672 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_fish_drama3.rs` and `crates/izwi-core/src/engine/executor/handler_tts.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 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. 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.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) crates/izwi-core/src/engine/executor.rs:4591 — crates/izwi-core/src/engine/executor.rs:4591-4622 | crates/izwi-core/src/engine/executor.rs:4701-4732 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor.rs:4591` 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 `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 (32 lines × 2) crates/izwi-serving-worker/src/realtime.rs:497 — crates/izwi-serving-worker/src/realtime.rs:497-528 | crates/izwi-serving-worker/src/realtime.rs:849-880 — both copies are in the same file, so extract the 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 `crates/izwi-serving-worker/src/realtime.rs:497` 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 · Duplicated block (27 lines × 2) · ×2
  • Duplicated block (27 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:283 — crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:283-309 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:282-308 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` and `crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 331 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 `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) crates/izwi-core/src/runtime/service/asr_encoders.rs:598 — crates/izwi-core/src/runtime/service/asr_encoders.rs:598-624 | crates/izwi-core/src/runtime/service/asr_encoders.rs:941-967 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:598` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `rows` to `Vec<ParakeetEncoderPending>` in one and `Vec<NemotronEncoderPending>` 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.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) crates/izwi-cli/src/commands/list.rs:29 — crates/izwi-cli/src/commands/list.rs:29-54 | crates/izwi-cli/src/commands/models.rs:108-133 — 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 `crates/izwi-cli/src/commands/list.rs:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) crates/izwi-core/src/backends/state/tensor.rs:599 — crates/izwi-core/src/backends/state/tensor.rs:599-624 | crates/izwi-core/src/backends/state/tensor.rs:646-671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×2
  • Duplicated block (24–25 lines × 2) crates/izwi-core/src/engine/scheduler/mod.rs:2199 — crates/izwi-core/src/engine/scheduler/mod.rs:2199-2222 | crates/izwi-core/src/engine/scheduler/mod.rs:2366-2390 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/scheduler/mod.rs:2199` 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, `crates/izwi-core/src/engine/scheduler/mod.rs:2391` calls `push` and `crates/izwi-core/src/engine/scheduler/mod.rs:2223` 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 (24–25 lines × 2) crates/izwi-core/src/runtime/service/asr_encoders.rs:492 — crates/izwi-core/src/runtime/service/asr_encoders.rs:492-515 | crates/izwi-core/src/runtime/service/asr_encoders.rs:850-874 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:492` 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 · Duplicated block (22 lines × 3) · ×2
  • Duplicated block (22 lines × 3) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:266 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:266-287 | crates/izwi-core/src/engine/executor/handler_maya1.rs:260-281 | crates/izwi-core/src/engine/executor/handler_maya2.rs:261-282 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:266` 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 × 3) crates/izwi-core/src/runtime/service/asr_preparation.rs:239 — crates/izwi-core/src/runtime/service/asr_preparation.rs:239-260 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1246-1267 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2257-2278 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs: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.
D4 · Code Duplication · Duplicated block (19–20 lines × 3) · ×2
  • Duplicated block (19–20 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/lfm3_live.rs:436 — crates/izwi-core/src/engine/executor/handler_asr/lfm3_live.rs:436-454 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:348-367 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:384-402 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` and `crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 171 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. 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, `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:345` calls `match`, `Some` and `crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:382` 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 (19–20 lines × 3) crates/izwi-core/src/runtime/service/tts_preparation.rs:1225 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1225-1243 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1903-1921 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2102-2121 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1225` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/runtime/service/tts_preparation.rs:1244` calls `clone` and `crates/izwi-core/src/runtime/service/tts_preparation.rs:1922` 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×2
  • Duplicated block (18–19 lines × 3) crates/izwi-core/src/runtime/service/asr_encoders.rs:1527 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1527-1545 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1790-1808 | crates/izwi-core/src/runtime/service/asr_encoders.rs:2000-2017 — 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1527` 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–19 lines × 3) crates/izwi-server/src/batch_runtime/store/speech.rs:316 — crates/izwi-server/src/batch_runtime/store/speech.rs:316-334 | crates/izwi-server/src/speech_history_store.rs:816-833 | crates/izwi-server/src/speech_history_store.rs:1152-1169 — 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.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×2
  • Duplicated block (16 lines × 4) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:482 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:482-497 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:637-652 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:818-833 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1022-1037 — 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:482` 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 × 4) crates/izwi-core/src/runtime/service/asr_preparation.rs:145 — crates/izwi-core/src/runtime/service/asr_preparation.rs:145-160 | crates/izwi-core/src/runtime/service/asr_preparation.rs:395-410 | crates/izwi-core/src/runtime/service/asr_preparation.rs:922-937 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2162-2177 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 5) · ×2
  • Duplicated block (13–14 lines × 5) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:114 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:114-126 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:123-135 | crates/izwi-core/src/engine/executor/handler_maya1.rs:123-135 | crates/izwi-core/src/engine/executor/handler_maya2.rs:124-136 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:129-142 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (13–14 lines × 5) crates/izwi-core/src/runtime/service/asr_preparation.rs:457 — crates/izwi-core/src/runtime/service/asr_preparation.rs:457-470 | crates/izwi-core/src/runtime/service/asr_preparation.rs:750-763 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1008-1021 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1218-1231 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2253-2265 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×2
  • Duplicated block (12–14 lines × 2) crates/izwi-core/src/engine/executor/handler_tts.rs:4253 — crates/izwi-core/src/engine/executor/handler_tts.rs:4253-4266 | crates/izwi-core/src/engine/executor/handler_tts.rs:4474-4485 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:4253` 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–14 lines × 2) crates/izwi-core/src/engine/scheduler/mod.rs:3170 — crates/izwi-core/src/engine/scheduler/mod.rs:3170-3183 | crates/izwi-core/src/engine/scheduler/mod.rs:3342-3353 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/scheduler/mod.rs:3170` 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 first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `crate) fn defer_execution_retry( &mut` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 6) · ×2
  • Duplicated block (12–13 lines × 6) crates/izwi-core/src/kernels/cuda.rs:933 — crates/izwi-core/src/kernels/cuda.rs:933-945 | crates/izwi-core/src/kernels/cuda.rs:2578-2590 | crates/izwi-core/src/kernels/cuda.rs:2693-2705 | crates/izwi-core/src/kernels/cuda.rs:2862-2874 | crates/izwi-core/src/kernels/cuda.rs:3004-3016 | crates/izwi-core/src/kernels/cuda.rs:3512-3523 — 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 `crates/izwi-core/src/kernels/cuda.rs:933` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12–13 lines × 6) crates/izwi-core/src/kernels/metal.rs:3311 — crates/izwi-core/src/kernels/metal.rs:3311-3323 | crates/izwi-core/src/kernels/metal.rs:3434-3446 | crates/izwi-core/src/kernels/metal.rs:3560-3572 | crates/izwi-core/src/kernels/metal.rs:3722-3733 | crates/izwi-core/src/kernels/metal.rs:3887-3899 | crates/izwi-core/src/kernels/metal.rs:4131-4143 — 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×2
  • Duplicated block (11–13 lines × 3) crates/izwi-cli/src/commands/config.rs:154 — crates/izwi-cli/src/commands/config.rs:154-164 | crates/izwi-cli/src/commands/models.rs:427-438 | crates/izwi-cli/src/commands/rm.rs:15-27 — before extracting anything, compare `crates/izwi-cli/src/commands/models.rs` and `crates/izwi-cli/src/commands/rm.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `crates/izwi-cli/src/commands/config.rs: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.
  • Duplicated block (11–13 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:266 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:266-278 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:573-584 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1158-1168 — 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 `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:266` it begins part-way through the construct above it, so those 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 · Duplicated block (12 lines × 6) · ×2
  • Duplicated block (12 lines × 6) crates/izwi-core/src/engine/executor.rs:4218 — crates/izwi-core/src/engine/executor.rs:4218-4229 | crates/izwi-core/src/engine/executor.rs:4235-4246 | crates/izwi-core/src/engine/executor.rs:4252-4263 | crates/izwi-core/src/engine/executor.rs:4269-4280 | crates/izwi-core/src/engine/executor.rs:4286-4297 | crates/izwi-core/src/engine/executor.rs:4303-4314 — 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 `crates/izwi-core/src/engine/executor.rs:4218` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 6) crates/izwi-core/src/engine/executor/dispatch.rs:190 — crates/izwi-core/src/engine/executor/dispatch.rs:190-201 | crates/izwi-core/src/engine/executor/dispatch.rs:214-225 | crates/izwi-core/src/engine/executor/dispatch.rs:238-249 | crates/izwi-core/src/engine/executor/dispatch.rs:262-273 | crates/izwi-core/src/engine/executor/dispatch.rs:302-313 | crates/izwi-core/src/engine/executor/dispatch.rs:326-337 — 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 `crates/izwi-core/src/engine/executor/dispatch.rs:190` 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.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×2
  • Duplicated block (12 lines × 5) crates/izwi-core/src/runtime/service/tts_preparation.rs:1392 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1392-1403 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1553-1564 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1721-1732 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1881-1892 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2077-2088 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 5) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:986 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:986-997 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:251-262 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:400-411 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1125-1136 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1729-1740 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/realtime.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:986` it begins part-way through the construct above it, so those 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 · Duplicated block (10–12 lines × 2) · ×2
  • Duplicated block (10–12 lines × 2) crates/izwi-gateway/src/app/audio_proxy.rs:421 — crates/izwi-gateway/src/app/audio_proxy.rs:421-432 | crates/izwi-gateway/src/app/openai_realtime_proxy.rs:494-503 — before extracting anything, compare `crates/izwi-gateway/src/app/audio_proxy.rs` and `crates/izwi-gateway/src/app/openai_realtime_proxy.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `crates/izwi-gateway/src/app/audio_proxy.rs:421` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-server/src/app/openai_realtime/respond.rs:1124 — crates/izwi-server/src/app/openai_realtime/respond.rs:1124-1135 | crates/izwi-server/src/app/openai_realtime/respond.rs:1152-1161 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/app/openai_realtime/respond.rs:1124` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×2
  • Duplicated block (8–9 lines × 3) crates/izwi-core/src/engine/mod.rs:1637 — crates/izwi-core/src/engine/mod.rs:1637-1644 | crates/izwi-core/src/engine/mod.rs:1692-1699 | crates/izwi-core/src/engine/mod.rs:2146-2154 — 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 `crates/izwi-core/src/engine/mod.rs:1637` it begins part-way through the construct above it, so those exact lines 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 × 3) crates/izwi-core/src/runtime/service/asr_preparation.rs:527 — crates/izwi-core/src/runtime/service/asr_preparation.rs:527-535 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1080-1087 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2334-2341 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:527` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:613 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:613-621 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1181-1188 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:613` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:465 — crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:465-473 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:489-496 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:465` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×2
  • Duplicated block (8 lines × 6) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:454 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:454-461 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:609-616 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:789-796 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:992-999 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1794-1801 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1971-1978 — 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:454` 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 × 6) crates/izwi-core/src/engine/executor/dispatch.rs:1044 — crates/izwi-core/src/engine/executor/dispatch.rs:1044-1051 | crates/izwi-core/src/engine/executor/dispatch.rs:1080-1087 | crates/izwi-core/src/engine/executor/dispatch.rs:1329-1336 | crates/izwi-core/src/engine/executor/dispatch.rs:1353-1360 | crates/izwi-core/src/engine/executor/dispatch.rs:1377-1384 | crates/izwi-core/src/engine/executor/dispatch.rs:1401-1408 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 34) · ×2
  • Duplicated block (7 lines × 34) crates/izwi-core/src/kernels/greedy.rs:153 — crates/izwi-core/src/kernels/greedy.rs:153-159 | crates/izwi-core/src/kernels/lfm_shortconv_step.rs:366-372 | crates/izwi-core/src/kernels/mamba2.rs:792-798 | crates/izwi-core/src/kernels/metal.rs:1681-1688 | crates/izwi-core/src/kernels/metal.rs:1845-1852 | crates/izwi-core/src/kernels/metal.rs:1991-1998 | crates/izwi-core/src/kernels/metal.rs:2170-2177 | crates/izwi-core/src/kernels/metal.rs:2727-2733 | crates/izwi-core/src/kernels/metal.rs:2779-2785 | crates/izwi-core/src/kernels/metal.rs:3140-3146 | crates/izwi-core/src/kernels/metal.rs:3192-3198 | crates/izwi-core/src/kernels/metal.rs:3325-3332 | crates/izwi-core/src/kernels/metal.rs:3448-3455 | crates/izwi-core/src/kernels/metal.rs:3574-3581 | crates/izwi-core/src/kernels/metal.rs:3735-3741 | crates/izwi-core/src/kernels/metal.rs:3901-3908 | crates/izwi-core/src/kernels/metal.rs:4145-4152 | crates/izwi-core/src/kernels/metal_fp8.rs:133-139 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:435-441 | crates/izwi-core/src/kernels/metal_kquant_mv.rs:298-304 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:268-274 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:157-163 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:195-201 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:352-358 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:952-958 | crates/izwi-core/src/kernels/moe_relu2.rs:1058-1064 | crates/izwi-core/src/kernels/qk_norm_rope.rs:360-366 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1173-1180 | crates/izwi-core/src/models/architectures/kokoro/prosody.rs:916-923 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:393-400 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:426-433 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:552-559 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:585-592 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:618-625 — before extracting anything, compare `crates/izwi-core/src/kernels/greedy.rs` and `crates/izwi-core/src/kernels/lfm_shortconv_step.rs` 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. 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 `crates/izwi-core/src/kernels/greedy.rs:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/kernels/metal.rs:2776` calls `map_err`, `new_compute_pipeline_state_with_function` and `crates/izwi-core/src/kernels/greedy.rs:152` 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 × 34) crates/izwi-core/src/kernels/greedy.rs:154 — crates/izwi-core/src/kernels/greedy.rs:154-160 | crates/izwi-core/src/kernels/lfm_shortconv_step.rs:367-373 | crates/izwi-core/src/kernels/mamba2.rs:793-799 | crates/izwi-core/src/kernels/metal.rs:1682-1689 | crates/izwi-core/src/kernels/metal.rs:1846-1853 | crates/izwi-core/src/kernels/metal.rs:1992-1999 | crates/izwi-core/src/kernels/metal.rs:2171-2178 | crates/izwi-core/src/kernels/metal.rs:2728-2734 | crates/izwi-core/src/kernels/metal.rs:3141-3147 | crates/izwi-core/src/kernels/metal.rs:3326-3333 | crates/izwi-core/src/kernels/metal.rs:3449-3456 | crates/izwi-core/src/kernels/metal.rs:3575-3582 | crates/izwi-core/src/kernels/metal.rs:3736-3742 | crates/izwi-core/src/kernels/metal.rs:3902-3909 | crates/izwi-core/src/kernels/metal.rs:4146-4153 | crates/izwi-core/src/kernels/metal_fp8.rs:134-140 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:436-442 | crates/izwi-core/src/kernels/metal_kquant_mv.rs:299-305 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:269-275 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:158-164 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:196-202 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:353-359 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:953-959 | crates/izwi-core/src/kernels/moe_relu2.rs:1059-1065 | crates/izwi-core/src/kernels/qk_norm_rope.rs:361-367 | crates/izwi-core/src/kernels/residual_norm.rs:318-324 | crates/izwi-core/src/kernels/swiglu.rs:139-145 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1174-1181 | crates/izwi-core/src/models/architectures/kokoro/prosody.rs:917-924 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:394-401 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:427-434 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:553-560 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:586-593 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:619-626 — before extracting anything, compare `crates/izwi-core/src/kernels/greedy.rs` and `crates/izwi-core/src/kernels/lfm_shortconv_step.rs` 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. 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) crates/izwi-core/src/backends/kv/accelerator.rs:1861 — crates/izwi-core/src/backends/kv/accelerator.rs:1861-1867 | crates/izwi-core/src/backends/kv/accelerator.rs:2327-2333 | crates/izwi-core/src/backends/kv/accelerator.rs:2379-2385 | crates/izwi-core/src/backends/kv/accelerator.rs:2415-2421 | crates/izwi-core/src/backends/kv/accelerator.rs:2452-2458 — 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, `crates/izwi-core/src/backends/kv/accelerator.rs:2422` calls `accelerator_indices` and `crates/izwi-core/src/backends/kv/accelerator.rs:2386` 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) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:685 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:685-691 | crates/izwi-server/src/batch_runtime/store/queue.rs:777-783 | crates/izwi-server/src/batch_runtime/store/queue.rs:1167-1173 | crates/izwi-server/src/batch_runtime/store/queue.rs:1228-1234 | crates/izwi-server/src/batch_runtime/store/speech.rs:348-354 — before extracting anything, compare `crates/izwi-server/src/batch_runtime/store/provider_writes.rs` and `crates/izwi-server/src/batch_runtime/store/speech.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-server/src/batch_runtime/store/queue.rs:784` calls `json_to_db_string` and `crates/izwi-server/src/batch_runtime/store/queue.rs:1174` 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.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×2
  • Duplicated block (6 lines × 6) crates/izwi-core/src/kv/v2/descriptor.rs:717 — crates/izwi-core/src/kv/v2/descriptor.rs:717-722 | crates/izwi-core/src/models/architectures/fish_s2/physical.rs:314-319 | crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:2142-2147 | crates/izwi-core/src/models/architectures/qwen3/asr/mod.rs:805-810 | crates/izwi-core/src/models/architectures/vibevoice/mod.rs:838-843 | crates/izwi-core/src/models/architectures/voxtral/mod.rs:625-630 — 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 `crates/izwi-core/src/kv/v2/descriptor.rs:717` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 6) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:614 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:614-619 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:929-934 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:156-161 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:168-174 | crates/izwi-core/src/engine/executor/handler_tts.rs:3084-3089 | crates/izwi-core/src/engine/executor/handler_tts.rs:3386-3391 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:614` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×2
  • Duplicated block (5 lines × 5) crates/izwi-core/src/runtime/service/asr_preparation.rs:280 — crates/izwi-core/src/runtime/service/asr_preparation.rs:280-284 | crates/izwi-core/src/runtime/service/asr_preparation.rs:531-535 | crates/izwi-core/src/runtime/service/asr_preparation.rs:820-824 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1083-1087 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2337-2341 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:280` it begins part-way through the construct above it, so those exact lines 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 × 5) crates/izwi-core/src/kernels/metal.rs:2461 — crates/izwi-core/src/kernels/metal.rs:2461-2465 | crates/izwi-core/src/kernels/metal.rs:2574-2578 | crates/izwi-core/src/kernels/metal.rs:2651-2655 | crates/izwi-core/src/kernels/metal.rs:2998-3002 | crates/izwi-core/src/kernels/metal.rs:3077-3081 — 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, `crates/izwi-core/src/kernels/metal.rs:2579` calls `set_bytes` and `crates/izwi-core/src/kernels/metal.rs:2466` 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.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×2
  • Duplicated block (4–5 lines × 3) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1467 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1467-1471 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1578-1582 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1728-1731 — 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 `crates/izwi-core/src/kernels/metal_qwen36moe.rs:1467` it begins part-way through the construct above it, so those exact lines 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) crates/izwi-gateway/src/api/request_context.rs:309 — crates/izwi-gateway/src/api/request_context.rs:309-313 | crates/izwi-gateway/src/api/request_context.rs:343-346 | crates/izwi-gateway/src/api/request_context.rs:579-584 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 8) · ×2
  • Duplicated block (8 lines × 8) crates/izwi-core/src/kernels/cuda/gdn.rs:775 — crates/izwi-core/src/kernels/cuda/gdn.rs:775-782 | crates/izwi-core/src/kernels/cuda/moe.rs:763-770 | crates/izwi-core/src/kernels/cuda/norm.rs:119-126 | crates/izwi-core/src/kernels/cuda/rope.rs:482-489 | crates/izwi-core/src/kernels/mamba2.rs:1061-1068 | crates/izwi-core/src/kernels/moe_relu2.rs:1321-1328 | crates/izwi-core/src/kernels/qk_norm_rope.rs:478-485 | crates/izwi-core/src/kernels/residual_norm.rs:409-416 — before extracting anything, compare `crates/izwi-core/src/kernels/mamba2.rs` and `crates/izwi-core/src/kernels/moe_relu2.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 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 `crates/izwi-core/src/kernels/mamba2.rs:1061` it begins part-way through the construct above it, so those 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 `device` to `&candle_core::cuda_backend::CudaDevice` in one and `&CudaDevice` 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 (8 lines × 8) crates/izwi-core/src/runtime/service/asr_preparation.rs:109 — crates/izwi-core/src/runtime/service/asr_preparation.rs:109-116 | crates/izwi-core/src/runtime/service/asr_preparation.rs:363-370 | crates/izwi-core/src/runtime/service/asr_preparation.rs:624-631 | crates/izwi-core/src/runtime/service/asr_preparation.rs:886-895 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1802-1809 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1966-1973 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2142-2151 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2437-2446 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:109` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/runtime/service/asr_preparation.rs:1964` calls `is_realtime_asr_session` and `crates/izwi-core/src/runtime/service/asr_preparation.rs:107` 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.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×2
  • Duplicated block (5 lines × 7) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:562 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:562-566 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:159-163 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:150-154 | crates/izwi-core/src/engine/executor/handler_chatterbox.rs:100-104 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:115-119 | crates/izwi-core/src/engine/executor/handler_tts.rs:1293-1297 | crates/izwi-core/src/engine/executor/handler_tts.rs:3038-3042 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:562` it begins part-way through the construct above it, so those exact lines 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 × 7) crates/izwi-core/src/kernels/cuda/gdn.rs:872 — crates/izwi-core/src/kernels/cuda/gdn.rs:872-876 | crates/izwi-core/src/kernels/cuda/gdn.rs:1000-1004 | crates/izwi-core/src/kernels/cuda/gdn.rs:1081-1085 | crates/izwi-core/src/kernels/cuda/gdn.rs:1167-1171 | crates/izwi-core/src/kernels/cuda/rope.rs:512-516 | crates/izwi-core/src/kernels/cuda/rope.rs:613-617 | crates/izwi-core/src/kernels/cuda/rope.rs:706-710 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart.
R10 · Code Duplication · Duplicated block (32 lines × 2 locations) · ×2
  • Duplicated block (32 lines × 2 locations) ui/src/features/text-to-speech/support.ts:49 — ui/src/features/text-to-speech/support.ts:49 · ui/src/features/transcription/playground/support.ts:158 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (32 lines × 2 locations) ui/src/shared/api/audio.ts:2896 — ui/src/shared/api/audio.ts:2896 · ui/src/shared/api/audio.ts:3024 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (24 lines × 2 locations) · ×2
  • Duplicated block (24 lines × 2 locations) ui/src/features/settings/route.tsx:672 — ui/src/features/settings/route.tsx:672 · ui/src/features/settings/route.tsx:705 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (24 lines × 2 locations) ui/src/shared/api/audio.ts:1542 — ui/src/shared/api/audio.ts:1542 · ui/src/shared/api/audio.ts:3153 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×2
  • Duplicated block (21 lines × 2 locations) ui/src/shared/api/audio.ts:1749 — ui/src/shared/api/audio.ts:1749 · ui/src/shared/api/audio.ts:2551 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (21 lines × 2 locations) ui/src/shared/api/audio.ts:2463 — ui/src/shared/api/audio.ts:2463 · ui/src/shared/api/audio.ts:2496 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×2
  • Duplicated block (20 lines × 2 locations) ui/src/features/diarization/components/NewDiarizationModal.tsx:236 — ui/src/features/diarization/components/NewDiarizationModal.tsx:236 · ui/src/features/transcription/components/NewTranscriptionModal.tsx:183 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (20 lines × 2 locations) ui/src/shared/api/audio.ts:2214 — ui/src/shared/api/audio.ts:2214 · ui/src/shared/api/audio.ts:2408 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (19 lines × 2 locations) · ×2
  • Duplicated block (19 lines × 2 locations) ui/src/features/diarization/components/NewDiarizationModal.tsx:756 — ui/src/features/diarization/components/NewDiarizationModal.tsx:756 · ui/src/features/transcription/components/NewTranscriptionModal.tsx:673 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (19 lines × 2 locations) ui/src/shared/api/audio.ts:2110 — ui/src/shared/api/audio.ts:2110 · ui/src/shared/api/audio.ts:2183 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×2
  • Duplicated block (18 lines × 2 locations) ui/src/features/diarization/components/DiarizationRecordDetail.tsx:413 — ui/src/features/diarization/components/DiarizationRecordDetail.tsx:413 · ui/src/features/diarization/components/DiarizationRecordDetail.tsx:432 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
  • Duplicated block (18 lines × 2 locations) ui/src/features/transcription/playground/support.ts:80 — ui/src/features/transcription/playground/support.ts:80 · ui/src/utils/diarizationSummary.ts:3 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×2
  • Recursive walk over a caller-supplied document has no depth cap crates/izwi-server/src/app/media_stream.rs:126 — `session_spec` is public, takes a document from its caller (line 86) and hands it to `merge`, which calls itself at line 126 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `merge` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/izwi-model-catalog/src/chat/tools/json.rs:19 — `write_python_json` is public and takes `value: &Value` from its caller, and it calls itself at line 19 with a piece of the document (and at line 31) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `write_python_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X2 · Cancellation propagation · Async function without AbortSignal · ×2
  • Async function without AbortSignal: downloadAudioFile ui/src/shared/api/audio.ts:1936 — `downloadAudioFile` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: updateSpeechTextJob ui/src/shared/api/audio.ts:2619 — `updateSpeechTextJob` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D1 · Cyclomatic Complexity · NewTextToSpeechModal.NewTextToSpeechModal (cyclomatic 167) · ×1
  • NewTextToSpeechModal.NewTextToSpeechModal (cyclomatic 167) ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:144 — NewTextToSpeechModal.NewTextToSpeechModal has cyclomatic complexity 167 (threshold 15). Of this number, 83 points are the body's own statements and 84 belong to 18 function literals 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.
D1 · Cyclomatic Complexity · route.TranscriptionPage (cyclomatic 127) · ×1
  • route.TranscriptionPage (cyclomatic 127) ui/src/features/transcription/route.tsx:96 — route.TranscriptionPage has cyclomatic complexity 127 (threshold 15). Of this number, 41 points are the body's own statements and 86 belong to 33 function literals 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.
D1 · Cyclomatic Complexity · NewDiarizationModal.NewDiarizationModal (cyclomatic 117) · ×1
  • NewDiarizationModal.NewDiarizationModal (cyclomatic 117) ui/src/features/diarization/components/NewDiarizationModal.tsx:137 — NewDiarizationModal.NewDiarizationModal has cyclomatic complexity 117 (threshold 15). Of this number, 54 points are the body's own statements and 63 belong to 21 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · ModelCatalogProvider.ModelCatalogProvider (cyclomatic 109) · ×1
  • ModelCatalogProvider.ModelCatalogProvider (cyclomatic 109) ui/src/app/providers/ModelCatalogProvider.tsx:177 — ModelCatalogProvider.ModelCatalogProvider has cyclomatic complexity 109 (threshold 15). Most of this is not in the body itself: 1 of the 109 points is its own statement and the rest belongs to 37 function literals inside it that branch (lines 478, 917, 1024, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NewTranscriptionModal.NewTranscriptionModal (cyclomatic 108) · ×1
  • NewTranscriptionModal.NewTranscriptionModal (cyclomatic 108) ui/src/features/transcription/components/NewTranscriptionModal.tsx:121 — NewTranscriptionModal.NewTranscriptionModal has cyclomatic complexity 108 (threshold 15). Of this number, 44 points are the body's own statements and 64 belong to 20 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.
D1 · Cyclomatic Complexity · route.TextToSpeechPage (cyclomatic 94) · ×1
  • route.TextToSpeechPage (cyclomatic 94) ui/src/features/text-to-speech/route.tsx:58 — route.TextToSpeechPage has cyclomatic complexity 94 (threshold 15). Of this number, 18 points are the body's own statements and 76 belong to 20 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · izwi_model_catalog · ×1
  • izwi_model_catalog::catalog::variant::resolve_by_heuristic (cyclomatic 89) crates/izwi-model-catalog/src/catalog/variant.rs:674 — izwi_model_catalog::catalog::variant::resolve_by_heuristic has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Projection · ×1
  • Projection::cuda_fwd (cyclomatic 85) crates/izwi-core/src/kernels/cuda/fp8.rs:1123 — Projection::cuda_fwd 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.
D1 · Cyclomatic Complexity · route.SettingsPage (cyclomatic 85) · ×1
  • route.SettingsPage (cyclomatic 85) ui/src/features/settings/route.tsx:462 — route.SettingsPage has cyclomatic complexity 85 (threshold 15). Of this number, 47 points are the body's own statements and 38 belong to 9 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.
D1 · Cyclomatic Complexity · support.isVoiceRealtimeV2ServerEnvelope (cyclomatic 85) · ×1
  • support.isVoiceRealtimeV2ServerEnvelope (cyclomatic 85) ui/src/features/voice/realtime/support.ts:664 — support.isVoiceRealtimeV2ServerEnvelope has cyclomatic complexity 85 (threshold 15). Of this number, 83 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.
D1 · Cyclomatic Complexity · DiarizationRecordDetail.DiarizationRecordDetail (cyclomatic 80) · ×1
  • DiarizationRecordDetail.DiarizationRecordDetail (cyclomatic 80) ui/src/features/diarization/components/DiarizationRecordDetail.tsx:66 — DiarizationRecordDetail.DiarizationRecordDetail has cyclomatic complexity 80 (threshold 15). Of this number, 42 points are the body's own statements and 38 belong to 10 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.
D1 · Cyclomatic Complexity · useVoiceSession.useVoiceSession.handleVoiceRealtimeServerEvent (cyclomatic 79) · ×1
  • useVoiceSession.useVoiceSession.handleVoiceRealtimeServerEvent (cyclomatic 79) ui/src/features/voice/useVoiceSession.ts:613 — useVoiceSession.useVoiceSession.handleVoiceRealtimeServerEvent has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExecutionReport · ×1
  • ExecutionReport::validate_against (cyclomatic 77) crates/izwi-core/src/engine/execution.rs:2923 — ExecutionReport::validate_against has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CloneVoiceDialog.CloneVoiceDialog (cyclomatic 71) · ×1
  • CloneVoiceDialog.CloneVoiceDialog (cyclomatic 71) ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:134 — CloneVoiceDialog.CloneVoiceDialog has cyclomatic complexity 71 (threshold 15). Of this number, 38 points are the body's own statements and 33 belong to 11 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · route.VoicesPage (cyclomatic 70) · ×1
  • route.VoicesPage (cyclomatic 70) ui/src/features/voices/route.tsx:118 — route.VoicesPage has cyclomatic complexity 70 (threshold 15). Of this number, 31 points are the body's own statements and 39 belong to 16 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.
D1 · Cyclomatic Complexity · AssistantMessage.AssistantMessage (cyclomatic 69) · ×1
  • AssistantMessage.AssistantMessage (cyclomatic 69) ui/src/features/chat/components/messages/AssistantMessage.tsx:87 — AssistantMessage.AssistantMessage has cyclomatic complexity 69 (threshold 15). Of this number, 67 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · ScriptParagraph.ScriptParagraph (cyclomatic 69) · ×1
  • ScriptParagraph.ScriptParagraph (cyclomatic 69) ui/src/features/studio/components/ScriptParagraph.tsx:95 — ScriptParagraph.ScriptParagraph has cyclomatic complexity 69 (threshold 15). Of this number, 21 points are the body's own statements and 48 belong to 12 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · AppLayout.AppShell (cyclomatic 67) · ×1
  • AppLayout.AppShell (cyclomatic 67) ui/src/app/layouts/AppLayout.tsx:149 — AppLayout.AppShell has cyclomatic complexity 67 (threshold 15). Of this number, 36 points are the body's own statements and 31 belong to 12 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · Engine · ×1
  • Engine::retain_incremental_model_identity (cyclomatic 66) crates/izwi-core/src/engine/mod.rs:1795 — Engine::retain_incremental_model_identity has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TranscriptionReviewWorkspace.TranscriptionReviewWorkspace (cyclomatic 59) · ×1
  • TranscriptionReviewWorkspace.TranscriptionReviewWorkspace (cyclomatic 59) ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:80 — TranscriptionReviewWorkspace.TranscriptionReviewWorkspace has cyclomatic complexity 59 (threshold 15). Of this number, 36 points are the body's own statements and 23 belong to 12 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.
D1 · Cyclomatic Complexity · FirstRunOnboarding.FirstRunOnboarding (cyclomatic 58) · ×1
  • FirstRunOnboarding.FirstRunOnboarding (cyclomatic 58) ui/src/app/onboarding/FirstRunOnboarding.tsx:210 — FirstRunOnboarding.FirstRunOnboarding has cyclomatic complexity 58 (threshold 15). Of this number, 32 points are the body's own statements and 26 belong to 17 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · DiarizationReviewWorkspace.DiarizationReviewWorkspace (cyclomatic 58) · ×1
  • DiarizationReviewWorkspace.DiarizationReviewWorkspace (cyclomatic 58) ui/src/components/DiarizationReviewWorkspace.tsx:165 — DiarizationReviewWorkspace.DiarizationReviewWorkspace has cyclomatic complexity 58 (threshold 15). Of this number, 24 points are the body's own statements and 34 belong to 17 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · StudioEditor.StudioEditor (cyclomatic 54) · ×1
  • StudioEditor.StudioEditor (cyclomatic 54) ui/src/features/studio/components/StudioEditor.tsx:66 — StudioEditor.StudioEditor has cyclomatic complexity 54 (threshold 15). Of this number, 19 points are the body's own statements and 35 belong to 13 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · TextToSpeechRecordDetail.TextToSpeechRecordDetail (cyclomatic 53) · ×1
  • TextToSpeechRecordDetail.TextToSpeechRecordDetail (cyclomatic 53) ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:126 — TextToSpeechRecordDetail.TextToSpeechRecordDetail has cyclomatic complexity 53 (threshold 15). Of this number, 37 points are the body's own statements and 16 belong to 5 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · CudaPagedDecodeOp · ×1
  • CudaPagedDecodeOp::cuda_fwd (cyclomatic 52) crates/izwi-core/src/kernels/cuda.rs:3241 — CudaPagedDecodeOp::cuda_fwd has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TranscriptionRecordDetail.TranscriptionRecordDetail (cyclomatic 50) · ×1
  • TranscriptionRecordDetail.TranscriptionRecordDetail (cyclomatic 50) ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:176 — TranscriptionRecordDetail.TranscriptionRecordDetail has cyclomatic complexity 50 (threshold 15). Of this number, 41 points are the body's own statements and 9 belong to 6 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.
D1 · Cyclomatic Complexity · BatchWorkerRunner · ×1
  • BatchWorkerRunner::run_once (cyclomatic 48) crates/izwi-server/src/batch_runtime/worker.rs:661 — BatchWorkerRunner::run_once 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.
D1 · Cyclomatic Complexity · support.isVoiceRealtimeServerEvent (cyclomatic 48) · ×1
  • support.isVoiceRealtimeServerEvent (cyclomatic 48) ui/src/features/voice/realtime/support.ts:1017 — support.isVoiceRealtimeServerEvent has cyclomatic complexity 48 (threshold 15). Of this number, 46 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · DesignVoiceDialog.DesignVoiceDialog (cyclomatic 47) · ×1
  • DesignVoiceDialog.DesignVoiceDialog (cyclomatic 47) ui/src/features/voice-studio/components/DesignVoiceDialog.tsx:83 — DesignVoiceDialog.DesignVoiceDialog has cyclomatic complexity 47 (threshold 15). Of this number, 20 points are the body's own statements and 27 belong to 7 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.
D1 · Cyclomatic Complexity · support.normalizeVoiceRealtimeV2Event (cyclomatic 47) · ×1
  • support.normalizeVoiceRealtimeV2Event (cyclomatic 47) ui/src/features/voice/realtime/support.ts:842 — support.normalizeVoiceRealtimeV2Event 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.
D1 · Cyclomatic Complexity · route.VoicePage (cyclomatic 47) · ×1
  • route.VoicePage (cyclomatic 47) ui/src/features/voice/route.tsx:73 — route.VoicePage has cyclomatic complexity 47 (threshold 15). Of this number, 28 points are the body's own statements and 19 belong to 6 function literals 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.
D1 · Cyclomatic Complexity · InferenceCoordinator · ×1
  • InferenceCoordinator::run_loaded_native_preparation_batch_in_parts (cyclomatic 46) crates/izwi-core/src/runtime/coordinator.rs:1805 — InferenceCoordinator::run_loaded_native_preparation_batch_in_parts has cyclomatic complexity 46 (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.
D1 · Cyclomatic Complexity · AppUpdateProvider.AppUpdateProvider (cyclomatic 43) · ×1
  • AppUpdateProvider.AppUpdateProvider (cyclomatic 43) ui/src/app/providers/AppUpdateProvider.tsx:74 — AppUpdateProvider.AppUpdateProvider has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 2 of the 43 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 135, 248, 269, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TextToSpeechHistoryTable.TextToSpeechHistoryTable (cyclomatic 43) · ×1
  • TextToSpeechHistoryTable.TextToSpeechHistoryTable (cyclomatic 43) ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx:87 — TextToSpeechHistoryTable.TextToSpeechHistoryTable has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 3 of the 43 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 372, a function literal at line 287, handleCopy, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · izwi_db · ×1
  • izwi_db::migrator::apply_migration (cyclomatic 42) REDACTED:142 — izwi_db::migrator::apply_migration has cyclomatic complexity 42 (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.
D1 · Cyclomatic Complexity · ChatPlayground.ChatPlayground · ×1
  • ChatPlayground.ChatPlayground::renderComposer (cyclomatic 42) ui/src/features/chat/components/ChatPlayground.tsx:1669 — ChatPlayground.ChatPlayground::renderComposer has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ChatPlayground.ChatPlayground) 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.
D1 · Cyclomatic Complexity · ChatPlayground.ChatPlayground (cyclomatic 40) · ×1
  • ChatPlayground.ChatPlayground (cyclomatic 40) ui/src/features/chat/components/ChatPlayground.tsx:167 — ChatPlayground.ChatPlayground 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. This shape REPEATS in the file: one other method here (ChatPlayground.ChatPlayground::renderComposer) 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.
D1 · Cyclomatic Complexity · LoadedCapabilityDescriptor · ×1
  • LoadedCapabilityDescriptor::new (cyclomatic 39) crates/izwi-core/src/runtime/adapters/loaded/descriptor.rs:80 — LoadedCapabilityDescriptor::new has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · route.DictationSettingsView (cyclomatic 39) · ×1
  • route.DictationSettingsView (cyclomatic 39) ui/src/features/dictation/route.tsx:271 — route.DictationSettingsView has cyclomatic complexity 39 (threshold 15). Of this number, 29 points are the body's own statements and 10 belong to 8 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · route.MyModelsPage (cyclomatic 39) · ×1
  • route.MyModelsPage (cyclomatic 39) ui/src/features/models/route.tsx:153 — route.MyModelsPage has cyclomatic complexity 39 (threshold 15). Of this number, 24 points are the body's own statements and 15 belong to 6 function literals 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.
D1 · Cyclomatic Complexity · DiarizationQualityPanel.DiarizationQualityPanel (cyclomatic 38) · ×1
  • DiarizationQualityPanel.DiarizationQualityPanel (cyclomatic 38) ui/src/components/DiarizationQualityPanel.tsx:60 — DiarizationQualityPanel.DiarizationQualityPanel has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 7 of the 38 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 95, a function literal at line 157, handleSubmit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · NodeConfig · ×1
  • NodeConfig::validate (cyclomatic 36) crates/izwi-serving-supervisor/src/config.rs:79 — NodeConfig::validate 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.
D1 · Cyclomatic Complexity · StreamingInputState · ×1
  • StreamingInputState::handle_pcm16_frame (cyclomatic 34) crates/izwi-server/src/app/voice_realtime/input.rs:241 — StreamingInputState::handle_pcm16_frame 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.
D1 · Cyclomatic Complexity · ModelListRow.ModelListRow (cyclomatic 34) · ×1
  • ModelListRow.ModelListRow (cyclomatic 34) ui/src/features/models/components/ModelListRow.tsx:186 — ModelListRow.ModelListRow 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.
D1 · Cyclomatic Complexity · DialogueEditor.DialogueEditor (cyclomatic 34) · ×1
  • DialogueEditor.DialogueEditor (cyclomatic 34) ui/src/features/text-to-speech/components/DialogueEditor.tsx:58 — DialogueEditor.DialogueEditor has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 7 of the 34 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 275, a function literal at line 145, a function literal at line 189, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CudaPagedPrefillOp · ×1
  • CudaPagedPrefillOp::cuda_fwd (cyclomatic 33) crates/izwi-core/src/kernels/cuda.rs:3087 — CudaPagedPrefillOp::cuda_fwd 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.
D1 · Cyclomatic Complexity · ServeRuntimeConfig · ×1
  • ServeRuntimeConfig::apply_overrides (cyclomatic 33) crates/izwi-core/src/serve_runtime.rs:179 — ServeRuntimeConfig::apply_overrides has cyclomatic complexity 33 (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.
D1 · Cyclomatic Complexity · SetupChecklist.SetupChecklist (cyclomatic 33) · ×1
  • SetupChecklist.SetupChecklist (cyclomatic 33) ui/src/features/dictation/components/SetupChecklist.tsx:119 — SetupChecklist.SetupChecklist has cyclomatic complexity 33 (threshold 15). Of this number, 28 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · StageDescriptor · ×1
  • StageDescriptor::validate (cyclomatic 32) crates/izwi-core/src/engine/execution.rs:664 — StageDescriptor::validate has cyclomatic complexity 32 (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.
D1 · Cyclomatic Complexity · SessionConfig · ×1
  • SessionConfig::apply_update (cyclomatic 32) crates/izwi-server/src/app/openai_realtime/session_config.rs:804 — SessionConfig::apply_update 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.
D1 · Cyclomatic Complexity · RuntimeChatInvocationDriver · ×1
  • RuntimeChatInvocationDriver::drive_until_terminal (cyclomatic 31) crates/izwi-core/src/runtime/service/chat_invocation.rs:434 — RuntimeChatInvocationDriver::drive_until_terminal 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.
D1 · Cyclomatic Complexity · TranscriptionHistoryTable.TranscriptionHistoryTable (cyclomatic 31) · ×1
  • TranscriptionHistoryTable.TranscriptionHistoryTable (cyclomatic 31) ui/src/features/transcription/components/TranscriptionHistoryTable.tsx:302 — TranscriptionHistoryTable.TranscriptionHistoryTable has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (handleCopy, handleExport, handleConfirmDelete, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CliOptions · ×1
  • CliOptions::parse (cyclomatic 30) crates/izwi-serving-supervisor/src/daemon/cli.rs:38 — CliOptions::parse 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.
D1 · Cyclomatic Complexity · support.parseUserMessageDisplayFromContentParts (cyclomatic 30) · ×1
  • support.parseUserMessageDisplayFromContentParts (cyclomatic 30) ui/src/features/chat/playground/support.ts:760 — support.parseUserMessageDisplayFromContentParts 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.
D1 · Cyclomatic Complexity · AgentEngine · ×1
  • AgentEngine::run_conversation (cyclomatic 29) crates/izwi-agent/src/engine.rs:229 — AgentEngine::run_conversation 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.
D1 · Cyclomatic Complexity · RouteModelModal.RouteModelModal (cyclomatic 29) · ×1
  • RouteModelModal.RouteModelModal (cyclomatic 29) ui/src/features/models/components/RouteModelModal.tsx:130 — RouteModelModal.RouteModelModal has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 267, a function literal at line 247, a function literal at line 162, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PagedDecodeAttentionOp · ×1
  • PagedDecodeAttentionOp::metal_fwd (cyclomatic 28) crates/izwi-core/src/kernels/metal.rs:2267 — PagedDecodeAttentionOp::metal_fwd 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.
D1 · Cyclomatic Complexity · InvocationRequest · ×1
  • InvocationRequest::validate (cyclomatic 28) crates/izwi-serving-protocol/src/types.rs:713 — InvocationRequest::validate 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.
D1 · Cyclomatic Complexity · NotificationItem.NotificationItem (cyclomatic 28) · ×1
  • NotificationItem.NotificationItem (cyclomatic 28) ui/src/app/providers/NotificationItem.tsx:51 — NotificationItem.NotificationItem has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · StudioVoicePicker.StudioVoicePicker (cyclomatic 28) · ×1
  • StudioVoicePicker.StudioVoicePicker (cyclomatic 28) ui/src/features/studio/components/StudioVoicePicker.tsx:76 — StudioVoicePicker.StudioVoicePicker has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 154, 94, 209, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · agentSettings.parseVoiceAgentSettings (cyclomatic 28) · ×1
  • agentSettings.parseVoiceAgentSettings (cyclomatic 28) ui/src/features/voice/agentSettings.ts:104 — agentSettings.parseVoiceAgentSettings has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · VoiceSettingsSheet.MainView (cyclomatic 28) · ×1
  • VoiceSettingsSheet.MainView (cyclomatic 28) ui/src/features/voice/components/VoiceSettingsSheet.tsx:158 — VoiceSettingsSheet.MainView has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 belong to 4 function literals 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.
D1 · Cyclomatic Complexity · SpeechPump · ×1
  • SpeechPump::run (cyclomatic 27) crates/izwi-server/src/api/openai/audio/speech.rs:1363 — SpeechPump::run has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useVoiceSession.useVoiceSession.start (cyclomatic 27) · ×1
  • useVoiceSession.useVoiceSession.start (cyclomatic 27) ui/src/features/voice/useVoiceSession.ts:1189 — useVoiceSession.useVoiceSession.start has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1273, 1336, 1321, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: useVoiceSession.useVoiceSession.ensureVoiceRealtimeSocket (cyclomatic 29) 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.
D1 · Cyclomatic Complexity · PhysicalBatchReport · ×1
  • PhysicalBatchReport::validate_against (cyclomatic 26) crates/izwi-core/src/engine/execution.rs:2540 — PhysicalBatchReport::validate_against 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.
D1 · Cyclomatic Complexity · DeliveryLane · ×1
  • DeliveryLane::run (cyclomatic 26) crates/izwi-core/src/engine/mod.rs:542 — DeliveryLane::run 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.
D1 · Cyclomatic Complexity · ToolCallParser · ×1
  • ToolCallParser::step (cyclomatic 26) crates/izwi-model-catalog/src/chat/tools/parse.rs:315 — ToolCallParser::step 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.
D1 · Cyclomatic Complexity · StudioExportDialog.StudioExportDialog (cyclomatic 26) · ×1
  • StudioExportDialog.StudioExportDialog (cyclomatic 26) ui/src/features/studio/components/StudioExportDialog.tsx:44 — StudioExportDialog.StudioExportDialog has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (save, a function literal at line 108, start, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PhysicalStateManager · ×1
  • PhysicalStateManager::prepare_unload_model_with_static_runtime_owners (cyclomatic 25) crates/izwi-core/src/engine/cache/physical.rs:969 — PhysicalStateManager::prepare_unload_model_with_static_runtime_owners 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.
D1 · Cyclomatic Complexity · PerformanceConfig · ×1
  • PerformanceConfig::apply_overrides (cyclomatic 24) crates/izwi-core/src/performance.rs:334 — PerformanceConfig::apply_overrides has cyclomatic complexity 24 (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.
D1 · Cyclomatic Complexity · ParakeetEncoderBatcher · ×1
  • ParakeetEncoderBatcher::run_batch (cyclomatic 24) crates/izwi-core/src/runtime/service/asr_encoders.rs:525 — ParakeetEncoderBatcher::run_batch 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.
D1 · Cyclomatic Complexity · WorkerConfig · ×1
  • WorkerConfig::validate (cyclomatic 24) crates/izwi-serving-worker/src/lib.rs:78 — WorkerConfig::validate has cyclomatic complexity 24 (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.
D1 · Cyclomatic Complexity · HistoryTable.HistoryTable (cyclomatic 24) · ×1
  • HistoryTable.HistoryTable (cyclomatic 24) ui/src/components/history/HistoryTable.tsx:56 — HistoryTable.HistoryTable has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to 3 function literals 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.
D1 · Cyclomatic Complexity · HotkeyRecorder.HotkeyRecorder (cyclomatic 24) · ×1
  • HotkeyRecorder.HotkeyRecorder (cyclomatic 24) ui/src/features/dictation/components/HotkeyRecorder.tsx:64 — HotkeyRecorder.HotkeyRecorder has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 5 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · AudioApiClient.consumeSpeechHistoryRecordStream · ×1
  • AudioApiClient.consumeSpeechHistoryRecordStream::startStream (cyclomatic 24) ui/src/shared/api/audio.ts:1821 — AudioApiClient.consumeSpeechHistoryRecordStream::startStream 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.
D1 · Cyclomatic Complexity · PagedPrefillAttentionOp · ×1
  • PagedPrefillAttentionOp::metal_fwd (cyclomatic 23) crates/izwi-core/src/kernels/metal.rs:2808 — PagedPrefillAttentionOp::metal_fwd 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.
D1 · Cyclomatic Complexity · routePresentation.documentTitleForLocation (cyclomatic 23) · ×1
  • routePresentation.documentTitleForLocation (cyclomatic 23) ui/src/app/router/routePresentation.ts:27 — routePresentation.documentTitleForLocation 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.
D1 · Cyclomatic Complexity · modelMetadata.getModelProviderLabel (cyclomatic 23) · ×1
  • modelMetadata.getModelProviderLabel (cyclomatic 23) ui/src/features/models/catalog/modelMetadata.ts:44 — modelMetadata.getModelProviderLabel 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.
D1 · Cyclomatic Complexity · Qwen35GatedDeltaSequenceOp · ×1
  • Qwen35GatedDeltaSequenceOp::metal_fwd (cyclomatic 22) crates/izwi-core/src/kernels/metal.rs:3958 — Qwen35GatedDeltaSequenceOp::metal_fwd 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.
D1 · Cyclomatic Complexity · ModelVariant · ×1
  • ModelVariant::cuda_quantization (cyclomatic 22) crates/izwi-model-catalog/src/catalog/cuda_support.rs:579 — ModelVariant::cuda_quantization 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.
D1 · Cyclomatic Complexity · ChatApiClient.chatCompletionsStream (cyclomatic 22) · ×1
  • ChatApiClient.chatCompletionsStream (cyclomatic 22) ui/src/shared/api/chat.ts:680 — ChatApiClient.chatCompletionsStream has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 721, startStream). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · izwi_asr_toolkit · ×1
  • izwi_asr_toolkit::plan_audio_chunks (cyclomatic 21) crates/izwi-asr-toolkit/src/lib.rs:162 — izwi_asr_toolkit::plan_audio_chunks 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.
D1 · Cyclomatic Complexity · ModelFamily · ×1
  • ModelFamily::prefix_reuse_support (cyclomatic 21) crates/izwi-model-catalog/src/catalog/prefix_reuse.rs:125 — ModelFamily::prefix_reuse_support has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · RuntimeCard.RuntimeCard (cyclomatic 21) · ×1
  • RuntimeCard.RuntimeCard (cyclomatic 21) ui/src/app/layouts/RuntimeCard.tsx:25 — RuntimeCard.RuntimeCard has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · VoiceLibraryGrid.VoicePreview (cyclomatic 21) · ×1
  • VoiceLibraryGrid.VoicePreview (cyclomatic 21) ui/src/features/voices/components/VoiceLibraryGrid.tsx:28 — VoiceLibraryGrid.VoicePreview has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · ChatApiClient.createResponseStream (cyclomatic 21) · ×1
  • ChatApiClient.createResponseStream (cyclomatic 21) ui/src/shared/api/chat.ts:823 — ChatApiClient.createResponseStream has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 863, startStream). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ManagedCacheReceipt · ×1
  • ManagedCacheReceipt::validate (cyclomatic 20) crates/izwi-core/src/engine/execution.rs:2166 — ManagedCacheReceipt::validate 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.
D1 · Cyclomatic Complexity · RelPosAttention · ×1
  • RelPosAttention::dims (cyclomatic 20) crates/izwi-core/src/kernels/relpos_attention.rs:129 — RelPosAttention::dims 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.
D1 · Cyclomatic Complexity · GraniteSpeechEncoderBatcher · ×1
  • GraniteSpeechEncoderBatcher::run_batch (cyclomatic 20) crates/izwi-core/src/runtime/service/asr_encoders.rs:1365 — GraniteSpeechEncoderBatcher::run_batch 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 (GraniteSpeech5EncoderBatcher::run_batch) 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.
D1 · Cyclomatic Complexity · GraniteSpeech5EncoderBatcher · ×1
  • GraniteSpeech5EncoderBatcher::run_batch (cyclomatic 20) crates/izwi-core/src/runtime/service/asr_encoders.rs:1629 — GraniteSpeech5EncoderBatcher::run_batch 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 (GraniteSpeechEncoderBatcher::run_batch) 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.
D1 · Cyclomatic Complexity · izwi_dictation · ×1
  • izwi_dictation::portal::portal_trigger (cyclomatic 20) crates/izwi-dictation/src/portal.rs:131 — izwi_dictation::portal::portal_trigger has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · SpeechTextUploadProgress.SpeechTextUploadProgress (cyclomatic 20) · ×1
  • SpeechTextUploadProgress.SpeechTextUploadProgress (cyclomatic 20) ui/src/features/speech-text/components/SpeechTextUploadProgress.tsx:62 — SpeechTextUploadProgress.SpeechTextUploadProgress 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.
D1 · Cyclomatic Complexity · ProjectSettingsSheet.ProjectSettingsSheet (cyclomatic 20) · ×1
  • ProjectSettingsSheet.ProjectSettingsSheet (cyclomatic 20) ui/src/features/studio/components/ProjectSettingsSheet.tsx:44 — ProjectSettingsSheet.ProjectSettingsSheet has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · SpeechPcmPlayer.push (cyclomatic 20) · ×1
  • SpeechPcmPlayer.push (cyclomatic 20) ui/src/features/text-to-speech/pcmPlayer.ts:34 — SpeechPcmPlayer.push has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal 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.
D1 · Cyclomatic Complexity · VoiceOrb.VoiceOrb (cyclomatic 20) · ×1
  • VoiceOrb.VoiceOrb (cyclomatic 20) ui/src/features/voice/components/VoiceOrb.tsx:14 — VoiceOrb.VoiceOrb has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · support.voiceRealtimePlaybackAction (cyclomatic 20) · ×1
  • support.voiceRealtimePlaybackAction (cyclomatic 20) ui/src/features/voice/realtime/support.ts:1181 — support.voiceRealtimePlaybackAction 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.
D1 · Cyclomatic Complexity · ChatApiClient.streamThreadTurn (cyclomatic 20) · ×1
  • ChatApiClient.streamThreadTurn (cyclomatic 20) ui/src/shared/api/chat.ts:509 — ChatApiClient.streamThreadTurn has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 562, startStream). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CpuKvArena · ×1
  • CpuKvArena::paged_prefill (cyclomatic 19) crates/izwi-core/src/backends/kv/cpu.rs:521 — CpuKvArena::paged_prefill has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · izwi_serving_client · ×1
  • izwi_serving_client::realtime::dial (cyclomatic 19) crates/izwi-serving-client/src/realtime.rs:236 — izwi_serving_client::realtime::dial has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · UpdateCard.UpdateCard (cyclomatic 19) · ×1
  • UpdateCard.UpdateCard (cyclomatic 19) ui/src/app/layouts/UpdateCard.tsx:23 — UpdateCard.UpdateCard 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.
D1 · Cyclomatic Complexity · firstRunPlan.modelDescriptor (cyclomatic 19) · ×1
  • firstRunPlan.modelDescriptor (cyclomatic 19) ui/src/app/onboarding/firstRunPlan.ts:369 — firstRunPlan.modelDescriptor 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.
D1 · Cyclomatic Complexity · GenerationStats.GenerationStats (cyclomatic 19) · ×1
  • GenerationStats.GenerationStats (cyclomatic 19) ui/src/components/GenerationStats.tsx:29 — GenerationStats.GenerationStats 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.
D1 · Cyclomatic Complexity · AudioPlayer.AudioPlayer (cyclomatic 19) · ×1
  • AudioPlayer.AudioPlayer (cyclomatic 19) ui/src/components/audio/AudioPlayer.tsx:56 — AudioPlayer.AudioPlayer has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · DiarizationSpeakersTable.DiarizationSpeakersTable (cyclomatic 19) · ×1
  • DiarizationSpeakersTable.DiarizationSpeakersTable (cyclomatic 19) ui/src/features/diarization/components/DiarizationSpeakersTable.tsx:151 — DiarizationSpeakersTable.DiarizationSpeakersTable has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 235, a function literal at line 172, displayName). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useSpeechStreamPlayback.useSpeechStreamPlayback.begin (cyclomatic 19) · ×1
  • useSpeechStreamPlayback.useSpeechStreamPlayback.begin (cyclomatic 19) ui/src/features/text-to-speech/hooks/useSpeechStreamPlayback.ts:53 — useSpeechStreamPlayback.useSpeechStreamPlayback.begin has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 107, 58, 100, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useVoicePreferences.useVoicePreferences (cyclomatic 19) · ×1
  • useVoicePreferences.useVoicePreferences (cyclomatic 19) ui/src/features/voice/useVoicePreferences.ts:46 — useVoicePreferences.useVoicePreferences has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 102, 153, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NotificationProvider.NotificationProvider (cyclomatic 18) · ×1
  • NotificationProvider.NotificationProvider (cyclomatic 18) ui/src/app/providers/NotificationProvider.tsx:196 — NotificationProvider.NotificationProvider has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 250, 235, 278, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · UserMessage.UserMessage (cyclomatic 18) · ×1
  • UserMessage.UserMessage (cyclomatic 18) ui/src/features/chat/components/messages/UserMessage.tsx:99 — UserMessage.UserMessage has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function literal 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.
D1 · Cyclomatic Complexity · AudioApiClient.asrTranscribeStream (cyclomatic 18) · ×1
  • AudioApiClient.asrTranscribeStream (cyclomatic 18) ui/src/shared/api/audio.ts:3064 — AudioApiClient.asrTranscribeStream has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 3092, startStream). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CandleAcceleratorKvArena · ×1
  • CandleAcceleratorKvArena::zero_pages (cyclomatic 17) crates/izwi-core/src/backends/kv/accelerator.rs:2175 — CandleAcceleratorKvArena::zero_pages has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · InvocationTensorArena · ×1
  • InvocationTensorArena::new (cyclomatic 17) crates/izwi-core/src/backends/state/invocation.rs:150 — InvocationTensorArena::new has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · ChunkedAsrRun · ×1
  • ChunkedAsrRun::run_chunk (cyclomatic 17) crates/izwi-core/src/engine/executor/audio.rs:1051 — ChunkedAsrRun::run_chunk has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · NemotronEncoderBatcher · ×1
  • NemotronEncoderBatcher::run_batch (cyclomatic 17) crates/izwi-core/src/runtime/service/asr_encoders.rs:884 — NemotronEncoderBatcher::run_batch has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · WorkerClientTlsConfig · ×1
  • WorkerClientTlsConfig::from_pem (cyclomatic 17) crates/izwi-serving-client/src/lib.rs:57 — WorkerClientTlsConfig::from_pem 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.
D1 · Cyclomatic Complexity · PreparedPhysicalDispatch · ×1
  • PreparedPhysicalDispatch::new (cyclomatic 16) crates/izwi-core/src/engine/execution_group.rs:76 — PreparedPhysicalDispatch::new 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.
D1 · Cyclomatic Complexity · izwi_desktop · ×1
  • izwi_desktop::app::run (cyclomatic 16) crates/izwi-desktop/src/app/mod.rs:68 — izwi_desktop::app::run 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.
D1 · Cyclomatic Complexity · WorkerRegistry · ×1
  • WorkerRegistry::select_and_reserve_routed (cyclomatic 16) crates/izwi-gateway/src/worker_registry.rs:852 — WorkerRegistry::select_and_reserve_routed 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.
D1 · Cyclomatic Complexity · SpeechTextPlan · ×1
  • SpeechTextPlan::fish (cyclomatic 16) crates/izwi-server/src/api/tts_long_form.rs:438 — SpeechTextPlan::fish 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.
D1 · Cyclomatic Complexity · SpeechHistoryStore · ×1
  • SpeechHistoryStore::complete_record_inner (cyclomatic 16) crates/izwi-server/src/speech_history_store.rs:1136 — SpeechHistoryStore::complete_record_inner 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.
D1 · Cyclomatic Complexity · Actor · ×1
  • Actor::run (cyclomatic 16) crates/izwi-serving-supervisor/src/actor.rs:328 — Actor::run has cyclomatic complexity 16 (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.
D1 · Cyclomatic Complexity · diarizationTranscript.aggregateRawSpeakerSummaries (cyclomatic 16) · ×1
  • diarizationTranscript.aggregateRawSpeakerSummaries (cyclomatic 16) REDACTED:205 — diarizationTranscript.aggregateRawSpeakerSummaries has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · route.DiarizationPage (cyclomatic 16) · ×1
  • route.DiarizationPage (cyclomatic 16) ui/src/features/diarization/route.tsx:58 — route.DiarizationPage has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 172, 253, 101, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · statusText.resultText (cyclomatic 16) · ×1
  • statusText.resultText (cyclomatic 16) ui/src/features/dictation/statusText.ts:24 — statusText.resultText has cyclomatic complexity 16 (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.
D1 · Cyclomatic Complexity · NewStudioProjectDialog.NewStudioProjectDialog (cyclomatic 16) · ×1
  • NewStudioProjectDialog.NewStudioProjectDialog (cyclomatic 16) ui/src/features/studio/components/NewStudioProjectDialog.tsx:32 — NewStudioProjectDialog.NewStudioProjectDialog has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (submit, importFile, a function literal at line 59, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · VoiceSettingsSheet.EngineView (cyclomatic 16) · ×1
  • VoiceSettingsSheet.EngineView (cyclomatic 16) ui/src/features/voice/components/VoiceSettingsSheet.tsx:576 — VoiceSettingsSheet.EngineView has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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.
D2 · Cognitive Complexity · NewTextToSpeechModal.NewTextToSpeechModal (cognitive 223) · ×1
  • NewTextToSpeechModal.NewTextToSpeechModal (cognitive 223) ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:144 — NewTextToSpeechModal.NewTextToSpeechModal has cognitive complexity 223 (threshold 15). Drivers by points: ternaries 76 (131 pts), boolean chains 47, if/else 35 (40 pts), error handling 4 (5 pts) (nesting depth added 61). Of this number, 128 points are the body's own statements and 95 belong to 18 function literals 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.
D2 · Cognitive Complexity · route.TranscriptionPage (cognitive 169) · ×1
  • route.TranscriptionPage (cognitive 169) ui/src/features/transcription/route.tsx:96 — route.TranscriptionPage has cognitive complexity 169 (threshold 15). Drivers by points: ternaries 54 (89 pts), if/else 34 (43 pts), boolean chains 30, error handling 5, loops 1, match/switch 1 (nesting depth added 44). Of this number, 54 points are the body's own statements and 115 belong to 33 function literals 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.
D2 · Cognitive Complexity · NewTranscriptionModal.NewTranscriptionModal (cognitive 136) · ×1
  • NewTranscriptionModal.NewTranscriptionModal (cognitive 136) ui/src/features/transcription/components/NewTranscriptionModal.tsx:121 — NewTranscriptionModal.NewTranscriptionModal has cognitive complexity 136 (threshold 15). Drivers by points: ternaries 44 (65 pts), if/else 25 (36 pts), boolean chains 31, error handling 2 (4 pts) (nesting depth added 34). Of this number, 46 points are the body's own statements and 90 belong to 20 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.
D2 · Cognitive Complexity · NewDiarizationModal.NewDiarizationModal (cognitive 125) · ×1
  • NewDiarizationModal.NewDiarizationModal (cognitive 125) ui/src/features/diarization/components/NewDiarizationModal.tsx:137 — NewDiarizationModal.NewDiarizationModal has cognitive complexity 125 (threshold 15). Drivers by points: ternaries 36 (50 pts), boolean chains 37, if/else 28 (32 pts), error handling 4 (5 pts), loops 1 (nesting depth added 19). Of this number, 53 points are the body's own statements and 72 belong to 21 function literals inside it that branch. 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.
D2 · Cognitive Complexity · Projection · ×1
  • Projection::cuda_fwd (cognitive 122) crates/izwi-core/src/kernels/cuda/fp8.rs:1123 — Projection::cuda_fwd has cognitive complexity 122 (threshold 15). Drivers by points: if/else 54 (84 pts), boolean chains 19, match/switch 13 (19 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.SettingsPage (cognitive 120) · ×1
  • route.SettingsPage (cognitive 120) ui/src/features/settings/route.tsx:462 — route.SettingsPage has cognitive complexity 120 (threshold 15). Drivers by points: ternaries 47 (87 pts), if/else 12 (15 pts), boolean chains 12, error handling 6 (nesting depth added 43). Of this number, 81 points are the body's own statements and 39 belong to 9 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.
D2 · Cognitive Complexity · izwi_model_catalog · ×1
  • izwi_model_catalog::catalog::variant::resolve_by_heuristic (cognitive 115) crates/izwi-model-catalog/src/catalog/variant.rs:674 — izwi_model_catalog::catalog::variant::resolve_by_heuristic has cognitive complexity 115 (threshold 15). Drivers by points: if/else 53 (78 pts), boolean chains 32, match/switch 3 (5 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.
D2 · Cognitive Complexity · ModelCatalogProvider.ModelCatalogProvider (cognitive 99) · ×1
  • ModelCatalogProvider.ModelCatalogProvider (cognitive 99) ui/src/app/providers/ModelCatalogProvider.tsx:177 — ModelCatalogProvider.ModelCatalogProvider has cognitive complexity 99 (threshold 15). Drivers by points: if/else 39 (46 pts), ternaries 19 (27 pts), boolean chains 17, error handling 7, loops 2 (nesting depth added 15). None of this is in the body itself: all 99 points belong to 37 function literals inside it that branch (lines 917, 1024, 786, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Engine · ×1
  • Engine::retain_incremental_model_identity (cognitive 96) crates/izwi-core/src/engine/mod.rs:1795 — Engine::retain_incremental_model_identity has cognitive complexity 96 (threshold 15). Drivers by points: if/else 27 (57 pts), match/switch 24 (28 pts), boolean chains 11 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.TextToSpeechPage (cognitive 94) · ×1
  • route.TextToSpeechPage (cognitive 94) ui/src/features/text-to-speech/route.tsx:58 — route.TextToSpeechPage has cognitive complexity 94 (threshold 15). Drivers by points: boolean chains 35, if/else 30 (32 pts), ternaries 16 (24 pts), error handling 3 (nesting depth added 10). Of this number, 19 points are the body's own statements and 75 belong to 20 function items inside it that branch. 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.
D2 · Cognitive Complexity · route.VoicesPage (cognitive 89) · ×1
  • route.VoicesPage (cognitive 89) ui/src/features/voices/route.tsx:118 — route.VoicesPage has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 31 (56 pts), boolean chains 15, if/else 14, error handling 4 (nesting depth added 25). Of this number, 49 points are the body's own statements and 40 belong to 16 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.
D2 · Cognitive Complexity · ExecutionReport · ×1
  • ExecutionReport::validate_against (cognitive 85) crates/izwi-core/src/engine/execution.rs:2923 — ExecutionReport::validate_against has cognitive complexity 85 (threshold 15). Drivers by points: if/else 33 (56 pts), boolean chains 26, match/switch 3 (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.
D2 · Cognitive Complexity · DiarizationRecordDetail.DiarizationRecordDetail (cognitive 81) · ×1
  • DiarizationRecordDetail.DiarizationRecordDetail (cognitive 81) ui/src/features/diarization/components/DiarizationRecordDetail.tsx:66 — DiarizationRecordDetail.DiarizationRecordDetail has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 35 (51 pts), boolean chains 16, if/else 7, error handling 5, match/switch 2 (nesting depth added 16). Of this number, 49 points are the body's own statements and 32 belong to 10 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.
D2 · Cognitive Complexity · TranscriptionReviewWorkspace.TranscriptionReviewWorkspace (cognitive 79) · ×1
  • TranscriptionReviewWorkspace.TranscriptionReviewWorkspace (cognitive 79) ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:80 — TranscriptionReviewWorkspace.TranscriptionReviewWorkspace has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 36 (54 pts), boolean chains 13, if/else 9 (12 pts) (nesting depth added 21). Of this number, 45 points are the body's own statements and 34 belong to 12 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.
D2 · Cognitive Complexity · CudaPagedDecodeOp · ×1
  • CudaPagedDecodeOp::cuda_fwd (cognitive 77) crates/izwi-core/src/kernels/cuda.rs:3241 — CudaPagedDecodeOp::cuda_fwd has cognitive complexity 77 (threshold 15). Drivers by points: if/else 40 (70 pts), match/switch 7 (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.
D2 · Cognitive Complexity · LoadedCapabilityDescriptor · ×1
  • LoadedCapabilityDescriptor::new (cognitive 77) crates/izwi-core/src/runtime/adapters/loaded/descriptor.rs:80 — LoadedCapabilityDescriptor::new has cognitive complexity 77 (threshold 15). Drivers by points: if/else 19 (49 pts), match/switch 6 (14 pts), boolean chains 7, loops 4 (7 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeliveryLane · ×1
  • DeliveryLane::run (cognitive 74) crates/izwi-core/src/engine/mod.rs:542 — DeliveryLane::run has cognitive complexity 74 (threshold 15). Drivers by points: if/else 13 (43 pts), match/switch 8 (25 pts), loops 3 (6 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScriptParagraph.ScriptParagraph (cognitive 74) · ×1
  • ScriptParagraph.ScriptParagraph (cognitive 74) ui/src/features/studio/components/ScriptParagraph.tsx:95 — ScriptParagraph.ScriptParagraph has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 22 (29 pts), if/else 24 (25 pts), boolean chains 20 (nesting depth added 8). Of this number, 22 points are the body's own statements and 52 belong to 12 function items inside it that branch. 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.
D2 · Cognitive Complexity · useVoiceSession.useVoiceSession.handleVoiceRealtimeServerEvent (cognitive 72) · ×1
  • useVoiceSession.useVoiceSession.handleVoiceRealtimeServerEvent (cognitive 72) ui/src/features/voice/useVoiceSession.ts:613 — useVoiceSession.useVoiceSession.handleVoiceRealtimeServerEvent has cognitive complexity 72 (threshold 15). Drivers by points: if/else 27 (50 pts), boolean chains 18, ternaries 2 (3 pts), match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloneVoiceDialog.CloneVoiceDialog (cognitive 70) · ×1
  • CloneVoiceDialog.CloneVoiceDialog (cognitive 70) ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:134 — CloneVoiceDialog.CloneVoiceDialog has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 19 (29 pts), if/else 19 (22 pts), boolean chains 13, error handling 6 (nesting depth added 13). Of this number, 34 points are the body's own statements and 36 belong to 11 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.
D2 · Cognitive Complexity · AppLayout.AppShell (cognitive 67) · ×1
  • AppLayout.AppShell (cognitive 67) ui/src/app/layouts/AppLayout.tsx:149 — AppLayout.AppShell has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 27 (30 pts), boolean chains 18, if/else 18, error handling 1 (nesting depth added 3). Of this number, 37 points are the body's own statements and 30 belong to 12 function items inside it that branch. 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.
D2 · Cognitive Complexity · StudioEditor.StudioEditor (cognitive 65) · ×1
  • StudioEditor.StudioEditor (cognitive 65) ui/src/features/studio/components/StudioEditor.tsx:66 — StudioEditor.StudioEditor has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 28 (37 pts), if/else 16 (19 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 13). Of this number, 22 points are the body's own statements and 43 belong to 13 function items inside it that branch. 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.
D2 · Cognitive Complexity · DiarizationReviewWorkspace.DiarizationReviewWorkspace (cognitive 64) · ×1
  • DiarizationReviewWorkspace.DiarizationReviewWorkspace (cognitive 64) ui/src/components/DiarizationReviewWorkspace.tsx:165 — DiarizationReviewWorkspace.DiarizationReviewWorkspace has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 33 (41 pts), if/else 12, boolean chains 11 (nesting depth added 8). Of this number, 28 points are the body's own statements and 36 belong to 17 function items inside it that branch. 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.
D2 · Cognitive Complexity · AgentEngine · ×1
  • AgentEngine::run_conversation (cognitive 63) crates/izwi-agent/src/engine.rs:229 — AgentEngine::run_conversation has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (34 pts), match/switch 6 (21 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeChatInvocationDriver · ×1
  • RuntimeChatInvocationDriver::drive_until_terminal (cognitive 62) crates/izwi-core/src/runtime/service/chat_invocation.rs:434 — RuntimeChatInvocationDriver::drive_until_terminal has cognitive complexity 62 (threshold 15). Drivers by points: if/else 12 (38 pts), match/switch 7 (18 pts), boolean chains 5, loops 1 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NodeConfig · ×1
  • NodeConfig::validate (cognitive 62) crates/izwi-serving-supervisor/src/config.rs:79 — NodeConfig::validate has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (50 pts), boolean chains 6, loops 2 (4 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · TranscriptionRecordDetail.TranscriptionRecordDetail (cognitive 60) · ×1
  • TranscriptionRecordDetail.TranscriptionRecordDetail (cognitive 60) ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:176 — TranscriptionRecordDetail.TranscriptionRecordDetail has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 31 (47 pts), boolean chains 9, if/else 4 (nesting depth added 16). Of this number, 51 points are the body's own statements and 9 belong to 6 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.
D2 · Cognitive Complexity · InferenceCoordinator · ×1
  • InferenceCoordinator::run_loaded_native_preparation_batch_in_parts (cognitive 59) crates/izwi-core/src/runtime/coordinator.rs:1805 — InferenceCoordinator::run_loaded_native_preparation_batch_in_parts has cognitive complexity 59 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 8 (18 pts), loops 6 (9 pts), boolean chains 8 (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.
D2 · Cognitive Complexity · AppUpdateProvider.AppUpdateProvider (cognitive 58) · ×1
  • AppUpdateProvider.AppUpdateProvider (cognitive 58) ui/src/app/providers/AppUpdateProvider.tsx:74 — AppUpdateProvider.AppUpdateProvider has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (33 pts), ternaries 9 (15 pts), boolean chains 7, error handling 3 (nesting depth added 14). Most of this is not in the body itself: 1 of the 58 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 135, 248, 269, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · StreamingInputState · ×1
  • StreamingInputState::handle_pcm16_frame (cognitive 55) crates/izwi-server/src/app/voice_realtime/input.rs:241 — StreamingInputState::handle_pcm16_frame has cognitive complexity 55 (threshold 15). Drivers by points: if/else 28 (43 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (3 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.
D2 · Cognitive Complexity · TextToSpeechRecordDetail.TextToSpeechRecordDetail (cognitive 55) · ×1
  • TextToSpeechRecordDetail.TextToSpeechRecordDetail (cognitive 55) ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:126 — TextToSpeechRecordDetail.TextToSpeechRecordDetail has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 23 (32 pts), boolean chains 15, if/else 7, match/switch 1 (nesting depth added 9). Of this number, 43 points are the body's own statements and 12 belong to 5 function items inside it that branch. 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.
D2 · Cognitive Complexity · AssistantMessage.AssistantMessage (cognitive 52) · ×1
  • AssistantMessage.AssistantMessage (cognitive 52) ui/src/features/chat/components/messages/AssistantMessage.tsx:87 — AssistantMessage.AssistantMessage has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 27, ternaries 17 (25 pts) (nesting depth added 8). 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.
D2 · Cognitive Complexity · RouteModelModal.RouteModelModal (cognitive 48) · ×1
  • RouteModelModal.RouteModelModal (cognitive 48) ui/src/features/models/components/RouteModelModal.tsx:130 — RouteModelModal.RouteModelModal has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 18 (40 pts), boolean chains 5, if/else 3 (nesting depth added 22). Most of this is not in the body itself: 11 of the 48 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 267, a function literal at line 247, a function literal at line 162, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · route.VoicePage (cognitive 48) · ×1
  • route.VoicePage (cognitive 48) ui/src/features/voice/route.tsx:73 — route.VoicePage has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 9 (24 pts), boolean chains 12, if/else 11 (12 pts) (nesting depth added 16). Of this number, 35 points are the body's own statements and 13 belong to 6 function literals 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.
D2 · Cognitive Complexity · SessionConfig · ×1
  • SessionConfig::apply_update (cognitive 47) crates/izwi-server/src/app/openai_realtime/session_config.rs:804 — SessionConfig::apply_update has cognitive complexity 47 (threshold 15). Drivers by points: if/else 26 (41 pts), boolean chains 4, loops 1, match/switch 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.
D2 · Cognitive Complexity · route.MyModelsPage (cognitive 47) · ×1
  • route.MyModelsPage (cognitive 47) ui/src/features/models/route.tsx:153 — route.MyModelsPage has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 20 (30 pts), if/else 7 (8 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 11). Of this number, 30 points are the body's own statements and 17 belong to 6 function literals 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.
D2 · Cognitive Complexity · CudaPagedPrefillOp · ×1
  • CudaPagedPrefillOp::cuda_fwd (cognitive 46) crates/izwi-core/src/kernels/cuda.rs:3087 — CudaPagedPrefillOp::cuda_fwd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 27 (45 pts), match/switch 1 (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.
D2 · Cognitive Complexity · SpeechPump · ×1
  • SpeechPump::run (cognitive 46) crates/izwi-server/src/api/openai/audio/speech.rs:1363 — SpeechPump::run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (30 pts), match/switch 7 (13 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · ChatPlayground.ChatPlayground (cognitive 45) · ×1
  • ChatPlayground.ChatPlayground (cognitive 45) ui/src/features/chat/components/ChatPlayground.tsx:167 — ChatPlayground.ChatPlayground has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 49 (96 pts), boolean chains 88, if/else 77 (88 pts), error handling 11 (13 pts), loops 6 (nesting depth added 60). To reduce it, split the body into named stages: move each independent 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 (ChatPlayground.ChatPlayground::renderComposer) 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.
D2 · Cognitive Complexity · TextToSpeechHistoryTable.TextToSpeechHistoryTable (cognitive 45) · ×1
  • TextToSpeechHistoryTable.TextToSpeechHistoryTable (cognitive 45) ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx:87 — TextToSpeechHistoryTable.TextToSpeechHistoryTable has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 14 (21 pts), boolean chains 14, if/else 6, error handling 4 (nesting depth added 7). Most of this is not in the body itself: 2 of the 45 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 287, a function literal at line 372, handleCopy, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ChatPlayground.ChatPlayground · ×1
  • ChatPlayground.ChatPlayground::renderComposer (cognitive 43) ui/src/features/chat/components/ChatPlayground.tsx:1669 — ChatPlayground.ChatPlayground::renderComposer has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 15 (27 pts), boolean chains 16 (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. This shape REPEATS in the file: one other method here (ChatPlayground.ChatPlayground) 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.
D2 · Cognitive Complexity · SetupChecklist.SetupChecklist (cognitive 43) · ×1
  • SetupChecklist.SetupChecklist (cognitive 43) ui/src/features/dictation/components/SetupChecklist.tsx:119 — SetupChecklist.SetupChecklist has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 20 (32 pts), boolean chains 8, if/else 2, error handling 1 (nesting depth added 12). Of this number, 37 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.
D2 · Cognitive Complexity · PhysicalStateManager · ×1
  • PhysicalStateManager::prepare_unload_model_with_static_runtime_owners (cognitive 41) crates/izwi-core/src/engine/cache/physical.rs:969 — PhysicalStateManager::prepare_unload_model_with_static_runtime_owners has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 6 (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.
D2 · Cognitive Complexity · route.DictationSettingsView (cognitive 40) · ×1
  • route.DictationSettingsView (cognitive 40) ui/src/features/dictation/route.tsx:271 — route.DictationSettingsView has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 24 (28 pts), boolean chains 9, if/else 3 (nesting depth added 4). Of this number, 30 points are the body's own statements and 10 belong to 8 function items inside it that branch. 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.
D2 · Cognitive Complexity · DialogueEditor.DialogueEditor (cognitive 39) · ×1
  • DialogueEditor.DialogueEditor (cognitive 39) ui/src/features/text-to-speech/components/DialogueEditor.tsx:58 — DialogueEditor.DialogueEditor has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 17 (23 pts), boolean chains 11, if/else 5 (nesting depth added 6). Most of this is not in the body itself: 9 of the 39 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 275, a function literal at line 145, a function literal at line 169, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · VoiceSettingsSheet.MainView (cognitive 38) · ×1
  • VoiceSettingsSheet.MainView (cognitive 38) ui/src/features/voice/components/VoiceSettingsSheet.tsx:158 — VoiceSettingsSheet.MainView has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 15 (28 pts), boolean chains 8, if/else 2 (nesting depth added 13). Of this number, 21 points are the body's own statements and 17 belong to 4 function literals 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.
D2 · Cognitive Complexity · PagedDecodeAttentionOp · ×1
  • PagedDecodeAttentionOp::metal_fwd (cognitive 37) crates/izwi-core/src/kernels/metal.rs:2267 — PagedDecodeAttentionOp::metal_fwd has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 9, loops 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.
D2 · Cognitive Complexity · StudioVoicePicker.StudioVoicePicker (cognitive 37) · ×1
  • StudioVoicePicker.StudioVoicePicker (cognitive 37) ui/src/features/studio/components/StudioVoicePicker.tsx:76 — StudioVoicePicker.StudioVoicePicker has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 13 (21 pts), boolean chains 9, if/else 5 (7 pts) (nesting depth added 10). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 154, 94, 209, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DiarizationQualityPanel.DiarizationQualityPanel (cognitive 36) · ×1
  • DiarizationQualityPanel.DiarizationQualityPanel (cognitive 36) ui/src/components/DiarizationQualityPanel.tsx:60 — DiarizationQualityPanel.DiarizationQualityPanel has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15, boolean chains 14, ternaries 5 (6 pts), loops 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 36 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 95, a function literal at line 157, handleSubmit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AudioApiClient.consumeSpeechHistoryRecordStream · ×1
  • AudioApiClient.consumeSpeechHistoryRecordStream::startStream (cognitive 36) ui/src/shared/api/audio.ts:1821 — AudioApiClient.consumeSpeechHistoryRecordStream::startStream has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 4 (10 pts), boolean chains 5, error handling 2 (3 pts), 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.
D2 · Cognitive Complexity · FirstRunOnboarding.FirstRunOnboarding (cognitive 35) · ×1
  • FirstRunOnboarding.FirstRunOnboarding (cognitive 35) ui/src/app/onboarding/FirstRunOnboarding.tsx:210 — FirstRunOnboarding.FirstRunOnboarding has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18, boolean chains 12, ternaries 4, error handling 1. Of this number, 18 points are the body's own statements and 17 belong to 17 function items inside it that branch. 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.
D2 · Cognitive Complexity · support.normalizeVoiceRealtimeV2Event (cognitive 35) · ×1
  • support.normalizeVoiceRealtimeV2Event (cognitive 35) ui/src/features/voice/realtime/support.ts:842 — support.normalizeVoiceRealtimeV2Event has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 17 (34 pts), match/switch 1 (nesting depth added 17). 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.
D2 · Cognitive Complexity · InvocationRequest · ×1
  • InvocationRequest::validate (cognitive 33) crates/izwi-serving-protocol/src/types.rs:713 — InvocationRequest::validate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 12, loops 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · TranscriptionHistoryTable.TranscriptionHistoryTable (cognitive 33) · ×1
  • TranscriptionHistoryTable.TranscriptionHistoryTable (cognitive 33) ui/src/features/transcription/components/TranscriptionHistoryTable.tsx:302 — TranscriptionHistoryTable.TranscriptionHistoryTable has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 8, if/else 8, error handling 3 (nesting depth added 5). Most of this is not in the body itself: 5 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (handleCopy, handleExport, handleConfirmDelete, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · StageDescriptor · ×1
  • StageDescriptor::validate (cognitive 32) crates/izwi-core/src/engine/execution.rs:664 — StageDescriptor::validate has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 16, if/else 14 (15 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.
D2 · Cognitive Complexity · ServeRuntimeConfig · ×1
  • ServeRuntimeConfig::apply_overrides (cognitive 32) crates/izwi-core/src/serve_runtime.rs:179 — ServeRuntimeConfig::apply_overrides has cognitive complexity 32 (threshold 15). Drivers by points: if/else 32. 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.
D2 · Cognitive Complexity · LiveTranscription · ×1
  • LiveTranscription::run (cognitive 32) crates/izwi-server/src/app/openai_realtime/live.rs:113 — LiveTranscription::run has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 7 (20 pts), if/else 2 (7 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 20). 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.
D2 · Cognitive Complexity · CandleAcceleratorKvArena · ×1
  • CandleAcceleratorKvArena::zero_pages (cognitive 31) crates/izwi-core/src/backends/kv/accelerator.rs:2175 — CandleAcceleratorKvArena::zero_pages has cognitive complexity 31 (threshold 15). Drivers by points: loops 9 (18 pts), if/else 6 (10 pts), match/switch 2 (3 pts) (nesting depth added 14). 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.
D2 · Cognitive Complexity · agentSettings.parseVoiceAgentSettings (cognitive 31) · ×1
  • agentSettings.parseVoiceAgentSettings (cognitive 31) ui/src/features/voice/agentSettings.ts:104 — agentSettings.parseVoiceAgentSettings has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 5 (9 pts), boolean chains 8, loops 3, error handling 1 (nesting depth added 7). Of this number, 29 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · ChatApiClient.chatCompletionsStream (cognitive 31) · ×1
  • ChatApiClient.chatCompletionsStream (cognitive 31) ui/src/shared/api/chat.ts:680 — ChatApiClient.chatCompletionsStream has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 2 (7 pts), boolean chains 2, error handling 2 (nesting depth added 10). None of this is in the body itself: all 31 points belong to 2 function items inside it that branch (a function literal at line 721, startStream). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · GraniteSpeechEncoderBatcher · ×1
  • GraniteSpeechEncoderBatcher::run_batch (cognitive 30) crates/izwi-core/src/runtime/service/asr_encoders.rs:1365 — GraniteSpeechEncoderBatcher::run_batch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 6 (8 pts), match/switch 4 (6 pts), boolean chains 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. This shape REPEATS in the file: one other method here (GraniteSpeech5EncoderBatcher::run_batch) 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.
D2 · Cognitive Complexity · GraniteSpeech5EncoderBatcher · ×1
  • GraniteSpeech5EncoderBatcher::run_batch (cognitive 30) crates/izwi-core/src/runtime/service/asr_encoders.rs:1629 — GraniteSpeech5EncoderBatcher::run_batch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 6 (8 pts), match/switch 4 (6 pts), boolean chains 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. This shape REPEATS in the file: one other method here (GraniteSpeechEncoderBatcher::run_batch) 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.
D2 · Cognitive Complexity · WorkerRegistry · ×1
  • WorkerRegistry::select_and_reserve_routed (cognitive 30) crates/izwi-gateway/src/worker_registry.rs:852 — WorkerRegistry::select_and_reserve_routed has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · support.parseUserMessageDisplayFromContentParts (cognitive 30) · ×1
  • support.parseUserMessageDisplayFromContentParts (cognitive 30) ui/src/features/chat/playground/support.ts:760 — support.parseUserMessageDisplayFromContentParts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 10, ternaries 2 (6 pts), 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.
D2 · Cognitive Complexity · ManagedCacheReceipt · ×1
  • ManagedCacheReceipt::validate (cognitive 29) crates/izwi-core/src/engine/execution.rs:2166 — ManagedCacheReceipt::validate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, loops 1, match/switch 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.
D2 · Cognitive Complexity · CliOptions · ×1
  • CliOptions::parse (cognitive 29) crates/izwi-serving-supervisor/src/daemon/cli.rs:38 — CliOptions::parse has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6, match/switch 1 (2 pts), 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.
D2 · Cognitive Complexity · StudioExportDialog.StudioExportDialog (cognitive 29) · ×1
  • StudioExportDialog.StudioExportDialog (cognitive 29) ui/src/features/studio/components/StudioExportDialog.tsx:44 — StudioExportDialog.StudioExportDialog has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 10, boolean chains 3, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 5 function items inside it that branch (save, a function literal at line 108, start, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NotificationItem.NotificationItem (cognitive 28) · ×1
  • NotificationItem.NotificationItem (cognitive 28) ui/src/app/providers/NotificationItem.tsx:51 — NotificationItem.NotificationItem has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 15 (17 pts), boolean chains 8, if/else 3 (nesting depth added 2). Of this number, 22 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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.
D2 · Cognitive Complexity · HistoryTable.HistoryTable (cognitive 28) · ×1
  • HistoryTable.HistoryTable (cognitive 28) ui/src/components/history/HistoryTable.tsx:56 — HistoryTable.HistoryTable has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 8, if/else 5 (nesting depth added 5). Of this number, 23 points are the body's own statements and 5 belong to 3 function literals 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.
D2 · Cognitive Complexity · support.isVoiceRealtimeV2ServerEnvelope (cognitive 28) · ×1
  • support.isVoiceRealtimeV2ServerEnvelope (cognitive 28) ui/src/features/voice/realtime/support.ts:664 — support.isVoiceRealtimeV2ServerEnvelope has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 23, if/else 3, match/switch 1, ternaries 1. Of this number, 27 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.
D2 · Cognitive Complexity · PagedPrefillAttentionOp · ×1
  • PagedPrefillAttentionOp::metal_fwd (cognitive 27) crates/izwi-core/src/kernels/metal.rs:2808 — PagedPrefillAttentionOp::metal_fwd has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, loops 2 (3 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.
D2 · Cognitive Complexity · ParakeetEncoderBatcher · ×1
  • ParakeetEncoderBatcher::run_batch (cognitive 27) crates/izwi-core/src/runtime/service/asr_encoders.rs:525 — ParakeetEncoderBatcher::run_batch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 5 (7 pts), match/switch 5 (7 pts) (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.
D2 · Cognitive Complexity · Parser · ×1
  • Parser::value (cognitive 27) crates/izwi-model-catalog/src/chat/tools/lfm.rs:218 — Parser::value has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 16). 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.
D2 · Cognitive Complexity · PhysicalBatchReport · ×1
  • PhysicalBatchReport::validate_against (cognitive 26) crates/izwi-core/src/engine/execution.rs:2540 — PhysicalBatchReport::validate_against has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, match/switch 2 (3 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.
D2 · Cognitive Complexity · RelPosAttention · ×1
  • RelPosAttention::dims (cognitive 26) crates/izwi-core/src/kernels/relpos_attention.rs:129 — RelPosAttention::dims has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, loops 2 (3 pts), match/switch 2 (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.
D2 · Cognitive Complexity · SettingsSection.SettingsRow (cognitive 26) · ×1
  • SettingsSection.SettingsRow (cognitive 26) ui/src/components/SettingsSection.tsx:40 — SettingsSection.SettingsRow has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (23 pts), boolean chains 3 (nesting depth added 13). 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.
D2 · Cognitive Complexity · ChatThreadList.ChatThreadList (cognitive 26) · ×1
  • ChatThreadList.ChatThreadList (cognitive 26) ui/src/features/chat/components/ChatThreadList.tsx:45 — ChatThreadList.ChatThreadList has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (21 pts), boolean chains 2, if/else 2, loops 1 (nesting depth added 12). Most of this is not in the body itself: 6 of the 26 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 147, 90, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AgentSet · ×1
  • AgentSet::new (cognitive 25) crates/izwi-agent/src/agent.rs:103 — AgentSet::new has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 2 (3 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.
D2 · Cognitive Complexity · Tokenizer · ×1
  • Tokenizer::from_vocab_merges (cognitive 25) crates/izwi-core/src/tokenizer.rs:225 — Tokenizer::from_vocab_merges has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (9 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.
D2 · Cognitive Complexity · HotkeyRecorder.HotkeyRecorder (cognitive 25) · ×1
  • HotkeyRecorder.HotkeyRecorder (cognitive 25) ui/src/features/dictation/components/HotkeyRecorder.tsx:64 — HotkeyRecorder.HotkeyRecorder has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 9 (12 pts), if/else 9 (10 pts), boolean chains 3 (nesting depth added 4). Of this number, 13 points are the body's own statements and 12 belong to 5 function literals inside it that branch. 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.
D2 · Cognitive Complexity · ModelManager · ×1
  • ModelManager::refresh_model_states (cognitive 24) crates/izwi-core/src/model/manager.rs:86 — ModelManager::refresh_model_states has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · PerformanceConfigOverrides · ×1
  • PerformanceConfigOverrides::from_lookup (cognitive 24) crates/izwi-core/src/performance.rs:489 — PerformanceConfigOverrides::from_lookup has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 1 (4 pts), 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.
D2 · Cognitive Complexity · WorkerConfig · ×1
  • WorkerConfig::validate (cognitive 24) crates/izwi-serving-worker/src/lib.rs:78 — WorkerConfig::validate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · UpdateCard.UpdateCard (cognitive 24) · ×1
  • UpdateCard.UpdateCard (cognitive 24) ui/src/app/layouts/UpdateCard.tsx:23 — UpdateCard.UpdateCard has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 4, if/else 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.
D2 · Cognitive Complexity · firstRunPlan.modelDescriptor (cognitive 24) · ×1
  • firstRunPlan.modelDescriptor (cognitive 24) ui/src/app/onboarding/firstRunPlan.ts:369 — firstRunPlan.modelDescriptor has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 6 (11 pts), match/switch 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.
D2 · Cognitive Complexity · NotificationProvider.NotificationProvider (cognitive 24) · ×1
  • NotificationProvider.NotificationProvider (cognitive 24) ui/src/app/providers/NotificationProvider.tsx:196 — NotificationProvider.NotificationProvider has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 7). None of this is in the body itself: all 24 points belong to 6 function literals inside it that branch (lines 250, 235, 323, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MelSpectrogram · ×1
  • MelSpectrogram::create_mel_filterbank (cognitive 23) crates/izwi-core/src/audio/preprocessing.rs:298 — MelSpectrogram::create_mel_filterbank has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (10 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.
D2 · Cognitive Complexity · InvocationWorkspaceRuntimeV2 · ×1
  • InvocationWorkspaceRuntimeV2::validate_for (cognitive 23) crates/izwi-core/src/kv/v2/runtime.rs:1038 — InvocationWorkspaceRuntimeV2::validate_for has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (11 pts), boolean chains 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.
D2 · Cognitive Complexity · PerformanceConfig · ×1
  • PerformanceConfig::apply_overrides (cognitive 23) crates/izwi-core/src/performance.rs:334 — PerformanceConfig::apply_overrides has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23. 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.
D2 · Cognitive Complexity · DesktopHost · ×1
  • DesktopHost::status (cognitive 23) crates/izwi-desktop/src/app/dictation/mod.rs:658 — DesktopHost::status has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 3 (5 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.
D2 · Cognitive Complexity · izwi_serving_client · ×1
  • izwi_serving_client::realtime::dial (cognitive 23) crates/izwi-serving-client/src/realtime.rs:236 — izwi_serving_client::realtime::dial has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (7 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · Actor · ×1
  • Actor::run (cognitive 23) crates/izwi-serving-supervisor/src/actor.rs:328 — Actor::run has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 1 (4 pts), loops 1 (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · route.CommandLineToolRow (cognitive 23) · ×1
  • route.CommandLineToolRow (cognitive 23) ui/src/features/settings/route.tsx:268 — route.CommandLineToolRow has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (18 pts), boolean chains 2, if/else 2, error handling 1 (nesting depth added 9). Of this number, 17 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.
D2 · Cognitive Complexity · support.voiceRealtimePlaybackAction (cognitive 23) · ×1
  • support.voiceRealtimePlaybackAction (cognitive 23) ui/src/features/voice/realtime/support.ts:1181 — support.voiceRealtimePlaybackAction has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 2 (3 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · AudioApiClient.buildDiarizationRecordRequestInit (cognitive 23) · ×1
  • AudioApiClient.buildDiarizationRecordRequestInit (cognitive 23) ui/src/shared/api/audio.ts:3374 — AudioApiClient.buildDiarizationRecordRequestInit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (22 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.
D2 · Cognitive Complexity · ChatApiClient.createResponseStream (cognitive 23) · ×1
  • ChatApiClient.createResponseStream (cognitive 23) ui/src/shared/api/chat.ts:823 — ChatApiClient.createResponseStream has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, ternaries 1 (3 pts), error handling 2 (nesting depth added 5). None of this is in the body itself: all 23 points belong to 2 function items inside it that branch (a function literal at line 863, startStream). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · InvocationRingDepthwiseConvTransaction · ×1
  • InvocationRingDepthwiseConvTransaction::direct_ring_convolution (cognitive 22) crates/izwi-core/src/backends/state/invocation.rs:1323 — InvocationRingDepthwiseConvTransaction::direct_ring_convolution has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (4 pts), loops 2 (3 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.
D2 · Cognitive Complexity · Qwen35GatedDeltaSequenceOp · ×1
  • Qwen35GatedDeltaSequenceOp::metal_fwd (cognitive 22) crates/izwi-core/src/kernels/metal.rs:3958 — Qwen35GatedDeltaSequenceOp::metal_fwd has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 5, loops 1 (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.
D2 · Cognitive Complexity · VerifiedArtifactReader · ×1
  • VerifiedArtifactReader::poll_read (cognitive 22) crates/izwi-server/src/artifact_store.rs:266 — VerifiedArtifactReader::poll_read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 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.
D2 · Cognitive Complexity · RuntimeCard.RuntimeCard (cognitive 22) · ×1
  • RuntimeCard.RuntimeCard (cognitive 22) ui/src/app/layouts/RuntimeCard.tsx:25 — RuntimeCard.RuntimeCard has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 13 (15 pts), boolean chains 6, if/else 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.
D2 · Cognitive Complexity · SpeechTextUploadProgress.SpeechTextUploadProgress (cognitive 22) · ×1
  • SpeechTextUploadProgress.SpeechTextUploadProgress (cognitive 22) ui/src/features/speech-text/components/SpeechTextUploadProgress.tsx:62 — SpeechTextUploadProgress.SpeechTextUploadProgress has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 13 (17 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · useVoiceSession.useVoiceSession.start (cognitive 22) · ×1
  • useVoiceSession.useVoiceSession.start (cognitive 22) ui/src/features/voice/useVoiceSession.ts:1189 — useVoiceSession.useVoiceSession.start has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 4, if/else 3, error handling 2 (nesting depth added 7). Of this number, 19 points are the body's own statements and 3 belong to 5 function literals 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.
D2 · Cognitive Complexity · InvocationTensorArena · ×1
  • InvocationTensorArena::new (cognitive 21) crates/izwi-core/src/backends/state/invocation.rs:150 — InvocationTensorArena::new has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, loops 1 (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.
D2 · Cognitive Complexity · PreparedPhysicalDispatch · ×1
  • PreparedPhysicalDispatch::new (cognitive 21) crates/izwi-core/src/engine/execution_group.rs:76 — PreparedPhysicalDispatch::new has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 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.
D2 · Cognitive Complexity · NemotronEncoderBatcher · ×1
  • NemotronEncoderBatcher::run_batch (cognitive 21) crates/izwi-core/src/runtime/service/asr_encoders.rs:884 — NemotronEncoderBatcher::run_batch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 5 (7 pts), match/switch 2 (3 pts) (nesting depth added 4). 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.
D2 · Cognitive Complexity · ReasoningSplitter · ×1
  • ReasoningSplitter::push (cognitive 21) crates/izwi-model-catalog/src/chat/reasoning.rs:118 — ReasoningSplitter::push has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · SpeechTextPlan · ×1
  • SpeechTextPlan::fish (cognitive 21) crates/izwi-server/src/api/tts_long_form.rs:438 — SpeechTextPlan::fish has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · diarizationTranscript.aggregateRawSpeakerSummaries (cognitive 21) · ×1
  • diarizationTranscript.aggregateRawSpeakerSummaries (cognitive 21) REDACTED:205 — diarizationTranscript.aggregateRawSpeakerSummaries has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioPlayer.AudioPlayer (cognitive 21) · ×1
  • AudioPlayer.AudioPlayer (cognitive 21) ui/src/components/audio/AudioPlayer.tsx:56 — AudioPlayer.AudioPlayer has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 14 (17 pts), boolean chains 4 (nesting depth added 3). Of this number, 12 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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.
D2 · Cognitive Complexity · DiarizationSpeakersTable.DiarizationSpeakersTable (cognitive 21) · ×1
  • DiarizationSpeakersTable.DiarizationSpeakersTable (cognitive 21) ui/src/features/diarization/components/DiarizationSpeakersTable.tsx:151 — DiarizationSpeakersTable.DiarizationSpeakersTable has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (10 pts), boolean chains 4, if/else 3 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 235, a function literal at line 172, displayName). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ModelListRow.ModelListRow (cognitive 21) · ×1
  • ModelListRow.ModelListRow (cognitive 21) ui/src/features/models/components/ModelListRow.tsx:186 — ModelListRow.ModelListRow has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 7, if/else 4, match/switch 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.
D2 · Cognitive Complexity · ProjectSettingsSheet.ProjectSettingsSheet (cognitive 21) · ×1
  • ProjectSettingsSheet.ProjectSettingsSheet (cognitive 21) ui/src/features/studio/components/ProjectSettingsSheet.tsx:44 — ProjectSettingsSheet.ProjectSettingsSheet has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 6, if/else 4 (nesting depth added 3). Of this number, 15 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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.
D2 · Cognitive Complexity · DesignVoiceDialog.DesignVoiceDialog (cognitive 21) · ×1
  • DesignVoiceDialog.DesignVoiceDialog (cognitive 21) ui/src/features/voice-studio/components/DesignVoiceDialog.tsx:83 — DesignVoiceDialog.DesignVoiceDialog has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 14 (23 pts), boolean chains 17, if/else 9 (11 pts), error handling 2, loops 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. This shape REPEATS in the file: one other method here (DesignVoiceDialog.DesignVoiceDialog::generate) 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.
D2 · Cognitive Complexity · VoiceLibraryGrid.VoicePreview (cognitive 21) · ×1
  • VoiceLibraryGrid.VoicePreview (cognitive 21) ui/src/features/voices/components/VoiceLibraryGrid.tsx:28 — VoiceLibraryGrid.VoicePreview has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, ternaries 6 (8 pts), if/else 5 (nesting depth added 2). Of this number, 14 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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.
D2 · Cognitive Complexity · ChatApiClient.streamThreadTurn (cognitive 21) · ×1
  • ChatApiClient.streamThreadTurn (cognitive 21) ui/src/shared/api/chat.ts:509 — ChatApiClient.streamThreadTurn has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 1 (3 pts), error handling 2, match/switch 1 (nesting depth added 6). None of this is in the body itself: all 21 points belong to 2 function items inside it that branch (a function literal at line 562, startStream). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CpuKvArena · ×1
  • CpuKvArena::paged_prefill (cognitive 20) crates/izwi-core/src/backends/kv/cpu.rs:521 — CpuKvArena::paged_prefill has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 2 (3 pts), match/switch 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.
D2 · Cognitive Complexity · ResolvedStatePlan · ×1
  • ResolvedStatePlan::validate_against (cognitive 20) crates/izwi-core/src/kv/v2/resolved.rs:233 — ResolvedStatePlan::validate_against has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2, 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.
D2 · Cognitive Complexity · LongTextPlanner · ×1
  • LongTextPlanner::next_window (cognitive 20) crates/izwi-core/src/runtime/forced_alignment.rs:489 — LongTextPlanner::next_window has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · WorkerClientTlsConfig · ×1
  • WorkerClientTlsConfig::from_pem (cognitive 20) crates/izwi-serving-client/src/lib.rs:57 — WorkerClientTlsConfig::from_pem has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, loops 1, match/switch 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.
D2 · Cognitive Complexity · DeploymentScaleState · ×1
  • DeploymentScaleState::evaluate (cognitive 20) crates/izwi-serving-supervisor/src/autoscale.rs:231 — DeploymentScaleState::evaluate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · izwi_vad · ×1
  • izwi_vad::detect_speech_regions_from_frames (cognitive 20) crates/izwi-vad/src/lib.rs:698 — izwi_vad::detect_speech_regions_from_frames has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 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.
D2 · Cognitive Complexity · SetupChecklist.speechModelStep (cognitive 20) · ×1
  • SetupChecklist.speechModelStep (cognitive 20) ui/src/features/dictation/components/SetupChecklist.tsx:31 — SetupChecklist.speechModelStep has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (7 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.
D2 · Cognitive Complexity · AudioApiClient.asrTranscribeStream (cognitive 20) · ×1
  • AudioApiClient.asrTranscribeStream (cognitive 20) ui/src/shared/api/audio.ts:3064 — AudioApiClient.asrTranscribeStream has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (5 pts), error handling 2, match/switch 1 (nesting depth added 8). None of this is in the body itself: all 20 points belong to 2 function items inside it that branch (a function literal at line 3092, startStream). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AudioApiClient.buildAsrRequestInit (cognitive 20) · ×1
  • AudioApiClient.buildAsrRequestInit (cognitive 20) ui/src/shared/api/audio.ts:3193 — AudioApiClient.buildAsrRequestInit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · McpClient · ×1
  • McpClient::list_tools (cognitive 19) crates/izwi-server/src/app/mcp.rs:528 — McpClient::list_tools has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 pts), loops 2 (3 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.
D2 · Cognitive Complexity · SpeechHistoryStore · ×1
  • SpeechHistoryStore::complete_record_inner (cognitive 19) crates/izwi-server/src/speech_history_store.rs:1136 — SpeechHistoryStore::complete_record_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, match/switch 3 (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.
D2 · Cognitive Complexity · GenerationStats.GenerationStats (cognitive 19) · ×1
  • GenerationStats.GenerationStats (cognitive 19) ui/src/components/GenerationStats.tsx:29 — GenerationStats.GenerationStats has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 3, if/else 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.
D2 · Cognitive Complexity · hotkey.recordHotkeyEvent (cognitive 19) · ×1
  • hotkey.recordHotkeyEvent (cognitive 19) ui/src/features/dictation/hotkey.ts:118 — hotkey.recordHotkeyEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (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.
D2 · Cognitive Complexity · modelMetadata.getModelProviderLabel (cognitive 19) · ×1
  • modelMetadata.getModelProviderLabel (cognitive 19) ui/src/features/models/catalog/modelMetadata.ts:44 — modelMetadata.getModelProviderLabel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 7. 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.
D2 · Cognitive Complexity · VoiceTranscript.VoiceTranscript (cognitive 19) · ×1
  • VoiceTranscript.VoiceTranscript (cognitive 19) ui/src/features/voice/components/VoiceTranscript.tsx:8 — VoiceTranscript.VoiceTranscript has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (15 pts), boolean chains 2, if/else 1 (2 pts) (nesting depth added 10). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 50). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AudioApiClient.buildTranscriptionRecordRequestInit (cognitive 19) · ×1
  • AudioApiClient.buildTranscriptionRecordRequestInit (cognitive 19) ui/src/shared/api/audio.ts:3257 — AudioApiClient.buildTranscriptionRecordRequestInit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · ChunkedAsrRun · ×1
  • ChunkedAsrRun::run_chunk (cognitive 18) crates/izwi-core/src/engine/executor/audio.rs:1051 — ChunkedAsrRun::run_chunk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · UnifiedExecutor · ×1
  • UnifiedExecutor::acquire_physical_execution (cognitive 18) crates/izwi-core/src/engine/executor.rs:5145 — UnifiedExecutor::acquire_physical_execution has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (5 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · ToolResponses · ×1
  • ToolResponses::render_response (cognitive 18) crates/izwi-gateway/src/api/openai/tool_response.rs:135 — ToolResponses::render_response has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (4 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · routePresentation.documentTitleForLocation (cognitive 18) · ×1
  • routePresentation.documentTitleForLocation (cognitive 18) ui/src/app/router/routePresentation.ts:27 — routePresentation.documentTitleForLocation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 9). 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.
D2 · Cognitive Complexity · useSpeechStreamPlayback.useSpeechStreamPlayback.begin (cognitive 18) · ×1
  • useSpeechStreamPlayback.useSpeechStreamPlayback.begin (cognitive 18) ui/src/features/text-to-speech/hooks/useSpeechStreamPlayback.ts:53 — useSpeechStreamPlayback.useSpeechStreamPlayback.begin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, error handling 3. None of this is in the body itself: all 18 points belong to 11 function literals inside it that branch (lines 107, 125, 100, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NewVoiceParts.VoiceModelRow (cognitive 18) · ×1
  • NewVoiceParts.VoiceModelRow (cognitive 18) ui/src/features/voice-studio/components/NewVoiceParts.tsx:60 — NewVoiceParts.VoiceModelRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (17 pts), boolean chains 1 (nesting depth added 9). 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.
D2 · Cognitive Complexity · ResourceAuthority · ×1
  • ResourceAuthority::reserve_internal (cognitive 17) crates/izwi-core/src/engine/resources.rs:1111 — ResourceAuthority::reserve_internal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · SpeechSamplingOptions · ×1
  • SpeechSamplingOptions::validate (cognitive 17) crates/izwi-core/src/engine/types.rs:158 — SpeechSamplingOptions::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 3 (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.
D2 · Cognitive Complexity · QwenAsrEncoderBatcher · ×1
  • QwenAsrEncoderBatcher::run_batch (cognitive 17) crates/izwi-core/src/runtime/service/asr_encoders.rs:1885 — QwenAsrEncoderBatcher::run_batch has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (7 pts), match/switch 5 (7 pts), if/else 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.
D2 · Cognitive Complexity · Worker · ×1
  • Worker::pump (cognitive 17) crates/izwi-dictation/src/capture.rs:294 — Worker::pump has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (4 pts), boolean chains 1, match/switch 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.
D2 · Cognitive Complexity · InvocationStream · ×1
  • InvocationStream::fill_pending (cognitive 17) crates/izwi-serving-client/src/lib.rs:1091 — InvocationStream::fill_pending has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · NewStudioProjectDialog.NewStudioProjectDialog (cognitive 17) · ×1
  • NewStudioProjectDialog.NewStudioProjectDialog (cognitive 17) ui/src/features/studio/components/NewStudioProjectDialog.tsx:32 — NewStudioProjectDialog.NewStudioProjectDialog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, ternaries 4 (6 pts), boolean chains 3, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (submit, importFile, a function literal at line 59, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · VoiceOrb.VoiceOrb (cognitive 17) · ×1
  • VoiceOrb.VoiceOrb (cognitive 17) ui/src/features/voice/components/VoiceOrb.tsx:14 — VoiceOrb.VoiceOrb has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (8 pts) (nesting depth added 4). Of this number, 12 points are the body's own statements and 5 belong to 2 function literals 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.
D2 · Cognitive Complexity · useVoicePreferences.useVoicePreferences (cognitive 17) · ×1
  • useVoicePreferences.useVoicePreferences (cognitive 17) ui/src/features/voice/useVoicePreferences.ts:46 — useVoicePreferences.useVoicePreferences has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5, if/else 5, boolean chains 4, ternaries 3. None of this is in the body itself: all 17 points belong to 12 function literals inside it that branch (lines 153, 102, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ConvLayer · ×1
  • ConvLayer::forward (cognitive 16) crates/izwi-core/src/audio/codec.rs:75 — ConvLayer::forward has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 1 (4 pts), 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.
D2 · Cognitive Complexity · DeviceProfile · ×1
  • DeviceProfile::cuda_model_family_dtype_selection (cognitive 16) crates/izwi-core/src/backends/device.rs:606 — DeviceProfile::cuda_model_family_dtype_selection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). 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.
D2 · Cognitive Complexity · StreamProgressBudget · ×1
  • StreamProgressBudget::reserve (cognitive 16) crates/izwi-core/src/engine/request/streaming.rs:15 — StreamProgressBudget::reserve 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.
D2 · Cognitive Complexity · InferenceStateContract · ×1
  • InferenceStateContract::validate (cognitive 16) crates/izwi-core/src/kv/v2/contract.rs:65 — InferenceStateContract::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), 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.
D2 · Cognitive Complexity · WhisperEncoderBatcher · ×1
  • WhisperEncoderBatcher::run_batch (cognitive 16) crates/izwi-core/src/runtime/service/asr_encoders.rs:1168 — WhisperEncoderBatcher::run_batch has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (7 pts), match/switch 4 (6 pts), if/else 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.
D2 · Cognitive Complexity · ModifierListener · ×1
  • ModifierListener::start (cognitive 16) crates/izwi-dictation/src/hotkey.rs:42 — ModifierListener::start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 1, match/switch 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.
D2 · Cognitive Complexity · WorkerTlsConfig · ×1
  • WorkerTlsConfig::from_env (cognitive 16) crates/izwi-serving-worker/src/main.rs:1044 — WorkerTlsConfig::from_env has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 8). 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.
D2 · Cognitive Complexity · NoiseGate · ×1
  • NoiseGate::push (cognitive 16) crates/izwi-vad/src/gate.rs:77 — NoiseGate::push has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 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.
D2 · Cognitive Complexity · firstRunPlan.buildTaskRows (cognitive 16) · ×1
  • firstRunPlan.buildTaskRows (cognitive 16) ui/src/app/onboarding/firstRunPlan.ts:154 — firstRunPlan.buildTaskRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), 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.
D2 · Cognitive Complexity · CopyButton.CopyButton (cognitive 16) · ×1
  • CopyButton.CopyButton (cognitive 16) ui/src/components/ui/CopyButton.tsx:43 — CopyButton.CopyButton has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 3, boolean chains 2 (nesting depth added 2). Of this number, 11 points are the body's own statements and 5 belong to 2 function items inside it that branch. 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.
D2 · Cognitive Complexity · StudioProjectsPage.StudioProjectsPage (cognitive 16) · ×1
  • StudioProjectsPage.StudioProjectsPage (cognitive 16) ui/src/features/studio/components/StudioProjectsPage.tsx:24 — StudioProjectsPage.StudioProjectsPage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (10 pts), error handling 3, if/else 3 (nesting depth added 3). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (loadMore, a function literal at line 41, confirmDelete, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · DesignVoiceDialog.DesignVoiceDialog · ×1
  • DesignVoiceDialog.DesignVoiceDialog::generate (cognitive 16) ui/src/features/voice-studio/components/DesignVoiceDialog.tsx:148 — DesignVoiceDialog.DesignVoiceDialog::generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (5 pts), boolean chains 2, error handling 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. This shape REPEATS in the file: one other method here (DesignVoiceDialog.DesignVoiceDialog) 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.
D2 · Cognitive Complexity · VoiceSettingsSheet.EngineView (cognitive 16) · ×1
  • VoiceSettingsSheet.EngineView (cognitive 16) ui/src/features/voice/components/VoiceSettingsSheet.tsx:576 — VoiceSettingsSheet.EngineView has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (8 pts), boolean chains 4, if/else 4 (nesting depth added 2). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 636, 595, 690). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · http.consumeDataStream (cognitive 16) · ×1
  • http.consumeDataStream (cognitive 16) ui/src/shared/api/http.ts:101 — http.consumeDataStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (28 members, 14 shared lines) · ×1
  • Near-duplicate member family (28 members, 14 shared lines) crates/izwi-core/src/kernels/greedy.rs:135 — crates/izwi-core/src/kernels/greedy.rs:135-162 | crates/izwi-core/src/kernels/lfm_shortconv_step.rs:349-375 | crates/izwi-core/src/kernels/mamba2.rs:774-801 | crates/izwi-core/src/kernels/metal.rs:3306-3336 | crates/izwi-core/src/kernels/metal.rs:3429-3459 | crates/izwi-core/src/kernels/metal.rs:3555-3585 | crates/izwi-core/src/kernels/metal.rs:3718-3744 | crates/izwi-core/src/kernels/metal.rs:3882-3911 | crates/izwi-core/src/kernels/metal.rs:4126-4155 | crates/izwi-core/src/kernels/metal_fp8.rs:115-142 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:417-444 | crates/izwi-core/src/kernels/metal_kquant_mv.rs:281-307 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:251-277 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:139-166 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:172-204 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:335-361 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:934-961 | crates/izwi-core/src/kernels/moe_relu2.rs:1040-1067 | crates/izwi-core/src/kernels/qk_norm_rope.rs:342-369 | crates/izwi-core/src/kernels/residual_norm.rs:299-326 | crates/izwi-core/src/kernels/swiglu.rs:120-147 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1154-1184 | crates/izwi-core/src/models/architectures/kokoro/prosody.rs:897-927 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:374-404 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:407-437 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:533-563 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:566-596 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:599-629 — These 28 members are variants of one another: a block of 14 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 28 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 28 times.
D4 · Code Duplication · Near-duplicate member family (8 members, 18 shared lines) · ×1
  • Near-duplicate member family (8 members, 18 shared lines) crates/izwi-core/src/kernels/metal.rs:1656 — crates/izwi-core/src/kernels/metal.rs:1656-1692 | crates/izwi-core/src/kernels/metal.rs:1820-1856 | crates/izwi-core/src/kernels/metal.rs:1966-2002 | crates/izwi-core/src/kernels/metal.rs:2145-2181 | crates/izwi-core/src/kernels/metal.rs:2703-2736 | crates/izwi-core/src/kernels/metal.rs:2742-2788 | crates/izwi-core/src/kernels/metal.rs:3116-3149 | crates/izwi-core/src/kernels/metal.rs:3155-3201 — These 8 members are variants of one another: a block of 18 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 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 · Near-duplicate member family (7 members, 19 shared lines) · ×1
  • Near-duplicate member family (7 members, 19 shared lines) crates/izwi-core/src/kernels/metal.rs:1656 — crates/izwi-core/src/kernels/metal.rs:1656-1692 | crates/izwi-core/src/kernels/metal.rs:1820-1856 | crates/izwi-core/src/kernels/metal.rs:1966-2002 | crates/izwi-core/src/kernels/metal.rs:2145-2181 | crates/izwi-core/src/kernels/metal.rs:2703-2736 | crates/izwi-core/src/kernels/metal.rs:3116-3149 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:172-204 — These 7 members are variants of one another: a block of 19 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 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 · Near-duplicate member family (5 members, 36 shared lines) · ×1
  • Near-duplicate member family (5 members, 36 shared lines) crates/izwi-core/src/runtime/service/tts_preparation.rs:576 — crates/izwi-core/src/runtime/service/tts_preparation.rs:576-764 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1331-1485 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1492-1659 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1666-1810 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1817-1991 — These 5 members are variants of one another: a block of 36 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 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 · Near-duplicate member family (4 members, 81 shared lines) · ×1
  • Near-duplicate member family (4 members, 81 shared lines) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:444 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:444-535 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:591-715 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:771-918 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:974-1099 — These 4 members are variants of one another: a block of 81 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 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 · Near-duplicate member family (4 members, 69 shared lines) · ×1
  • Near-duplicate member family (4 members, 69 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:356 — crates/izwi-core/src/runtime/service/asr_preparation.rs:356-610 | crates/izwi-core/src/runtime/service/asr_preparation.rs:617-872 | crates/izwi-core/src/runtime/service/asr_preparation.rs:879-1126 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2135-2380 — These 4 members are variants of one another: a block of 69 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 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 · Near-duplicate member family (4 members, 64 shared lines) · ×1
  • Near-duplicate member family (4 members, 64 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:102 — crates/izwi-core/src/runtime/service/asr_preparation.rs:102-349 | crates/izwi-core/src/runtime/service/asr_preparation.rs:356-610 | crates/izwi-core/src/runtime/service/asr_preparation.rs:879-1126 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2135-2380 — These 4 members are variants of one another: a block of 64 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 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 · Near-duplicate member family (4 members, 44 shared lines) · ×1
  • Near-duplicate member family (4 members, 44 shared lines) crates/izwi-core/src/runtime/service/tts_preparation.rs:576 — crates/izwi-core/src/runtime/service/tts_preparation.rs:576-764 | crates/izwi-core/src/runtime/service/tts_preparation.rs:771-977 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1331-1485 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1492-1659 — These 4 members are variants of one another: a block of 44 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 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 · Near-duplicate member family (4 members, 12 shared lines) · ×1
  • Near-duplicate member family (4 members, 12 shared lines) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:560 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:560-849 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:856-1210 | crates/izwi-core/src/engine/executor/handler_tts.rs:3036-3330 | crates/izwi-core/src/engine/executor/handler_tts.rs:3337-3676 — These 4 members are variants of one another: a block of 12 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 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 · Near-duplicate member family (4 members, 7 shared lines) · ×1
  • Near-duplicate member family (4 members, 7 shared lines) crates/izwi-core/src/runtime/service/asr_encoders.rs:1168 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1168-1283 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1365-1545 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1629-1808 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1885-2017 — These 4 members are variants of one another: a block of 7 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 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 · Near-duplicate member family (3 members, 34 shared lines) · ×1
  • Near-duplicate member family (3 members, 34 shared lines) crates/izwi-cli/src/commands/bench.rs:1807 — crates/izwi-cli/src/commands/bench.rs:1807-2099 | crates/izwi-cli/src/commands/bench.rs:2118-2426 | crates/izwi-cli/src/commands/bench.rs:2440-2751 — These 3 members are variants of one another: a block of 34 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 pair (107 shared lines) · ×1
  • Near-duplicate member pair (107 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:1133 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1133-1390 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2186-2406 — These two members are variants of one another: 107 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 · Near-duplicate member pair (68 shared lines) · ×1
  • Near-duplicate member pair (68 shared lines) crates/izwi-core/src/runtime/service/tts_preparation.rs:990 — crates/izwi-core/src/runtime/service/tts_preparation.rs:990-1324 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1817-1991 — These two members are variants of one another: 68 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 · Near-duplicate member pair (66 shared lines) · ×1
  • Near-duplicate member pair (66 shared lines) crates/izwi-core/src/runtime/service/asr_preparation.rs:1400 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1400-1564 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2004-2179 — These two members are variants of one another: 66 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 · Near-duplicate member pair (63 shared lines) · ×1
  • Near-duplicate member pair (63 shared lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:315 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:315-467 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:539-665 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (61 shared lines) · ×1
  • Near-duplicate member pair (61 shared lines) crates/izwi-server/src/persistence/mod.rs:376 — crates/izwi-server/src/persistence/mod.rs:376-463 | crates/izwi-server/src/persistence/mod.rs:469-560 — These two members are variants of one another: 61 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 · Near-duplicate member pair (58 shared lines) · ×1
  • Near-duplicate member pair (58 shared lines) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:177 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:177-363 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:811-1001 — These two members are variants of one another: 58 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 · Near-duplicate member pair (51 shared lines) · ×1
  • Near-duplicate member pair (51 shared lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:781 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:781-937 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1011-1137 — These two members are variants of one another: 51 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 · Near-duplicate member pair (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:177 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:177-363 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1100-1241 — 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.
D4 · Code Duplication · Near-duplicate member pair (43 shared lines) · ×1
  • Near-duplicate member pair (43 shared lines) crates/izwi-server/src/diarization_store.rs:427 — crates/izwi-server/src/diarization_store.rs:427-571 | crates/izwi-server/src/diarization_store.rs:798-972 — These two members are variants of one another: 43 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 · Near-duplicate member pair (42 shared lines) · ×1
  • Near-duplicate member pair (42 shared lines) crates/izwi-core/src/runtime/service/tts_preparation.rs:389 — crates/izwi-core/src/runtime/service/tts_preparation.rs:389-569 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1817-1991 — These two members are variants of one another: 42 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 · Near-duplicate member pair (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) crates/izwi-core/src/engine/executor/handler_maya1.rs:531 — crates/izwi-core/src/engine/executor/handler_maya1.rs:531-577 | crates/izwi-core/src/engine/executor/handler_maya2.rs:426-472 — These two members are variants of one another: 40 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 · Near-duplicate member pair (33 shared lines) · ×1
  • Near-duplicate member pair (33 shared lines) crates/izwi-core/src/kernels/metal.rs:4349 — crates/izwi-core/src/kernels/metal.rs:4349-4412 | crates/izwi-core/src/kernels/metal.rs:4468-4531 — These two members are variants of one another: 33 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 · Near-duplicate member pair (32 shared lines) · ×1
  • Near-duplicate member pair (32 shared lines) crates/izwi-core/src/config.rs:81 — crates/izwi-core/src/config.rs:81-124 | crates/izwi-core/src/config.rs:286-329 — These two members are variants of one another: 32 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (28 shared lines) · ×1
  • Near-duplicate member pair (28 shared lines) crates/izwi-core/src/kernels/cuda.rs:379 — crates/izwi-core/src/kernels/cuda.rs:379-471 | crates/izwi-core/src/kernels/cuda.rs:483-563 — These two members are variants of one another: 28 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 · Near-duplicate member pair (23 shared lines) · ×1
  • Near-duplicate member pair (23 shared lines) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1166 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1166-1208 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1223-1304 — These two members are variants of one another: 23 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 (14 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (14 members, 50+ identical tokens) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:560 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:560-849 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:856-1210 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:157-331 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:338-569 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:148-330 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:337-570 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:514-767 | crates/izwi-core/src/engine/executor/handler_chatterbox.rs:95-357 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:104-424 | crates/izwi-core/src/engine/executor/handler_maya1.rs:106-347 | crates/izwi-core/src/engine/executor/handler_maya2.rs:107-349 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:110-491 | crates/izwi-core/src/engine/executor/handler_tts.rs:1291-1614 | crates/izwi-core/src/engine/executor/handler_tts.rs:3036-3330 — These 14 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 14 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 14 times.
D4 · Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (13 members, 50+ identical tokens) crates/izwi-core/src/kernels/metal.rs:3229 — crates/izwi-core/src/kernels/metal.rs:3229-3302 | crates/izwi-core/src/kernels/metal.rs:3360-3425 | crates/izwi-core/src/kernels/metal.rs:3483-3551 | crates/izwi-core/src/kernels/metal.rs:3613-3714 | crates/izwi-core/src/kernels/metal.rs:3780-3878 | crates/izwi-core/src/kernels/metal.rs:3966-4122 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1034-1150 | crates/izwi-core/src/models/architectures/kokoro/prosody.rs:798-893 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:154-236 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:265-370 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:206-304 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:329-411 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:436-529 — These 13 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 13 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 13 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) crates/izwi-core/src/kernels/metal.rs:1592 — crates/izwi-core/src/kernels/metal.rs:1592-1652 | crates/izwi-core/src/kernels/metal.rs:1729-1816 | crates/izwi-core/src/kernels/metal.rs:1888-1962 | crates/izwi-core/src/kernels/metal.rs:2041-2141 | crates/izwi-core/src/kernels/metal.rs:2275-2682 | crates/izwi-core/src/kernels/metal.rs:2816-3109 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:266-332 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1047-1086 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) crates/izwi-core/src/kernels/cuda/gdn.rs:859 — crates/izwi-core/src/kernels/cuda/gdn.rs:859-929 | crates/izwi-core/src/kernels/cuda/gdn.rs:989-1053 | crates/izwi-core/src/kernels/cuda/gdn.rs:1069-1138 | crates/izwi-core/src/kernels/cuda/gdn.rs:1153-1258 | crates/izwi-core/src/kernels/cuda/rope.rs:504-568 | crates/izwi-core/src/kernels/cuda/rope.rs:598-670 | crates/izwi-core/src/kernels/cuda/rope.rs:687-778 — 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 · Edited copy of a member (174 corresponding lines) · ×1
  • Edited copy of a member (174 corresponding lines) crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:585 — crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:585-758 | crates/izwi-core/src/engine/executor/handler_tts.rs:2026-2216 — These two members are one piece of code written twice and then edited apart: 174 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 (109 corresponding lines) · ×1
  • Edited copy of a member (109 corresponding lines) crates/izwi-core/src/engine/executor.rs:4552 — crates/izwi-core/src/engine/executor.rs:4552-4661 | crates/izwi-core/src/engine/executor.rs:4667-4775 — These two members are one piece of code written twice and then edited apart: 109 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 (84 corresponding lines) · ×1
  • Edited copy of a member (84 corresponding lines) crates/izwi-cli/src/commands/bench.rs:3797 — crates/izwi-cli/src/commands/bench.rs:3797-3884 | crates/izwi-cli/src/commands/bench.rs:3886-3969 — These two members are one piece of code written twice and then edited apart: 84 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 (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1439 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1439-1484 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1550-1596 — These two members are one piece of code written twice and then edited apart: 46 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 (72 corresponding lines) · ×1
  • Edited copy of a member (72 corresponding lines) crates/izwi-core/src/kernels/cuda/sampling_device.rs:54 — crates/izwi-core/src/kernels/cuda/sampling_device.rs:54-132 | crates/izwi-core/src/kernels/cuda/sampling_device.rs:138-209 — These two members are one piece of code written twice and then edited apart: 72 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 (66 corresponding lines) · ×1
  • Edited copy of a member (66 corresponding lines) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:792 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:792-877 | crates/izwi-core/src/engine/executor/handler_asr/granite_speech5.rs:131-196 — These two members are one piece of code written twice and then edited apart: 66 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 (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) crates/izwi-server/src/app/openai_realtime/respond.rs:670 — crates/izwi-server/src/app/openai_realtime/respond.rs:670-728 | crates/izwi-server/src/app/openai_realtime/respond.rs:781-850 — These two members are one piece of code written twice and then edited apart: 59 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 (71 corresponding lines) · ×1
  • Edited copy of a member (71 corresponding lines) crates/izwi-core/src/audio/codec.rs:208 — crates/izwi-core/src/audio/codec.rs:208-278 | crates/izwi-core/src/audio/codec.rs:287-363 — These two members are one piece of code written twice and then edited apart: 71 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 (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:669 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:669-771 | crates/izwi-core/src/engine/executor/handler_asr/granite_speech5.rs:48-120 — These two members are one piece of code written twice and then edited apart: 73 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, 45+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 45+ corresponding lines) crates/izwi-server/src/diarization_store.rs:338 — crates/izwi-server/src/diarization_store.rs:338-382 | crates/izwi-server/src/speech_history_store.rs:622-670 | crates/izwi-server/src/transcription_store.rs:373-421 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 45 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 (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) crates/izwi-core/src/kernels/cuda/moe.rs:476 — crates/izwi-core/src/kernels/cuda/moe.rs:476-530 | crates/izwi-core/src/kernels/cuda/moe.rs:540-595 — These two members are one piece of code written twice and then edited apart: 55 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) crates/izwi-core/src/kernels/metal_lfm_norm.rs:137 — crates/izwi-core/src/kernels/metal_lfm_norm.rs:137-181 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:210-248 — 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 (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) crates/izwi-core/src/runtime/lifecycle/load/admission.rs:464 — crates/izwi-core/src/runtime/lifecycle/load/admission.rs:464-528 | crates/izwi-core/src/runtime/lifecycle/load/admission.rs:1181-1237 — These two members are one piece of code written twice and then edited apart: 57 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 (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:70 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:70-120 | crates/izwi-core/src/engine/executor/fish_pending.rs:44-101 — These two members are one piece of code written twice and then edited apart: 51 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) · ×1
  • Edited copy of a member (43 corresponding lines) crates/izwi-core/src/kernels/greedy.rs:91 — crates/izwi-core/src/kernels/greedy.rs:91-133 | crates/izwi-core/src/kernels/swiglu.rs:74-118 — 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 (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) crates/izwi-server/src/artifact_store.rs:997 — crates/izwi-server/src/artifact_store.rs:997-1050 | crates/izwi-server/src/artifact_store.rs:1056-1110 — These two members are one piece of code written twice and then edited apart: 54 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 (7 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 29+ corresponding lines) crates/izwi-core/src/engine/executor/dispatch.rs:1043 — crates/izwi-core/src/engine/executor/dispatch.rs:1043-1072 | crates/izwi-core/src/engine/executor/dispatch.rs:1079-1108 | crates/izwi-core/src/engine/executor/dispatch.rs:1115-1143 | crates/izwi-core/src/engine/executor/dispatch.rs:1150-1178 | crates/izwi-core/src/engine/executor/dispatch.rs:1188-1221 | crates/izwi-core/src/engine/executor/dispatch.rs:1231-1263 | crates/izwi-core/src/engine/executor/dispatch.rs:1270-1298 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 29 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) crates/izwi-core/src/kernels/metal_qwen36moe.rs:1126 — crates/izwi-core/src/kernels/metal_qwen36moe.rs:1126-1154 | crates/izwi-core/src/kernels/moe_relu2.rs:1137-1155 | crates/izwi-core/src/kernels/moe_relu2.rs:1163-1179 | crates/izwi-core/src/kernels/moe_relu2.rs:1186-1203 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) crates/izwi-core/src/engine/resources.rs:1337 — crates/izwi-core/src/engine/resources.rs:1337-1373 | crates/izwi-core/src/engine/resources.rs:1379-1418 — These two members are one piece of code written twice and then edited apart: 37 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, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) crates/izwi-server/src/speech_history_store.rs:1074 — crates/izwi-server/src/speech_history_store.rs:1074-1112 | crates/izwi-server/src/transcription_store.rs:807-842 | crates/izwi-server/src/transcription_store.rs:907-941 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 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 (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) crates/izwi-server/src/batch_runtime/store/artifacts.rs:230 — crates/izwi-server/src/batch_runtime/store/artifacts.rs:230-282 | crates/izwi-server/src/batch_runtime/store/media.rs:281-343 — These two members are one piece of code written twice and then edited apart: 53 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) crates/izwi-core/src/model/manager.rs:305 — crates/izwi-core/src/model/manager.rs:305-337 | crates/izwi-core/src/model/manager.rs:344-376 — 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, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:291 — crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:291-320 | crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:380-404 | crates/izwi-core/src/runtime/lifecycle/tts_memory.rs:492-516 — 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 copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) crates/izwi-core/src/runtime/asr/realtime_session.rs:1351 — crates/izwi-core/src/runtime/asr/realtime_session.rs:1351-1372 | crates/izwi-core/src/runtime/coordinator.rs:2987-3016 | crates/izwi-core/src/runtime/tts.rs:171-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 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) crates/izwi-server/src/voice_store.rs:355 — crates/izwi-server/src/voice_store.rs:355-382 | crates/izwi-server/src/voice_store.rs:389-414 | crates/izwi-server/src/voice_store.rs:421-453 — 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 copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/izwi-gateway/src/app/chat_content.rs:92 — crates/izwi-gateway/src/app/chat_content.rs:92-107 | crates/izwi-gateway/src/app/chat_content.rs:111-125 | crates/izwi-gateway/src/app/chat_content.rs:173-188 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:213 — crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:213-225 | crates/izwi-core/src/engine/executor/fish_drama3_pending.rs:228-240 | crates/izwi-core/src/engine/executor/fish_pending.rs:192-205 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) crates/izwi-core/src/engine/executor/dispatch.rs:1305 — crates/izwi-core/src/engine/executor/dispatch.rs:1305-1321 | crates/izwi-core/src/engine/executor/dispatch.rs:1328-1345 | crates/izwi-core/src/engine/executor/dispatch.rs:1352-1369 | crates/izwi-core/src/engine/executor/dispatch.rs:1376-1393 | crates/izwi-core/src/engine/executor/dispatch.rs:1400-1417 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) crates/izwi-server/src/api/diarization/handlers.rs:145 — crates/izwi-server/src/api/diarization/handlers.rs:145-163 | crates/izwi-server/src/api/saved_voices/handlers.rs:81-103 | crates/izwi-server/src/api/studio/handlers.rs:211-228 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 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 (6 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 14+ corresponding lines) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:53 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:53-66 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:729-742 | crates/izwi-core/src/runtime/adapters/loaded/realtime.rs:43-56 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1065-1079 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1293-1306 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1529-1542 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) crates/izwi-core/src/backends/state/invocation.rs:1618 — crates/izwi-core/src/backends/state/invocation.rs:1618-1628 | crates/izwi-core/src/backends/state/static_attention.rs:1547-1557 | crates/izwi-core/src/backends/state/tensor.rs:1147-1157 | crates/izwi-core/src/engine/cache/physical.rs:1218-1228 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 9+ corresponding lines) crates/izwi-core/src/kernels/cuda/gate.rs:77 — crates/izwi-core/src/kernels/cuda/gate.rs:77-85 | crates/izwi-core/src/kernels/cuda/gdn.rs:765-773 | crates/izwi-core/src/kernels/cuda/moe.rs:744-752 | crates/izwi-core/src/kernels/cuda/norm.rs:109-117 | crates/izwi-core/src/kernels/cuda/rope.rs:472-480 | crates/izwi-core/src/kernels/cuda/row_gemv.rs:336-344 | crates/izwi-core/src/kernels/qk_norm_rope.rs:468-476 | crates/izwi-core/src/kernels/residual_norm.rs:399-407 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 15+ corresponding lines) crates/izwi-core/src/kernels/mod.rs:117 — crates/izwi-core/src/kernels/mod.rs:117-131 | crates/izwi-core/src/kernels/mod.rs:178-192 | crates/izwi-core/src/kernels/mod.rs:198-212 | crates/izwi-core/src/kernels/mod.rs:214-228 | crates/izwi-core/src/kernels/mod.rs:300-314 | crates/izwi-core/src/kernels/mod.rs:320-334 | crates/izwi-core/src/kernels/mod.rs:353-367 | crates/izwi-core/src/kernels/mod.rs:376-390 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 15 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 8 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) crates/izwi-core/src/engine/executor/streaming.rs:558 — crates/izwi-core/src/engine/executor/streaming.rs:558-577 | crates/izwi-core/src/engine/executor/streaming.rs:587-606 | crates/izwi-core/src/engine/executor/streaming.rs:670-689 | crates/izwi-core/src/engine/executor/streaming.rs:697-716 — 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 copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) crates/izwi-core/src/engine/cache/invocation_tensor.rs:1098 — crates/izwi-core/src/engine/cache/invocation_tensor.rs:1098-1106 | crates/izwi-core/src/engine/cache/prefix.rs:45-53 | crates/izwi-core/src/kv/v2/contract.rs:130-141 | crates/izwi-core/src/kv/v2/descriptor.rs:872-880 — 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 (7 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 12+ corresponding lines) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:57 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:57-68 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:66-77 | crates/izwi-core/src/engine/executor/handler_maya1.rs:52-63 | crates/izwi-core/src/engine/executor/handler_maya2.rs:53-64 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:69-83 | crates/izwi-core/src/engine/executor/handler_tts.rs:183-194 | crates/izwi-core/src/engine/executor/handler_tts.rs:249-266 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 9+ corresponding lines) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:77 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:77-86 | crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:213-223 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:86-95 | crates/izwi-core/src/engine/executor/handler_maya1.rs:88-97 | crates/izwi-core/src/engine/executor/handler_maya2.rs:89-98 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:92-101 | crates/izwi-core/src/engine/executor/handler_tts.rs:2002-2010 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 8+ corresponding lines) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:545 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:545-552 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:536-543 | crates/izwi-core/src/engine/executor/handler_maya1.rs:613-620 | crates/izwi-core/src/engine/executor/handler_maya2.rs:508-515 | crates/izwi-core/src/engine/executor/handler_tts.rs:4626-4634 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 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, 6+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 6+ corresponding lines) crates/izwi-core/src/artifacts/downloader.rs:407 — crates/izwi-core/src/artifacts/downloader.rs:407-412 | crates/izwi-core/src/kv/v2/runtime.rs:804-810 | crates/izwi-core/src/models/architectures/maya2/text/lang.rs:365-370 | crates/izwi-server/src/app/voice_realtime/turn.rs:35-40 — These 4 members are one piece of code written 4 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 4 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) crates/izwi-cli/src/commands/transcribe.rs:157 — crates/izwi-cli/src/commands/transcribe.rs:157-161 | crates/izwi-cli/src/commands/tts.rs:633-636 | crates/izwi-server/src/api/transcription/handlers.rs:2063-2066 — 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.
D4 · Code Duplication · Duplicated block (36–37 lines × 3) · ×1
  • Duplicated block (36–37 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:520 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:520-555 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:306-342 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:388-423 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:520` it begins part-way through the construct above it, so those 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 · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) crates/izwi-core/src/runtime/service/asr_encoders.rs:1424 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1424-1460 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1688-1724 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1424` 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.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) crates/izwi-cli/src/commands/list.rs:72 — crates/izwi-cli/src/commands/list.rs:72-104 | crates/izwi-cli/src/commands/models.rs:150-182 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `models` to `&[ModelRecord]` in one and `&[AdminModelInfo]` 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.
D4 · Code Duplication · Duplicated block (32–33 lines × 2) · ×1
  • Duplicated block (32–33 lines × 2) crates/izwi-core/src/kernels/cuda/gdn.rs:1099 — crates/izwi-core/src/kernels/cuda/gdn.rs:1099-1131 | crates/izwi-core/src/kernels/cuda/gdn.rs:1208-1239 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/gdn.rs:1099` 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.
D4 · Code Duplication · Duplicated block (32 lines × 3) · ×1
  • Duplicated block (32 lines × 3) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:326 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:326-357 | crates/izwi-core/src/engine/executor/handler_maya1.rs:316-347 | crates/izwi-core/src/engine/executor/handler_maya2.rs:318-349 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:326` 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.
D4 · Code Duplication · Duplicated block (31–32 lines × 2) · ×1
  • Duplicated block (31–32 lines × 2) crates/izwi-core/src/engine/executor/handler_maya1.rs:383 — crates/izwi-core/src/engine/executor/handler_maya1.rs:383-414 | crates/izwi-core/src/engine/executor/handler_maya1.rs:489-519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) crates/izwi-core/src/kernels/cuda/rope.rs:634 — crates/izwi-core/src/kernels/cuda/rope.rs:634-661 | crates/izwi-core/src/kernels/cuda/rope.rs:728-757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) crates/izwi-core/src/runtime/service/asr_encoders.rs:1366 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1366-1395 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1630-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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) crates/izwi-server/src/diarization_store.rs:440 — crates/izwi-server/src/diarization_store.rs:440-468 | crates/izwi-server/src/diarization_store.rs:805-833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `record` to `NewDiarizationRecord` in one and `CompleteDiarizationRecord` 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, `crates/izwi-server/src/diarization_store.rs:439` calls `normalize_processing_status`, `as_deref` and `crates/izwi-server/src/diarization_store.rs:804` 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.
D4 · Code Duplication · Duplicated block (25–28 lines × 2) · ×1
  • Duplicated block (25–28 lines × 2) crates/izwi-server/src/media_ingest.rs:391 — crates/izwi-server/src/media_ingest.rs:391-418 | crates/izwi-server/src/media_ingest.rs:498-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-server/src/media_ingest.rs:391` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-server/src/media_ingest.rs:390` calls `compensate_delete` and `crates/izwi-server/src/media_ingest.rs:497` 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.
D4 · Code Duplication · Duplicated block (25–26 lines × 3) · ×1
  • Duplicated block (25–26 lines × 3) crates/izwi-server/src/api/saved_voices/handlers.rs:250 — crates/izwi-server/src/api/saved_voices/handlers.rs:250-275 | crates/izwi-server/src/api/speech_history/handlers.rs:3191-3215 | crates/izwi-server/src/api/studio/handlers.rs:1445-1469 — `crates/izwi-server/src/api/speech_history/handlers.rs` and `crates/izwi-server/src/api/studio/handlers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `audio` to `StoredSavedVoiceAudio` in one and `StoredSpeechAudio` 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.
D4 · Code Duplication · Duplicated block (19–24 lines × 4) · ×1
  • Duplicated block (19–24 lines × 4) crates/izwi-core/src/engine/mod.rs:2073 — crates/izwi-core/src/engine/mod.rs:2073-2096 | crates/izwi-core/src/engine/mod.rs:2182-2200 | crates/izwi-core/src/engine/mod.rs:2284-2302 | crates/izwi-core/src/engine/mod.rs:2394-2415 — 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 `crates/izwi-core/src/engine/mod.rs:2073` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:274 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:274-295 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:580-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:274` 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 · Duplicated block (21–24 lines × 2) · ×1
  • Duplicated block (21–24 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:1470 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1470-1490 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1682-1705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) crates/izwi-core/src/runtime/service/tts_preparation.rs:1390 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1390-1412 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1551-1573 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1719-1741 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1390` 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 · Duplicated block (22 lines × 4) · ×1
  • Duplicated block (22 lines × 4) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:513 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:513-534 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:468-489 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1104-1125 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:748-769 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:513` 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, `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:466` calls `Ok` and `crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:747` 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.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:347 — crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:347-368 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:383-402 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` and `crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 171 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. 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, `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:345` calls `match`, `Some` and `crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:382` 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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) crates/izwi-core/src/runtime/service/asr_preparation.rs:1370 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1370-1390 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2385-2406 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1370` 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.
D4 · Code Duplication · Duplicated block (21 lines × 4) · ×1
  • Duplicated block (21 lines × 4) crates/izwi-core/src/runtime/service/asr_preparation.rs:491 — crates/izwi-core/src/runtime/service/asr_preparation.rs:491-511 | crates/izwi-core/src/runtime/service/asr_preparation.rs:779-799 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1043-1063 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2298-2318 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:491` 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 · Duplicated block (18–19 lines × 9) · ×1
  • Duplicated block (18–19 lines × 9) crates/izwi-core/src/runtime/service/tts_preparation.rs:410 — crates/izwi-core/src/runtime/service/tts_preparation.rs:410-428 | crates/izwi-core/src/runtime/service/tts_preparation.rs:599-617 | crates/izwi-core/src/runtime/service/tts_preparation.rs:794-812 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1021-1039 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1354-1372 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1513-1531 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1685-1702 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1836-1853 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2209-2227 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/service/tts_preparation.rs:410` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–19 lines × 7) · ×1
  • Duplicated block (18–19 lines × 7) crates/izwi-core/src/runtime/service/asr_preparation.rs:247 — crates/izwi-core/src/runtime/service/asr_preparation.rs:247-264 | crates/izwi-core/src/runtime/service/asr_preparation.rs:497-515 | crates/izwi-core/src/runtime/service/asr_preparation.rs:785-803 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1049-1067 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1254-1271 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2304-2322 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2265-2282 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:247` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/runtime/service/asr_preparation.rs:265` calls `ok_or_else`, `InferenceError`, `to_string` and `crates/izwi-core/src/runtime/service/asr_preparation.rs:1068` 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 4) · ×1
  • Duplicated block (18–19 lines × 4) crates/izwi-core/src/runtime/service/asr_preparation.rs:1503 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1503-1520 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1421-1439 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1750-1768 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2110-2128 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1503` it begins part-way through the construct above it, so those 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 · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) crates/izwi-core/src/runtime/service/tts_preparation.rs:1414 — crates/izwi-core/src/runtime/service/tts_preparation.rs:1414-1432 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1575-1593 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1743-1761 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:1414` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/runtime/service/tts_preparation.rs:1594` calls `clone` and `crates/izwi-core/src/runtime/service/tts_preparation.rs:1433` 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.
D4 · Code Duplication · Duplicated block (13–18 lines × 13) · ×1
  • Duplicated block (13–18 lines × 13) crates/izwi-core/src/kernels/metal.rs:3261 — crates/izwi-core/src/kernels/metal.rs:3261-3278 | crates/izwi-core/src/kernels/metal.rs:3389-3401 | crates/izwi-core/src/kernels/metal.rs:3514-3526 | crates/izwi-core/src/kernels/metal.rs:3670-3686 | crates/izwi-core/src/kernels/metal.rs:3835-3852 | crates/izwi-core/src/kernels/metal.rs:4061-4078 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1103-1120 | crates/izwi-core/src/models/architectures/kokoro/prosody.rs:850-867 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:194-206 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:320-337 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:257-274 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:369-381 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:484-496 — before extracting anything, compare `crates/izwi-core/src/kernels/metal.rs` and `crates/izwi-core/src/models/architectures/kokoro/decoder.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 81 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, `crates/izwi-core/src/kernels/metal.rs:3528` calls `set_bytes` and `crates/izwi-core/src/kernels/metal.rs:3280` 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.
D4 · Code Duplication · Duplicated block (13–18 lines × 9) · ×1
  • Duplicated block (13–18 lines × 9) crates/izwi-core/src/kernels/metal.rs:1617 — crates/izwi-core/src/kernels/metal.rs:1617-1629 | crates/izwi-core/src/kernels/metal.rs:1769-1786 | crates/izwi-core/src/kernels/metal.rs:1921-1933 | crates/izwi-core/src/kernels/metal.rs:2096-2113 | crates/izwi-core/src/kernels/metal.rs:2439-2455 | crates/izwi-core/src/kernels/metal.rs:2553-2569 | crates/izwi-core/src/kernels/metal.rs:2632-2648 | crates/izwi-core/src/kernels/metal.rs:2976-2992 | crates/izwi-core/src/kernels/metal.rs:3057-3073 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/kernels/metal.rs:1789` calls `set_bytes` and `crates/izwi-core/src/kernels/metal.rs:1936` 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.
D4 · Code Duplication · Duplicated block (18 lines × 6) · ×1
  • Duplicated block (18 lines × 6) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:532 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:532-549 | crates/izwi-core/src/engine/executor/handler_asr/lfm3_live.rs:437-454 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:319-336 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:400-417 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:349-366 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:385-402 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:532` it begins part-way through the construct above it, so those 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 · Duplicated block (17–18 lines × 4) · ×1
  • Duplicated block (17–18 lines × 4) crates/izwi-core/src/runtime/service/asr_encoders.rs:1145 — crates/izwi-core/src/runtime/service/asr_encoders.rs:1145-1161 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1341-1358 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1605-1622 | crates/izwi-core/src/runtime/service/asr_encoders.rs:1861-1878 — 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 `crates/izwi-core/src/runtime/service/asr_encoders.rs:1145` 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 · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/granite.rs:455 — crates/izwi-core/src/engine/executor/handler_asr/granite.rs:455-472 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:222-239 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:294-311 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/granite.rs` and `crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 160 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 `crates/izwi-core/src/engine/executor/handler_asr/granite.rs:455` it begins part-way through the construct above it, so those 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 · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) crates/izwi-core/src/kernels/metal.rs:1942 — crates/izwi-core/src/kernels/metal.rs:1942-1959 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:164-178 — before extracting anything, compare `crates/izwi-core/src/kernels/metal.rs` and `crates/izwi-core/src/kernels/metal_lfm_norm.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 81 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 `crates/izwi-core/src/kernels/metal.rs:1942` it begins part-way through the construct above it, so those 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 · Duplicated block (16–17 lines × 13) · ×1
  • Duplicated block (16–17 lines × 13) crates/izwi-core/src/kernels/metal.rs:1632 — crates/izwi-core/src/kernels/metal.rs:1632-1648 | crates/izwi-core/src/kernels/metal.rs:2121-2137 | crates/izwi-core/src/kernels/metal.rs:3282-3298 | crates/izwi-core/src/kernels/metal.rs:3405-3421 | crates/izwi-core/src/kernels/metal.rs:3531-3547 | crates/izwi-core/src/kernels/metal.rs:3695-3710 | crates/izwi-core/src/kernels/metal.rs:3859-3874 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1130-1146 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:216-232 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:350-366 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:284-300 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:391-407 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:509-525 — before extracting anything, compare `crates/izwi-core/src/kernels/metal.rs` and `crates/izwi-core/src/models/architectures/kokoro/decoder.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 81 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 `crates/izwi-core/src/kernels/metal.rs:1632` 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, `crates/izwi-core/src/kernels/metal.rs:3279` calls `set_bytes` and `crates/izwi-core/src/kernels/metal.rs:1629` 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.
D4 · Code Duplication · Duplicated block (17 lines × 6) · ×1
  • Duplicated block (17 lines × 6) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:516 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:516-532 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:471-487 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1107-1123 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:476-492 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:475-491 | crates/izwi-core/src/engine/executor/handler_asr/whisper.rs:751-767 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 6) · ×1
  • Duplicated block (16–17 lines × 6) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:793 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:793-808 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1021-1036 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1382-1398 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:189-204 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:455-470 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:826-841 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:793` 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 · Duplicated block (16–17 lines × 4) · ×1
  • Duplicated block (16–17 lines × 4) crates/izwi-core/src/engine/executor/dispatch.rs:856 — crates/izwi-core/src/engine/executor/dispatch.rs:856-872 | crates/izwi-core/src/engine/executor/dispatch.rs:897-912 | crates/izwi-core/src/engine/executor/dispatch.rs:937-952 | crates/izwi-core/src/engine/executor/dispatch.rs:1011-1027 — 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 `crates/izwi-core/src/engine/executor/dispatch.rs:856` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–17 lines × 3) · ×1
  • Duplicated block (15–17 lines × 3) crates/izwi-core/src/kernels/metal.rs:1636 — crates/izwi-core/src/kernels/metal.rs:1636-1652 | crates/izwi-core/src/kernels/metal.rs:1946-1962 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:167-181 — before extracting anything, compare `crates/izwi-core/src/kernels/metal.rs` and `crates/izwi-core/src/kernels/metal_lfm_norm.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 81 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 `crates/izwi-core/src/kernels/metal.rs:1636` 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) crates/izwi-core/src/kernels/metal.rs:2499 — crates/izwi-core/src/kernels/metal.rs:2499-2515 | crates/izwi-core/src/kernels/metal.rs:2613-2628 | crates/izwi-core/src/kernels/metal.rs:2659-2675 — 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 `crates/izwi-core/src/kernels/metal.rs:2499` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) crates/izwi-core/src/engine/executor/handler_tts.rs:3456 — crates/izwi-core/src/engine/executor/handler_tts.rs:3456-3472 | crates/izwi-core/src/engine/executor/handler_tts.rs:3518-3532 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:3456` 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:130 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:130-145 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:336-350 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1117-1131 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:146` calls `dispatch_long_form_asr_by_chunk` and `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:351` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) crates/izwi-cli/src/commands/serve.rs:349 — crates/izwi-cli/src/commands/serve.rs:349-362 | crates/izwi-cli/src/commands/serve.rs:419-434 — both copies are in the same file, so extract the 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 `crates/izwi-cli/src/commands/serve.rs:349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) crates/izwi-core/src/backends/kv/accelerator.rs:2314 — crates/izwi-core/src/backends/kv/accelerator.rs:2314-2325 | crates/izwi-core/src/backends/kv/cpu.rs:279-295 — before extracting anything, compare `crates/izwi-core/src/backends/kv/accelerator.rs` and `crates/izwi-core/src/backends/kv/cpu.rs` as WHOLE FILES: this scan already matched 9 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. 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, `crates/izwi-core/src/backends/kv/cpu.rs:276` calls `is_empty`, `Ok`, `ready_fence` and `crates/izwi-core/src/backends/kv/accelerator.rs:2313` 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.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) crates/izwi-core/src/backends/kv/accelerator.rs:2369 — crates/izwi-core/src/backends/kv/accelerator.rs:2369-2384 | crates/izwi-core/src/backends/kv/accelerator.rs:2408-2420 — both copies are in the same file, so extract the 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, `crates/izwi-core/src/backends/kv/accelerator.rs:2422` calls `accelerator_indices` and `crates/izwi-core/src/backends/kv/accelerator.rs:2386` 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.
D4 · Code Duplication · Duplicated block (15 lines × 13) · ×1
  • Duplicated block (15 lines × 13) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:567 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:567-581 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:860-874 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:164-178 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:340-354 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:155-169 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:339-353 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:541-555 | crates/izwi-core/src/engine/executor/handler_chatterbox.rs:105-119 | crates/izwi-core/src/engine/executor/handler_maya1.rs:114-128 | crates/izwi-core/src/engine/executor/handler_maya2.rs:115-129 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:120-134 | crates/izwi-core/src/engine/executor/handler_tts.rs:1298-1312 | crates/izwi-core/src/engine/executor/handler_tts.rs:3043-3057 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:567` 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 · Duplicated block (14–15 lines × 10) · ×1
  • Duplicated block (14–15 lines × 10) crates/izwi-core/src/runtime/service/asr_preparation.rs:120 — crates/izwi-core/src/runtime/service/asr_preparation.rs:120-134 | crates/izwi-core/src/runtime/service/asr_preparation.rs:373-386 | crates/izwi-core/src/runtime/service/asr_preparation.rs:634-647 | crates/izwi-core/src/runtime/service/asr_preparation.rs:898-911 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1154-1167 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1419-1432 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1598-1611 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1819-1832 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1986-1999 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2269-2282 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/izwi-core/src/runtime/service/asr_preparation.rs:1433` calls `lfm3_audio`, `row_context`, `clone` and `crates/izwi-core/src/runtime/service/asr_preparation.rs:135` 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.
D4 · Code Duplication · Duplicated block (15 lines × 9) · ×1
  • Duplicated block (15 lines × 9) crates/izwi-core/src/kernels/greedy.rs:143 — crates/izwi-core/src/kernels/greedy.rs:143-157 | crates/izwi-core/src/kernels/mamba2.rs:782-796 | crates/izwi-core/src/kernels/metal_fp8.rs:123-137 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:425-439 | crates/izwi-core/src/kernels/metal_kquant_mv.rs:288-302 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:258-272 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:942-956 | crates/izwi-core/src/kernels/moe_relu2.rs:1048-1062 | crates/izwi-core/src/kernels/qk_norm_rope.rs:350-364 — before extracting anything, compare `crates/izwi-core/src/kernels/greedy.rs` and `crates/izwi-core/src/kernels/mamba2.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 73 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 `crates/izwi-core/src/kernels/greedy.rs:143` it begins part-way through the construct above it, so those 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 · Duplicated block (11–15 lines × 8) · ×1
  • Duplicated block (11–15 lines × 8) crates/izwi-core/src/runtime/service/asr_preparation.rs:1295 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1295-1309 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1511-1521 | crates/izwi-core/src/runtime/service/tts_preparation.rs:498-508 | crates/izwi-core/src/runtime/service/tts_preparation.rs:694-704 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1430-1440 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1759-1769 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2119-2129 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2301-2315 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1295` 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 5) · ×1
  • Duplicated block (13–15 lines × 5) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1086 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1086-1099 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:468-480 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:623-635 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:803-816 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1006-1020 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1086` 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 4) · ×1
  • Duplicated block (13–15 lines × 4) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:108 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:108-120 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:782-796 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1012-1024 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1373-1385 — 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) crates/izwi-core/src/bin/kokoro_inspect.rs:23 — crates/izwi-core/src/bin/kokoro_inspect.rs:23-37 | crates/izwi-core/src/bin/kokoro_inspect.rs:86-100 | crates/izwi-core/src/bin/kokoro_inspect.rs:113-127 — 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 `crates/izwi-core/src/bin/kokoro_inspect.rs:23` 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) crates/izwi-core/src/kernels/cuda/sampling_device.rs:87 — crates/izwi-core/src/kernels/cuda/sampling_device.rs:87-106 | crates/izwi-core/src/kernels/cuda/sampling_device.rs:162-180 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/kernels/cuda/sampling_device.rs: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.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) crates/izwi-core/src/model/manager.rs:347 — crates/izwi-core/src/model/manager.rs:347-361 | crates/izwi-core/src/model/manager.rs:528-539 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/model/manager.rs:347` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) crates/izwi-server/src/api/tts_policy.rs:614 — crates/izwi-core/src/models/architectures/fish_drama3/model/budget.rs:42-56 | crates/izwi-server/src/api/tts_policy.rs:614-627 — 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–14 lines × 10) · ×1
  • Duplicated block (10–14 lines × 10) crates/izwi-core/src/runtime/service/asr_preparation.rs:1297 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1297-1310 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1513-1522 | crates/izwi-core/src/runtime/service/tts_preparation.rs:500-509 | crates/izwi-core/src/runtime/service/tts_preparation.rs:696-705 | crates/izwi-core/src/runtime/service/tts_preparation.rs:910-919 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1432-1441 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1594-1603 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1761-1770 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2121-2130 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2303-2316 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1297` 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, `crates/izwi-core/src/runtime/service/tts_preparation.rs:908` calls `clone` and `crates/izwi-core/src/runtime/service/asr_preparation.rs:1296` 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.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) crates/izwi-core/src/engine/mod.rs:2083 — crates/izwi-core/src/engine/mod.rs:2083-2096 | crates/izwi-core/src/engine/mod.rs:2187-2200 | crates/izwi-core/src/engine/mod.rs:2289-2302 | crates/izwi-core/src/engine/mod.rs:2399-2412 | crates/izwi-core/src/engine/mod.rs:2502-2515 — 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 5) · ×1
  • Duplicated block (12–14 lines × 5) crates/izwi-server/src/chat_store.rs:916 — crates/izwi-server/src/chat_store.rs:916-927 | crates/izwi-server/src/diarization_store.rs:1480-1491 | crates/izwi-server/src/saved_voice_store.rs:810-823 | crates/izwi-server/src/speech_history_store.rs:1759-1770 | crates/izwi-server/src/transcription_store.rs:1650-1661 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/saved_voice_store.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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. 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.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:669 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:669-682 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1054-1066 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1418-1428 — 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 `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:669` 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) crates/izwi-core/src/runtime/service/asr_preparation.rs:597 — crates/izwi-core/src/runtime/service/asr_preparation.rs:597-610 | crates/izwi-core/src/runtime/service/asr_preparation.rs:859-872 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2468-2481 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:597` 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.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) crates/izwi-core/src/engine/executor/handler_tts.rs:3273 — crates/izwi-core/src/engine/executor/handler_tts.rs:3273-3286 | crates/izwi-core/src/engine/executor/handler_tts.rs:3587-3597 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/executor/handler_tts.rs:3273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–13 lines × 8) · ×1
  • Duplicated block (11–13 lines × 8) crates/izwi-core/src/runtime/service/asr_preparation.rs:458 — crates/izwi-core/src/runtime/service/asr_preparation.rs:458-468 | crates/izwi-core/src/runtime/service/asr_preparation.rs:597-609 | crates/izwi-core/src/runtime/service/asr_preparation.rs:751-761 | crates/izwi-core/src/runtime/service/asr_preparation.rs:859-871 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1009-1019 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1219-1229 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2254-2264 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2468-2480 — 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:458` it begins part-way through the construct above it, so those 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 · Duplicated block (10–13 lines × 6) · ×1
  • Duplicated block (10–13 lines × 6) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:187 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:187-196 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:386-398 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:585-596 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:919-928 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1173-1184 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:94-103 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:187` 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 · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:653 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:653-665 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1534-1546 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:351-363 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:668-680 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:989-1001 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:653` 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, `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:988` calls `Some` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:350` 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.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1450 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1450-1462 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:275-287 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:581-593 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:911-923 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 32) · ×1
  • Duplicated block (10–12 lines × 32) crates/izwi-core/src/kernels/greedy.rs:153 — crates/izwi-core/src/kernels/greedy.rs:153-162 | crates/izwi-core/src/kernels/lfm_shortconv_step.rs:366-375 | crates/izwi-core/src/kernels/mamba2.rs:792-801 | crates/izwi-core/src/kernels/metal.rs:1681-1692 | crates/izwi-core/src/kernels/metal.rs:1845-1856 | crates/izwi-core/src/kernels/metal.rs:1991-2002 | crates/izwi-core/src/kernels/metal.rs:2170-2181 | crates/izwi-core/src/kernels/metal.rs:2727-2736 | crates/izwi-core/src/kernels/metal.rs:3140-3149 | crates/izwi-core/src/kernels/metal.rs:3325-3336 | crates/izwi-core/src/kernels/metal.rs:3448-3459 | crates/izwi-core/src/kernels/metal.rs:3574-3585 | crates/izwi-core/src/kernels/metal.rs:3735-3744 | crates/izwi-core/src/kernels/metal.rs:3901-3911 | crates/izwi-core/src/kernels/metal.rs:4145-4155 | crates/izwi-core/src/kernels/metal_fp8.rs:133-142 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:435-444 | crates/izwi-core/src/kernels/metal_kquant_mv.rs:298-307 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:268-277 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:157-166 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:195-204 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:352-361 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:952-961 | crates/izwi-core/src/kernels/moe_relu2.rs:1058-1067 | crates/izwi-core/src/kernels/qk_norm_rope.rs:360-369 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1173-1184 | crates/izwi-core/src/models/architectures/kokoro/prosody.rs:916-927 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:393-404 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:426-437 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:552-563 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:585-596 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:618-629 — before extracting anything, compare `crates/izwi-core/src/kernels/greedy.rs` and `crates/izwi-core/src/kernels/lfm_shortconv_step.rs` 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. 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 `crates/izwi-core/src/kernels/greedy.rs:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 10) · ×1
  • Duplicated block (12 lines × 10) crates/izwi-core/src/kernels/greedy.rs:140 — crates/izwi-core/src/kernels/greedy.rs:140-151 | crates/izwi-core/src/kernels/lfm_shortconv_step.rs:353-364 | crates/izwi-core/src/kernels/mamba2.rs:779-790 | crates/izwi-core/src/kernels/metal_fp8.rs:120-131 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:422-433 | crates/izwi-core/src/kernels/metal_kquant_mv.rs:285-296 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:255-266 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:939-950 | crates/izwi-core/src/kernels/moe_relu2.rs:1045-1056 | crates/izwi-core/src/kernels/qk_norm_rope.rs:347-358 — before extracting anything, compare `crates/izwi-core/src/kernels/greedy.rs` and `crates/izwi-core/src/kernels/lfm_shortconv_step.rs` 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. 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 8) · ×1
  • Duplicated block (11–12 lines × 8) crates/izwi-core/src/kernels/metal.rs:1658 — crates/izwi-core/src/kernels/metal.rs:1658-1669 | crates/izwi-core/src/kernels/metal.rs:1822-1833 | crates/izwi-core/src/kernels/metal.rs:1968-1979 | crates/izwi-core/src/kernels/metal.rs:2147-2158 | crates/izwi-core/src/kernels/metal.rs:2705-2715 | crates/izwi-core/src/kernels/metal.rs:2744-2755 | crates/izwi-core/src/kernels/metal.rs:3118-3128 | crates/izwi-core/src/kernels/metal.rs:3157-3168 — 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. 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.
D4 · Code Duplication · Duplicated block (12 lines × 8) · ×1
  • Duplicated block (12 lines × 8) crates/izwi-core/src/kernels/metal.rs:1772 — crates/izwi-core/src/kernels/metal.rs:1772-1783 | crates/izwi-core/src/kernels/metal.rs:2099-2110 | crates/izwi-core/src/kernels/metal.rs:2441-2452 | crates/izwi-core/src/kernels/metal.rs:2555-2566 | crates/izwi-core/src/kernels/metal.rs:2634-2645 | crates/izwi-core/src/kernels/metal.rs:2978-2989 | crates/izwi-core/src/kernels/metal.rs:3059-3070 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:303-314 — before extracting anything, compare `crates/izwi-core/src/kernels/metal.rs` and `crates/izwi-core/src/kernels/metal_paged_gqa.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 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 `crates/izwi-core/src/kernels/metal.rs:1772` 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.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) crates/izwi-core/src/engine/mod.rs:1821 — crates/izwi-core/src/engine/mod.rs:1821-1832 | crates/izwi-core/src/engine/mod.rs:2055-2066 | crates/izwi-core/src/engine/mod.rs:2164-2175 | crates/izwi-core/src/engine/mod.rs:2266-2277 | crates/izwi-core/src/engine/mod.rs:2376-2387 | crates/izwi-core/src/engine/mod.rs:2479-2490 | crates/izwi-core/src/engine/mod.rs:2547-2558 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/engine/mod.rs:1821` 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 · Duplicated block (11–12 lines × 6) · ×1
  • Duplicated block (11–12 lines × 6) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:222 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:222-233 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:236-247 | crates/izwi-core/src/engine/executor/handler_maya1.rs:217-228 | crates/izwi-core/src/engine/executor/handler_maya2.rs:218-229 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:241-252 | crates/izwi-core/src/engine/executor/handler_tts.rs:1406-1416 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 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.
D4 · Code Duplication · Duplicated block (8–12 lines × 4) · ×1
  • Duplicated block (8–12 lines × 4) crates/izwi-core/src/backends/kv/accelerator.rs:2368 — crates/izwi-core/src/backends/kv/accelerator.rs:2368-2375 | crates/izwi-core/src/backends/kv/accelerator.rs:2407-2414 | crates/izwi-core/src/backends/kv/cpu.rs:312-323 | crates/izwi-core/src/backends/kv/cpu.rs:340-349 — before extracting anything, compare `crates/izwi-core/src/backends/kv/accelerator.rs` and `crates/izwi-core/src/backends/kv/cpu.rs` as WHOLE FILES: this scan already matched 9 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. 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.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:158 — crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:158-177 | crates/izwi-core/src/engine/executor/handler_chat.rs:789-808 | crates/izwi-core/src/engine/executor/handler_tts.rs:4047-4066 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs` and `crates/izwi-core/src/engine/executor/handler_chat.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/engine/executor/handler_asr/continuous.rs:158` 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:147 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:147-157 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:350-361 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1133-1143 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:146` calls `dispatch_long_form_asr_by_chunk`, `validate` and `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:350` 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.
D4 · Code Duplication · Duplicated block (3–12 lines × 3) · ×1
  • Duplicated block (3–12 lines × 3) crates/izwi-core/src/runtime/service/asr_preparation.rs:1088 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1088-1099 | crates/izwi-core/src/runtime/service/asr_preparation.rs:2342-2353 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2349-2351 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1088` 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 11) · ×1
  • Duplicated block (10–11 lines × 11) crates/izwi-core/src/engine/mod.rs:1826 — crates/izwi-core/src/engine/mod.rs:1826-1835 | crates/izwi-core/src/engine/mod.rs:1937-1947 | crates/izwi-core/src/engine/mod.rs:2011-2021 | crates/izwi-core/src/engine/mod.rs:2060-2069 | crates/izwi-core/src/engine/mod.rs:2169-2178 | crates/izwi-core/src/engine/mod.rs:2271-2280 | crates/izwi-core/src/engine/mod.rs:2381-2390 | crates/izwi-core/src/engine/mod.rs:2484-2493 | crates/izwi-core/src/engine/mod.rs:2552-2561 | crates/izwi-core/src/engine/mod.rs:2608-2618 | crates/izwi-core/src/engine/mod.rs:2667-2677 — all 11 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 `crates/izwi-core/src/engine/mod.rs:1937` it begins part-way through the construct above it, so those 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 · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:821 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:821-831 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1050-1060 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1412-1422 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:218-228 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:862-872 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:821` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:217` calls `dispatch_long_form_asr_by_chunk` and `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:820` 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.
D4 · Code Duplication · Duplicated block (8–11 lines × 4) · ×1
  • Duplicated block (8–11 lines × 4) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:267 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:267-277 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:574-583 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1158-1167 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:80-87 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 3 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. 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 `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:267` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:90` calls `as_str` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:280` 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) crates/izwi-core/src/engine/resources.rs:1138 — crates/izwi-core/src/engine/resources.rs:1138-1146 | crates/izwi-core/src/engine/resources.rs:1242-1252 — both copies are in the same file, so extract the 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 `crates/izwi-core/src/engine/resources.rs:1242` it begins part-way through the construct above it, so those 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.
D4 · Code Duplication · Duplicated block (6–10 lines × 7) · ×1
  • Duplicated block (6–10 lines × 7) crates/izwi-core/src/kernels/metal.rs:1617 — crates/izwi-core/src/kernels/metal.rs:1617-1626 | crates/izwi-core/src/kernels/metal.rs:1769-1778 | crates/izwi-core/src/kernels/metal.rs:1921-1930 | crates/izwi-core/src/kernels/metal.rs:2096-2105 | crates/izwi-core/src/kernels/metal.rs:2632-2640 | crates/izwi-core/src/kernels/metal.rs:3057-3065 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:1066-1071 — before extracting anything, compare `crates/izwi-core/src/kernels/metal.rs` and `crates/izwi-core/src/kernels/metal_qwen36moe.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 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 `crates/izwi-core/src/kernels/metal.rs:1617` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–10 lines × 7) · ×1
  • Duplicated block (9–10 lines × 7) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:125 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:125-134 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:801-809 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1029-1037 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1390-1399 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:197-205 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:463-471 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:834-842 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:125` 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 · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) crates/izwi-core/src/runtime/adapters/loaded/tts.rs:523 — crates/izwi-core/src/runtime/adapters/loaded/tts.rs:523-532 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:703-712 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:906-915 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1087-1096 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1232-1241 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1461-1470 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1697-1706 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/runtime/adapters/loaded/tts.rs:523` it begins part-way through the construct above it, so those 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 · Duplicated block (4–10 lines × 5) · ×1
  • Duplicated block (4–10 lines × 5) crates/izwi-core/src/kernels/metal.rs:4487 — crates/izwi-core/src/kernels/metal.rs:4487-4490 | crates/izwi-core/src/kernels/metal.rs:4647-4656 | crates/izwi-core/src/kernels/metal.rs:4788-4797 | crates/izwi-core/src/kernels/metal.rs:4868-4877 | crates/izwi-core/src/kernels/metal.rs:4999-5002 — 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/izwi-core/src/kernels/metal.rs:4646` calls `device`, `same_device` and `crates/izwi-core/src/kernels/metal.rs:4487` 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) crates/izwi-server/src/batch_runtime/store/provider_writes.rs:990 — crates/izwi-server/src/batch_runtime/store/provider_writes.rs:990-997 | crates/izwi-server/src/batch_runtime/store/speech.rs:678-687 — before extracting anything, compare `crates/izwi-server/src/batch_runtime/store/provider_writes.rs` and `crates/izwi-server/src/batch_runtime/store/speech.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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 `crates/izwi-server/src/batch_runtime/store/provider_writes.rs:990` it begins part-way through the construct above it, so those 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 · Duplicated block (9 lines × 25) · ×1
  • Duplicated block (9 lines × 25) crates/izwi-core/src/kernels/greedy.rs:140 — crates/izwi-core/src/kernels/greedy.rs:140-148 | crates/izwi-core/src/kernels/lfm_shortconv_step.rs:353-361 | crates/izwi-core/src/kernels/mamba2.rs:779-787 | crates/izwi-core/src/kernels/metal.rs:3311-3320 | crates/izwi-core/src/kernels/metal.rs:3434-3443 | crates/izwi-core/src/kernels/metal.rs:3560-3569 | crates/izwi-core/src/kernels/metal.rs:3722-3730 | crates/izwi-core/src/kernels/metal.rs:3887-3896 | crates/izwi-core/src/kernels/metal.rs:4131-4140 | crates/izwi-core/src/kernels/metal_fp8.rs:120-128 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:422-430 | crates/izwi-core/src/kernels/metal_kquant_mv.rs:285-293 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:255-263 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:144-152 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:339-347 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:939-947 | crates/izwi-core/src/kernels/moe_relu2.rs:1045-1053 | crates/izwi-core/src/kernels/qk_norm_rope.rs:347-355 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1159-1168 | crates/izwi-core/src/models/architectures/kokoro/prosody.rs:902-911 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:379-388 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:412-421 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:538-547 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:571-580 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:604-613 — before extracting anything, compare `crates/izwi-core/src/kernels/greedy.rs` and `crates/izwi-core/src/kernels/lfm_shortconv_step.rs` 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. 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 13) · ×1
  • Duplicated block (7–9 lines × 13) crates/izwi-core/src/engine/mod.rs:1597 — crates/izwi-core/src/engine/mod.rs:1597-1603 | crates/izwi-core/src/engine/mod.rs:1677-1683 | crates/izwi-core/src/engine/mod.rs:1829-1837 | crates/izwi-core/src/engine/mod.rs:1941-1949 | crates/izwi-core/src/engine/mod.rs:2015-2023 | crates/izwi-core/src/engine/mod.rs:2063-2071 | crates/izwi-core/src/engine/mod.rs:2172-2180 | crates/izwi-core/src/engine/mod.rs:2274-2282 | crates/izwi-core/src/engine/mod.rs:2384-2392 | crates/izwi-core/src/engine/mod.rs:2487-2495 | crates/izwi-core/src/engine/mod.rs:2555-2563 | crates/izwi-core/src/engine/mod.rs:2612-2620 | crates/izwi-core/src/engine/mod.rs:2671-2679 — all 13 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 `crates/izwi-core/src/engine/mod.rs:1597` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 6) · ×1
  • Duplicated block (8–9 lines × 6) crates/izwi-core/src/engine/mod.rs:1981 — crates/izwi-core/src/engine/mod.rs:1981-1989 | crates/izwi-core/src/engine/mod.rs:2032-2039 | crates/izwi-core/src/engine/mod.rs:2518-2525 | crates/izwi-core/src/engine/mod.rs:2577-2585 | crates/izwi-core/src/engine/mod.rs:2634-2642 | crates/izwi-core/src/engine/mod.rs:2702-2710 — 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 `crates/izwi-core/src/engine/mod.rs:1981` it begins part-way through the construct above it, so those 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, `crates/izwi-core/src/engine/mod.rs:2632` calls `Some` and `crates/izwi-core/src/engine/mod.rs:1979` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×1
  • Duplicated block (8–9 lines × 4) crates/izwi-server/src/diarization_store.rs:471 — crates/izwi-server/src/diarization_store.rs:471-479 | crates/izwi-server/src/diarization_store.rs:844-851 | crates/izwi-server/src/transcription_store.rs:500-508 | crates/izwi-server/src/transcription_store.rs:993-1000 — before extracting anything, compare `crates/izwi-server/src/diarization_store.rs` and `crates/izwi-server/src/transcription_store.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 176 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. 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 `record` to `NewDiarizationRecord` in one and `CompleteDiarizationRecord` 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, `crates/izwi-server/src/transcription_store.rs:992` calls `sanitize_saa_warnings` and `crates/izwi-server/src/transcription_store.rs:499` 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) crates/izwi-core/src/kernels/cuda.rs:2616 — crates/izwi-core/src/kernels/cuda.rs:2616-2624 | crates/izwi-core/src/kernels/cuda.rs:3039-3047 | crates/izwi-core/src/kernels/cuda.rs:3539-3545 — 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 `crates/izwi-core/src/kernels/cuda.rs:2616` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) crates/izwi-server/src/api/audio_payload.rs:94 — crates/izwi-server/src/api/audio_payload.rs:94-99 | crates/izwi-server/src/api/audio_payload.rs:122-130 — both copies are in the same file, so extract the 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 `crates/izwi-server/src/api/audio_payload.rs:94` 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 28) · ×1
  • Duplicated block (7–8 lines × 28) crates/izwi-core/src/kernels/greedy.rs:139 — crates/izwi-core/src/kernels/greedy.rs:139-145 | crates/izwi-core/src/kernels/lfm_shortconv_step.rs:352-358 | crates/izwi-core/src/kernels/mamba2.rs:778-784 | crates/izwi-core/src/kernels/metal.rs:3309-3316 | crates/izwi-core/src/kernels/metal.rs:3432-3439 | crates/izwi-core/src/kernels/metal.rs:3558-3565 | crates/izwi-core/src/kernels/metal.rs:3721-3727 | crates/izwi-core/src/kernels/metal.rs:3885-3892 | crates/izwi-core/src/kernels/metal.rs:4129-4136 | crates/izwi-core/src/kernels/metal_fp8.rs:119-125 | crates/izwi-core/src/kernels/metal_fp8_gemm.rs:421-427 | crates/izwi-core/src/kernels/metal_kquant_mv.rs:284-290 | crates/izwi-core/src/kernels/metal_lfm_norm.rs:254-260 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:143-149 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:176-182 | crates/izwi-core/src/kernels/metal_paged_gqa.rs:338-344 | crates/izwi-core/src/kernels/metal_qwen36moe.rs:938-944 | crates/izwi-core/src/kernels/moe_relu2.rs:1044-1050 | crates/izwi-core/src/kernels/qk_norm_rope.rs:346-352 | crates/izwi-core/src/kernels/residual_norm.rs:303-309 | crates/izwi-core/src/kernels/swiglu.rs:124-130 | crates/izwi-core/src/models/architectures/kokoro/decoder.rs:1157-1164 | crates/izwi-core/src/models/architectures/kokoro/prosody.rs:900-907 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:377-384 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:410-417 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:536-543 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:569-576 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:602-609 — before extracting anything, compare `crates/izwi-core/src/kernels/greedy.rs` and `crates/izwi-core/src/kernels/lfm_shortconv_step.rs` 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. 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 `crates/izwi-core/src/kernels/greedy.rs:139` 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 · Duplicated block (8 lines × 14) · ×1
  • Duplicated block (8 lines × 14) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:567 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:567-574 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:860-867 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:164-171 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:340-347 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:155-162 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:339-346 | crates/izwi-core/src/engine/executor/handler_asr/vibevoice.rs:541-548 | crates/izwi-core/src/engine/executor/handler_chatterbox.rs:105-112 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:114-121 | crates/izwi-core/src/engine/executor/handler_maya1.rs:114-121 | crates/izwi-core/src/engine/executor/handler_maya2.rs:115-122 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:120-127 | crates/izwi-core/src/engine/executor/handler_tts.rs:1298-1305 | crates/izwi-core/src/engine/executor/handler_tts.rs:3043-3050 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:567` 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 · Duplicated block (7–8 lines × 13) · ×1
  • Duplicated block (7–8 lines × 13) crates/izwi-core/src/engine/mod.rs:1639 — crates/izwi-core/src/engine/mod.rs:1639-1645 | crates/izwi-core/src/engine/mod.rs:1694-1700 | crates/izwi-core/src/engine/mod.rs:1907-1914 | crates/izwi-core/src/engine/mod.rs:1984-1991 | crates/izwi-core/src/engine/mod.rs:2034-2041 | crates/izwi-core/src/engine/mod.rs:2149-2155 | crates/izwi-core/src/engine/mod.rs:2251-2258 | crates/izwi-core/src/engine/mod.rs:2361-2368 | crates/izwi-core/src/engine/mod.rs:2462-2469 | crates/izwi-core/src/engine/mod.rs:2520-2527 | crates/izwi-core/src/engine/mod.rs:2580-2587 | crates/izwi-core/src/engine/mod.rs:2637-2644 | crates/izwi-core/src/engine/mod.rs:2705-2712 — all 13 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 `crates/izwi-core/src/engine/mod.rs:1639` 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.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:116 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:116-123 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:792-799 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1020-1027 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1381-1388 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:188-195 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:454-461 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:825-832 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 5) · ×1
  • Duplicated block (7–8 lines × 5) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:163 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:163-170 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:179-186 | crates/izwi-core/src/engine/executor/handler_maya1.rs:170-177 | crates/izwi-core/src/engine/executor/handler_maya2.rs:171-178 | crates/izwi-core/src/engine/executor/handler_tts.rs:1358-1364 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:163` 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) crates/izwi-server/src/api/openai/audio/speech.rs:544 — crates/izwi-server/src/api/openai/audio/speech.rs:544-550 | crates/izwi-server/src/api/speech_history/handlers.rs:3032-3040 — before extracting anything, compare `crates/izwi-server/src/api/openai/audio/speech.rs` and `crates/izwi-server/src/api/speech_history/handlers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `crates/izwi-server/src/api/speech_history/handlers.rs:3032` 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 `req` to `SpeechRequest` in one and `CreateSpeechHistoryRecordRequest` 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.
D4 · Code Duplication · Duplicated block (7 lines × 9) · ×1
  • Duplicated block (7 lines × 9) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1063 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1063-1069 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1205-1211 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1446-1452 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:446-452 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:601-607 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:781-787 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:984-990 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1167-1173 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:1963-1969 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:1063` 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 · Duplicated block (14 lines × 7) · ×1
  • Duplicated block (14 lines × 7) crates/izwi-core/src/engine/executor/dispatch.rs:1050 — crates/izwi-core/src/engine/executor/dispatch.rs:1050-1063 | crates/izwi-core/src/engine/executor/dispatch.rs:1086-1099 | crates/izwi-core/src/engine/executor/dispatch.rs:1121-1134 | crates/izwi-core/src/engine/executor/dispatch.rs:1156-1169 | crates/izwi-core/src/engine/executor/dispatch.rs:1199-1212 | crates/izwi-core/src/engine/executor/dispatch.rs:1241-1254 | crates/izwi-core/src/engine/executor/dispatch.rs:1276-1289 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/izwi-core/src/engine/executor/dispatch.rs:1050` it begins part-way through the construct above it, so those 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 · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:636 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:636-642 | crates/izwi-core/src/engine/executor/handler_chatterbox.rs:162-168 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:178-184 | crates/izwi-core/src/engine/executor/handler_maya1.rs:169-175 | crates/izwi-core/src/engine/executor/handler_maya2.rs:170-176 | crates/izwi-core/src/engine/executor/handler_tts.rs:1357-1363 | crates/izwi-core/src/engine/executor/handler_tts.rs:3106-3112 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 55 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:636` it begins part-way through the construct above it, so those 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 · Duplicated block (9–10 lines × 5) · ×1
  • Duplicated block (9–10 lines × 5) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:285 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:285-294 | crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs:309-317 | crates/izwi-core/src/engine/executor/handler_maya1.rs:279-288 | crates/izwi-core/src/engine/executor/handler_maya2.rs:280-289 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:342-350 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_lfm3_audio_rows.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:285` 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 · Duplicated block (6–7 lines × 3) · ×1
  • Duplicated block (6–7 lines × 3) crates/izwi-core/src/engine/resources.rs:844 — crates/izwi-core/src/engine/resources.rs:844-849 | crates/izwi-core/src/engine/resources.rs:952-958 | crates/izwi-core/src/engine/resources.rs:982-987 — 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 `crates/izwi-core/src/engine/resources.rs:952` 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 · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) crates/izwi-server/src/batch_runtime/store/speech.rs:309 — crates/izwi-server/src/batch_runtime/store/speech.rs:309-316 | crates/izwi-server/src/speech_history_store.rs:808-814 | crates/izwi-server/src/speech_history_store.rs:1144-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 9) · ×1
  • Duplicated block (5 lines × 9) crates/izwi-core/src/runtime/service/asr_preparation.rs:1547 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1547-1551 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1771-1775 | crates/izwi-core/src/runtime/service/tts_preparation.rs:542-546 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1306-1310 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1461-1465 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1635-1639 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1792-1796 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1973-1977 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2162-2166 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1547` 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.
D4 · Code Duplication · Duplicated block (6 lines × 8) · ×1
  • Duplicated block (6 lines × 8) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:723 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:723-728 | crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:1027-1032 | crates/izwi-core/src/engine/executor/handler_chatterbox.rs:238-243 | crates/izwi-core/src/engine/executor/handler_maya1.rs:233-238 | crates/izwi-core/src/engine/executor/handler_maya2.rs:234-239 | crates/izwi-core/src/engine/executor/handler_tts.rs:3185-3190 | crates/izwi-core/src/engine/executor/handler_tts.rs:3446-3451 | crates/izwi-core/src/engine/executor/handler_tts.rs:3508-3513 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 55 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:723` 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, `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:721` calls `with_capacity` and `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:237` 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) crates/izwi-core/src/engine/executor/audio.rs:369 — crates/izwi-core/src/engine/executor/audio.rs:369-374 | crates/izwi-core/src/models/architectures/whisper/asr/mod.rs:3905-3910 | crates/izwi-core/src/models/registry.rs:4105-4110 | crates/izwi-core/src/runtime/asr/speaker_attribution.rs:785-790 | crates/izwi-core/src/runtime/diarization.rs:1254-1259 — before extracting anything, compare `crates/izwi-core/src/engine/executor/audio.rs` and `crates/izwi-core/src/runtime/asr/speaker_attribution.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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.
D4 · Code Duplication · Duplicated block (13 lines × 6) · ×1
  • Duplicated block (13 lines × 6) crates/izwi-core/src/runtime/adapters/loaded/asr.rs:280 — crates/izwi-core/src/runtime/adapters/loaded/asr.rs:280-292 | crates/izwi-core/src/runtime/adapters/loaded/asr.rs:504-516 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:411-423 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:558-570 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:738-750 | crates/izwi-core/src/runtime/adapters/loaded/tts.rs:941-953 — before extracting anything, compare `crates/izwi-core/src/runtime/adapters/loaded/asr.rs` and `crates/izwi-core/src/runtime/adapters/loaded/tts.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 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 `crates/izwi-core/src/runtime/adapters/loaded/asr.rs:280` it begins part-way through the construct above it, so those 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 · Duplicated block (26 lines × 4) · ×1
  • Duplicated block (26 lines × 4) crates/izwi-server/src/batch_runtime/store/reconcile.rs:102 — crates/izwi-server/src/batch_runtime/store/reconcile.rs:102-136 | crates/izwi-server/src/batch_runtime/store/reconcile.rs:141-173 | crates/izwi-server/src/batch_runtime/store/reconcile.rs:178-203 | crates/izwi-server/src/batch_runtime/store/reconcile.rs:208-241 — 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 `crates/izwi-server/src/batch_runtime/store/reconcile.rs: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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) crates/izwi-server/src/batch_runtime/store/artifacts.rs:231 — crates/izwi-server/src/batch_runtime/store/artifacts.rs:231-258 | crates/izwi-server/src/batch_runtime/store/media.rs:282-315 — 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 `crates/izwi-server/src/batch_runtime/store/artifacts.rs:231` 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 first that the copies are not typed on the same thing: the declarations holding them bind `input` to `NewRuntimeArtifact` in one and `NewMediaAsset` 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.
D4 · Code Duplication · Duplicated block (11 lines × 12) · ×1
  • Duplicated block (11 lines × 12) crates/izwi-core/src/runtime/service/asr_preparation.rs:1299 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1299-1313 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1515-1525 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1734-1744 | crates/izwi-core/src/runtime/service/tts_preparation.rs:502-512 | crates/izwi-core/src/runtime/service/tts_preparation.rs:698-708 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1249-1259 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1434-1444 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1596-1606 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1763-1774 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1924-1934 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2123-2133 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2305-2320 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1299` 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 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, `crates/izwi-core/src/runtime/service/asr_preparation.rs:1732` calls `dir_name` and `crates/izwi-core/src/runtime/service/asr_preparation.rs:1297` 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.
D4 · Code Duplication · Duplicated block (20–21 lines × 3) · ×1
  • Duplicated block (20–21 lines × 3) crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:325 — crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:325-344 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:642-661 | crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:1203-1223 — 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 `crates/izwi-core/src/runtime/adapters/loaded/sequence_asr.rs:325` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) crates/izwi-core/src/kernels/metal.rs:3230 — crates/izwi-core/src/kernels/metal.rs:3230-3239 | crates/izwi-core/src/kernels/metal.rs:3614-3623 | crates/izwi-core/src/kernels/metal.rs:3781-3790 | crates/izwi-core/src/kernels/metal.rs:3967-3976 | crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs:266-275 | crates/izwi-core/src/models/architectures/parakeet/asr/metal_kernels.rs:207-216 — before extracting anything, compare `crates/izwi-core/src/kernels/metal.rs` and `crates/izwi-core/src/models/architectures/nemotron/asr/metal_kernels.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 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 `crates/izwi-core/src/kernels/metal.rs:3230` 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 · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) crates/izwi-core/src/engine/executor/handler_chatterbox.rs:530 — crates/izwi-core/src/engine/executor/handler_chatterbox.rs:530-537 | crates/izwi-core/src/engine/executor/handler_fish_drama3.rs:791-798 | crates/izwi-core/src/engine/executor/handler_maya1.rs:598-605 | crates/izwi-core/src/engine/executor/handler_maya2.rs:493-500 | crates/izwi-core/src/engine/executor/handler_tts.rs:2243-2250 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_chatterbox.rs` and `crates/izwi-core/src/engine/executor/handler_maya1.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 262 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 `crates/izwi-core/src/engine/executor/handler_chatterbox.rs:530` 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 `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.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) crates/izwi-core/src/runtime/service/tts_preparation.rs:619 — crates/izwi-core/src/runtime/service/tts_preparation.rs:619-626 | crates/izwi-core/src/runtime/service/tts_preparation.rs:814-821 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1374-1381 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1533-1540 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1704-1710 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1855-1861 — 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 `crates/izwi-core/src/runtime/service/tts_preparation.rs:619` it begins part-way through the construct above it, so those 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 · Duplicated block (7 lines × 8) · ×1
  • Duplicated block (7 lines × 8) crates/izwi-core/src/runtime/service/asr_preparation.rs:1539 — crates/izwi-core/src/runtime/service/asr_preparation.rs:1539-1545 | crates/izwi-core/src/runtime/service/asr_preparation.rs:1763-1769 | crates/izwi-core/src/runtime/service/tts_preparation.rs:722-728 | crates/izwi-core/src/runtime/service/tts_preparation.rs:948-954 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1298-1304 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1453-1459 | crates/izwi-core/src/runtime/service/tts_preparation.rs:1627-1633 | crates/izwi-core/src/runtime/service/tts_preparation.rs:2154-2160 — before extracting anything, compare `crates/izwi-core/src/runtime/service/asr_preparation.rs` and `crates/izwi-core/src/runtime/service/tts_preparation.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 281 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 `crates/izwi-core/src/runtime/service/asr_preparation.rs:1539` it begins part-way through the construct above it, so those 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 · Duplicated block (4–7 lines × 3) · ×1
  • Duplicated block (4–7 lines × 3) crates/izwi-core/src/kernels/cuda/moe.rs:832 — crates/izwi-core/src/kernels/cuda/moe.rs:832-838 | crates/izwi-core/src/kernels/cuda/moe.rs:1009-1015 | crates/izwi-core/src/kernels/moe_relu2.rs:1519-1522 — 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 `crates/izwi-core/src/kernels/cuda/moe.rs:832` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–5 lines × 4) · ×1
  • Duplicated block (3–5 lines × 4) crates/izwi-core/src/backends/state/mod.rs:968 — crates/izwi-core/src/backends/state/mod.rs:968-970 | crates/izwi-core/src/kv/v2/descriptor.rs:725-729 | crates/izwi-core/src/kv/v2/descriptor.rs:791-795 | crates/izwi-core/src/kv/v2/descriptor.rs:807-811 — 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 `crates/izwi-core/src/backends/state/mod.rs:968` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–5 lines × 6) · ×1
  • Duplicated block (3–5 lines × 6) crates/izwi-core/src/backends/state/mod.rs:522 — crates/izwi-core/src/backends/state/mod.rs:522-524 | crates/izwi-core/src/models/architectures/fish_s2/physical.rs:322-326 | crates/izwi-core/src/models/architectures/granite_speech/asr/mod.rs:2150-2154 | crates/izwi-core/src/models/architectures/qwen3/asr/mod.rs:814-816 | crates/izwi-core/src/models/architectures/vibevoice/mod.rs:846-850 | crates/izwi-core/src/models/architectures/voxtral/mod.rs:633-637 — 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 `crates/izwi-core/src/backends/state/mod.rs:522` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:562 — crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:562-566 | crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs:159-163 | crates/izwi-core/src/engine/executor/handler_asr/parakeet.rs:150-154 | crates/izwi-core/src/engine/executor/handler_chatterbox.rs:100-104 | crates/izwi-core/src/engine/executor/handler_maya1.rs:427-431 | crates/izwi-core/src/engine/executor/handler_nemotron_transcribe_rows.rs:115-119 | crates/izwi-core/src/engine/executor/handler_tts.rs:1293-1297 | crates/izwi-core/src/engine/executor/handler_tts.rs:3038-3042 — before extracting anything, compare `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs` and `crates/izwi-core/src/engine/executor/handler_asr/nemotron.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 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 `crates/izwi-core/src/engine/executor/handler_asr/lfm25_audio.rs:562` it begins part-way through the construct above it, so those 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 (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) scripts/fixtures/generate_qwen36moe_golden.py:176 — scripts/fixtures/generate_qwen36moe_golden.py:176-233 | scripts/fixtures/generate_qwen38_golden.py:225-327 — 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 (2 corresponding lines) · ×1
  • Edited copy of a member (2 corresponding lines) scripts/fixtures/generate_chatterbox_reference.py:131 — scripts/fixtures/generate_chatterbox_reference.py:131-132 | scripts/fixtures/generate_granite_speech5_reference.py:121-122 — These two members are one piece of code written twice and then edited apart: 2 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 (1 corresponding lines) · ×1
  • Edited copy of a member (1 corresponding lines) scripts/fixtures/generate_lfm25_reference.py:212 — scripts/fixtures/generate_lfm25_reference.py:212-212 | scripts/fixtures/generate_lfm3_reference.py:280-280 — These two members are one piece of code written twice and then edited apart: 1 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.
D5 · Coupling · Unstable project izwi-gateway · ×1
  • Unstable project izwi-gateway — izwi-gateway has instability 0.88 with 1 dependents.
IC1 · Incompleteness & stubs · Skeleton type · ×1
  • Skeleton type — most members are unfinished crates/izwi-cli/src/style.rs:44 — `impl Theme` has 4 unfinished methods out of 6 — a scaffolded type that was never implemented.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×1
  • Outbound HTTP without resilience crates/izwi-desktop/src/app/downloads.rs:93 — `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication · Duplication concentrated across 11 sibling directories (72 clone groups) · ×1
  • Duplication concentrated across 11 sibling directories (72 clone groups) ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:139 — 72 duplicated blocks under ui/src/features/ have copies in at least two of the sibling directories chat, diarization, dictation, models, speech-text, studio (+5 more sibling(s) not listed) — 31 of them are reported below, and 41 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 72 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 72 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 72 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 6 sibling directories (27 clone groups) · ×1
  • Duplication concentrated across 6 sibling directories (27 clone groups) ui/src/components/DiarizationReviewWorkspace.tsx:188 — 27 duplicated blocks under ui/src/ have copies in at least two of the sibling directories app, components, features, hooks, shared, utils — 12 of them are reported below, and 15 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 27 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 27 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 27 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (211 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (211 matched lines × 2 locations) ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:139 — ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:139 · ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:190 — the two spans are one implementation copied and then locally edited — 860 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (189 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (189 matched lines × 2 locations) ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:128 — ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:128 · ui/src/features/voice-studio/components/DesignVoiceDialog.tsx:76 — the two spans are one implementation copied and then locally edited — 868 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (150 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (150 matched lines × 2 locations) ui/src/components/DiarizationReviewWorkspace.tsx:188 — ui/src/components/DiarizationReviewWorkspace.tsx:188 · ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:115 — the two spans are one implementation copied and then locally edited — 759 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (132 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (132 matched lines × 2 locations) ui/src/utils/diarizationExport.ts:33 — ui/src/utils/diarizationExport.ts:33 · ui/src/utils/transcriptionExport.ts:30 — the two spans are one implementation copied and then locally edited — 780 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (83 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (83 matched lines × 2 locations) ui/src/components/ui/dialog.tsx:10 — ui/src/components/ui/dialog.tsx:10 · ui/src/components/ui/sheet.tsx:11 — the two spans are one implementation copied and then locally edited — 490 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (80 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (80 matched lines × 2 locations) ui/src/features/diarization/components/DiarizationRecordDetail.tsx:300 — ui/src/features/diarization/components/DiarizationRecordDetail.tsx:300 · ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:249 — the two spans are one implementation copied and then locally edited — 328 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (77 lines × 2 locations) · ×1
  • Duplicated block (77 lines × 2 locations) ui/src/features/diarization/components/NewDiarizationModal.tsx:448 — ui/src/features/diarization/components/NewDiarizationModal.tsx:448 · ui/src/features/transcription/components/NewTranscriptionModal.tsx:478 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (62 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (62 matched lines × 2 locations) ui/src/features/speech-text/hooks/useSpeechTextRecord.ts:41 — ui/src/features/speech-text/hooks/useSpeechTextRecord.ts:41 · ui/src/features/text-to-speech/hooks/useTextToSpeechRecord.ts:16 — the two spans are one implementation copied and then locally edited — 371 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (55 lines × 2 locations) · ×1
  • Duplicated block (55 lines × 2 locations) ui/src/features/text-to-speech/route.tsx:556 — ui/src/features/text-to-speech/route.tsx:556 · ui/src/features/transcription/route.tsx:898 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (53 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (53 matched lines × 2 locations) ui/src/features/voices/route.tsx:146 — ui/src/features/voices/route.tsx:146 · ui/src/hooks/usePolledCursorHistory.ts:92 — the two spans are one implementation copied and then locally edited — 361 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (52 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (52 matched lines × 2 locations) ui/src/shared/api/chat.ts:687 — ui/src/shared/api/chat.ts:687 · ui/src/shared/api/chat.ts:831 — the two spans are one implementation copied and then locally edited — 245 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (49 lines × 3 locations) · ×1
  • Duplicated block (49 lines × 3 locations) ui/src/features/settings/route.tsx:828 — ui/src/features/settings/route.tsx:828 · ui/src/features/settings/route.tsx:883 · ui/src/features/settings/route.tsx:978 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (46 lines × 2 locations) · ×1
  • Duplicated block (46 lines × 2 locations) ui/src/features/diarization/route.tsx:100 — ui/src/features/diarization/route.tsx:100 · ui/src/features/transcription/route.tsx:412 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block with local edits (44 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (44 matched lines × 2 locations) ui/src/features/studio/components/StudioVoicePicker.tsx:182 — ui/src/features/studio/components/StudioVoicePicker.tsx:182 · ui/src/features/voice/components/VoiceSettingsSheet.tsx:254 — the two spans are one implementation copied and then locally edited — 179 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) ui/src/features/voice/realtime/support.ts:1240 — ui/src/features/voice/realtime/support.ts:1240 · ui/src/shared/audioUpload.ts:196 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (36 lines × 2 locations) · ×1
  • Duplicated block (36 lines × 2 locations) ui/src/app/providers/AppUpdateProvider.tsx:361 — ui/src/app/providers/AppUpdateProvider.tsx:361 · ui/src/app/providers/ModelCatalogProvider.tsx:1175 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (36 lines × 3 locations) · ×1
  • Duplicated block (36 lines × 3 locations) ui/src/features/diarization/components/DiarizationRecordDetail.tsx:548 — ui/src/features/diarization/components/DiarizationRecordDetail.tsx:548 · ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:467 · ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:504 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (35 lines × 2 locations) · ×1
  • Duplicated block (35 lines × 2 locations) ui/src/app/providers/ModelCatalogProvider.tsx:1175 — ui/src/app/providers/ModelCatalogProvider.tsx:1175 · ui/src/features/voice/useVoicePreferences.ts:238 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (34 lines × 2 locations) · ×1
  • Duplicated block (34 lines × 2 locations) ui/src/features/voice/realtime/support.ts:471 — ui/src/features/voice/realtime/support.ts:471 · ui/src/shared/audioUpload.ts:1 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (33 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (33 matched lines × 2 locations) ui/src/components/ui/dropdown-menu.tsx:48 — ui/src/components/ui/dropdown-menu.tsx:48 · ui/src/components/ui/dropdown-menu.tsx:84 — the two spans are one implementation copied and then locally edited — 179 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (29 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (29 matched lines × 2 locations) ui/src/components/DiarizationExportDialog.tsx:73 — ui/src/components/DiarizationExportDialog.tsx:73 · ui/src/features/transcription/components/TranscriptionExportDialog.tsx:52 — the two spans are one implementation copied and then locally edited — 170 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (27 lines × 2 locations) · ×1
  • Duplicated block (27 lines × 2 locations) ui/src/features/diarization/components/NewDiarizationModal.tsx:906 — ui/src/features/diarization/components/NewDiarizationModal.tsx:906 · ui/src/features/diarization/components/NewDiarizationModal.tsx:937 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×1
  • Duplicated block (26 lines × 2 locations) ui/src/features/settings/route.tsx:555 — ui/src/features/settings/route.tsx:555 · ui/src/features/settings/route.tsx:586 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×1
  • Duplicated block (22 lines × 2 locations) ui/src/shared/api/audio.ts:1416 — ui/src/shared/api/audio.ts:1416 · ui/src/shared/api/audio.ts:1471 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (20 lines × 4 locations) · ×1
  • Duplicated block (20 lines × 4 locations) ui/src/shared/api/audio.ts:3224 — ui/src/shared/api/audio.ts:3224 · ui/src/shared/api/audio.ts:3291 · ui/src/shared/api/audio.ts:3346 · ui/src/shared/api/audio.ts:3419 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (18 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (18 matched lines × 2 locations) ui/src/features/chat/playground/support.ts:349 — ui/src/features/chat/playground/support.ts:349 · ui/src/features/chat/playground/support.ts:405 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity · Complex function NewTextToSpeechModal (cyclomatic 96, cognitive 95) · ×1
  • Complex function NewTextToSpeechModal (cyclomatic 96, cognitive 95) ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:144 — NewTextToSpeechModal has cyclomatic complexity 96 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 84, cognitive 79) · ×1
  • Complex function (anonymous) (cyclomatic 84, cognitive 79) ui/src/features/voice/useVoiceSession.ts:613 — (anonymous) has cyclomatic complexity 84 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function isVoiceRealtimeV2ServerEnvelope (cyclomatic 83, cognitive 38) · ×1
  • Complex function isVoiceRealtimeV2ServerEnvelope (cyclomatic 83, cognitive 38) ui/src/features/voice/realtime/support.ts:664 — isVoiceRealtimeV2ServerEnvelope has cyclomatic complexity 83 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function AssistantMessage (cyclomatic 68, cognitive 61) · ×1
  • Complex function AssistantMessage (cyclomatic 68, cognitive 61) ui/src/features/chat/components/messages/AssistantMessage.tsx:87 — AssistantMessage has cyclomatic complexity 68 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function NewDiarizationModal (cyclomatic 57, cognitive 50) · ×1
  • Complex function NewDiarizationModal (cyclomatic 57, cognitive 50) ui/src/features/diarization/components/NewDiarizationModal.tsx:137 — NewDiarizationModal has cyclomatic complexity 57 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function SettingsPage (cyclomatic 51, cognitive 48) · ×1
  • Complex function SettingsPage (cyclomatic 51, cognitive 48) ui/src/features/settings/route.tsx:462 — SettingsPage has cyclomatic complexity 51 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ChatPlayground (cyclomatic 49, cognitive 43) · ×1
  • Complex function ChatPlayground (cyclomatic 49, cognitive 43) ui/src/features/chat/components/ChatPlayground.tsx:167 — ChatPlayground has cyclomatic complexity 49 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalizeVoiceRealtimeV2Event (cyclomatic 49, cognitive 37) · ×1
  • Complex function normalizeVoiceRealtimeV2Event (cyclomatic 49, cognitive 37) ui/src/features/voice/realtime/support.ts:842 — normalizeVoiceRealtimeV2Event has cyclomatic complexity 49 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function NewTranscriptionModal (cyclomatic 46, cognitive 42) · ×1
  • Complex function NewTranscriptionModal (cyclomatic 46, cognitive 42) ui/src/features/transcription/components/NewTranscriptionModal.tsx:121 — NewTranscriptionModal has cyclomatic complexity 46 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function isVoiceRealtimeServerEvent (cyclomatic 46, cognitive 17) · ×1
  • Complex function isVoiceRealtimeServerEvent (cyclomatic 46, cognitive 17) ui/src/features/voice/realtime/support.ts:1017 — isVoiceRealtimeServerEvent has cyclomatic complexity 46 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function DiarizationRecordDetail (cyclomatic 43, cognitive 39) · ×1
  • Complex function DiarizationRecordDetail (cyclomatic 43, cognitive 39) ui/src/features/diarization/components/DiarizationRecordDetail.tsx:66 — DiarizationRecordDetail has cyclomatic complexity 43 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function CloneVoiceDialog (cyclomatic 42, cognitive 45) · ×1
  • Complex function CloneVoiceDialog (cyclomatic 42, cognitive 45) ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:134 — CloneVoiceDialog has cyclomatic complexity 42 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function TextToSpeechRecordDetail (cyclomatic 42, cognitive 39) · ×1
  • Complex function TextToSpeechRecordDetail (cyclomatic 42, cognitive 39) ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:126 — TextToSpeechRecordDetail has cyclomatic complexity 42 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function TranscriptionRecordDetail (cyclomatic 41, cognitive 35) · ×1
  • Complex function TranscriptionRecordDetail (cyclomatic 41, cognitive 35) ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:176 — TranscriptionRecordDetail has cyclomatic complexity 41 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function renderComposer (cyclomatic 41, cognitive 34) · ×1
  • Complex function renderComposer (cyclomatic 41, cognitive 34) ui/src/features/chat/components/ChatPlayground.tsx:1669 — renderComposer has cyclomatic complexity 41 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseUserMessageDisplayFromContentParts (cyclomatic 39, cognitive 39) · ×1
  • Complex function parseUserMessageDisplayFromContentParts (cyclomatic 39, cognitive 39) ui/src/features/chat/playground/support.ts:760 — parseUserMessageDisplayFromContentParts has cyclomatic complexity 39 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function TranscriptionPage (cyclomatic 39, cognitive 38) · ×1
  • Complex function TranscriptionPage (cyclomatic 39, cognitive 38) ui/src/features/transcription/route.tsx:96 — TranscriptionPage has cyclomatic complexity 39 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ModelListRow (cyclomatic 38, cognitive 36) · ×1
  • Complex function ModelListRow (cyclomatic 38, cognitive 36) ui/src/features/models/components/ModelListRow.tsx:186 — ModelListRow has cyclomatic complexity 38 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function TranscriptionReviewWorkspace (cyclomatic 37, cognitive 36) · ×1
  • Complex function TranscriptionReviewWorkspace (cyclomatic 37, cognitive 36) ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:80 — TranscriptionReviewWorkspace has cyclomatic complexity 37 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function AppShell (cyclomatic 36, cognitive 35) · ×1
  • Complex function AppShell (cyclomatic 36, cognitive 35) ui/src/app/layouts/AppLayout.tsx:149 — AppShell has cyclomatic complexity 36 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function DictationSettingsView (cyclomatic 36, cognitive 34) · ×1
  • Complex function DictationSettingsView (cyclomatic 36, cognitive 34) ui/src/features/dictation/route.tsx:271 — DictationSettingsView has cyclomatic complexity 36 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function VoicesPage (cyclomatic 31, cognitive 28) · ×1
  • Complex function VoicesPage (cyclomatic 31, cognitive 28) ui/src/features/voices/route.tsx:118 — VoicesPage has cyclomatic complexity 31 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function SetupChecklist (cyclomatic 29, cognitive 27) · ×1
  • Complex function SetupChecklist (cyclomatic 29, cognitive 27) ui/src/features/dictation/components/SetupChecklist.tsx:119 — SetupChecklist has cyclomatic complexity 29 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 27, cognitive 39) · ×1
  • Complex function (anonymous) (cyclomatic 27, cognitive 39) ui/src/app/providers/AppUpdateProvider.tsx:135 — (anonymous) has cyclomatic complexity 27 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function FirstRunOnboarding (cyclomatic 27, cognitive 37) · ×1
  • Complex function FirstRunOnboarding (cyclomatic 27, cognitive 37) ui/src/app/onboarding/FirstRunOnboarding.tsx:210 — FirstRunOnboarding has cyclomatic complexity 27 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function VoicePage (cyclomatic 26, cognitive 32) · ×1
  • Complex function VoicePage (cyclomatic 26, cognitive 32) ui/src/features/voice/route.tsx:73 — VoicePage has cyclomatic complexity 26 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function DiarizationReviewWorkspace (cyclomatic 26, cognitive 25) · ×1
  • Complex function DiarizationReviewWorkspace (cyclomatic 26, cognitive 25) ui/src/components/DiarizationReviewWorkspace.tsx:165 — DiarizationReviewWorkspace has cyclomatic complexity 26 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function MyModelsPage (cyclomatic 26, cognitive 24) · ×1
  • Complex function MyModelsPage (cyclomatic 26, cognitive 24) ui/src/features/models/route.tsx:153 — MyModelsPage has cyclomatic complexity 26 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 26, cognitive 24) · ×1
  • Complex function (anonymous) (cyclomatic 26, cognitive 24) ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:552 — (anonymous) has cyclomatic complexity 26 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function documentTitleForLocation (cyclomatic 26, cognitive 20) · ×1
  • Complex function documentTitleForLocation (cyclomatic 26, cognitive 20) ui/src/app/router/routePresentation.ts:27 — documentTitleForLocation has cyclomatic complexity 26 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function aggregateRawSpeakerSummaries (cyclomatic 25, cognitive 30) · ×1
  • Complex function aggregateRawSpeakerSummaries (cyclomatic 25, cognitive 30) REDACTED:205 — aggregateRawSpeakerSummaries has cyclomatic complexity 25 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function NotificationItem (cyclomatic 25, cognitive 24) · ×1
  • Complex function NotificationItem (cyclomatic 25, cognitive 24) ui/src/app/providers/NotificationItem.tsx:51 — NotificationItem has cyclomatic complexity 25 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function startStream (cyclomatic 24, cognitive 35) · ×1
  • Complex function startStream (cyclomatic 24, cognitive 35) ui/src/shared/api/audio.ts:1821 — startStream has cyclomatic complexity 24 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseVoiceAgentSettings (cyclomatic 24, cognitive 29) · ×1
  • Complex function parseVoiceAgentSettings (cyclomatic 24, cognitive 29) ui/src/features/voice/agentSettings.ts:104 — parseVoiceAgentSettings has cyclomatic complexity 24 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function RuntimeCard (cyclomatic 23, cognitive 22) · ×1
  • Complex function RuntimeCard (cyclomatic 23, cognitive 22) ui/src/app/layouts/RuntimeCard.tsx:25 — RuntimeCard has cyclomatic complexity 23 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getModelProviderLabel (cyclomatic 23, cognitive 19) · ×1
  • Complex function getModelProviderLabel (cyclomatic 23, cognitive 19) ui/src/features/models/catalog/modelMetadata.ts:44 — getModelProviderLabel has cyclomatic complexity 23 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function SpeechTextUploadProgress (cyclomatic 22, cognitive 21) · ×1
  • Complex function SpeechTextUploadProgress (cyclomatic 22, cognitive 21) ui/src/features/speech-text/components/SpeechTextUploadProgress.tsx:62 — SpeechTextUploadProgress has cyclomatic complexity 22 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 22, cognitive 20) · ×1
  • Complex function (anonymous) (cyclomatic 22, cognitive 20) ui/src/components/DiarizationQualityPanel.tsx:95 — (anonymous) has cyclomatic complexity 22 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 21, cognitive 24) · ×1
  • Complex function (anonymous) (cyclomatic 21, cognitive 24) ui/src/features/transcription/components/NewTranscriptionModal.tsx:308 — (anonymous) has cyclomatic complexity 21 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ScriptParagraph (cyclomatic 21, cognitive 20) · ×1
  • Complex function ScriptParagraph (cyclomatic 21, cognitive 20) ui/src/features/studio/components/ScriptParagraph.tsx:95 — ScriptParagraph has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · ui/src/shared/api/audio.ts · ×1
  • ui/src/shared/api/audio.ts: 3146 lines of code ui/src/shared/api/audio.ts:1 — ui/src/shared/api/audio.ts has 3146 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/chat/components/ChatPlayground.tsx · ×1
  • ui/src/features/chat/components/ChatPlayground.tsx: 2276 lines of code ui/src/features/chat/components/ChatPlayground.tsx:1 — ui/src/features/chat/components/ChatPlayground.tsx has 2276 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/voice/useVoiceSession.ts · ×1
  • ui/src/features/voice/useVoiceSession.ts: 1289 lines of code ui/src/features/voice/useVoiceSession.ts:1 — ui/src/features/voice/useVoiceSession.ts has 1289 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/transcription/route.tsx · ×1
  • ui/src/features/transcription/route.tsx: 1218 lines of code ui/src/features/transcription/route.tsx:1 — ui/src/features/transcription/route.tsx has 1218 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/voice/realtime/support.ts · ×1
  • ui/src/features/voice/realtime/support.ts: 1214 lines of code ui/src/features/voice/realtime/support.ts:1 — ui/src/features/voice/realtime/support.ts has 1214 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/app/providers/ModelCatalogProvider.tsx · ×1
  • ui/src/app/providers/ModelCatalogProvider.tsx: 1134 lines of code ui/src/app/providers/ModelCatalogProvider.tsx:1 — ui/src/app/providers/ModelCatalogProvider.tsx has 1134 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx · ×1
  • ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx: 1103 lines of code ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx:1 — ui/src/features/text-to-speech/components/NewTextToSpeechModal.tsx has 1103 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/settings/route.tsx · ×1
  • ui/src/features/settings/route.tsx: 1094 lines of code ui/src/features/settings/route.tsx:1 — ui/src/features/settings/route.tsx has 1094 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/diarization/components/NewDiarizationModal.tsx · ×1
  • ui/src/features/diarization/components/NewDiarizationModal.tsx: 967 lines of code ui/src/features/diarization/components/NewDiarizationModal.tsx:1 — ui/src/features/diarization/components/NewDiarizationModal.tsx has 967 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/shared/api/chat.ts · ×1
  • ui/src/shared/api/chat.ts: 877 lines of code ui/src/shared/api/chat.ts:1 — ui/src/shared/api/chat.ts has 877 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/transcription/components/NewTranscriptionModal.tsx · ×1
  • ui/src/features/transcription/components/NewTranscriptionModal.tsx: 865 lines of code ui/src/features/transcription/components/NewTranscriptionModal.tsx:1 — ui/src/features/transcription/components/NewTranscriptionModal.tsx has 865 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/types.ts · ×1
  • ui/src/types.ts: 839 lines of code ui/src/types.ts:1 — ui/src/types.ts has 839 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/dictation/route.tsx · ×1
  • ui/src/features/dictation/route.tsx: 837 lines of code ui/src/features/dictation/route.tsx:1 — ui/src/features/dictation/route.tsx has 837 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/app/onboarding/FirstRunOnboarding.tsx · ×1
  • ui/src/app/onboarding/FirstRunOnboarding.tsx: 764 lines of code ui/src/app/onboarding/FirstRunOnboarding.tsx:1 — ui/src/app/onboarding/FirstRunOnboarding.tsx has 764 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/voice-studio/components/CloneVoiceDialog.tsx · ×1
  • ui/src/features/voice-studio/components/CloneVoiceDialog.tsx: 759 lines of code ui/src/features/voice-studio/components/CloneVoiceDialog.tsx:1 — ui/src/features/voice-studio/components/CloneVoiceDialog.tsx has 759 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/voice/components/VoiceSettingsSheet.tsx · ×1
  • ui/src/features/voice/components/VoiceSettingsSheet.tsx: 735 lines of code ui/src/features/voice/components/VoiceSettingsSheet.tsx:1 — ui/src/features/voice/components/VoiceSettingsSheet.tsx has 735 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/voices/route.tsx · ×1
  • ui/src/features/voices/route.tsx: 716 lines of code ui/src/features/voices/route.tsx:1 — ui/src/features/voices/route.tsx has 716 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/models/catalog/modelMetadata.ts · ×1
  • ui/src/features/models/catalog/modelMetadata.ts: 704 lines of code ui/src/features/models/catalog/modelMetadata.ts:1 — ui/src/features/models/catalog/modelMetadata.ts has 704 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/text-to-speech/route.tsx · ×1
  • ui/src/features/text-to-speech/route.tsx: 636 lines of code ui/src/features/text-to-speech/route.tsx:1 — ui/src/features/text-to-speech/route.tsx has 636 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/components/DiarizationReviewWorkspace.tsx · ×1
  • ui/src/components/DiarizationReviewWorkspace.tsx: 629 lines of code ui/src/components/DiarizationReviewWorkspace.tsx:1 — ui/src/components/DiarizationReviewWorkspace.tsx has 629 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/studio/components/StudioEditor.tsx · ×1
  • ui/src/features/studio/components/StudioEditor.tsx: 610 lines of code ui/src/features/studio/components/StudioEditor.tsx:1 — ui/src/features/studio/components/StudioEditor.tsx has 610 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/diarization/components/DiarizationRecordDetail.tsx · ×1
  • ui/src/features/diarization/components/DiarizationRecordDetail.tsx: 557 lines of code ui/src/features/diarization/components/DiarizationRecordDetail.tsx:1 — ui/src/features/diarization/components/DiarizationRecordDetail.tsx has 557 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/models/route.tsx · ×1
  • ui/src/features/models/route.tsx: 538 lines of code ui/src/features/models/route.tsx:1 — ui/src/features/models/route.tsx has 538 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/app/layouts/AppLayout.tsx · ×1
  • ui/src/app/layouts/AppLayout.tsx: 534 lines of code ui/src/app/layouts/AppLayout.tsx:1 — ui/src/app/layouts/AppLayout.tsx has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/transcription/components/TranscriptionRecordDetail.tsx · ×1
  • ui/src/features/transcription/components/TranscriptionRecordDetail.tsx: 519 lines of code ui/src/features/transcription/components/TranscriptionRecordDetail.tsx:1 — ui/src/features/transcription/components/TranscriptionRecordDetail.tsx has 519 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/transcription/components/TranscriptionHistoryTable.tsx · ×1
  • ui/src/features/transcription/components/TranscriptionHistoryTable.tsx: 517 lines of code ui/src/features/transcription/components/TranscriptionHistoryTable.tsx:1 — ui/src/features/transcription/components/TranscriptionHistoryTable.tsx has 517 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/app/onboarding/firstRunPlan.ts · ×1
  • ui/src/app/onboarding/firstRunPlan.ts: 495 lines of code ui/src/app/onboarding/firstRunPlan.ts:1 — ui/src/app/onboarding/firstRunPlan.ts has 495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx · ×1
  • ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx: 486 lines of code ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx:1 — ui/src/features/text-to-speech/components/TextToSpeechRecordDetail.tsx has 486 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/voice-studio/components/DesignVoiceDialog.tsx · ×1
  • ui/src/features/voice-studio/components/DesignVoiceDialog.tsx: 482 lines of code ui/src/features/voice-studio/components/DesignVoiceDialog.tsx:1 — ui/src/features/voice-studio/components/DesignVoiceDialog.tsx has 482 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/voice/components/VoiceAgentSettings.tsx · ×1
  • ui/src/features/voice/components/VoiceAgentSettings.tsx: 474 lines of code ui/src/features/voice/components/VoiceAgentSettings.tsx:1 — ui/src/features/voice/components/VoiceAgentSettings.tsx has 474 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx · ×1
  • ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx: 458 lines of code ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx:1 — ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx has 458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx · ×1
  • ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx: 453 lines of code ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx:1 — ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx has 453 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/studio/components/ScriptParagraph.tsx · ×1
  • ui/src/features/studio/components/ScriptParagraph.tsx: 451 lines of code ui/src/features/studio/components/ScriptParagraph.tsx:1 — ui/src/features/studio/components/ScriptParagraph.tsx has 451 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/text-to-speech/components/DialogueEditor.tsx · ×1
  • ui/src/features/text-to-speech/components/DialogueEditor.tsx: 416 lines of code ui/src/features/text-to-speech/components/DialogueEditor.tsx:1 — ui/src/features/text-to-speech/components/DialogueEditor.tsx has 416 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · ui/src/features/transcription/transcript.ts · ×1
  • ui/src/features/transcription/transcript.ts: 401 lines of code ui/src/features/transcription/transcript.ts:1 — ui/src/features/transcription/transcript.ts has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~127 LoC) · ×1
  • Dead file (~127 LoC) ui/src/components/GenerationStats.tsx — no import path from any entry point (16 application, 6 tooling, 114 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~83 LoC) · ×1
  • Dead file (~83 LoC) ui/src/utils/useDownloadIndicator.ts — no import path from any entry point (16 application, 6 tooling, 114 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~73 LoC) · ×1
  • Dead file (~73 LoC) ui/src/components/ui/Waveform.tsx — no import path from any entry point (16 application, 6 tooling, 114 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~56 LoC) · ×1
  • Dead file (~56 LoC) ui/src/components/ui/accordion.tsx — no import path from any entry point (16 application, 6 tooling, 114 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~46 LoC) · ×1
  • Dead file (~46 LoC) ui/src/components/ui/scroll-area.tsx — no import path from any entry point (16 application, 6 tooling, 114 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
X29 · Per-element action decided by a fixed element · Per-element action decided by a fixed element · ×1
  • Per-element action decided by a fixed element crates/izwi-core/src/engine/executor/handler_tts.rs:3718 — This loop runs once per element of `requests`, and the statement it guards acts on the element it is on — `requests[index]`. The test deciding whether that statement runs does not: `!Arc : : ptr_eq(& model_arc, & row_model.model_arc()) || row_params != cohort...` reads `requests[first_live]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 3702, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
Minor — 152 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate ui/src/utils/diarizationExport.ts:45 — `!Number.isFinite(seconds) || seconds < 0` appears character-identically in 2 files — ui/src/utils/diarizationExport.ts, ui/src/utils/transcriptionExport.ts. 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 ui/src/features/transcription/playground/support.ts:194 — `!Number.isFinite(totalSeconds) || totalSeconds < 0` appears character-identically in 2 files — ui/src/features/transcription/playground/support.ts, ui/src/features/transcription/transcript.ts. 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 ui/src/components/DiarizationReviewWorkspace.tsx:296 — `!autoScrollActiveEntry || !isPlaying || activeEntryIndex < 0` appears character-identically in 2 files — ui/src/components/DiarizationReviewWorkspace.tsx, ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx. 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 ui/src/features/diarization/components/NewDiarizationModal.tsx:240 — `!current || current.phase === "accepted" || current.phase === "opening"` appears character-identically in 2 files — ui/src/features/diarization/components/NewDiarizationModal.tsx, ui/src/features/transcription/components/NewTranscriptionModal.tsx. 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 ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx:201 — `!deleteTarget || !onDeleteRecord || deletePending` appears character-identically in 2 files — ui/src/features/text-to-speech/components/TextToSpeechHistoryTable.tsx, ui/src/features/transcription/components/TranscriptionHistoryTable.tsx. 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 ui/src/features/text-to-speech/route.tsx:291 — `!record || !streamingRecord || record.id !== streamingRecord.id` appears character-identically in 2 files — ui/src/features/text-to-speech/route.tsx, ui/src/features/transcription/route.tsx. 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 ui/src/features/text-to-speech/route.tsx:333 — `!streamingRecord || streamingRecord.id !== recordId` appears character-identically in 2 files — ui/src/features/text-to-speech/route.tsx, ui/src/features/transcription/route.tsx. 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 ui/src/features/text-to-speech/route.tsx:602 — `Boolean(historySearch.trim()) || historyFilter !== "all"` appears character-identically in 2 files — ui/src/features/text-to-speech/route.tsx, ui/src/features/transcription/route.tsx. 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 ui/src/features/text-to-speech/support.ts:72 — `durationSecs === null || !Number.isFinite(durationSecs) || durationSecs < 0` appears character-identically in 2 files — ui/src/features/text-to-speech/support.ts, ui/src/features/transcription/playground/support.ts. 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 ui/src/features/chat/playground/support.ts:183 — `error instanceof Error && error.message.trim()` appears character-identically in 3 files — ui/src/features/chat/playground/support.ts, ui/src/features/dictation/api.ts, ui/src/utils/useDownloadIndicator.ts. 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 ui/src/features/chat/components/ChatPlayground.tsx:1745 — `event.key === "Enter" && !event.shiftKey && !event.nativeEvent.isComposing` appears character-identically in 4 files — ui/src/features/chat/components/ChatPlayground.tsx, ui/src/features/chat/components/messages/UserMessage.tsx, ui/src/features/studio/components/ScriptParagraph.tsx, ui/src/features/studio/components/StudioEditor.tsx. 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 ui/src/features/diarization/components/NewDiarizationModal.tsx:763 — `isSubmitting && (uploadState.phase === "preparing" || uploadState.phase === "uploading")` appears character-identically in 2 files — ui/src/features/diarization/components/NewDiarizationModal.tsx, ui/src/features/transcription/components/NewTranscriptionModal.tsx. 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 ui/src/app/layouts/RuntimeCard.tsx:41 — `memory?.system_total_bytes && memory.system_total_bytes > 0` appears character-identically in 2 files — ui/src/app/layouts/RuntimeCard.tsx, ui/src/features/models/route.tsx. 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 ui/src/features/voice/agentSettings.ts:233 — `mode === "modular" && settings.replySooner` appears character-identically in 2 files — ui/src/features/voice/agentSettings.ts, ui/src/features/voice/components/VoiceAgentSettings.tsx. 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 ui/src/app/router/routePresentation.ts:50 — `mode === "speaker_attributed_asr" || mode === "saa"` appears character-identically in 2 files — ui/src/app/router/routePresentation.ts, ui/src/features/speech-text/route.tsx. 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 ui/src/features/models/components/ModelListRow.tsx:59 — `model.status === "downloaded" || model.status === "ready"` appears character-identically in 2 files — ui/src/features/models/components/ModelListRow.tsx, ui/src/features/models/route.tsx. 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 ui/src/features/models/components/RouteModelModal.tsx:281 — `model.status === "ready" && model.pinned` appears character-identically in 2 files — ui/src/features/models/components/RouteModelModal.tsx, ui/src/features/models/route.tsx. 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 ui/src/components/DiarizationReviewWorkspace.tsx:414 — `normalizedSummaryGuidance && summaryStatus !== "ready"` appears character-identically in 2 files — ui/src/components/DiarizationReviewWorkspace.tsx, ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx. 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 ui/src/features/diarization/components/DiarizationRecordDetail.tsx:145 — `processingStatus === "pending" || processingStatus === "processing"` appears character-identically in 2 files — ui/src/features/diarization/components/DiarizationRecordDetail.tsx, ui/src/features/transcription/components/TranscriptionRecordDetail.tsx. 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 ui/src/features/text-to-speech/route.tsx:299 — `processingStatus === "ready" || processingStatus === "failed"` appears character-identically in 2 files — ui/src/features/text-to-speech/route.tsx, ui/src/features/transcription/route.tsx. 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 ui/src/features/speech-text/hooks/useSpeechTextRecord.ts:27 — `record.processing_status === "pending" || record.processing_status === "processing"` appears character-identically in 2 files — ui/src/features/speech-text/hooks/useSpeechTextRecord.ts, ui/src/features/transcription/components/TranscriptionHistoryTable.tsx. 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 ui/src/components/DiarizationReviewWorkspace.tsx:225 — `record?.duration_secs && record.duration_secs > 0` appears character-identically in 2 files — ui/src/components/DiarizationReviewWorkspace.tsx, ui/src/features/transcription/components/TranscriptionReviewWorkspace.tsx. 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 ui/src/features/voice/components/VoiceSettingsSheet.tsx:596 — `row.model && (row.model.status === "not_downloaded" || row.model.status === "error")` appears character-identically in 2 files — ui/src/features/voice/components/VoiceSettingsSheet.tsx, ui/src/features/voice/route.tsx. 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 ui/src/features/studio/hooks/useStudioProject.ts:103 — `segment.render_state === "queued" || segment.render_state === "rendering"` appears character-identically in 2 files — ui/src/features/studio/hooks/useStudioProject.ts, ui/src/features/studio/studio.ts. 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 ui/src/features/transcription/playground/support.ts:85 — `status === "not_requested" || status === "pending" || status === "ready" || status === "failed"` appears character-identically in 2 files — ui/src/features/transcription/playground/support.ts, ui/src/utils/diarizationSummary.ts. 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.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:360 — `info!` at line 360 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:373 — `info!` at line 373 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:430 — `warn!` at line 430 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:454 — `warn!` at line 454 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:472 — `info!` at line 472 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:544 — `warn!` at line 544 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:550 — `warn!` at line 550 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:560 — `info!` at line 560 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:568 — `warn!` at line 568 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:576 — `warn!` at line 576 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:584 — `warn!` at line 584 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:607 — `info!` at line 607 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:613 — `warn!` at line 613 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:620 — `info!` at line 620 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:626 — `warn!` at line 626 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:643 — `info!` at line 643 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:657 — `warn!` at line 657 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/actor.rs:662 — `warn!` at line 662 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:39 — `info!` at line 39 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:106 — `info!` at line 106 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:123 — `warn!` at line 123 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:140 — `info!` at line 140 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:155 — `info!` at line 155 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:203 — `info!` at line 203 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/izwi-serving-supervisor/src/daemon/autoscale_driver.rs:206 — `warn!` at line 206 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 15 more in this group — see findings.md.
D10 · Test Quality · Mock-dominated test · ×25
  • Mock-dominated test: reconnects durable speech from consumed PCM without restarting playback or duplicating chunks ui/src/shared/api/audio.test.ts:274 — This test sets up 7 test doubles (for example `vi.fn`) against 3 real object(s) of its own, and its only verification is 8 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: parses direct TTS stream audio event names ui/src/shared/api/audio.test.ts:359 — This test sets up 4 test doubles (for example `vi.fn`) against 3 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: parses direct ASR stream transcript type names ui/src/shared/api/audio.test.ts:419 — This test sets up 4 test doubles (for example `vi.fn`) against 3 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: delivers a delta while the response body remains open ui/src/shared/api/chat.test.ts:152 — This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: surfaces an OpenAI error frame and does not complete on done ui/src/shared/api/chat.test.ts:186 — This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: reports a truncated stream that closes without done ui/src/shared/api/chat.test.ts:242 — This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: rejects done without an OpenAI terminal chunk ui/src/shared/api/chat.test.ts:269 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: does not turn an explicit terminal error into success ui/src/shared/api/chat.test.ts:337 — This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: rejects an empty terminal after text without erasing the streamed answer ui/src/shared/api/chat.test.ts:376 — This test sets up 5 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: preserves reasoning-only terminal responses ui/src/shared/api/chat.test.ts:399 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: ignores a read failure after a completed thread terminal ui/src/shared/api/chat.test.ts:417 — This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: reports closure before a terminal thread event ui/src/shared/api/chat.test.ts:451 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: keeps a failed response terminal after the done sentinel ui/src/shared/api/chat.test.ts:485 — This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: ignores a read failure after a completed response terminal ui/src/shared/api/chat.test.ts:520 — This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: reports closure before a terminal response event ui/src/shared/api/chat.test.ts:547 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: runs the latest handler without re-registering the listener ui/src/hooks/useWorkspaceShortcuts.test.ts:7 — This test sets up 3 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: releases the microphone when the dialog closes mid-recording ui/src/features/voice-studio/components/CloneVoiceDialog.test.tsx:287 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: loads the selected model from the modal readiness action ui/src/features/text-to-speech/route.test.tsx:829 — This test sets up 6 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: opens TTS models from the new generation modal ui/src/features/text-to-speech/route.test.tsx:867 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: selects a saved-voice-capable model when opening with a saved voice id ui/src/features/text-to-speech/route.test.tsx:969 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: retries redirect model selection after route model options hydrate ui/src/features/text-to-speech/route.test.tsx:1018 — This test sets up 8 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: allows a loading model to be cancelled ui/src/features/models/route.test.tsx:80 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: allows a loading model to be cancelled ui/src/features/models/components/RouteModelModal.test.tsx:53 — This test sets up 6 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: forwards enable_thinking for Qwen3.6, whose template reads it ui/src/features/chat/components/ChatPlayground.test.tsx:1415 — This test sets up 7 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: opens the speech model manager when no voice is loaded ui/src/features/chat/components/ChatPlayground.test.tsx:1946 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
X9 · Subsumed condition operand · Subsumed condition operand · ×14
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:785 — `normalized.contains("17b")` can never decide this `||` — every value satisfying `normalized.contains("17b")` also satisfies `normalized.contains("17")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:847 — `normalized.contains("17b")` can never decide this `||` — every value satisfying `normalized.contains("17b")` also satisfies `normalized.contains("17")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:849 — `normalized.contains("qwen34b")` can never decide this `||` — every value satisfying `normalized.contains("qwen34b")` also satisfies `normalized.contains("4b")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:852 — `normalized.contains("q80")` can never decide this `||` — every value satisfying `normalized.contains("q80")` also satisfies `normalized.contains("q8")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:875 — `normalized.contains("06b")` can never decide this `||` — every value satisfying `normalized.contains("06b")` also satisfies `normalized.contains("06")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:931 — `normalized.contains("qwen3asr17")` can never decide this `||` — every value satisfying `normalized.contains("qwen3asr17")` also satisfies `normalized.contains("17")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:939 — `normalized.contains("qwen3asr06")` can never decide this `||` — every value satisfying `normalized.contains("qwen3asr06")` also satisfies `normalized.contains("06")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:1022 — `normalized.contains("09b")` can never decide this `||` — every value satisfying `normalized.contains("09b")` also satisfies `normalized.contains("9b")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:1025 — `normalized.contains("08b")` can never decide this `||` — every value satisfying `normalized.contains("08b")` also satisfies `normalized.contains("08")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:1049 — `normalized.contains("12b")` can never decide this `||` — every value satisfying `normalized.contains("12b")` also satisfies `normalized.contains("12")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:1079 — `normalized.contains("q80")` can never decide this `||` — every value satisfying `normalized.contains("q80")` also satisfies `normalized.contains("q8")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:1097 — `normalized.contains("q80")` can never decide this `||` — every value satisfying `normalized.contains("q80")` also satisfies `normalized.contains("q8")`, 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.
  • Subsumed condition operand crates/izwi-model-catalog/src/catalog/variant.rs:1115 — `normalized.contains("15b")` can never decide this `||` — every value satisfying `normalized.contains("15b")` also satisfies `normalized.contains("15")`, 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.
  • Subsumed condition operand crates/izwi-core/src/runtime/lifecycle/load.rs:96 — `message.contains("kiogpucommandbuffercallbackerroroutofmemory")` can never decide this `||` — every value satisfying `message.contains("kiogpucommandbuffercallbackerroroutofmemory")` also satisfies `message.contains("commandbuffercallbackerroroutofmemory")`, 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.
X7 · Silent fallback defaults · Silent fallback default on Err · ×5
  • Silent fallback default on Err crates/izwi-desktop/src/app/settings.rs:63 — `merge` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/izwi-server/src/app/media_stream.rs:250 — `frames` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/izwi-server/src/api/speech_history/handlers.rs:3159 — `to_stream_json` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err REDACTED:3201 — `encode_json_string_vec` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/izwi-serving-supervisor/src/quarantine.rs:48 — `take_quarantine_clear_requests` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 on the arm or in the doc comment, and the row stops firing.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×4
  • Projects may be oversized for their cohesion crates/izwi-core/Cargo.toml:1 — `crates/izwi-core` (267280 LoC, 1733 module-visible types across 83 directories) overshoots its size bounds. 4 of 22 build unit(s) (Cargo, npm) overshoot their size bounds, lowering Project Cohesion to 6.4/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/izwi-server/Cargo.toml:1 — `crates/izwi-server` (103149 LoC, 586 module-visible types across 30 directories) overshoots its size bounds. 4 of 22 build unit(s) (Cargo, npm) overshoot their size bounds, lowering Project Cohesion to 6.4/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion ui/package.json:1 — `ui` (51626 LoC, 510 module-visible types across 57 directories) overshoots its size bounds. 4 of 22 build unit(s) (Cargo, npm) overshoot their size bounds, lowering Project Cohesion to 6.4/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/izwi-gateway/Cargo.toml:1 — `crates/izwi-gateway` (24367 LoC, 211 module-visible types across 8 directories) overshoots its size bounds. 4 of 22 build unit(s) (Cargo, npm) overshoot their size bounds, lowering Project Cohesion to 6.4/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D31 · IaC & Container Security · Low IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D41 · Kernel & Syscall Confinement · No seccomp profile · ×2
  • No seccomp profile REDACTED:59 — The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
  • No seccomp profile REDACTED:50 — The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D40 · Network Egress Confinement · No network policy · ×1
  • No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 9/11 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/izwi-desktop`, `crates/izwi-serving-protocol`.
R7 · Dead Code · Unused export 'getAnalyticsEnabled' · ×1
  • Unused export 'getAnalyticsEnabled' ui/src/app/analytics/client.ts:12 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formatThreadTimestamp' · ×1
  • Unused export 'formatThreadTimestamp' ui/src/features/chat/playground/support.ts:189 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formatSpeechCreatedAt' · ×1
  • Unused export 'formatSpeechCreatedAt' ui/src/features/text-to-speech/support.ts:52 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formatSpeechDuration' · ×1
  • Unused export 'formatSpeechDuration' ui/src/features/text-to-speech/support.ts:70 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formatCreatedAt' · ×1
  • Unused export 'formatCreatedAt' ui/src/features/transcription/playground/support.ts:161 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'transcodeToWav' · ×1
  • Unused export 'transcodeToWav' ui/src/features/voice/realtime/support.ts:1236 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'buildDiarizationSummaryPreview' · ×1
  • Unused export 'buildDiarizationSummaryPreview' ui/src/utils/diarizationSummary.ts:41 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formattedTranscriptFromResult' · ×1
  • Unused export 'formattedTranscriptFromResult' REDACTED:153 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'previewTranscript' · ×1
  • Unused export 'previewTranscript' REDACTED:189 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'correctedSpeakerCount' · ×1
  • Unused export 'correctedSpeakerCount' REDACTED:320 — Nothing imports this binding — it is safe to review for removal.
S1 · Web-Security Posture · Security headers incomplete · ×1
  • Security headers incomplete — Set: Content-Security-Policy, Referrer-Policy, X-Content-Type-Options, X-Frame-Options. Missing: Strict-Transport-Security — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−0.5 on this card.) The server: `axum::serve(` (crates/izwi-serving-worker/src/main.rs:436).
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 13/15 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×1
  • Diagnostic log message is built whether or not it is wanted crates/izwi-core/src/engine/executor/handler_tts.rs:4456 — `tracing::debug!` at line 4456 is called with an argument built by `steps.iter().map(|step|step.frames).sum::<usize>()` (line 4458), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::debug! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch ui/src/app/providers/ModelCatalogProvider.tsx:157 — `readPersistedRouteSelections` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Minor — 18 finding(s)
D12 · Dependency Hygiene · Outdated · ×17
  • Outdated: clap — `clap` is locked at 4.6.7 but 4.6.8 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in crates/izwi-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
  • Outdated: clap_complete — `clap_complete` is locked at 4.6.11 but 4.6.12 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in crates/izwi-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap_complete` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.10 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/izwi-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: handy-keys — `handy-keys` is locked at 0.3.4 but 0.3.5 is the current stable release on crates.io, and it already satisfies the `"0.3.4"` requirement declared in crates/izwi-dictation/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p handy-keys` and commit the updated REDACTED.
  • Outdated: icu_properties — `icu_properties` is locked at 2.3.0 but 2.4.0 is the current stable release on crates.io, and it already satisfies the `"2.3"` requirement declared in crates/izwi-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p icu_properties` and commit the updated REDACTED.
  • Outdated: rand — `rand` is locked at 0.10.3 but 0.10.4 is the current stable release on crates.io, and it already satisfies the `"0.10"` requirement declared in crates/izwi-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rand` and commit the updated REDACTED.
  • Outdated: rubato — `rubato` is locked at 5.0.1 but 5.1.0 is the current stable release on crates.io, and it already satisfies the `"5"` requirement declared in crates/izwi-audio-codec/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rubato` and commit the updated REDACTED.
  • Outdated: rustix — `rustix` is locked at 1.1.5 but 1.1.6 is the current stable release on crates.io, and it already satisfies the `"1.1.3"` requirement declared in crates/izwi-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustix` and commit the updated REDACTED.
  • Outdated: scalar_api_reference — `scalar_api_reference` is locked at 0.2.16 but 0.2.25 is the current stable release on crates.io, and it already satisfies the `"0.2.2"` requirement declared in crates/izwi-gateway/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p scalar_api_reference` and commit the updated REDACTED.
  • Outdated: tauri — `tauri` is locked at 2.12.5 but 2.12.6 is the current stable release on crates.io, and it already satisfies the `"2.12.5"` requirement declared in crates/izwi-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri` and commit the updated REDACTED.
  • Outdated: tauri-build — `tauri-build` is locked at 2.7.4 but 2.7.5 is the current stable release on crates.io, and it already satisfies the `"2.7.4"` requirement declared in crates/izwi-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-build` and commit the updated REDACTED.
  • Outdated: tauri-plugin-dialog — `tauri-plugin-dialog` is locked at 2.8.3 but 2.8.4 is the current stable release on crates.io, and it already satisfies the `"2.8.3"` requirement declared in crates/izwi-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-dialog` and commit the updated REDACTED.
  • Outdated: tauri-plugin-single-instance — `tauri-plugin-single-instance` is locked at 2.5.4 but 2.5.5 is the current stable release on crates.io, and it already satisfies the `"2.5.4"` requirement declared in crates/izwi-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-single-instance` and commit the updated REDACTED.
  • Outdated: toml — `toml` is locked at 1.1.8+spec-1.1.0 but 1.2.1+spec-1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/izwi-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p toml` and commit the updated REDACTED.
  • Outdated: uuid — `uuid` is locked at 1.28.0 but 1.29.3 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/izwi-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
  • Outdated: webpki-roots — `webpki-roots` is locked at 1.0.10 but 1.0.12 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/izwi-serving-client/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p webpki-roots` and commit the updated REDACTED.
  • Outdated: zip — `zip` is locked at 9.2.2 but 9.6.1 is the current stable release on crates.io, and it already satisfies the `"9"` requirement declared in crates/izwi-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zip` and commit the updated REDACTED.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names ui/src/features/text-to-speech/take.ts:34 — 0 of 0 documented parameters and 1 of 733 summaries in `izwi-ui` only repeat the member or parameter name (e.g. ""Speaker 1", "Speaker 1 and Speaker 3", "Speaker 0, Speaker 1 and …"." for `speakerList`). Delete the restating tags, or add what the name does not say.

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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-27e37b6061694fa78331f22368d64263/history.json --exit-code 0 --source .3artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=539" --report-format json --report-path /tmp/watchdog-gitleaks-27e37b6061694fa78331f22368d64263/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=739 --max-count=885" --report-format json --report-path /tmp/watchdog-gitleaks-27e37b6061694fa78331f22368d64263/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-27e37b6061694fa78331f22368d64263/tree.json --exit-code 0 --source .3artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .23artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .9artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .45artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—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 2 file(s) — `ui/src/features/chat/components/ChatPlayground.tsx`, `ui/src/features/voice/useVoiceSession.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e78c-2442-7fde-9b84-3457c1ed775b · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md