Public report — embassy, published 29 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.17 (frozen) · verify this surveyFiledcd_dd2e04cd33224abab827e14cae68bc29
Filed 29 September 2026, 05:51 UTC
Public
Large · 397,989 LoC · 48 projects · rebuild ~4.3 person-years · weakest lens: Readiness (48%)
Findings by grade
3 critical2144 serious18 minor53 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 September 2026, 04:28 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
2132findings with an exact file:lineof 2165 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
36/120dimensions across the health lenses397989 LoC · 48 projects — wide & deep
Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.
This system is a strong, large-scale asset with a 66% health score, but it carries significant operational risk due to weak production readiness. With nearly 400,000 lines of production code and a rebuild cost of roughly €630,000, the value at stake is substantial. While the architecture is robust and the code is well-structured, the lack of operational safeguards means that daily changes are slower and riskier than they need to be.
The most critical issue is fragile operational trust. With a readiness score of only 48%, the system lacks the testing, observability, and security gates required for safe, independent operation. This exposes the business to potential outages and security regressions that could disrupt service. The cost of this neglect is high: fixing the top security gap pays for itself in one to two months by preventing annual delays estimated at hundreds of engineer-days. Without this fix, every change incurs a hidden velocity tax, slowing delivery and increasing defect rates.
A secondary concern is development friction. The code quality signals indicate a moderate complexity tax, meaning modifications in weaker areas take 5–10% longer than in clean code. While the architecture is sound, this friction compounds as the team grows, reducing overall throughput. Additionally, the absence of measured domain modeling and event-driven metrics means we cannot fully assess the system’s long-term adaptability, leaving some strategic risks unquantified.
On the positive side, the codebase is highly maintainable with excellent architecture and no boilerplate waste. The team has built a solid foundation that is easy to understand and extend. However, this strength is undermined by the lack of automated safety nets.
Focus first on adding automated security scanning to the CI pipeline. This single action delivers the highest return on investment, paying for itself quickly while significantly reducing security exposure. Once this gate is in place, the team can address broader readiness gaps with greater confidence, ensuring the system remains a reliable business asset rather than a liability.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
145 finding(s) are new versus the previous scan (2026-09-12) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €210,000–€1,000,000
0.9× (at 66% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~4.3 person-years of build effort (about ~€630,000 to rebuild). Its weakest lens is Readiness at 48% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.9× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 84.5–507 engineer-days every year, paid as drag on the ~745,999 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–10% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 183,945 line(s) changed over a 90-day window ⇒ ~745,999/year · D1/D2/D4 code quality: averaging 6.2/10 ⇒ a 5–10% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Large asset (~4.3 person-years to rebuild), and its weakest lens is Readiness at 48%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.2/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–10% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 6.2/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
1121 modules, 3619 dependencies. 10 dependency cycles across 182 modules, marked above the diagonal.
Showing the 40 most-connected modules; 1081 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
embassy_crypto_rustcrypto.aes.aes128_cbc_impl uses embassy_crypto.driver. Changing embassy_crypto.driver can break embassy_crypto_rustcrypto.aes.aes128_cbc_impl, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
11→4 embassy_nrf.config depends on embassy_hal_internal.interrupt✕
Type pairs
1 distinct (type in embassy_nrf.config → type in embassy_hal_internal.interrupt) reference.
embassy_stm32.can.fd.message_ram.generic uses embassy_net_enc28j60.traits. Changing embassy_net_enc28j60.traits can break embassy_stm32.can.fd.message_ram.generic, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
13→9 embassy_ambiq.i2c depends on embassy_ambiq.gpio✕
Type pairs
4 distinct (type in embassy_ambiq.i2c → type in embassy_ambiq.gpio) references.
embassy_usb_synopsys_otg.otg_v1 uses embassy_net_enc28j60.traits. Changing embassy_net_enc28j60.traits can break embassy_usb_synopsys_otg.otg_v1, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
15→12 embassy_usb_synopsys_otg.otg_v1 depends on embassy_stm32.can.fd.message_ram.generic✕
Type pairs
1 distinct (type in embassy_usb_synopsys_otg.otg_v1 → type in embassy_stm32.can.fd.message_ram.generic) reference.
embassy_usb_synopsys_otg.otg_v1 uses embassy_stm32.can.fd.message_ram.generic. Changing embassy_stm32.can.fd.message_ram.generic can break embassy_usb_synopsys_otg.otg_v1, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
16→13 embassy_embedded_hal depends on embassy_ambiq.i2c✕
Type pairs
2 distinct (type in embassy_embedded_hal → type in embassy_ambiq.i2c) references.
embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel uses embassy_hal_internal.interrupt. Changing embassy_hal_internal.interrupt can break embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
18→7 embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel depends on embassy_sync.waitqueue.atomic_waker✕
Type pairs
1 distinct (type in embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel → type in embassy_sync.waitqueue.atomic_waker) reference.
embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel uses embassy_sync.waitqueue.atomic_waker. Changing embassy_sync.waitqueue.atomic_waker can break embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
18→17 embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel depends on embassy_imxrt.crc✕
Type pairs
3 distinct (type in embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel → type in embassy_imxrt.crc) references.
embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel uses embassy_imxrt.crc. Changing embassy_imxrt.crc can break embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
19→7 embassy_nrf.i2s depends on embassy_sync.waitqueue.atomic_waker✕
Type pairs
1 distinct (type in embassy_nrf.i2s → type in embassy_sync.waitqueue.atomic_waker) reference.
embassy_nrf.i2s uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_nrf.i2s, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
19→20 embassy_nrf.i2s depends on embassy_hal_internal.peripheralcycle✕
Type pairs
2 distinct (type in embassy_nrf.i2s → type in embassy_hal_internal.peripheral) references.
embassy_imxrt.dma uses embassy_crypto_rustcrypto.aes.aes128_cbc_impl. Changing embassy_crypto_rustcrypto.aes.aes128_cbc_impl can break embassy_imxrt.dma, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→20 embassy_imxrt.dma depends on embassy_hal_internal.peripheral✕
Type pairs
4 distinct (type in embassy_imxrt.dma → type in embassy_hal_internal.peripheral) references.
embassy_imxrt.gpio uses embassy_sync.waitqueue.atomic_waker. Changing embassy_sync.waitqueue.atomic_waker can break embassy_imxrt.gpio, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→9 embassy_imxrt.gpio depends on embassy_ambiq.gpio✕
Type pairs
7 distinct (type in embassy_imxrt.gpio → type in embassy_ambiq.gpio) references.
embassy_imxrt.gpio uses embassy_crypto_rustcrypto.aes.aes128_cbc_impl. Changing embassy_crypto_rustcrypto.aes.aes128_cbc_impl can break embassy_imxrt.gpio, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→20 embassy_imxrt.gpio depends on embassy_hal_internal.peripheral✕
Type pairs
5 distinct (type in embassy_imxrt.gpio → type in embassy_hal_internal.peripheral) references.
embassy_imxrt.flexcomm.uart uses embassy_usb_synopsys_otg.otg_v1. Changing embassy_usb_synopsys_otg.otg_v1 can break embassy_imxrt.flexcomm.uart, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→17 embassy_imxrt.flexcomm.uart depends on embassy_imxrt.crc✕
Type pairs
4 distinct (type in embassy_imxrt.flexcomm.uart → type in embassy_imxrt.crc) references.
embassy_imxrt.flexcomm.uart uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_imxrt.flexcomm.uart, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→20 embassy_imxrt.flexcomm.uart depends on embassy_hal_internal.peripheral✕
Type pairs
8 distinct (type in embassy_imxrt.flexcomm.uart → type in embassy_hal_internal.peripheral) references.
embassy_imxrt.flexcomm.uart uses embassy_hal_internal.peripheral. Changing embassy_hal_internal.peripheral can break embassy_imxrt.flexcomm.uart, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→22 embassy_imxrt.flexcomm.uart depends on embassy_imxrt.dma✕
Type pairs
2 distinct (type in embassy_imxrt.flexcomm.uart → type in embassy_imxrt.dma) references.
embassy_nrf.crypto.symmetric uses embassy_hal_internal.peripheral. Changing embassy_hal_internal.peripheral can break embassy_nrf.crypto.symmetric, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
29→25 embassy_nrf.crypto.symmetric depends on cyw43.bluetooth✕
Type pairs
1 distinct (type in embassy_nrf.crypto.symmetric → type in cyw43.bluetooth) reference.
embassy_mcxa.dma uses embassy_crypto_rustcrypto.aes.aes128_cbc_impl. Changing embassy_crypto_rustcrypto.aes.aes128_cbc_impl can break embassy_mcxa.dma, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→18 embassy_mcxa.dma depends on embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel✕
Type pairs
1 distinct (type in embassy_mcxa.dma → type in embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel) reference.
embassy_mcxa.dma uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_mcxa.dma, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→20 embassy_mcxa.dma depends on embassy_hal_internal.peripheral✕
Type pairs
3 distinct (type in embassy_mcxa.dma → type in embassy_hal_internal.peripheral) references.
embassy_rp.pio uses embassy_crypto_rustcrypto.aes.aes128_cbc_impl. Changing embassy_crypto_rustcrypto.aes.aes128_cbc_impl can break embassy_rp.pio, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→13 embassy_rp.pio depends on embassy_ambiq.i2c✕
Type pairs
1 distinct (type in embassy_rp.pio → type in embassy_ambiq.i2c) reference.
embassy_rp.pio uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_rp.pio, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→20 embassy_rp.pio depends on embassy_hal_internal.peripheral✕
Type pairs
4 distinct (type in embassy_rp.pio → type in embassy_hal_internal.peripheral) references.
embassy_mcxa.i2c.controller uses embassy_usb_synopsys_otg.otg_v1. Changing embassy_usb_synopsys_otg.otg_v1 can break embassy_mcxa.i2c.controller, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→16 embassy_mcxa.i2c.controller depends on embassy_embedded_hal✕
Type pairs
1 distinct (type in embassy_mcxa.i2c.controller → type in embassy_embedded_hal) reference.
embassy_mcxa.i2c.controller uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_mcxa.i2c.controller, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→20 embassy_mcxa.i2c.controller depends on embassy_hal_internal.peripheral✕
Type pairs
1 distinct (type in embassy_mcxa.i2c.controller → type in embassy_hal_internal.peripheral) reference.
embassy_mcxa.i2c.controller uses embassy_hal_internal.peripheral. Changing embassy_hal_internal.peripheral can break embassy_mcxa.i2c.controller, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→25 embassy_mcxa.i2c.controller depends on cyw43.bluetooth✕
Type pairs
1 distinct (type in embassy_mcxa.i2c.controller → type in cyw43.bluetooth) reference.
embassy_stm32.adc uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_stm32.adc, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
35→20 embassy_stm32.adc depends on embassy_hal_internal.peripheral✕
Type pairs
2 distinct (type in embassy_stm32.adc → type in embassy_hal_internal.peripheral) references.
embassy_mcxa.i2c.target uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_mcxa.i2c.target, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
36→20 embassy_mcxa.i2c.target depends on embassy_hal_internal.peripheral✕
Type pairs
1 distinct (type in embassy_mcxa.i2c.target → type in embassy_hal_internal.peripheral) reference.
embassy_mcxa.i2c.target uses embassy_hal_internal.peripheral. Changing embassy_hal_internal.peripheral can break embassy_mcxa.i2c.target, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
36→25 embassy_mcxa.i2c.target depends on cyw43.bluetooth✕
Type pairs
1 distinct (type in embassy_mcxa.i2c.target → type in cyw43.bluetooth) reference.
embassy_mcxa.i3c.controller uses embassy_usb_synopsys_otg.otg_v1. Changing embassy_usb_synopsys_otg.otg_v1 can break embassy_mcxa.i3c.controller, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→16 embassy_mcxa.i3c.controller depends on embassy_embedded_hal✕
Type pairs
1 distinct (type in embassy_mcxa.i3c.controller → type in embassy_embedded_hal) reference.
embassy_mcxa.i3c.controller uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_mcxa.i3c.controller, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→20 embassy_mcxa.i3c.controller depends on embassy_hal_internal.peripheral✕
Type pairs
1 distinct (type in embassy_mcxa.i3c.controller → type in embassy_hal_internal.peripheral) reference.
embassy_mcxa.i3c.controller uses embassy_hal_internal.peripheral. Changing embassy_hal_internal.peripheral can break embassy_mcxa.i3c.controller, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→25 embassy_mcxa.i3c.controller depends on cyw43.bluetooth✕
Type pairs
1 distinct (type in embassy_mcxa.i3c.controller → type in cyw43.bluetooth) reference.
embassy_mcxa.i3c.controller uses embassy_mcxa.i2c.controller. Changing embassy_mcxa.i2c.controller can break embassy_mcxa.i3c.controller, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→12 embassy_nrf.sqspi.regs depends on embassy_stm32.can.fd.message_ram.generic✕
Type pairs
9 distinct (type in embassy_nrf.sqspi.regs → type in embassy_stm32.can.fd.message_ram.generic) references.
embassy_nrf.sqspi.regs uses embassy_stm32.can.fd.message_ram.generic. Changing embassy_stm32.can.fd.message_ram.generic can break embassy_nrf.sqspi.regs, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→13 embassy_nrf.sqspi.regs depends on embassy_ambiq.i2c✕
Type pairs
1 distinct (type in embassy_nrf.sqspi.regs → type in embassy_ambiq.i2c) reference.
embassy_mcxa.flexspi uses embassy_sync.waitqueue.atomic_waker. Changing embassy_sync.waitqueue.atomic_waker can break embassy_mcxa.flexspi, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
39→9 embassy_mcxa.flexspi depends on embassy_ambiq.gpio✕
Type pairs
9 distinct (type in embassy_mcxa.flexspi → type in embassy_ambiq.gpio) references.
embassy_mcxa.flexspi uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_mcxa.flexspi, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
39→20 embassy_mcxa.flexspi depends on embassy_hal_internal.peripheral✕
Type pairs
4 distinct (type in embassy_mcxa.flexspi → type in embassy_hal_internal.peripheral) references.
embassy_stm32.dma.dma_bdma uses embassy_hal_internal.interrupt. Changing embassy_hal_internal.interrupt can break embassy_stm32.dma.dma_bdma, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→5 embassy_stm32.dma.dma_bdma depends on embassy_mcxa.clocks.types✕
Type pairs
4 distinct (type in embassy_stm32.dma.dma_bdma → type in embassy_mcxa.clocks.types) references.
embassy_stm32.dma.dma_bdma uses embassy_sync.waitqueue.atomic_waker. Changing embassy_sync.waitqueue.atomic_waker can break embassy_stm32.dma.dma_bdma, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→10 embassy_stm32.dma.dma_bdma depends on embassy_crypto_rustcrypto.aes.aes128_cbc_impl✕
Type pairs
1 distinct (type in embassy_stm32.dma.dma_bdma → type in embassy_crypto_rustcrypto.aes.aes128_cbc_impl) reference.
embassy_stm32.dma.dma_bdma uses embassy_crypto_rustcrypto.aes.aes128_cbc_impl. Changing embassy_crypto_rustcrypto.aes.aes128_cbc_impl can break embassy_stm32.dma.dma_bdma, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→18 embassy_stm32.dma.dma_bdma depends on embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel✕
Type pairs
1 distinct (type in embassy_stm32.dma.dma_bdma → type in embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel) reference.
embassy_stm32.dma.dma_bdma uses embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel. Changing embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel can break embassy_stm32.dma.dma_bdma, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→22 embassy_stm32.dma.dma_bdma depends on embassy_imxrt.dma✕
Type pairs
5 distinct (type in embassy_stm32.dma.dma_bdma → type in embassy_imxrt.dma) references.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2021 — Injection
3
High / Critical
Roadmap
First, integrate automated security scanning into the CI pipeline to block regressions and stamp version numbers in build manifests to ensure traceable releases. Next, enforce merge gates by running the full test suite in CI and extend structured logging across all runnable modules to improve production diagnosability. Finally, address the single gap in architectural decision records to complete the documentation baseline.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
God Classes: FunctionTooLong: embassy_mcxa::flexcan::classic::mailbox::rx::setup
embassy-net-esp-hosted/src/proto/mcu/mod.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/rcc/h.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/rcc/n6.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/rcc/l.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-nrf/src/lib.rs
6.0
Mixed
Explicit Debt: TodoComment repeated across 11 files
embassy-stm32/src/rcc/u3.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/rcc/mod.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-mcxa/src/clocks/operator.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-rp/src/clocks.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/rcc/f247.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/rcc/f013.rs
6.0
Mixed
Explicit Debt: TodoComment
cyw43/src/runner.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/rcc/bd.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/i2c/v1.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-stm32/src/usart/buffered.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-usb-synopsys-otg/src/lib.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-rp/src/pio/mod.rs
6.0
Mixed
Explicit Debt: TodoComment
embassy-usb/src/lib.rs
6.0
Mixed
Explicit Debt: TodoComment
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 — 3
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 — 2144
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 — 18
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 53
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 32 of 36 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 36 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2132 of 2165 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D6 Cohesion (LCOM4) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.rs) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs) and this repository declares a Cargo test suite (cyw43, 78 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 186 direct Cargo declaration(s) were read, but the outdated signal needs crates.io, and no committed Cargo.lock resolves them to versions, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — this repository declares Cargo manifests but commits no Cargo.lock, so the set of crates it actually ships is not resolvable from the checkout: its declarations carry version RANGES, and grading whichever release happens to be newest today would be a verdict about a dependency graph this repository has not pinned. Commit the lock and this dimension grades the closure against crates.io. NOT a finding that this repository's licences are compliant: this dimension asserts nothing about its licensing in either direction.
D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A hotspot's complexity is meant to be the worst body its churn actually touched. For embassy-crypto-test/src/lib.rs, embassy-stm32/src/cordic/mod.rs, cyw43/src/consts.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
D30 Dependency Vulnerabilities — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Osv: the scanner produced no output at all, so no dependency was actually scanned. 'osv-scanner' exited 128 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
D43 Malicious Dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Osv: the scanner produced no output at all, so no dependency was actually scanned. 'osv-scanner' exited 128 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX2 Stateful singletons — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, or a Dockerfile. None was found, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P1 CI/CD gates — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
P10 Library API & versioning — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads NuGet packaging and C# public API only, and no .NET project was loaded for this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
PF1 Benchmark discipline — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
PF2 Allocation hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X10 Duplicated predicate — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X6 Hand-rolled structured-format parsing — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
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.
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.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (4): D19, D21, D22, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
119 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Rpc::decode at 161. A further 50 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 Event::from at 147 — they are counted neither in the figure above nor in this dimension's score. 26 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: cyw43/src/events.rs (Event::from at 147), embassy-stm32/src/rif.rs (RifPeripheral::set_attributes at 95), embassy-stm32/src/xspi/enums.rs (ChipSelectHighTime::into at 64), embassy-stm32/src/hspi/enums.rs (FIFOThresholdLevel::into at 32), embassy-stm32/src/tsc/io_pin.rs (IOPin::to_u32 at 32), and 21 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.
+ 57 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 22 embassy_stm32 finding(s) in Cyclomatic Complexity — start with h.rs (2), u5.rs (2), n6.rs (2). — One of this dimension's main actionable groups (22 warning-level).
Resolve the 6 I2c finding(s) in Cyclomatic Complexity — start with v1.rs (4), v2.rs (2). — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 ClockOperator finding(s) in Cyclomatic Complexity — start with operator.rs (5). — One of this dimension's main actionable groups (5 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 96 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 25 embassy_stm32 finding(s) in Cognitive Complexity — start with mod.rs (3), l.rs (3), n6.rs (2). — One of this dimension's main actionable groups (25 warning-level).
Resolve the 21 I2c finding(s) in Cognitive Complexity — start with v2.rs (11), v1.rs (6), target.rs (4). — One of this dimension's main actionable groups (21 warning-level).
Resolve the 10 Runner finding(s) in Cognitive Complexity — start with runner.rs (6), lib.rs (4). — One of this dimension's main actionable groups (10 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.0 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 113 FileTooLong finding(s) in God Classes — start with mod.rs (27), lib.rs (7), gpio.rs (7). — One of this dimension's main actionable groups (113 warning-level).
Resolve the 53 TooManyMethods finding(s) in God Classes — start with mod.rs (31), otg_v1.rs (5), controller.rs (2). — One of this dimension's main actionable groups (53 warning-level).
Resolve the 33 MethodTooLong finding(s) in God Classes — start with mod.rs (16), operator.rs (4), runner.rs (2). — One of this dimension's main actionable groups (33 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
1070 duplicated block group(s) detected. A further 80 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 231 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 74 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (24), controller.rs (5), v1.rs (3). — One of this dimension's main actionable groups (74 warning-level).
Resolve the 63 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with mod.rs (6), gpio.rs (4), lib.rs (3). — One of this dimension's main actionable groups (63 warning-level).
Resolve the 57 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with mod.rs (23), lpc55.rs (3), u3.rs (3). — One of this dimension's main actionable groups (57 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.4 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
47 production modules (Cargo), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; 7 module(s) off the main sequence, with abstractness counted on 45 of the 47 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).
Off the main sequence: embassy-futures · ×7
Unstable project embassy-nrf
Unstable project embassy-rp
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Unstable project embassy-nrf finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project embassy-rp finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
420 test methods: 403 unit, 17 integration, 0 BDD, 0 e2e. The Rust suite contributes 420 `#[test]` function(s) across 78 file(s) declaring at least one; its unit/integration split is Cargo's own — 5 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 31 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (6), lib.rs (3), v2.rs (2). — One of this dimension's main actionable groups (31 warning-level).
Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with uart.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.5 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
113 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is embassy-net-esp-hosted/src/proto/mcu/mod.rs. Counted over 757 of the 918 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×9
Further sole-owners (lower concentration)
What to do
Resolve the 9 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (9 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
349 deducted task-comment markers across 397989 LoC (0.1/KLoC) → score 9.8. 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.
TodoComment · ×306cyw43/src/spi.rs:215
FixmeComment · ×22embassy-mspm0/src/dma.rs:555
TodoComment repeated across 11 filesembassy-nrf/src/lib.rs:101
What to do
Resolve the 306 TodoComment finding(s) in Explicit Debt — start with mod.rs (47), periph_helpers.rs (26), lib.rs (22). — One of this dimension's main actionable groups (306 warning-level).
Resolve the 22 FixmeComment finding(s) in Explicit Debt — start with mod.rs (8), host.rs (2), ringbuffered.rs (2). — One of this dimension's main actionable groups (22 warning-level).
Resolve the 1 TodoComment repeated across 11 files finding(s) in Explicit Debt — start with lib.rs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README is a clear project overview (Embassy: the next-generation embedded Rust framework) with links to documentation, an excellent Rust+async embedded rationale, and a Batteries-included list of hardware abstraction layers. The docs directory holds architecture/design documents for each subsystem (cyw43 firmware, embassy-ambiq, embassy-boot), plus a comprehensive README for embassy-executor covering features like no alloc/heap, static task allocation, integrated timer queues, and platform support across RP2040, STM32, and MCXA. The root README is the single source of truth for installation, usage, contribution, and licensing; all four are present there. (5 of 25 sampled documents could not be assessed: 1 of 2 evaluation groups failed.)
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyStronggated by 2 serious findings◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
2 API inconsistencies across a 400-member sample of 2488 exposed types.
Inconsistent SPI command method naming and signatures between SpiBusCyw43 and PioSpi. SpiBusCyw43 uses 'cmd_write' and 'cmd_read', while PioSpi uses 'write' and 'cmd_read'. Additionally, 'cmd_write' takes a slice for data, while 'write' also takes a slice, but the naming difference ('cmd_' prefix) is inconsistent across the two bus implementations.
Inconsistent naming between BootLoaderConfig and FirmwareUpdaterConfig for similar configuration loading methods. BootLoaderConfig has 'from_linkerfile_blocking', while FirmwareUpdaterConfig has both 'from_linkerfile' (non-blocking?) and 'from_linkerfile_blocking'. The presence of both blocking and non-blocking variants in one struct but only blocking in the other is inconsistent.
What to do
Resolve the 1 Inconsistent SPI command method naming and signatures between… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Inconsistent naming between BootLoaderConfig and FirmwareUpdaterConfig… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
9 of 48 build units (Cargo) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
3 finding(s): 0 critical, 2 high, 1 medium, 0 low. 2 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 5 file(s) — `cyw43/src/runner.rs` (line 90, line 442, line 531, …), `embassy-executor/src/platform/aarch32.rs` (line 275, line 276, line 277), `embassy-stm32-wpan/src/bluetooth/security/mod.rs` (line 34), `embassy-stm32/src/rcc/mod.rs` (line 118, line 309, line 387), `embassy-usb-host/src/handler.rs` (line 162, line 181, line 224, …) — 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.
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
No action in Static Analysis (SAST) — all 2 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (2 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
33 of 757 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is embassy-stm32/src/can/bxcan/filter.rs. Counted over 757 of the 918 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned files with no living knowledge
✓ On the Gold path — maintain.
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 6 Change coupling finding(s) in Change Coupling — start with cdc_acm.rs, sdio.rs, mailbox.rs. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 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.
End-of-life runtime: Rust 1.97
What to do
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
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.
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 131 of 268 project(s) that lack one — worth up to 1 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Do you agree with this assessment?
P1 · CI/CD gates6.5 / 10Strong✓ Tool-verified
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.
A CI pipeline exists but no build step was matched — changes may merge without the build ever running. A build step may be invoked directly as a command, or declared as a task that a runner named in the pipeline resolves.
What to do
Run the test suite in CI via an explicit runner step for your stack, and gate merges on it.
Add an explicit build step to your CI pipeline — your stack's own build command, or, if the pipeline delegates to a task runner, a build task that runner executes in CI — so every change is built before merge.
Do you agree with this assessment?
P2 · Observability6.8 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 35/37 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `cyw43-firmware`, `embassy-executor-macros`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 4536 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
What to do
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Not evidenced — 5 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 79 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~124074 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D12 Dependency Hygiene — Not scored — 186 direct Cargo declaration(s) were read, but the outdated signal needs crates.io, and no committed Cargo.lock resolves them to versions, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — Crate licences not graded — this Cargo repository commits no Cargo.lock
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — too few calls resolved to assess navigability
D30 Dependency Vulnerabilities — Scanner failed to run — not a clean result
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 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.
D36 Supply-chain Provenance & Signing — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Scanner failed to run — not a clean result
D6 Cohesion (LCOM4) — D6 reads a CS/VB/GO/SCALA/SWIFT/DART/JAVA/PY/KT/TS/TSX/MTS/CTS/JS/JSX/MJS/CJS/PHP class graph only — this repository's production source is .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 424 value object(s); 11 domain event(s); its domain events are published by services or handlers — no domain entity raises one
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 — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P10 Library API & versioning — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python, Rust source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
PF2 Allocation hygiene — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X10 Duplicated predicate — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X7 Silent fallback defaults — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X9 Subsumed condition operand — 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.
TodoComment cyw43/src/spi.rs:215— // TODO: C library is uint32_t val = WORD_LENGTH_32 | HIGH_SPEED_MODE| ENDIAN_BIG | INTERRUPT_POLARITY_HIGH | WAKE_UP | 0x4 << (8 * SPI_RESPONSE_DELAY) | INTR_WITH_STATUS << (8 * SPI_STATUS_ENABLE); — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/spi.rs:234— // TODO: C doesn't do this? i doubt it messes anything up — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/spi.rs:240— // TODO: C doesn't do this? i doubt it messes anything up — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/spi.rs:250— // TODO: Make sure error interrupt bits are clear? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/spi.rs:261— // TODO: why not all of these F2_F3_FIFO_RD_UNDERFLOW | F2_F3_FIFO_WR_OVERFLOW | COMMAND_ERROR | DATA_ERROR | F2_PACKET_AVAILABLE | F1_OVERFLOW | F1_INTR — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/runner.rs:352— // TODO: remove this after investigation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/runner.rs:415— // TODO do we need to sleep the bus to read the irq line, due to — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/runner.rs:559— // TODO: is this needed if we reset right after? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/runner.rs:833— // TODO does this len need to be rounded up to u32? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/runner.rs:1358— // TODO does this len need to be rounded up to u32? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/runner.rs:1036— // TODO: investigate this condition — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/runner.rs:1075— // TODO: propagate error instead — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/ioctl.rs:117— // TODO fix this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment embassy-net-esp-hosted/src/ioctl.rs:106— // TODO fix this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/events.rs:290— // TODO this PubSub can probably be replaced with shared memory to make it a bit more efficient. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/control.rs:698— // TODO this is not really working, it always returns all zeros. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/bluetooth.rs:362— // TODO: use this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cyw43/src/bluetooth.rs:382— // TODO: CYW43_THREAD_ENTER mutex? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment embassy-boot/src/lib.rs:21— // TODO: Use the value provided by NorFlash when available — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment embassy-executor/src/spawner.rs:53— // TODO deallocate the task instead. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment embassy-imxrt/src/time_driver.rs:91— // TODO: low power support. line above is leaving out write to .wakedpd_en().set_bit()) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment embassy-imxrt/src/time_driver.rs:113— // TODO: this is admittedly not great for power that we're generating this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment embassy-imxrt/src/time_driver.rs:156— // TODO: additional error handling beyond logging — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment embassy-imxrt/src/rng.rs:104— // TODO: Is this necessary? Could we just check once after — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment embassy-imxrt/src/clocks.rs:59— // todo: move ADC here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FileTooLong: mcu/mod.rs embassy-net-esp-hosted/src/proto/mcu/mod.rs— FileTooLong — 33170 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 32670 over it, 66.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: fg/mod.rs embassy-net-esp-hosted/src/proto/fg/mod.rs— FileTooLong — 8334 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 7834 over it, 16.67× 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: src/otg_v1.rs embassy-usb-synopsys-otg/src/otg_v1.rs— FileTooLong — 4152 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 3652 over it, 8.30× 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: usart/mod.rs embassy-stm32/src/usart/mod.rs— FileTooLong — 1955 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 1455 over it, 3.91× 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: pka/mod.rs embassy-stm32/src/pka/mod.rs— FileTooLong — 1648 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: Pka (8 blocks, 837-2950). The bar is 500 significant lines; this is 1148 over it, 3.30× 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: i2c/v2.rs embassy-stm32/src/i2c/v2.rs— FileTooLong — 1564 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: I2c (8 blocks, 112-2540). The bar is 500 significant lines; this is 1064 over it, 3.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: ospi/mod.rs embassy-stm32/src/ospi/mod.rs— FileTooLong — 1546 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: Ospi (7 blocks, 245-2220). The bar is 500 significant lines; this is 1046 over it, 3.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: spi/mod.rs embassy-stm32/src/spi/mod.rs— FileTooLong — 1536 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 62% of them inside a single declaration: Spi (13 blocks, 333-2481). The bar is 500 significant lines; this is 1036 over it, 3.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: xspi/mod.rs embassy-stm32/src/xspi/mod.rs— FileTooLong — 1450 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: Xspi (7 blocks, 170-1992). The bar is 500 significant lines; this is 950 over it, 2.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: sdmmc/mod.rs embassy-stm32/src/sdmmc/mod.rs— FileTooLong — 1445 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: Sdmmc (10 blocks, 457-2242). The bar is 500 significant lines; this is 945 over it, 2.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: i2c/v1.rs embassy-stm32/src/i2c/v1.rs— FileTooLong — 1154 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: I2c (7 blocks, 46-2180). The bar is 500 significant lines; this is 654 over it, 2.31× 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: usb/host.rs embassy-rp/src/usb/host.rs— FileTooLong — 1144 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 644 over it, 2.29× 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: src/lib.rs embassy-usb-synopsys-otg/src/lib.rs— FileTooLong — 1103 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 603 over it, 2.21× 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: src/dma.rs embassy-mcxa/src/dma.rs— FileTooLong — 1087 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 587 over it, 2.17× 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: rcc/n6.rs embassy-stm32/src/rcc/n6.rs— FileTooLong — 1075 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 575 over it, 2.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: i3c/controller.rs embassy-mcxa/src/i3c/controller.rs— FileTooLong — 1071 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: I3c (17 blocks, 322-2019). The bar is 500 significant lines; this is 571 over it, 2.14× 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/flexspi.rs embassy-mcxa/src/flexspi.rs— FileTooLong — 1058 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 558 over it, 2.12× 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: src/lib.rs embassy-crypto-test/src/lib.rs— FileTooLong — 1056 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 58 free functions. The bar is 500 significant lines; this is 556 over it, 2.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: cryp/mod.rs embassy-stm32/src/cryp/mod.rs— FileTooLong — 1051 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 63% of them inside a single declaration: Cryp (6 blocks, 615-1666). The bar is 500 significant lines; this is 551 over it, 2.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: src/clocks.rs embassy-rp/src/clocks.rs— FileTooLong — 1031 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 531 over it, 2.06× 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: dma/dma_bdma.rs embassy-stm32/src/dma/dma_bdma.rs— FileTooLong — 1030 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 530 over it, 2.06× 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: pio/mod.rs embassy-rp/src/pio/mod.rs— FileTooLong — 993 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 493 over it, 1.99× 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: src/clocks.rs embassy-imxrt/src/clocks.rs— FileTooLong — 962 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 462 over it, 1.92× 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: uac/descriptors.rs embassy-usb-host/src/class/uac/descriptors.rs— FileTooLong — 945 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 445 over it, 1.89× 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: src/jpeg.rs embassy-stm32/src/jpeg.rs— FileTooLong — 936 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 436 over it, 1.87× 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.
Duplicated block (8 lines × 2) embassy-executor-macros/src/macros/main.rs:119— embassy-executor-macros/src/macros/main.rs:119-126 | embassy-executor-macros/src/macros/task.rs:74-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) embassy-imxrt/src/flexcomm/uart.rs:384— embassy-imxrt/src/flexcomm/uart.rs:384-391 | embassy-mcxa/src/lpuart/mod.rs:344-351 — 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) embassy-imxrt/src/flexcomm/uart.rs:935— embassy-imxrt/src/flexcomm/uart.rs:935-942 | embassy-mcxa/src/lpuart/mod.rs:843-850 — 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) embassy-mcxa/src/flexcan/classic/mailbox.rs:522— embassy-mcxa/src/flexcan/classic/mailbox.rs:522-529 | embassy-mcxa/src/flexcan/classic/mailbox.rs:536-543 — both copies are in the same file, so extract the 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) embassy-mcxa/src/flexspi.rs:1022— embassy-mcxa/src/flexspi.rs:1022-1029 | embassy-mcxa/src/flexspi.rs:1255-1262 — both copies are in the same file, so extract the 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) embassy-mcxa/src/i2c/controller.rs:1303— embassy-mcxa/src/i2c/controller.rs:1303-1310 | embassy-mcxa/src/i2c/controller.rs:1408-1416 — both copies are in the same file, so extract the 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) embassy-mcxa/src/i2c/target.rs:579— embassy-mcxa/src/i2c/target.rs:579-586 | embassy-mcxa/src/i2c/target.rs:598-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) embassy-mcxa/src/i3c/controller.rs:614— embassy-mcxa/src/i3c/controller.rs:614-621 | embassy-mcxa/src/i3c/controller.rs:1482-1489 — both copies are in the same file, so extract the 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) embassy-mcxa/src/spi/controller.rs:1017— embassy-mcxa/src/spi/controller.rs:1017-1024 | embassy-mcxa/src/spi/controller.rs:1048-1055 — both copies are in the same file, so extract the 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) embassy-mcxa/src/spi/controller.rs:1058— embassy-mcxa/src/spi/controller.rs:1058-1065 | embassy-mcxa/src/spi/controller.rs:1210-1217 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:11229— embassy-net-esp-hosted/src/proto/fg/mod.rs:11229-11236 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48908-48915 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11242— embassy-net-esp-hosted/src/proto/fg/mod.rs:11242-11249 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48921-48928 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11307— embassy-net-esp-hosted/src/proto/fg/mod.rs:11307-11314 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48947-48954 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11320— embassy-net-esp-hosted/src/proto/fg/mod.rs:11320-11327 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48960-48967 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11346— embassy-net-esp-hosted/src/proto/fg/mod.rs:11346-11353 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48985-48992 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11372— embassy-net-esp-hosted/src/proto/fg/mod.rs:11372-11379 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49154-49161 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11385— embassy-net-esp-hosted/src/proto/fg/mod.rs:11385-11392 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49167-49174 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11450— embassy-net-esp-hosted/src/proto/fg/mod.rs:11450-11457 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49193-49200 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11463— embassy-net-esp-hosted/src/proto/fg/mod.rs:11463-11470 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49206-49213 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11476— embassy-net-esp-hosted/src/proto/fg/mod.rs:11476-11483 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49219-49226 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11489— embassy-net-esp-hosted/src/proto/fg/mod.rs:11489-11496 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49232-49239 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:12394— embassy-net-esp-hosted/src/proto/fg/mod.rs:12394-12401 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12407-12414 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:12394— embassy-net-esp-hosted/src/proto/fg/mod.rs:12394-12401 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50631-50638 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:12407— embassy-net-esp-hosted/src/proto/fg/mod.rs:12407-12414 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50644-50651 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:7984— embassy-net-esp-hosted/src/proto/mcu/mod.rs:7984-7991 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8920-8927 — both copies are in the same file, so extract the 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) cyw43/src/bluetooth.rs:548— cyw43/src/bluetooth.rs:548-556 | embassy-net-esp-hosted/src/bluetooth.rs:163-171 — before extracting anything, compare `cyw43/src/bluetooth.rs` and `embassy-net-esp-hosted/src/bluetooth.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) cyw43/src/sdio.rs:257— cyw43/src/sdio.rs:257-265 | cyw43/src/sdio.rs:294-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) embassy-boot/src/firmware_updater/asynch.rs:131— embassy-boot/src/firmware_updater/asynch.rs:131-139 | embassy-boot/src/firmware_updater/blocking.rs:166-174 — before extracting anything, compare `embassy-boot/src/firmware_updater/asynch.rs` and `embassy-boot/src/firmware_updater/blocking.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-boot-rp/src/lib.rs:55— embassy-boot-rp/src/lib.rs:55-63 | embassy-boot-stm32/src/lib.rs:49-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) embassy-embedded-hal/src/shared_bus/blocking/spi.rs:82— embassy-embedded-hal/src/shared_bus/blocking/spi.rs:82-91 | embassy-embedded-hal/src/shared_bus/blocking/spi.rs:158-166 — both copies are in the same file, so extract the 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) embassy-imxrt/src/flexcomm/uart.rs:368— embassy-imxrt/src/flexcomm/uart.rs:368-376 | embassy-mcxa/src/lpuart/mod.rs:328-336 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) embassy-imxrt/src/flexcomm/uart.rs:599— embassy-imxrt/src/flexcomm/uart.rs:599-607 | embassy-imxrt/src/flexcomm/uart.rs:727-735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) embassy-mcxa/src/flexspi.rs:1311— embassy-mcxa/src/flexspi.rs:1311-1319 | embassy-mcxa/src/flexspi.rs:1359-1367 — both copies are in the same file, so extract the 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) embassy-mcxa/src/i2c/target.rs:1162— embassy-mcxa/src/i2c/target.rs:1162-1170 | embassy-mcxa/src/i2c/target.rs:1190-1198 — both copies are in the same file, so extract the 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) embassy-mcxa/src/lpuart/bbq.rs:273— embassy-mcxa/src/lpuart/bbq.rs:273-281 | embassy-mcxa/src/lpuart/bbq.rs:308-316 — both copies are in the same file, so extract the 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) embassy-microchip/src/i2c.rs:336— embassy-microchip/src/i2c.rs:336-344 | embassy-microchip/src/i2c.rs:624-632 — both copies are in the same file, so extract the 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) embassy-microchip/src/time_driver.rs:104— embassy-microchip/src/time_driver.rs:104-112 | embassy-stm32/src/time_driver/lptim.rs:263-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) embassy-mspm0/src/low_power/c110x.rs:39— embassy-mspm0/src/low_power/c110x.rs:39-47 | embassy-mspm0/src/low_power/h321x.rs:38-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) embassy-mspm0/src/sysctl/c1103_1104.rs:49— embassy-mspm0/src/sysctl/c1103_1104.rs:49-57 | embassy-mspm0/src/sysctl/c1105_1106.rs:49-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) embassy-mspm0/src/uart/buffered.rs:998— embassy-mspm0/src/uart/buffered.rs:998-1006 | embassy-rp/src/uart/buffered.rs:67-75 — before extracting anything, compare `embassy-mspm0/src/uart/buffered.rs` and `embassy-rp/src/uart/buffered.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.
Duplicated block (9 lines × 2) embassy-net-enc28j60/src/lib.rs:347— embassy-net-enc28j60/src/lib.rs:347-355 | embassy-net-enc28j60/src/lib.rs:362-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26844— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26844-26852 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27587-27595 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26861— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26861-26869 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27604-27612 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:30870— embassy-net-esp-hosted/src/proto/mcu/mod.rs:30870-30878 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38098-38106 — both copies are in the same file, so extract the 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) embassy-nrf/src/rramc.rs:177— embassy-nrf/src/rramc.rs:177-185 | embassy-nrf/src/rramc.rs:267-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) embassy-nrf/src/uarte.rs:365— embassy-nrf/src/uarte.rs:365-373 | embassy-nrf/src/uarte.rs:395-403 — both copies are in the same file, so extract the 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) embassy-nrf/src/uarte.rs:726— embassy-nrf/src/uarte.rs:726-734 | embassy-nrf/src/uarte.rs:1174-1182 — both copies are in the same file, so extract the 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) embassy-nxp/src/i2c/lpc55.rs:384— embassy-nxp/src/i2c/lpc55.rs:384-392 | embassy-nxp/src/i2c/lpc55.rs:607-615 — both copies are in the same file, so extract the 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) embassy-rp/src/spi.rs:486— embassy-rp/src/spi.rs:486-494 | embassy-rp/src/spi.rs:573-581 — both copies are in the same file, so extract the 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) embassy-stm32/src/adc/injected.rs:172— embassy-stm32/src/adc/injected.rs:172-180 | embassy-stm32/src/adc/injected.rs:247-255 — both copies are in the same file, so extract the 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) cyw43/src/bluetooth.rs:128— cyw43/src/bluetooth.rs:128-138 | embassy-net-esp-hosted/src/bluetooth.rs:94-104 — before extracting anything, compare `cyw43/src/bluetooth.rs` and `embassy-net-esp-hosted/src/bluetooth.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. 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 (11 lines × 2) cyw43/src/consts.rs:304— cyw43/src/consts.rs:304-314 | cyw43/src/consts.rs:371-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) cyw43/src/consts.rs:332— cyw43/src/consts.rs:332-342 | cyw43/src/consts.rs:405-415 — both copies are in the same file, so extract the 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) embassy-boot/src/firmware_updater/asynch.rs:28— embassy-boot/src/firmware_updater/asynch.rs:28-38 | embassy-boot/src/firmware_updater/blocking.rs:58-68 — before extracting anything, compare `embassy-boot/src/firmware_updater/asynch.rs` and `embassy-boot/src/firmware_updater/blocking.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) embassy-mcxa/src/clkout.rs:74— embassy-mcxa/src/clkout.rs:74-84 | embassy-mcxa/src/clkout.rs:107-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) embassy-mcxa/src/i2c/controller.rs:433— embassy-mcxa/src/i2c/controller.rs:433-443 | embassy-mcxa/src/i2c/controller.rs:483-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:934— embassy-mcxa/src/lpuart/bbq.rs:934-944 | embassy-mcxa/src/lpuart/bbq.rs:1296-1306 — both copies are in the same file, so extract the 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) embassy-mspm0/src/adc.rs:293— embassy-mspm0/src/adc.rs:293-303 | embassy-mspm0/src/adc.rs:340-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) embassy-mspm0/src/mathacl.rs:47— embassy-mspm0/src/mathacl.rs:47-57 | embassy-mspm0/src/wwdt.rs:272-282 — 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 (11 lines × 2) embassy-mspm0/src/time_driver/tim.rs:244— embassy-mspm0/src/time_driver/tim.rs:244-254 | embassy-mspm0/src/time_driver/tim.rs:267-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) embassy-mspm0/src/uart/buffered.rs:939— embassy-mspm0/src/uart/buffered.rs:939-949 | embassy-stm32/src/usart/buffered.rs:900-910 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:446— embassy-net-esp-hosted/src/proto/fg/mod.rs:446-456 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15649-15659 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (11 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:3952— embassy-net-esp-hosted/src/proto/fg/mod.rs:3952-3962 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4181-4191 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:3485— embassy-net-esp-hosted/src/proto/mcu/mod.rs:3485-3495 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3691-3701 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:5014— embassy-net-esp-hosted/src/proto/mcu/mod.rs:5014-5024 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7781-7791 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:16684— embassy-net-esp-hosted/src/proto/mcu/mod.rs:16684-16694 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34572-34582 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:41161— embassy-net-esp-hosted/src/proto/mcu/mod.rs:41161-41171 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41859-41869 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/rpc/fg.rs:241— embassy-net-esp-hosted/src/rpc/fg.rs:241-251 | embassy-net-esp-hosted/src/rpc/mcu.rs:335-345 — before extracting anything, compare `embassy-net-esp-hosted/src/rpc/fg.rs` and `embassy-net-esp-hosted/src/rpc/mcu.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) embassy-nrf/src/twis.rs:703— embassy-nrf/src/twis.rs:703-713 | embassy-nrf/src/twis.rs:736-746 — both copies are in the same file, so extract the 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) embassy-nrf/src/uarte.rs:379— embassy-nrf/src/uarte.rs:379-389 | embassy-nrf/src/uarte.rs:410-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) embassy-nxp/src/i2c/lpc55.rs:397— embassy-nxp/src/i2c/lpc55.rs:397-407 | embassy-nxp/src/i2c/lpc55.rs:427-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) embassy-nxp/src/i2c/lpc55.rs:414— embassy-nxp/src/i2c/lpc55.rs:414-424 | embassy-nxp/src/i2c/lpc55.rs:637-647 — both copies are in the same file, so extract the 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) embassy-nxp/src/i2c/lpc55.rs:620— embassy-nxp/src/i2c/lpc55.rs:620-630 | embassy-nxp/src/i2c/lpc55.rs:650-660 — both copies are in the same file, so extract the 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) embassy-rp/src/clocks.rs:1613— embassy-rp/src/clocks.rs:1613-1623 | embassy-rp/src/clocks.rs:1707-1717 — both copies are in the same file, so extract the 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) embassy-rp/src/pio/mod.rs:1090— embassy-rp/src/pio/mod.rs:1090-1100 | embassy-rp/src/pio/mod.rs:1105-1115 — both copies are in the same file, so extract the 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) embassy-mcxa/src/adc.rs:416— embassy-mcxa/src/adc.rs:416-425 | embassy-mcxa/src/adc.rs:443-452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) embassy-mcxa/src/adc.rs:466— embassy-mcxa/src/adc.rs:466-475 | embassy-mcxa/src/adc.rs:490-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.
Duplicated block (10 lines × 2) embassy-mcxa/src/ctimer/pwm.rs:337— embassy-mcxa/src/ctimer/pwm.rs:337-346 | embassy-mcxa/src/ctimer/pwm.rs:474-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) embassy-mcxa/src/dma.rs:488— embassy-mcxa/src/dma.rs:488-497 | embassy-mcxa/src/dma.rs:562-571 — both copies are in the same file, so extract the 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) embassy-mcxa/src/flexcan/classic/mailbox.rs:502— embassy-mcxa/src/flexcan/classic/mailbox.rs:502-511 | embassy-mcxa/src/flexcan/classic/mailbox.rs:550-559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:358— embassy-mcxa/src/lpuart/bbq.rs:358-367 | embassy-mcxa/src/lpuart/bbq.rs:382-391 — both copies are in the same file, so extract the 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) embassy-mcxa/src/lpuart/bbq.rs:408— embassy-mcxa/src/lpuart/bbq.rs:408-417 | embassy-mcxa/src/lpuart/bbq.rs:458-467 — both copies are in the same file, so extract the 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) embassy-mcxa/src/lpuart/bbq.rs:404— embassy-mcxa/src/lpuart/bbq.rs:404-413 | embassy-mcxa/src/lpuart/bbq.rs:428-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:432— embassy-mcxa/src/lpuart/bbq.rs:432-441 | embassy-mcxa/src/lpuart/bbq.rs:485-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:454— embassy-mcxa/src/lpuart/bbq.rs:454-463 | embassy-mcxa/src/lpuart/bbq.rs:481-490 — both copies are in the same file, so extract the 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) embassy-mcxa/src/spi/controller.rs:283— embassy-mcxa/src/spi/controller.rs:283-292 | embassy-mcxa/src/spi/controller.rs:949-958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) embassy-mspm0/src/dma.rs:100— embassy-mspm0/src/dma.rs:100-109 | embassy-mspm0/src/dma.rs:140-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.
Duplicated block (10 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:8449— embassy-net-esp-hosted/src/proto/fg/mod.rs:8449-8458 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36258-36267 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (10 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:2726— embassy-net-esp-hosted/src/proto/mcu/mod.rs:2726-2735 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2978-2987 — both copies are in the same file, so extract the 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) embassy-nrf/src/buffered_uarte/v1.rs:205— embassy-nrf/src/buffered_uarte/v1.rs:205-214 | embassy-nrf/src/buffered_uarte/v2.rs:150-159 — before extracting anything, compare `embassy-nrf/src/buffered_uarte/v1.rs` and `embassy-nrf/src/buffered_uarte/v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) embassy-nrf/src/crypto/pka/driver.rs:297— embassy-nrf/src/crypto/pka/driver.rs:297-306 | embassy-stm32/src/pka/driver.rs:388-397 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (10 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:351— embassy-nrf/src/crypto/pka/driver.rs:351-360 | embassy-stm32/src/pka/driver.rs:448-457 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (10 lines × 2) embassy-nrf/src/saadc.rs:101— embassy-nrf/src/saadc.rs:101-110 | embassy-nrf/src/saadc.rs:116-125 — both copies are in the same file, so extract the 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) embassy-nrf/src/twim.rs:316— embassy-nrf/src/twim.rs:316-325 | embassy-nrf/src/twis.rs:347-356 — before extracting anything, compare `embassy-nrf/src/twim.rs` and `embassy-nrf/src/twis.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) embassy-rp/src/pio_programs/ws2812.rs:178— embassy-rp/src/pio_programs/ws2812.rs:178-187 | embassy-rp/src/pio_programs/ws2812.rs:287-296 — both copies are in the same file, so extract the 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) embassy-stm32/src/cordic/mod.rs:621— embassy-stm32/src/cordic/mod.rs:621-630 | embassy-stm32/src/cordic/mod.rs:653-662 — both copies are in the same file, so extract the 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) embassy-stm32/src/dac/mod.rs:764— embassy-stm32/src/dac/mod.rs:764-773 | embassy-stm32/src/dac/mod.rs:849-858 — both copies are in the same file, so extract the 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) embassy-stm32/src/flash/edata.rs:178— embassy-stm32/src/flash/edata.rs:178-187 | embassy-stm32/src/flash/edata.rs:218-227 — both copies are in the same file, so extract the 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) embassy-stm32/src/hash/mod.rs:567— embassy-stm32/src/hash/mod.rs:567-576 | embassy-stm32/src/hash/mod.rs:953-962 — both copies are in the same file, so extract the 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) embassy-stm32/src/hspi/mod.rs:489— embassy-stm32/src/hspi/mod.rs:489-499 | embassy-stm32/src/hspi/mod.rs:530-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.
Duplicated block (6 lines × 2) cyw43/src/lib.rs:499— cyw43/src/lib.rs:499-504 | cyw43/src/lib.rs:535-540 — both copies are in the same file, so extract the 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) embassy-boot/src/firmware_updater/asynch.rs:158— embassy-boot/src/firmware_updater/asynch.rs:158-163 | embassy-boot/src/firmware_updater/blocking.rs:193-198 — before extracting anything, compare `embassy-boot/src/firmware_updater/asynch.rs` and `embassy-boot/src/firmware_updater/blocking.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-embedded-hal/src/shared_bus/blocking/spi.rs:59— embassy-embedded-hal/src/shared_bus/blocking/spi.rs:59-64 | embassy-embedded-hal/src/shared_bus/blocking/spi.rs:134-139 — both copies are in the same file, so extract the 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) embassy-imxrt/src/clocks.rs:1231— embassy-imxrt/src/clocks.rs:1231-1236 | embassy-imxrt/src/clocks.rs:1251-1256 — both copies are in the same file, so extract the 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) embassy-mcxa/src/flexspi.rs:1056— embassy-mcxa/src/flexspi.rs:1056-1061 | embassy-mcxa/src/flexspi.rs:1290-1295 — both copies are in the same file, so extract the 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) embassy-mcxa/src/flexspi.rs:1305— embassy-mcxa/src/flexspi.rs:1305-1310 | embassy-mcxa/src/flexspi.rs:1353-1358 — both copies are in the same file, so extract the 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) embassy-mspm0/src/low_power/c110x.rs:53— embassy-mspm0/src/low_power/c110x.rs:53-58 | embassy-mspm0/src/low_power/h321x.rs:49-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:47— embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:47-52 | embassy-mspm0/src/sysctl/g151x_351x.rs:47-52 — 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) embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:58— embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:58-63 | embassy-mspm0/src/sysctl/g151x_351x.rs:58-63 — 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) embassy-mspm0/src/sysctl/h321x.rs:51— embassy-mspm0/src/sysctl/h321x.rs:51-57 | embassy-mspm0/src/sysctl/l_typeb.rs:51-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) embassy-nrf/src/buffered_uarte/v1.rs:449— embassy-nrf/src/buffered_uarte/v1.rs:449-454 | embassy-nrf/src/buffered_uarte/v1.rs:695-700 — both copies are in the same file, so extract the 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) embassy-nrf/src/crypto/symmetric/aes_cracen.rs:226— embassy-nrf/src/crypto/symmetric/aes_cracen.rs:226-231 | embassy-nrf/src/crypto/symmetric/chacha_cracen.rs:164-169 — 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) embassy-nrf/src/spim.rs:314— embassy-nrf/src/spim.rs:314-319 | embassy-nrf/src/spim.rs:561-566 — both copies are in the same file, so extract the 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) embassy-nrf/src/spis.rs:234— embassy-nrf/src/spis.rs:234-239 | embassy-nrf/src/spis.rs:446-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) embassy-nrf/src/wdt.rs:41— embassy-nrf/src/wdt.rs:41-46 | embassy-nrf/src/wdt.rs:94-99 — both copies are in the same file, so extract the 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) embassy-nrf/src/ppi/dppi.rs:93— embassy-nrf/src/ppi/dppi.rs:93-98 | embassy-nrf/src/ppi/dppi.rs:115-120 — both copies are in the same file, so extract the 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) embassy-nxp/src/adc/lpc55.rs:267— embassy-nxp/src/adc/lpc55.rs:267-272 | embassy-nxp/src/adc/lpc55.rs:310-315 — both copies are in the same file, so extract the 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) embassy-nxp/src/adc/lpc55.rs:358— embassy-nxp/src/adc/lpc55.rs:358-363 | embassy-nxp/src/adc/lpc55.rs:366-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.
Duplicated block (6 lines × 2) embassy-nxp/src/i2c/lpc55.rs:320— embassy-nxp/src/i2c/lpc55.rs:320-325 | embassy-nxp/src/i2c/lpc55.rs:565-570 — both copies are in the same file, so extract the 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) embassy-rp/src/gpio.rs:661— embassy-rp/src/gpio.rs:661-666 | embassy-rp/src/pio/mod.rs:248-253 — 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) embassy-rp/src/gpio.rs:883— embassy-rp/src/gpio.rs:883-888 | embassy-rp/src/gpio.rs:907-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.
Duplicated block (6 lines × 2) embassy-stm32/src/can/bxcan/mod.rs:636— embassy-stm32/src/can/bxcan/mod.rs:636-641 | embassy-stm32/src/can/bxcan/mod.rs:665-670 — both copies are in the same file, so extract the 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) embassy-stm32/src/cordic/mod.rs:189— embassy-stm32/src/cordic/mod.rs:189-194 | embassy-stm32/src/cordic/mod.rs:250-255 — both copies are in the same file, so extract the 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) embassy-stm32/src/cordic/mod.rs:272— embassy-stm32/src/cordic/mod.rs:272-277 | embassy-stm32/src/cordic/mod.rs:379-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) embassy-stm32/src/cryp/mod.rs:841— embassy-stm32/src/cryp/mod.rs:841-846 | embassy-stm32/src/cryp/mod.rs:1411-1416 — both copies are in the same file, so extract the 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) embassy-embedded-hal/src/flash/partition/asynch.rs:36— embassy-embedded-hal/src/flash/partition/asynch.rs:36-42 | embassy-embedded-hal/src/flash/partition/blocking.rs:37-43 — 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) embassy-imxrt/src/clocks.rs:716— embassy-imxrt/src/clocks.rs:716-722 | embassy-imxrt/src/clocks.rs:853-859 — both copies are in the same file, so extract the 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) embassy-imxrt/src/flexcomm/spi.rs:155— embassy-imxrt/src/flexcomm/spi.rs:155-161 | embassy-imxrt/src/flexcomm/spi.rs:384-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:6103— embassy-net-esp-hosted/src/proto/fg/mod.rs:6103-6109 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34678-34684 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (7 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26123— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26123-26129 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39863-39869 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/rpc/mod.rs:127— embassy-net-esp-hosted/src/rpc/mod.rs:127-133 | embassy-net-esp-hosted/src/rpc/mod.rs:152-158 — both copies are in the same file, so extract the 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) embassy-nrf/src/buffered_uarte/v1.rs:108— embassy-nrf/src/buffered_uarte/v1.rs:108-114 | embassy-nrf/src/buffered_uarte/v1.rs:139-145 — both copies are in the same file, so extract the 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) embassy-nrf/src/crypto/symmetric/aes_cracen.rs:213— embassy-nrf/src/crypto/symmetric/aes_cracen.rs:213-219 | embassy-nrf/src/crypto/symmetric/chacha_cracen.rs:151-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) embassy-nrf/src/gpiote.rs:356— embassy-nrf/src/gpiote.rs:356-362 | embassy-nrf/src/gpiote.rs:535-541 — both copies are in the same file, so extract the 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) embassy-nrf/src/uarte.rs:281— embassy-nrf/src/uarte.rs:281-287 | embassy-nrf/src/uarte.rs:910-916 — both copies are in the same file, so extract the 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) embassy-nxp/src/gpio/rt1xxx.rs:191— embassy-nxp/src/gpio/rt1xxx.rs:191-197 | embassy-nxp/src/gpio/rt1xxx.rs:209-215 — both copies are in the same file, so extract the 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) embassy-nxp/src/spi/lpc55.rs:261— embassy-nxp/src/spi/lpc55.rs:261-267 | embassy-nxp/src/spi/lpc55.rs:280-286 — both copies are in the same file, so extract the 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) embassy-rp/src/pio_programs/ws2812.rs:200— embassy-rp/src/pio_programs/ws2812.rs:200-206 | embassy-rp/src/pio_programs/ws2812.rs:309-315 — both copies are in the same file, so extract the 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) embassy-rp/src/usb/host.rs:513— embassy-rp/src/usb/host.rs:513-519 | embassy-rp/src/usb/host.rs:761-767 — both copies are in the same file, so extract the 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) embassy-rp/src/usb/host.rs:1123— embassy-rp/src/usb/host.rs:1123-1129 | embassy-rp/src/usb/host.rs:1144-1150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) embassy-stm32/src/comp.rs:576— embassy-stm32/src/comp.rs:576-582 | embassy-stm32/src/comp.rs:754-760 — both copies are in the same file, so extract the 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) embassy-stm32/src/comp.rs:731— embassy-stm32/src/comp.rs:731-737 | embassy-stm32/src/comp.rs:743-749 — both copies are in the same file, so extract the 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) embassy-stm32/src/cryp/mod.rs:806— embassy-stm32/src/cryp/mod.rs:806-812 | embassy-stm32/src/cryp/mod.rs:1371-1377 — both copies are in the same file, so extract the 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) embassy-stm32/src/cryp/mod.rs:925— embassy-stm32/src/cryp/mod.rs:925-931 | embassy-stm32/src/cryp/mod.rs:1520-1526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) embassy-stm32/src/hrtim/advanced_channel.rs:40— embassy-stm32/src/hrtim/advanced_channel.rs:40-46 | embassy-stm32/src/hrtim/advanced_channel.rs:96-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) embassy-stm32/src/hrtim/bridge_converter.rs:29— embassy-stm32/src/hrtim/bridge_converter.rs:29-35 | embassy-stm32/src/hrtim/resonant_converter.rs:23-30 — 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) embassy-stm32/src/hrtim/bridge_converter.rs:33— embassy-stm32/src/hrtim/bridge_converter.rs:33-39 | embassy-stm32/src/hrtim/fullbridge.rs:39-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) embassy-stm32/src/hrtim/bridge_converter.rs:36— embassy-stm32/src/hrtim/bridge_converter.rs:36-42 | embassy-stm32/src/hrtim/resonant_converter.rs:32-38 — 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) embassy-stm32/src/i2c/v1.rs:352— embassy-stm32/src/i2c/v1.rs:352-358 | embassy-stm32/src/i2c/v1.rs:361-367 — both copies are in the same file, so extract the 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) embassy-stm32/src/i2c/v1.rs:596— embassy-stm32/src/i2c/v1.rs:596-602 | embassy-stm32/src/i2c/v1.rs:877-883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyMethods: Timer embassy-stm32/src/timer/low_level.rs:452— TooManyMethods — 150 methods. The bar is 30 methods; this is 120 over it, 5.00× 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: Pka embassy-stm32/src/pka/mod.rs:837— TooManyMethods — 101 methods. The bar is 30 methods; this is 71 over it, 3.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: I2c embassy-stm32/src/i2c/mod.rs:131— TooManyMethods — 100 methods, declared across 3 files: i2c/v1.rs (55), i2c/v2.rs (39), i2c/mod.rs (6). 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: r#wifi_init_config embassy-net-esp-hosted/src/proto/mcu/mod.rs:3— TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.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.
TooManyMethods: r#wifi_ap_config embassy-net-esp-hosted/src/proto/mcu/mod.rs:4021— 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: r#wifi_pkt_rx_ctrl embassy-net-esp-hosted/src/proto/mcu/mod.rs:6721— 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: ComplementaryPwm embassy-stm32/src/timer/complementary_pwm.rs:72— TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.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: r#wifi_sta_config embassy-net-esp-hosted/src/proto/mcu/mod.rs:5175— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.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: Otg embassy-usb-synopsys-otg/src/otg_v1.rs:97— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.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.
TooManyMethods: NeoChrom embassy-stm32-neochrom/src/driver.rs:74— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× 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: r#esp_app_desc embassy-net-esp-hosted/src/proto/mcu/mod.rs:14173— TooManyMethods — 56 methods. The bar is 30 methods; 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.
TooManyMethods: Gintmsk embassy-usb-synopsys-otg/src/otg_v1.rs:2330— TooManyMethods — 56 methods. The bar is 30 methods; 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.
TooManyMethods: DmaChannel embassy-mcxa/src/dma.rs:618— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Gintsts embassy-usb-synopsys-otg/src/otg_v1.rs:2650— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HCI embassy-stm32-wpan/src/bluetooth/mod.rs:93— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TcpSocket embassy-net/src/tcp.rs:99— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: InnerFlexSpi embassy-mcxa/src/flexspi.rs:560— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Iface embassy-net/src/iface/mod.rs:93— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Crc embassy-mcxa/src/crc.rs:13— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: Sdmmc embassy-stm32/src/sdmmc/mod.rs:457— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: Gusbcfg embassy-usb-synopsys-otg/src/otg_v1.rs:3637— 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: CtrlMsg_Resp_GetDhcpDnsStatus embassy-net-esp-hosted/src/proto/fg/mod.rs:7845— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CtrlMsg_Event_SetDhcpDnsStatus embassy-net-esp-hosted/src/proto/fg/mod.rs:9946— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Rpc_Resp_GetDhcpDnsStatus embassy-net-esp-hosted/src/proto/mcu/mod.rs:32299— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Rpc_Event_DhcpDnsStatus embassy-net-esp-hosted/src/proto/mcu/mod.rs:40272— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (5 lines × 2) embassy-embedded-hal/src/shared_bus/asynch/spi.rs:69— embassy-embedded-hal/src/shared_bus/asynch/spi.rs:69-73 | embassy-embedded-hal/src/shared_bus/asynch/spi.rs:165-169 — both copies are in the same file, so extract the 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) embassy-imxrt/src/flexcomm/mod.rs:138— embassy-imxrt/src/flexcomm/mod.rs:138-142 | embassy-imxrt/src/flexcomm/mod.rs:181-185 — both copies are in the same file, so extract the 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) embassy-imxrt/src/flexcomm/mod.rs:146— embassy-imxrt/src/flexcomm/mod.rs:146-150 | embassy-imxrt/src/flexcomm/mod.rs:188-192 — both copies are in the same file, so extract the 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) embassy-mcxa/src/gpio.rs:609— embassy-mcxa/src/gpio.rs:609-613 | embassy-mcxa/src/gpio.rs:621-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.
Duplicated block (5 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:1858— embassy-mcxa/src/lpuart/bbq.rs:1858-1862 | embassy-mcxa/src/lpuart/bbq.rs:1878-1882 — both copies are in the same file, so extract the 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) embassy-mcxa/src/spi/controller.rs:1067— embassy-mcxa/src/spi/controller.rs:1067-1071 | embassy-mcxa/src/spi/controller.rs:1219-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.
Duplicated block (5 lines × 2) embassy-mspm0/src/low_power/full.rs:45— embassy-mspm0/src/low_power/full.rs:45-49 | embassy-mspm0/src/low_power/h321x.rs:42-46 — 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) embassy-net/src/tcp.rs:1255— embassy-net/src/tcp.rs:1255-1259 | embassy-net/src/tcp.rs:1270-1274 — both copies are in the same file, so extract the 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) embassy-nrf/src/crypto/pka/driver.rs:119— embassy-nrf/src/crypto/pka/driver.rs:119-123 | embassy-stm32/src/pka/driver.rs:136-140 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) embassy-nrf/src/uarte.rs:1012— embassy-nrf/src/uarte.rs:1012-1016 | embassy-nrf/src/uarte.rs:1268-1272 — both copies are in the same file, so extract the 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) embassy-rp/src/rtc/mod.rs:59— embassy-rp/src/rtc/mod.rs:59-63 | embassy-rp/src/rtc/mod.rs:100-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) embassy-rp/src/rtc/mod.rs:68— embassy-rp/src/rtc/mod.rs:68-72 | embassy-rp/src/rtc/mod.rs:109-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) embassy-rp/src/usb/device.rs:42— embassy-rp/src/usb/device.rs:42-46 | embassy-rp/src/usb/mod.rs:75-79 — 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) embassy-rp/src/usb/device.rs:50— embassy-rp/src/usb/device.rs:50-54 | embassy-rp/src/usb/mod.rs:83-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) embassy-stm32/src/adc/v2.rs:555— embassy-stm32/src/adc/v2.rs:555-559 | embassy-stm32/src/adc/v3.rs:595-599 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (5 lines × 2) embassy-stm32/src/can/fdcan.rs:373— embassy-stm32/src/can/fdcan.rs:373-377 | embassy-stm32/src/can/fdcan.rs:740-744 — both copies are in the same file, so extract the 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) embassy-stm32/src/can/fdcan.rs:420— embassy-stm32/src/can/fdcan.rs:420-424 | embassy-stm32/src/can/fdcan.rs:766-770 — both copies are in the same file, so extract the 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) embassy-stm32/src/crypto_driver.rs:159— embassy-stm32/src/crypto_driver.rs:159-163 | embassy-stm32/src/crypto_driver.rs:796-800 — both copies are in the same file, so extract the 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) embassy-stm32/src/crypto_driver.rs:625— embassy-stm32/src/crypto_driver.rs:625-629 | embassy-stm32/src/crypto_driver.rs:688-692 — both copies are in the same file, so extract the 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) embassy-stm32/src/crypto_driver.rs:649— embassy-stm32/src/crypto_driver.rs:649-653 | embassy-stm32/src/crypto_driver.rs:712-716 — both copies are in the same file, so extract the 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) embassy-stm32/src/fmac/mod.rs:256— embassy-stm32/src/fmac/mod.rs:256-260 | embassy-stm32/src/fmac/mod.rs:273-277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) embassy-stm32/src/hash/mod.rs:657— embassy-stm32/src/hash/mod.rs:657-661 | embassy-stm32/src/hash/mod.rs:670-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) embassy-stm32/src/hrtim/fullbridge.rs:46— embassy-stm32/src/hrtim/fullbridge.rs:46-50 | embassy-stm32/src/hrtim/fullbridge.rs:158-162 — both copies are in the same file, so extract the 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) embassy-stm32/src/i2c/v1.rs:188— embassy-stm32/src/i2c/v1.rs:188-195 | embassy-stm32/src/i2c/v1.rs:551-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.
Duplicated block (5 lines × 2) embassy-stm32/src/i2c/v1.rs:348— embassy-stm32/src/i2c/v1.rs:348-352 | embassy-stm32/src/i2c/v1.rs:866-870 — both copies are in the same file, so extract the 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) embassy-boot/src/firmware_updater/asynch.rs:95— embassy-boot/src/firmware_updater/asynch.rs:95-107 | embassy-boot/src/firmware_updater/blocking.rs:130-142 — before extracting anything, compare `embassy-boot/src/firmware_updater/asynch.rs` and `embassy-boot/src/firmware_updater/blocking.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-imxrt/src/flexcomm/spi.rs:309— embassy-imxrt/src/flexcomm/spi.rs:309-321 | embassy-imxrt/src/flexcomm/spi.rs:493-505 — both copies are in the same file, so extract the 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) embassy-mcxa/src/i3c/controller.rs:634— embassy-mcxa/src/i3c/controller.rs:634-646 | embassy-mcxa/src/i3c/controller.rs:1502-1514 — both copies are in the same file, so extract the 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) embassy-mcxa/src/i3c/controller.rs:1336— embassy-mcxa/src/i3c/controller.rs:1336-1348 | embassy-mcxa/src/spi/controller.rs:652-664 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) embassy-mcxa/src/spi/controller.rs:257— embassy-mcxa/src/spi/controller.rs:257-269 | embassy-mcxa/src/spi/controller.rs:358-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) embassy-mspm0/src/i2c_target.rs:111— embassy-mspm0/src/i2c_target.rs:111-123 | embassy-mspm0/src/i2c_target.rs:131-143 — both copies are in the same file, so extract the 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) embassy-mspm0/src/uart/buffered.rs:822— embassy-mspm0/src/uart/buffered.rs:822-834 | embassy-rp/src/uart/buffered.rs:329-341 — before extracting anything, compare `embassy-mspm0/src/uart/buffered.rs` and `embassy-rp/src/uart/buffered.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.
Duplicated block (13 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:427— embassy-net-esp-hosted/src/proto/fg/mod.rs:427-439 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15630-15642 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:882— embassy-net-esp-hosted/src/proto/fg/mod.rs:882-894 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16294-16306 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:3928— embassy-net-esp-hosted/src/proto/fg/mod.rs:3928-3940 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4157-4169 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:3448— embassy-net-esp-hosted/src/proto/mcu/mod.rs:3448-3460 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3665-3677 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4887— embassy-net-esp-hosted/src/proto/mcu/mod.rs:4887-4899 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7655-7667 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:23613— embassy-net-esp-hosted/src/proto/mcu/mod.rs:23613-23625 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23959-23971 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:25806— embassy-net-esp-hosted/src/proto/mcu/mod.rs:25806-25818 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26683-26695 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:41124— embassy-net-esp-hosted/src/proto/mcu/mod.rs:41124-41136 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41834-41846 — both copies are in the same file, so extract the 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) embassy-net-nrf91/src/context.rs:181— embassy-net-nrf91/src/context.rs:181-193 | embassy-net-nrf91/src/context.rs:199-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) embassy-nrf/src/buffered_uarte/v1.rs:481— embassy-nrf/src/buffered_uarte/v1.rs:481-493 | embassy-nrf/src/buffered_uarte/v2.rs:383-395 — before extracting anything, compare `embassy-nrf/src/buffered_uarte/v1.rs` and `embassy-nrf/src/buffered_uarte/v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-nrf/src/buffered_uarte/v1.rs:555— embassy-nrf/src/buffered_uarte/v1.rs:555-567 | embassy-nrf/src/buffered_uarte/v2.rs:457-469 — before extracting anything, compare `embassy-nrf/src/buffered_uarte/v1.rs` and `embassy-nrf/src/buffered_uarte/v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-nrf/src/spim.rs:635— embassy-nrf/src/spim.rs:635-647 | embassy-nrf/src/spis.rs:545-557 — before extracting anything, compare `embassy-nrf/src/spim.rs` and `embassy-nrf/src/spis.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. If that is what happened, the fix is to keep one copy and have the 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) embassy-nrf/src/uarte.rs:492— embassy-nrf/src/uarte.rs:492-504 | embassy-nrf/src/uarte.rs:614-626 — both copies are in the same file, so extract the 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) embassy-rp/src/uart/mod.rs:496— embassy-rp/src/uart/mod.rs:496-508 | embassy-rp/src/uart/mod.rs:664-676 — both copies are in the same file, so extract the 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) embassy-stm32/src/adc/v2.rs:644— embassy-stm32/src/adc/v2.rs:644-656 | embassy-stm32/src/adc/v3.rs:668-680 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-stm32/src/aes/common.rs:496— embassy-stm32/src/aes/common.rs:496-508 | embassy-stm32/src/saes/mod.rs:716-728 — before extracting anything, compare `embassy-stm32/src/aes/common.rs` and `embassy-stm32/src/saes/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (13 lines × 2) embassy-stm32/src/can/fdcan.rs:861— embassy-stm32/src/can/fdcan.rs:861-873 | embassy-stm32/src/can/fdcan.rs:878-890 — both copies are in the same file, so extract the 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) embassy-stm32/src/cryp/mod.rs:954— embassy-stm32/src/cryp/mod.rs:954-966 | embassy-stm32/src/cryp/mod.rs:1554-1566 — both copies are in the same file, so extract the 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) embassy-boot/src/boot_loader.rs:113— embassy-boot/src/boot_loader.rs:113-126 | embassy-boot/src/firmware_updater/blocking.rs:65-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) embassy-mcxa/src/ctimer/pwm.rs:284— embassy-mcxa/src/ctimer/pwm.rs:284-297 | embassy-mcxa/src/ctimer/pwm.rs:418-431 — both copies are in the same file, so extract the 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) embassy-mcxa/src/i2c/target.rs:542— embassy-mcxa/src/i2c/target.rs:542-555 | embassy-mcxa/src/i2c/target.rs:1070-1083 — both copies are in the same file, so extract the 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) embassy-mcxa/src/sgi/mod.rs:594— embassy-mcxa/src/sgi/mod.rs:594-607 | embassy-mcxa/src/sgi/mod.rs:641-654 — both copies are in the same file, so extract the 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) embassy-mcxa/src/spi/controller.rs:903— embassy-mcxa/src/spi/controller.rs:903-916 | embassy-mcxa/src/spi/controller.rs:1094-1107 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:1701— embassy-net-esp-hosted/src/proto/fg/mod.rs:1701-1714 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2476-2489 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4531— embassy-net-esp-hosted/src/proto/mcu/mod.rs:4531-4544 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5656-5669 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4999— embassy-net-esp-hosted/src/proto/mcu/mod.rs:4999-5012 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6065-6078 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:18050— embassy-net-esp-hosted/src/proto/mcu/mod.rs:18050-18063 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18311-18324 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:20981— embassy-net-esp-hosted/src/proto/mcu/mod.rs:20981-20994 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21261-21274 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:21474— embassy-net-esp-hosted/src/proto/mcu/mod.rs:21474-21487 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22405-22418 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:21490— embassy-net-esp-hosted/src/proto/mcu/mod.rs:21490-21503 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22421-22434 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:22595— embassy-net-esp-hosted/src/proto/mcu/mod.rs:22595-22608 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22943-22956 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:23095— embassy-net-esp-hosted/src/proto/mcu/mod.rs:23095-23108 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23443-23456 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:25788— embassy-net-esp-hosted/src/proto/mcu/mod.rs:25788-25801 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26665-26678 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26846— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26846-26859 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27364-27377 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:27589— embassy-net-esp-hosted/src/proto/mcu/mod.rs:27589-27602 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28107-28120 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:29023— embassy-net-esp-hosted/src/proto/mcu/mod.rs:29023-29036 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29250-29263 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:29763— embassy-net-esp-hosted/src/proto/mcu/mod.rs:29763-29776 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29982-29995 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:38562— embassy-net-esp-hosted/src/proto/mcu/mod.rs:38562-38575 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38910-38923 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/rpc/fg.rs:68— embassy-net-esp-hosted/src/rpc/fg.rs:68-81 | embassy-net-esp-hosted/src/rpc/mcu.rs:78-91 — before extracting anything, compare `embassy-net-esp-hosted/src/rpc/fg.rs` and `embassy-net-esp-hosted/src/rpc/mcu.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-nrf/src/buffered_uarte/v1.rs:82— embassy-nrf/src/buffered_uarte/v1.rs:82-95 | embassy-nrf/src/buffered_uarte/v2.rs:76-89 — before extracting anything, compare `embassy-nrf/src/buffered_uarte/v1.rs` and `embassy-nrf/src/buffered_uarte/v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-nrf/src/sqspi/mod.rs:649— embassy-nrf/src/sqspi/mod.rs:649-662 | embassy-nrf/src/sqspi/mod.rs:670-683 — both copies are in the same file, so extract the 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) embassy-nrf/src/sqspi/mod.rs:702— embassy-nrf/src/sqspi/mod.rs:702-715 | embassy-nrf/src/sqspi/mod.rs:738-751 — both copies are in the same file, so extract the 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) embassy-nrf/src/twim.rs:336— embassy-nrf/src/twim.rs:336-349 | embassy-nrf/src/twis.rs:367-380 — before extracting anything, compare `embassy-nrf/src/twim.rs` and `embassy-nrf/src/twis.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) cyw43/src/bluetooth.rs:564— cyw43/src/bluetooth.rs:564-575 | embassy-net-esp-hosted/src/bluetooth.rs:179-190 — before extracting anything, compare `cyw43/src/bluetooth.rs` and `embassy-net-esp-hosted/src/bluetooth.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) embassy-ambiq/src/i2c.rs:213— embassy-ambiq/src/i2c.rs:213-224 | embassy-ambiq/src/i2c.rs:247-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.
Duplicated block (12 lines × 2) embassy-crypto-test/src/lib.rs:1297— embassy-crypto-test/src/lib.rs:1297-1308 | embassy-crypto-test/src/lib.rs:1479-1490 — both copies are in the same file, so extract the 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) embassy-mcxa/src/flexspi.rs:1003— embassy-mcxa/src/flexspi.rs:1003-1014 | embassy-mcxa/src/flexspi.rs:1235-1246 — both copies are in the same file, so extract the 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) embassy-mcxa/src/flexspi.rs:1496— embassy-mcxa/src/flexspi.rs:1496-1507 | embassy-mcxa/src/flexspi.rs:1524-1535 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:2672— embassy-net-esp-hosted/src/proto/mcu/mod.rs:2672-2683 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2960-2971 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:7912— embassy-net-esp-hosted/src/proto/mcu/mod.rs:7912-7923 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8756-8767 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:16666— embassy-net-esp-hosted/src/proto/mcu/mod.rs:16666-16677 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34547-34558 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:22614— embassy-net-esp-hosted/src/proto/mcu/mod.rs:22614-22625 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22962-22973 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:23114— embassy-net-esp-hosted/src/proto/mcu/mod.rs:23114-23125 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23462-23473 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26433— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26433-26444 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41111-41122 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26449— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26449-26460 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41148-41159 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26864— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26864-26875 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27388-27399 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:27607— embassy-net-esp-hosted/src/proto/mcu/mod.rs:27607-27618 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28131-28142 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:38581— embassy-net-esp-hosted/src/proto/mcu/mod.rs:38581-38592 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38929-38940 — both copies are in the same file, so extract the 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) embassy-nrf/src/uarte.rs:815— embassy-nrf/src/uarte.rs:815-826 | embassy-nrf/src/uarte.rs:1142-1153 — both copies are in the same file, so extract the 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) embassy-rp/src/pio_programs/step_dir.rs:253— embassy-rp/src/pio_programs/step_dir.rs:253-264 | embassy-rp/src/pio_programs/stepper.rs:113-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) embassy-stm32/src/comp.rs:312— embassy-stm32/src/comp.rs:312-323 | embassy-stm32/src/comp.rs:343-354 — both copies are in the same file, so extract the 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) embassy-stm32/src/cryp/mod.rs:863— embassy-stm32/src/cryp/mod.rs:863-874 | embassy-stm32/src/cryp/mod.rs:1441-1452 — both copies are in the same file, so extract the 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) embassy-stm32/src/eth/v1/ptp.rs:87— embassy-stm32/src/eth/v1/ptp.rs:87-98 | embassy-stm32/src/eth/v2/ptp.rs:87-98 — `embassy-stm32/src/eth/v1/ptp.rs` and `embassy-stm32/src/eth/v2/ptp.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 (12 lines × 2) embassy-stm32/src/flash/asynch.rs:171— embassy-stm32/src/flash/asynch.rs:171-182 | embassy-stm32/src/flash/common.rs:174-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) embassy-stm32/src/hrtim/mod.rs:250— embassy-stm32/src/hrtim/mod.rs:250-261 | embassy-stm32/src/lptim/timer/prescaler.rs:63-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) embassy-stm32/src/jpeg.rs:507— embassy-stm32/src/jpeg.rs:507-518 | embassy-stm32/src/jpeg.rs:719-730 — both copies are in the same file, so extract the 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) embassy-stm32/src/opamp.rs:279— embassy-stm32/src/opamp.rs:279-290 | embassy-stm32/src/opamp.rs:319-330 — both copies are in the same file, so extract the 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) embassy-stm32/src/ospi/mod.rs:481— embassy-stm32/src/ospi/mod.rs:481-492 | embassy-stm32/src/ospi/mod.rs:507-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
MethodTooLong: Rpc.decode embassy-net-esp-hosted/src/proto/mcu/mod.rs:48859— MethodTooLong — decode runs 336 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 236 over it, 3.36× 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: ClockOperator.configure_spll embassy-mcxa/src/clocks/operator.rs:807— MethodTooLong — configure_spll runs 224 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 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Channel.configure embassy-stm32/src/dma/dma_bdma.rs:501— MethodTooLong — configure runs 215 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 115 over it, 2.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: CtrlMsg.decode embassy-net-esp-hosted/src/proto/fg/mod.rs:11170— MethodTooLong — decode runs 214 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 114 over it, 2.14× 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: Rpc.encode embassy-net-esp-hosted/src/proto/mcu/mod.rs:50025— MethodTooLong — encode runs 172 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 72 over it, 1.72× 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: r#wifi_init_config.decode embassy-net-esp-hosted/src/proto/mcu/mod.rs:584— MethodTooLong — decode runs 158 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 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LsConfig.init embassy-stm32/src/rcc/bd.rs:154— MethodTooLong — init runs 154 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 54 over it, 1.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: Runner.init cyw43/src/runner.rs:486— MethodTooLong — init runs 151 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 51 over it, 1.51× 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: Ethernet.new_inner embassy-stm32/src/eth/v2/mod.rs:356— MethodTooLong — new_inner runs 145 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 45 over it, 1.45× 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: Algorithm16.into_config embassy-mcxa/src/crc.rs:459— MethodTooLong — into_config runs 140 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 40 over it, 1.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: Speaker.new embassy-usb/src/class/uac1/speaker.rs:111— MethodTooLong — new runs 140 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 40 over it, 1.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: Runner.rx cyw43/src/runner.rs:1057— MethodTooLong — rx runs 132 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 32 over it, 1.32× 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: I2c.read_frame embassy-stm32/src/i2c/v1.rs:722— MethodTooLong — read_frame runs 131 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 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Rpc.compute_size embassy-net-esp-hosted/src/proto/mcu/mod.rs:50247— MethodTooLong — compute_size runs 129 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 29 over it, 1.29× 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: r#wifi_pkt_rx_ctrl.decode embassy-net-esp-hosted/src/proto/mcu/mod.rs:7198— MethodTooLong — decode runs 128 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 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StateMachine.set_config embassy-rp/src/pio/mod.rs:790— MethodTooLong — set_config runs 124 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 24 over it, 1.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: ClockOperator.configure_osc32k_clocks embassy-mcxa/src/clocks/operator.rs:449— MethodTooLong — configure_osc32k_clocks runs 121 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 21 over it, 1.21× 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: Xspi.new_inner embassy-stm32/src/xspi/mod.rs:307— MethodTooLong — new_inner runs 120 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 20 over it, 1.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.
MethodTooLong: HCI.process_event embassy-stm32-wpan/src/bluetooth/mod.rs:674— MethodTooLong — process_event runs 119 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 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MidiClass.build embassy-usb/src/class/midi/mod.rs:184— MethodTooLong — build runs 118 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 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Psram.init_psram embassy-rp/src/psram.rs:445— MethodTooLong — init_psram runs 116 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 16 over it, 1.16× 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: TlMbox.init embassy-stm32-wpan/src/wb/mod.rs:81— MethodTooLong — init runs 116 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 16 over it, 1.16× 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: ReportDescriptor.parse embassy-usb-host/src/class/hid_report.rs:240— MethodTooLong — parse runs 115 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 15 over it, 1.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: ClockOperator.configure_voltages embassy-mcxa/src/clocks/operator.rs:1300— MethodTooLong — configure_voltages runs 114 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 14 over it, 1.14× 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: I2c.write_frame embassy-stm32/src/i2c/v1.rs:488— MethodTooLong — write_frame runs 114 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 14 over it, 1.14× 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.
ClassTooLong: Ospi embassy-stm32/src/ospi/mod.rs:245— ClassTooLong — 1338 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, 7 blocks, lines 245-2220. The bar is 400 significant lines; this is 938 over it, 3.35× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Xspi embassy-stm32/src/xspi/mod.rs:170— ClassTooLong — 1286 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 7 blocks, lines 170-1992. The bar is 400 significant lines; this is 886 over it, 3.22× 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: Pka embassy-stm32/src/pka/mod.rs:837— ClassTooLong — 1175 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 101 methods, 8 blocks, lines 837-2950. The bar is 400 significant lines; this is 775 over it, 2.94× 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: Sdmmc embassy-stm32/src/sdmmc/mod.rs:457— ClassTooLong — 1088 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 43 methods, 10 blocks, lines 457-2242. The bar is 400 significant lines; this is 688 over it, 2.72× 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: Rpc embassy-net-esp-hosted/src/proto/mcu/mod.rs:48780— ClassTooLong — 1068 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 4 blocks, lines 48780-50426. The bar is 400 significant lines; this is 668 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Spi embassy-stm32/src/spi/mod.rs:333— ClassTooLong — 959 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, 13 blocks, lines 333-2481. The bar is 400 significant lines; this is 559 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: I3c embassy-mcxa/src/i3c/controller.rs:322— ClassTooLong — 860 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, 17 blocks, lines 322-2019. The bar is 400 significant lines; this is 460 over it, 2.15× 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: Runner cyw43/src/runner.rs:120— ClassTooLong — 805 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 120-1388. The bar is 400 significant lines; this is 405 over it, 2.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ClockOperator embassy-mcxa/src/clocks/operator.rs:37— ClassTooLong — 801 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 37-1583. The bar is 400 significant lines; this is 401 over it, 2.00× 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: NeoChrom embassy-stm32-neochrom/src/driver.rs:74— ClassTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 60 methods, 2 blocks, lines 74-1115. The bar is 400 significant lines; this is 382 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: Spi embassy-mcxa/src/spi/controller.rs:132— ClassTooLong — 733 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, 15 blocks, lines 132-1383. The bar is 400 significant lines; this is 333 over it, 1.83× 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: CtrlMsg embassy-net-esp-hosted/src/proto/fg/mod.rs:11067— ClassTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 4 blocks, lines 11067-12172. The bar is 400 significant lines; this is 312 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: Cryp embassy-stm32/src/cryp/mod.rs:615— ClassTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 6 blocks, lines 615-1666. The bar is 400 significant lines; this is 259 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: Uart embassy-stm32/src/usart/mod.rs:448— ClassTooLong — 626 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, 9 blocks, lines 448-2859. The bar is 400 significant lines; this is 226 over it, 1.57× 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: InnerFlexSpi embassy-mcxa/src/flexspi.rs:560— ClassTooLong — 592 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 45 methods, 3 blocks, lines 560-1471. The bar is 400 significant lines; this is 192 over it, 1.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: Timer embassy-stm32/src/timer/low_level.rs:452— ClassTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 150 methods, 12 blocks, lines 452-1786. The bar is 400 significant lines; this is 185 over it, 1.46× 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: I2c embassy-mcxa/src/i2c/target.rs:303— ClassTooLong — 572 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 13 blocks, lines 303-1545. The bar is 400 significant lines; this is 172 over it, 1.43× 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: Qspi embassy-stm32/src/qspi/mod.rs:96— ClassTooLong — 563 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, 4 blocks, lines 96-879. The bar is 400 significant lines; this is 163 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: I2c embassy-mcxa/src/i2c/controller.rs:298— ClassTooLong — 554 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 17 blocks, lines 298-1610. The bar is 400 significant lines; this is 154 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Channel embassy-rp/src/usb/host.rs:468— ClassTooLong — 541 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, 6 blocks, lines 468-1577. The bar is 400 significant lines; this is 141 over it, 1.35× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Hspi embassy-stm32/src/hspi/mod.rs:167— ClassTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 7 blocks, lines 167-990. The bar is 400 significant lines; this is 116 over it, 1.29× 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: DmaChannel embassy-mcxa/src/dma.rs:618— ClassTooLong — 475 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods, 4 blocks, lines 618-2398. The bar is 400 significant lines; this is 75 over it, 1.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: I3c embassy-mcxa/src/i3c/target.rs:312— ClassTooLong — 473 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, 5 blocks, lines 312-1429. The bar is 400 significant lines; this is 73 over it, 1.18× 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: HCI embassy-stm32-wpan/src/bluetooth/mod.rs:93— ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 52 methods, 4 blocks, lines 93-1039. The bar is 400 significant lines; this is 70 over it, 1.18× 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: I2c embassy-microchip/src/i2c.rs:149— ClassTooLong — 466 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 11 blocks, lines 149-912. The bar is 400 significant lines; this is 66 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.
Hotspot: embassy-rp/src/usb/host.rs embassy-rp/src/usb/host.rs:1845— embassy-rp/src/usb/host.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in InterruptHandler::on_interrupt at line 1845. 7 of those changes were fix/bug commits, and the other 26 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-rp/src/usb/host.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: embassy-stm32/src/adc/v3.rs embassy-stm32/src/adc/v3.rs:375— embassy-stm32/src/adc/v3.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in Regs::configure_sequence at line 375. 8 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-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/adc/v3.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: embassy-stm32/src/dma/dma_bdma.rs embassy-stm32/src/dma/dma_bdma.rs:501— embassy-stm32/src/dma/dma_bdma.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in Channel::configure at line 501. 4 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/dma/dma_bdma.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: embassy-stm32/src/rcc/mod.rs embassy-stm32/src/rcc/mod.rs:667— embassy-stm32/src/rcc/mod.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in embassy_stm32::rcc::init_rcc at line 667. 3 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/rcc/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: embassy-stm32/src/comp.rs embassy-stm32/src/comp.rs:500— embassy-stm32/src/comp.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Comp::configure_raw at line 500. 5 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/comp.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: embassy-usb-synopsys-otg/src/lib.rs embassy-usb-synopsys-otg/src/lib.rs:38— embassy-usb-synopsys-otg/src/lib.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in embassy_usb_synopsys_otg::on_interrupt at line 38. 1 of those changes was a fix/bug commit, 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-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-usb-synopsys-otg/src/lib.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: embassy-stm32/src/dma/gpdma/mod.rs embassy-stm32/src/dma/gpdma/mod.rs:629— embassy-stm32/src/dma/gpdma/mod.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Channel::configure at line 629. 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-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/dma/gpdma/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: embassy-stm32/src/usart/mod.rs embassy-stm32/src/usart/mod.rs:1093— embassy-stm32/src/usart/mod.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in UartRx::inner_read_run at line 1093. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/usart/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: embassy-stm32/src/rcc/n6.rs embassy-stm32/src/rcc/n6.rs:890— embassy-stm32/src/rcc/n6.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in embassy_stm32::rcc::n6::init_osc at line 890. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/rcc/n6.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: cyw43/src/runner.rs cyw43/src/runner.rs:1057— cyw43/src/runner.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Runner::rx at line 1057. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- cyw43/src/runner.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: embassy-stm32/src/low_power.rs embassy-stm32/src/low_power.rs:201— embassy-stm32/src/low_power.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in embassy_stm32::low_power::platform::exit_stop at line 201. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/low_power.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: embassy-mcxa/src/clocks/periph_helpers.rs embassy-mcxa/src/clocks/periph_helpers.rs:1386— embassy-mcxa/src/clocks/periph_helpers.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in LpuartConfig::pre_enable_config at line 1386. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-mcxa/src/clocks/periph_helpers.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: embassy-stm32/src/usart/buffered.rs embassy-stm32/src/usart/buffered.rs:35— embassy-stm32/src/usart/buffered.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in embassy_stm32::usart::buffered::on_interrupt at line 35. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/usart/buffered.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: embassy-rp/src/pio/mod.rs embassy-rp/src/pio/mod.rs:790— embassy-rp/src/pio/mod.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in StateMachine::set_config at line 790. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-rp/src/pio/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: embassy-stm32/src/hash/mod.rs embassy-stm32/src/hash/mod.rs:848— embassy-stm32/src/hash/mod.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in Hash::update at line 848. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/hash/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: embassy-stm32/src/i2c/v2.rs embassy-stm32/src/i2c/v2.rs:834— embassy-stm32/src/i2c/v2.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in I2c::blocking_write_vectored at line 834. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/i2c/v2.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: embassy-stm32/src/rcc/h.rs embassy-stm32/src/rcc/h.rs:328— embassy-stm32/src/rcc/h.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in embassy_stm32::rcc::h::init at line 328. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/rcc/h.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: embassy-stm32/src/rcc/c5.rs embassy-stm32/src/rcc/c5.rs:79— embassy-stm32/src/rcc/c5.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in embassy_stm32::rcc::c5::init at line 79. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/rcc/c5.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: embassy-crypto-test/src/lib.rs embassy-crypto-test/src/lib.rs:1035— embassy-crypto-test/src/lib.rs changed 5 times in last 90 days, max cyclomatic complexity 32 in embassy_crypto_test::p384::arith at line 1035. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-crypto-test/src/lib.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: embassy-net-adin1110/src/lib.rs embassy-net-adin1110/src/lib.rs:354— embassy-net-adin1110/src/lib.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Runner::run at line 354. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-net-adin1110/src/lib.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: embassy-rp/src/clocks.rs embassy-rp/src/clocks.rs:979— embassy-rp/src/clocks.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in embassy_rp::clocks::init at line 979. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-rp/src/clocks.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: embassy-stm32/src/rcc/l.rs embassy-stm32/src/rcc/l.rs:178— embassy-stm32/src/rcc/l.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in embassy_stm32::rcc::l::init at line 178. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/rcc/l.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: embassy-stm32/src/rcc/bd.rs embassy-stm32/src/rcc/bd.rs:154— embassy-stm32/src/rcc/bd.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in LsConfig::init at line 154. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/rcc/bd.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: embassy-stm32/src/adc/v2.rs embassy-stm32/src/adc/v2.rs:397— embassy-stm32/src/adc/v2.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Regs::configure_sequence at line 397. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-stm32/src/adc/v2.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: embassy-mcxa/src/i2c/target.rs embassy-mcxa/src/i2c/target.rs:889— embassy-mcxa/src/i2c/target.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in I2c::write_dma_chunk at line 889. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-mcxa/src/i2c/target.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.
Duplicated block (16 lines × 2) cyw43/src/bluetooth.rs:578— cyw43/src/bluetooth.rs:578-593 | embassy-net-esp-hosted/src/bluetooth.rs:193-208 — before extracting anything, compare `cyw43/src/bluetooth.rs` and `embassy-net-esp-hosted/src/bluetooth.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. 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 (16 lines × 2) embassy-boot/src/firmware_updater/asynch.rs:113— embassy-boot/src/firmware_updater/asynch.rs:113-128 | embassy-boot/src/firmware_updater/blocking.rs:148-163 — before extracting anything, compare `embassy-boot/src/firmware_updater/asynch.rs` and `embassy-boot/src/firmware_updater/blocking.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (16 lines × 2) embassy-boot/src/firmware_updater/asynch.rs:223— embassy-boot/src/firmware_updater/asynch.rs:223-238 | embassy-boot/src/firmware_updater/blocking.rs:258-273 — before extracting anything, compare `embassy-boot/src/firmware_updater/asynch.rs` and `embassy-boot/src/firmware_updater/blocking.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (16 lines × 2) embassy-mcxa/src/clocks/operator.rs:565— embassy-mcxa/src/clocks/operator.rs:565-580 | embassy-mcxa/src/clocks/operator.rs:652-667 — both copies are in the same file, so extract the 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) embassy-mcxa/src/lpuart/bbq.rs:542— embassy-mcxa/src/lpuart/bbq.rs:542-557 | embassy-mcxa/src/lpuart/bbq.rs:1113-1128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:1839— embassy-net-esp-hosted/src/proto/fg/mod.rs:1839-1854 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2635-2650 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:2208— embassy-net-esp-hosted/src/proto/fg/mod.rs:2208-2223 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3420-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.
Duplicated block (16 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:5928— embassy-net-esp-hosted/src/proto/fg/mod.rs:5928-5943 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18538-18553 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:6884— embassy-net-esp-hosted/src/proto/fg/mod.rs:6884-6899 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24300-24315 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:7172— embassy-net-esp-hosted/src/proto/fg/mod.rs:7172-7187 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24588-24603 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:8272— embassy-net-esp-hosted/src/proto/fg/mod.rs:8272-8287 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19650-19665 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4870— embassy-net-esp-hosted/src/proto/mcu/mod.rs:4870-4885 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5950-5965 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:13470— embassy-net-esp-hosted/src/proto/mcu/mod.rs:13470-13485 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13624-13639 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:30821— embassy-net-esp-hosted/src/proto/mcu/mod.rs:30821-30836 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38049-38064 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:35964— embassy-net-esp-hosted/src/proto/mcu/mod.rs:35964-35979 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48697-48712 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:37807— embassy-net-esp-hosted/src/proto/mcu/mod.rs:37807-37822 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39010-39025 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:41608— embassy-net-esp-hosted/src/proto/mcu/mod.rs:41608-41623 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41825-41840 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:46879— embassy-net-esp-hosted/src/proto/mcu/mod.rs:46879-46894 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47397-47412 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:47248— embassy-net-esp-hosted/src/proto/mcu/mod.rs:47248-47263 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47766-47781 — both copies are in the same file, so extract the 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) embassy-nrf/src/twis.rs:539— embassy-nrf/src/twis.rs:539-554 | embassy-nrf/src/twis.rs:565-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) embassy-stm32/src/aes/common.rs:351— embassy-stm32/src/aes/common.rs:351-366 | embassy-stm32/src/saes/mod.rs:617-632 — before extracting anything, compare `embassy-stm32/src/aes/common.rs` and `embassy-stm32/src/saes/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (16 lines × 2) embassy-stm32/src/cordic/mod.rs:471— embassy-stm32/src/cordic/mod.rs:471-486 | embassy-stm32/src/cordic/mod.rs:533-548 — both copies are in the same file, so extract the 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) embassy-stm32/src/eth/v1/ptp.rs:144— embassy-stm32/src/eth/v1/ptp.rs:144-159 | embassy-stm32/src/eth/v2/ptp.rs:144-159 — `embassy-stm32/src/eth/v1/ptp.rs` and `embassy-stm32/src/eth/v2/ptp.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 (16 lines × 2) embassy-stm32/src/i2c/v1.rs:511— embassy-stm32/src/i2c/v1.rs:511-526 | embassy-stm32/src/i2c/v1.rs:742-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.
Duplicated block (16 lines × 2) embassy-stm32/src/i2c/v1.rs:604— embassy-stm32/src/i2c/v1.rs:604-619 | embassy-stm32/src/i2c/v1.rs:823-838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) cyw43/src/lib.rs:506— cyw43/src/lib.rs:506-522 | cyw43/src/lib.rs:542-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-executor/src/platform/cortex_m.rs:10— embassy-executor/src/platform/cortex_m.rs:10-26 | embassy-rp/src/executor.rs:22-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:670— embassy-net-esp-hosted/src/proto/fg/mod.rs:670-686 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16082-16098 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:1348— embassy-net-esp-hosted/src/proto/fg/mod.rs:1348-1364 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17010-17026 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:2091— embassy-net-esp-hosted/src/proto/fg/mod.rs:2091-2107 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3261-3277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:4370— embassy-net-esp-hosted/src/proto/fg/mod.rs:4370-4386 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17320-17336 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:5910— embassy-net-esp-hosted/src/proto/fg/mod.rs:5910-5926 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18520-18536 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:6866— embassy-net-esp-hosted/src/proto/fg/mod.rs:6866-6882 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24282-24298 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:7154— embassy-net-esp-hosted/src/proto/fg/mod.rs:7154-7170 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24570-24586 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:10840— embassy-net-esp-hosted/src/proto/fg/mod.rs:10840-10856 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48116-48132 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:2519— embassy-net-esp-hosted/src/proto/mcu/mod.rs:2519-2535 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2903-2919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:11203— embassy-net-esp-hosted/src/proto/mcu/mod.rs:11203-11219 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13031-13047 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:13452— embassy-net-esp-hosted/src/proto/mcu/mod.rs:13452-13468 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13606-13622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:20920— embassy-net-esp-hosted/src/proto/mcu/mod.rs:20920-20936 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21039-21055 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26375— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26375-26391 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40999-41015 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26990— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26990-27006 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29254-29270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:28224— embassy-net-esp-hosted/src/proto/mcu/mod.rs:28224-28240 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28495-28511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:28614— embassy-net-esp-hosted/src/proto/mcu/mod.rs:28614-28630 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28885-28901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:44718— embassy-net-esp-hosted/src/proto/mcu/mod.rs:44718-44734 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44989-45005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:46861— embassy-net-esp-hosted/src/proto/mcu/mod.rs:46861-46877 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47379-47395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:47230— embassy-net-esp-hosted/src/proto/mcu/mod.rs:47230-47246 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47748-47764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-nrf/src/twis.rs:513— embassy-nrf/src/twis.rs:513-529 | embassy-nrf/src/twis.rs:625-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-stm32/src/crypto_driver.rs:475— embassy-stm32/src/crypto_driver.rs:475-491 | embassy-stm32/src/crypto_driver.rs:545-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) embassy-stm32/src/crypto_driver.rs:505— embassy-stm32/src/crypto_driver.rs:505-521 | embassy-stm32/src/crypto_driver.rs:575-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 (17 lines × 2) embassy-stm32/src/dma/gpdma/mod.rs:1078— embassy-stm32/src/dma/gpdma/mod.rs:1078-1094 | embassy-stm32/src/dma/gpdma/mod.rs:1122-1138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 4 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×28
Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-executor/src/platform/cortex_m.rs:232— embassy-executor/src/platform/cortex_m.rs:232-238 | embassy-mspm0/src/executor.rs:247-253 | embassy-rp/src/executor.rs:254-260 | embassy-stm32/src/executor.rs:273-279 — 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) embassy-imxrt/src/flexcomm/uart.rs:858— embassy-imxrt/src/flexcomm/uart.rs:858-866 | embassy-imxrt/src/flexcomm/uart.rs:958-966 | embassy-mcxa/src/lpuart/blocking.rs:281-288 | embassy-mcxa/src/lpuart/blocking.rs:356-363 — 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) embassy-mcxa/src/flexspi.rs:997— embassy-mcxa/src/flexspi.rs:997-1034 | embassy-mcxa/src/flexspi.rs:1036-1061 | embassy-mcxa/src/flexspi.rs:1229-1265 | embassy-mcxa/src/flexspi.rs:1272-1295 — 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) embassy-mcxa/src/i2c/controller.rs:357— embassy-mcxa/src/i2c/controller.rs:357-389 | embassy-mcxa/src/i2c/target.rs:320-352 | embassy-mcxa/src/i3c/controller.rs:338-369 | embassy-mcxa/src/i3c/target.rs:369-403 — 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) embassy-mcxa/src/i2c/controller.rs:1330— embassy-mcxa/src/i2c/controller.rs:1330-1436 | embassy-mcxa/src/i2c/target.rs:889-999 | embassy-mcxa/src/i3c/controller.rs:1274-1378 | embassy-mcxa/src/spi/controller.rs:626-674 — 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) embassy-mcxa/src/lpuart/bbq.rs:403— embassy-mcxa/src/lpuart/bbq.rs:403-417 | embassy-mcxa/src/lpuart/bbq.rs:427-441 | embassy-mcxa/src/lpuart/bbq.rs:453-467 | embassy-mcxa/src/lpuart/bbq.rs:480-494 — 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:11905— embassy-net-esp-hosted/src/proto/fg/mod.rs:11905-12050 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12560-12615 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50028-50246 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50787-50835 — 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:12051— embassy-net-esp-hosted/src/proto/fg/mod.rs:12051-12171 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12616-12664 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50247-50425 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50836-50878 — 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:42265— embassy-net-esp-hosted/src/proto/mcu/mod.rs:42265-42282 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42651-42668 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43037-43054 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43423-43440 — 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:42283— embassy-net-esp-hosted/src/proto/mcu/mod.rs:42283-42299 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42669-42685 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43055-43071 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43441-43457 — 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) embassy-nxp/src/casper/lpc55.rs:480— embassy-nxp/src/casper/lpc55.rs:480-498 | embassy-nxp/src/casper/lpc55.rs:513-537 | embassy-nxp/src/casper/lpc55.rs:554-578 | embassy-nxp/src/casper/lpc55.rs:595-623 — 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) embassy-stm32/src/adc/mod.rs:811— embassy-stm32/src/adc/mod.rs:811-843 | embassy-stm32/src/adc/mod.rs:895-910 | embassy-stm32/src/adc/mod.rs:925-937 | embassy-stm32/src/adc/watchdog.rs:185-223 — 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) embassy-stm32/src/adc/mod.rs:991— embassy-stm32/src/adc/mod.rs:991-1027 | embassy-stm32/src/adc/mod.rs:1053-1088 | embassy-stm32/src/adc/mod.rs:1110-1125 | embassy-stm32/src/adc/mod.rs:1150-1167 — 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) embassy-stm32/src/cryp/mod.rs:144— embassy-stm32/src/cryp/mod.rs:144-154 | embassy-stm32/src/cryp/mod.rs:186-196 | embassy-stm32/src/cryp/mod.rs:228-238 | embassy-stm32/src/cryp/mod.rs:269-279 — 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) embassy-stm32/src/cryp/mod.rs:766— embassy-stm32/src/cryp/mod.rs:766-846 | embassy-stm32/src/cryp/mod.rs:946-984 | embassy-stm32/src/cryp/mod.rs:1332-1416 | embassy-stm32/src/cryp/mod.rs:1546-1583 — 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) embassy-stm32/src/crypto_driver.rs:283— embassy-stm32/src/crypto_driver.rs:283-300 | embassy-stm32/src/crypto_driver.rs:302-319 | embassy-stm32/src/crypto_driver.rs:331-348 | embassy-stm32/src/crypto_driver.rs:350-367 — 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) embassy-stm32/src/hspi/mod.rs:589— embassy-stm32/src/hspi/mod.rs:589-620 | embassy-stm32/src/hspi/mod.rs:682-713 | embassy-stm32/src/xspi/mod.rs:782-815 | embassy-stm32/src/xspi/mod.rs:1247-1280 — 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) embassy-stm32/src/i2c/v1.rs:162— embassy-stm32/src/i2c/v1.rs:162-254 | embassy-stm32/src/i2c/v1.rs:299-391 | embassy-stm32/src/i2c/v1.rs:488-702 | embassy-stm32/src/i2c/v1.rs:722-969 — 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) embassy-stm32/src/ospi/mod.rs:985— embassy-stm32/src/ospi/mod.rs:985-1007 | embassy-stm32/src/ospi/mod.rs:1018-1043 | embassy-stm32/src/ospi/mod.rs:1445-1467 | embassy-stm32/src/ospi/mod.rs:1480-1505 — 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) embassy-stm32/src/ospi/mod.rs:1054— embassy-stm32/src/ospi/mod.rs:1054-1076 | embassy-stm32/src/ospi/mod.rs:1087-1112 | embassy-stm32/src/ospi/mod.rs:1518-1540 | embassy-stm32/src/ospi/mod.rs:1553-1578 — 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) embassy-stm32/src/spi/mod.rs:803— embassy-stm32/src/spi/mod.rs:803-849 | embassy-stm32/src/spi/mod.rs:852-868 | embassy-stm32/src/spi/mod.rs:873-889 | embassy-stm32/src/spi/mod.rs:897-913 — 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) embassy-stm32/src/usart/mod.rs:1665— embassy-stm32/src/usart/mod.rs:1665-1680 | embassy-stm32/src/usart/mod.rs:1846-1861 | embassy-stm32/src/usart/mod.rs:2040-2055 | embassy-stm32/src/usart/mod.rs:2190-2205 — 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) embassy-stm32/src/usb/otg.rs:67— embassy-stm32/src/usb/otg.rs:67-92 | embassy-stm32/src/usb/otg.rs:108-131 | embassy-stm32/src/usb/otg.rs:926-963 | embassy-stm32/src/usb/otg.rs:971-1012 — 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) embassy-stm32/src/flash/c5.rs:118— embassy-stm32/src/flash/c5.rs:118-167 | embassy-stm32/src/flash/h5.rs:39-85 | embassy-stm32/src/flash/h7.rs:67-113 | embassy-stm32/src/flash/h7.rs:115-155 — 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) embassy-stm32/src/flash/f2.rs:49— embassy-stm32/src/flash/f2.rs:49-58 | embassy-stm32/src/flash/f4.rs:88-97 | embassy-stm32/src/flash/g.rs:91-100 | embassy-stm32/src/flash/l.rs:64-73 — 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.
embassy_stm32::rcc::n6::init_osc (cognitive 86) embassy-stm32/src/rcc/n6.rs:890— embassy_stm32::rcc::n6::init_osc has cognitive complexity 86 (threshold 15). Drivers by points: loops 14 (31 pts), if/else 21 (29 pts), boolean chains 21, 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.
embassy_stm32::rcc::h::init (cognitive 77) embassy-stm32/src/rcc/h.rs:328— embassy_stm32::rcc::h::init has cognitive complexity 77 (threshold 15). Drivers by points: loops 24 (37 pts), match/switch 19 (22 pts), if/else 11 (16 pts), boolean chains 2 (nesting depth added 21). 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.
embassy_stm32::rcc::u3::init (cognitive 71) embassy-stm32/src/rcc/u3.rs:186— embassy_stm32::rcc::u3::init has cognitive complexity 71 (threshold 15). Drivers by points: if/else 21 (31 pts), loops 12 (19 pts), match/switch 12 (19 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
embassy_stm32::rcc::u5::init (cognitive 64) embassy-stm32/src/rcc/u5.rs:180— embassy_stm32::rcc::u5::init has cognitive complexity 64 (threshold 15). Drivers by points: match/switch 16 (26 pts), if/else 17 (24 pts), loops 11 (12 pts), boolean chains 2 (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.
embassy_stm32::usart::buffered::on_interrupt (cognitive 44) embassy-stm32/src/usart/buffered.rs:35— embassy_stm32::usart::buffered::on_interrupt has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (35 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
embassy_stm32::rcc::init_rcc (cognitive 40) embassy-stm32/src/rcc/mod.rs:667— embassy_stm32::rcc::init_rcc has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 8 (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.
embassy_stm32::rcc::f013::init (cognitive 36) embassy-stm32/src/rcc/f013.rs:178— embassy_stm32::rcc::f013::init has cognitive complexity 36 (threshold 15). Drivers by points: match/switch 12 (14 pts), loops 8 (12 pts), if/else 8 (10 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.
embassy_stm32::rcc::l::init (cognitive 32) embassy-stm32/src/rcc/l.rs:178— embassy_stm32::rcc::l::init has cognitive complexity 32 (threshold 15). Drivers by points: loops 11 (12 pts), match/switch 10, if/else 9, boolean chains 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
embassy_stm32::rcc::c5::init (cognitive 29) embassy-stm32/src/rcc/c5.rs:79— embassy_stm32::rcc::c5::init has cognitive complexity 29 (threshold 15). Drivers by points: loops 11 (17 pts), match/switch 5 (7 pts), if/else 4, boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
embassy_stm32::dma::dma_bdma::on_irq (cognitive 27) embassy-stm32/src/dma/dma_bdma.rs:17— embassy_stm32::dma::dma_bdma::on_irq has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4, match/switch 1 (nesting depth added 11). 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.
embassy_stm32::rcc::wba::init (cognitive 26) embassy-stm32/src/rcc/wba.rs:264— embassy_stm32::rcc::wba::init has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 12 (17 pts), loops 5 (6 pts), if/else 3 (nesting depth added 6). 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.
embassy_stm32::rcc::l::pll::init_pll (cognitive 25) embassy-stm32/src/rcc/l.rs:708— embassy_stm32::rcc::l::pll::init_pll has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 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.
embassy_stm32::rcc::f247::init_pll (cognitive 24) embassy-stm32/src/rcc/f247.rs:431— embassy_stm32::rcc::f247::init_pll has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 5 (6 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.
embassy_stm32::init_hw (cognitive 24) embassy-stm32/src/lib.rs:792— embassy_stm32::init_hw has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, loops 1 (2 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.
embassy_stm32::rcc::n6::init_clocks (cognitive 24) embassy-stm32/src/rcc/n6.rs:282— embassy_stm32::rcc::n6::init_clocks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 6, loops 3, boolean chains 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.
embassy_stm32::aes::common::op_aad (cognitive 23) embassy-stm32/src/aes/common.rs:336— embassy_stm32::aes::common::op_aad has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 7 (9 pts), boolean chains 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
embassy_stm32::usart::configure (cognitive 23) embassy-stm32/src/usart/mod.rs:2601— embassy_stm32::usart::configure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 3, match/switch 2 (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.
embassy_stm32::spi::transfer_words (cognitive 22) embassy-stm32/src/spi/mod.rs:2179— embassy_stm32::spi::transfer_words has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 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.
embassy_stm32::flash::h5::blocking_wait_ready (cognitive 21) embassy-stm32/src/flash/h5.rs:129— embassy_stm32::flash::h5::blocking_wait_ready has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 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.
embassy_stm32::rcc::g4::init (cognitive 20) embassy-stm32/src/rcc/g4.rs:126— embassy_stm32::rcc::g4::init has cognitive complexity 20 (threshold 15). Drivers by points: loops 7 (8 pts), match/switch 6 (7 pts), if/else 5 (nesting depth added 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.
embassy_stm32::flash::l::wait_ready_blocking (cognitive 20) embassy-stm32/src/flash/l.rs:347— embassy_stm32::flash::l::wait_ready_blocking has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
embassy_stm32::rcc::g0::init (cognitive 19) embassy-stm32/src/rcc/g0.rs:134— embassy_stm32::rcc::g0::init has cognitive complexity 19 (threshold 15). Drivers by points: loops 7 (8 pts), match/switch 6 (7 pts), if/else 4 (nesting depth added 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.
embassy_stm32::rcc::c0::init (cognitive 19) embassy-stm32/src/rcc/c0.rs:99— embassy_stm32::rcc::c0::init has cognitive complexity 19 (threshold 15). Drivers by points: loops 7 (9 pts), match/switch 5 (6 pts), if/else 4 (nesting depth added 3). 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.
embassy_stm32::flash::c5::blocking_wait_ready (cognitive 18) embassy-stm32/src/flash/c5.rs:259— embassy_stm32::flash::c5::blocking_wait_ready has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 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.
embassy_stm32::rcc::f247::init (cognitive 17) embassy-stm32/src/rcc/f247.rs:163— embassy_stm32::rcc::f247::init has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (8 pts), match/switch 5 (6 pts), if/else 3 (nesting depth added 2). 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.
FunctionTooLong: embassy_stm32::rcc::h::init embassy-stm32/src/rcc/h.rs:328— FunctionTooLong — embassy_stm32::rcc::h::init runs 381 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 281 over it, 3.81× 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: embassy_nrf::init embassy-nrf/src/lib.rs:801— FunctionTooLong — embassy_nrf::init 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.
FunctionTooLong: embassy_stm32::rcc::l::init embassy-stm32/src/rcc/l.rs:178— FunctionTooLong — embassy_stm32::rcc::l::init runs 256 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 156 over it, 2.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.
FunctionTooLong: embassy_stm32::rcc::u5::init embassy-stm32/src/rcc/u5.rs:180— FunctionTooLong — embassy_stm32::rcc::u5::init runs 233 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 133 over it, 2.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: embassy_rp::clocks::init embassy-rp/src/clocks.rs:979— FunctionTooLong — embassy_rp::clocks::init runs 221 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 121 over it, 2.21× 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: embassy_stm32::rcc::f013::init embassy-stm32/src/rcc/f013.rs:178— FunctionTooLong — embassy_stm32::rcc::f013::init runs 205 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 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: embassy_stm32::init_hw embassy-stm32/src/lib.rs:792— FunctionTooLong — embassy_stm32::init_hw runs 189 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 89 over it, 1.89× 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: embassy_stm32::rcc::u3::init embassy-stm32/src/rcc/u3.rs:186— FunctionTooLong — embassy_stm32::rcc::u3::init runs 184 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 84 over it, 1.84× 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: embassy_stm32::rcc::n6::init embassy-stm32/src/rcc/n6.rs:1212— FunctionTooLong — embassy_stm32::rcc::n6::init runs 179 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 79 over it, 1.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: embassy_stm32::rcc::n6::init_osc embassy-stm32/src/rcc/n6.rs:890— FunctionTooLong — embassy_stm32::rcc::n6::init_osc runs 174 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 74 over it, 1.74× 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: embassy_stm32::rcc::n6::enable_low_power_peripherals embassy-stm32/src/rcc/n6.rs:468— FunctionTooLong — embassy_stm32::rcc::n6::enable_low_power_peripherals runs 154 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 54 over it, 1.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.
FunctionTooLong: embassy_stm32::rcc::f247::init embassy-stm32/src/rcc/f247.rs:163— FunctionTooLong — embassy_stm32::rcc::f247::init runs 151 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 51 over it, 1.51× 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: embassy_executor_macros::macros::task::run embassy-executor-macros/src/macros/task.rs:21— FunctionTooLong — embassy_executor_macros::macros::task::run runs 142 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 42 over it, 1.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.
FunctionTooLong: embassy_stm32::rcc::wba::init embassy-stm32/src/rcc/wba.rs:264— FunctionTooLong — embassy_stm32::rcc::wba::init runs 137 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 37 over it, 1.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.
FunctionTooLong: embassy_usb_synopsys_otg::host::on_host_interrupt embassy-usb-synopsys-otg/src/host.rs:176— FunctionTooLong — embassy_usb_synopsys_otg::host::on_host_interrupt runs 135 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 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: embassy_stm32::rcc::g4::init embassy-stm32/src/rcc/g4.rs:126— FunctionTooLong — embassy_stm32::rcc::g4::init runs 132 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 32 over it, 1.32× 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: embassy_stm32::rcc::n6::init_clocks embassy-stm32/src/rcc/n6.rs:282— FunctionTooLong — embassy_stm32::rcc::n6::init_clocks runs 132 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 32 over it, 1.32× 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: embassy_stm32::usart::configure embassy-stm32/src/usart/mod.rs:2601— FunctionTooLong — embassy_stm32::usart::configure runs 132 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 32 over it, 1.32× 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: embassy_stm32::rcc::g0::init embassy-stm32/src/rcc/g0.rs:134— FunctionTooLong — embassy_stm32::rcc::g0::init runs 125 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 25 over it, 1.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: embassy_stm32::rcc::h::flash_setup embassy-stm32/src/rcc/h.rs:1095— FunctionTooLong — embassy_stm32::rcc::h::flash_setup runs 112 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 12 over it, 1.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.
FunctionTooLong: embassy_net_nrf91::new_internal embassy-net-nrf91/src/lib.rs:115— FunctionTooLong — embassy_net_nrf91::new_internal runs 109 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 9 over it, 1.09× 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: embassy_stm32_wpan::bluetooth::gap_init::init_gap_and_hal embassy-stm32-wpan/src/bluetooth/gap_init.rs:269— FunctionTooLong — embassy_stm32_wpan::bluetooth::gap_init::init_gap_and_hal runs 107 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 7 over it, 1.07× 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: embassy_executor_macros::macros::main::run embassy-executor-macros/src/macros/main.rs:78— FunctionTooLong — embassy_executor_macros::macros::main::run runs 102 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 2 over it, 1.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.
FunctionTooLong: embassy_mcxa::flexcan::classic::mailbox::rx::setup embassy-mcxa/src/flexcan/classic/mailbox.rs:432— FunctionTooLong — embassy_mcxa::flexcan::classic::mailbox::rx::setup runs 102 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 2 over it, 1.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.
FunctionTooLong: embassy_usb_synopsys_otg::on_interrupt embassy-usb-synopsys-otg/src/lib.rs:38— FunctionTooLong — embassy_usb_synopsys_otg::on_interrupt runs 102 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 2 over it, 1.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.
embassy_stm32::rcc::h::init (cyclomatic 83) embassy-stm32/src/rcc/h.rs:328— embassy_stm32::rcc::h::init has cyclomatic complexity 83 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: embassy_stm32::rcc::h::flash_setup (cyclomatic 93) 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 function is counted neither in this dimension's figures nor in its score.
embassy_stm32::rcc::u5::init (cyclomatic 64) embassy-stm32/src/rcc/u5.rs:180— embassy_stm32::rcc::u5::init has cyclomatic complexity 64 (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.
embassy_stm32::rcc::n6::init_osc (cyclomatic 56) embassy-stm32/src/rcc/n6.rs:890— embassy_stm32::rcc::n6::init_osc has cyclomatic complexity 56 (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.
embassy_stm32::rcc::l::init (cyclomatic 55) embassy-stm32/src/rcc/l.rs:178— embassy_stm32::rcc::l::init has cyclomatic complexity 55 (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.
embassy_stm32::rcc::u3::init (cyclomatic 50) embassy-stm32/src/rcc/u3.rs:186— embassy_stm32::rcc::u3::init has cyclomatic complexity 50 (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.
embassy_stm32::rcc::init_rcc (cyclomatic 49) embassy-stm32/src/rcc/mod.rs:667— embassy_stm32::rcc::init_rcc 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.
embassy_stm32::rcc::f247::init (cyclomatic 41) embassy-stm32/src/rcc/f247.rs:163— embassy_stm32::rcc::f247::init has cyclomatic complexity 41 (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.
embassy_stm32::rcc::n6::init_clocks (cyclomatic 41) embassy-stm32/src/rcc/n6.rs:282— embassy_stm32::rcc::n6::init_clocks has cyclomatic complexity 41 (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.
embassy_stm32::rcc::wba::init (cyclomatic 41) embassy-stm32/src/rcc/wba.rs:264— embassy_stm32::rcc::wba::init has cyclomatic complexity 41 (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.
embassy_stm32::rcc::f013::init (cyclomatic 39) embassy-stm32/src/rcc/f013.rs:178— embassy_stm32::rcc::f013::init has cyclomatic complexity 39 (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.
embassy_stm32::rcc::g4::init (cyclomatic 30) embassy-stm32/src/rcc/g4.rs:126— embassy_stm32::rcc::g4::init has cyclomatic complexity 30 (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.
embassy_stm32::rcc::g0::init (cyclomatic 28) embassy-stm32/src/rcc/g0.rs:134— embassy_stm32::rcc::g0::init has cyclomatic complexity 28 (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.
embassy_stm32::rcc::c5::init (cyclomatic 27) embassy-stm32/src/rcc/c5.rs:79— embassy_stm32::rcc::c5::init has cyclomatic complexity 27 (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.
embassy_stm32::usart::buffered::on_interrupt (cyclomatic 26) embassy-stm32/src/usart/buffered.rs:35— embassy_stm32::usart::buffered::on_interrupt 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.
embassy_stm32::usart::configure (cyclomatic 26) embassy-stm32/src/usart/mod.rs:2601— embassy_stm32::usart::configure has cyclomatic complexity 26 (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.
embassy_stm32::rcc::f247::init_pll (cyclomatic 23) embassy-stm32/src/rcc/f247.rs:431— embassy_stm32::rcc::f247::init_pll 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.
embassy_stm32::rcc::l::pll::init_pll (cyclomatic 20) embassy-stm32/src/rcc/l.rs:708— embassy_stm32::rcc::l::pll::init_pll 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.
embassy_stm32::rcc::c0::init (cyclomatic 20) embassy-stm32/src/rcc/c0.rs:99— embassy_stm32::rcc::c0::init 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.
embassy_stm32::low_power::platform::exit_stop (cyclomatic 20) embassy-stm32/src/low_power.rs:201— embassy_stm32::low_power::platform::exit_stop 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.
embassy_stm32::dma::dma_bdma::on_irq (cyclomatic 18) embassy-stm32/src/dma/dma_bdma.rs:17— embassy_stm32::dma::dma_bdma::on_irq 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.
embassy_stm32::rcc::u5::init_pll (cyclomatic 18) embassy-stm32/src/rcc/u5.rs:610— embassy_stm32::rcc::u5::init_pll 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.
embassy_stm32::rcc::h::init_pll (cyclomatic 16) embassy-stm32/src/rcc/h.rs:961— embassy_stm32::rcc::h::init_pll 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. This is NOT this file's highest cyclomatic complexity: embassy_stm32::rcc::h::flash_setup (cyclomatic 93) 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 function is counted neither in this dimension's figures nor in its score.
FixmeComment embassy-mspm0/src/dma.rs:555— // FIXME: Why did putting set_req later fix some transfers — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-mspm0/src/adc.rs:451— // FIXME: Consider clock config — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-mspm0/src/low_power/mod.rs:122— // FIXME: This could be a problem for embassy-executor's default executor. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-mspm0/src/sysctl/mod.rs:201— // FIXME: Config (pull, invert, etc?) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-mspm0/src/sysctl/mod.rs:203— // FIXME: Infallible operation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-mspm0/src/sysctl/h321x.rs:53— // FIXME: Wrong name from SVD — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-mspm0/src/sysctl/c1105_1106.rs:53— // FIXME: Wrong name from SVD — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-mspm0/src/sysctl/c1103_1104.rs:53— // FIXME: Wrong name from SVD — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-mspm0/src/sysctl/g511x_518x.rs:68— // FIXME: Update SVD to define _RESERVED_6 as USBFLL — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-nxp/src/gpio/rt1xxx.rs:652— // FIXME: These don't always need to be 32 entries. GPIO5 on RT1101 contains a single pin and GPIO2 only 14. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-rp/src/usb/mod.rs:16— // FIXME(svd): Add EPX to svd — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-rp/src/usb/mod.rs:115— // FIXME: Compat — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-rp/src/usb/host.rs:868— // FIXME: Stall derived from other place — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-rp/src/usb/host.rs:930— // FIXME: RX Timeout with LS device on hub — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-stm32/src/can/fdcan.rs:1079— // error reporting in this driver should have a big ol' FIXME on it — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-stm32/src/dma/gpdma/ringbuffered.rs:3— //! FIXME: Add request_pause functionality? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-stm32/src/dma/gpdma/ringbuffered.rs:4— //! FIXME: Stop the DMA, if a user does not queue new transfers (chain of linked-list items ends automatically). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-stm32/src/dsihost/mod.rs:297— // FIXME: This might be a generic long packet, as well... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-stm32/src/spdifrx/mod.rs:193— // Write parity bit to the data register. FIXME: Add parity check. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-stm32/src/usb/usb.rs:383— // FIXME: Bulk endpoints can be double buffered, but are not in the current implementation. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-usb-host/src/descriptor.rs:136— // FIXME use Self::BUF_SIZE when stable is able to use constant expressions with generics — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment embassy-usb/src/class/uac1/mod.rs:16— /// FIXME: Use `core::mem::variant_count(...)` when stabilized. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TooManyFields: Peripherals embassy-nrf/src/chips/nrf54l05_app.rs:203— TooManyFields — 227 stored fields beside 3 methods. The bar is 30 stored fields; this is 197 over it, 7.57× 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: Peripherals embassy-nrf/src/chips/nrf54l10_app.rs:203— TooManyFields — 227 stored fields beside 3 methods. The bar is 30 stored fields; this is 197 over it, 7.57× 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: Peripherals embassy-nrf/src/chips/nrf54l15_app.rs:203— TooManyFields — 227 stored fields beside 3 methods. The bar is 30 stored fields; this is 197 over it, 7.57× 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: Peripherals embassy-nrf/src/chips/nrf52840.rs:10— TooManyFields — 133 stored fields beside 3 methods. The bar is 30 stored fields; this is 103 over it, 4.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: Peripherals embassy-nrf/src/chips/nrf52833.rs:10— TooManyFields — 129 stored fields beside 3 methods. The bar is 30 stored fields; this is 99 over it, 4.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: Peripherals embassy-nrf/src/chips/nrf5340_app.rs:174— TooManyFields — 128 stored fields beside 3 methods. The bar is 30 stored fields; this is 98 over it, 4.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: Peripherals embassy-nrf/src/chips/nrf5340_net.rs:57— TooManyFields — 115 stored fields beside 3 methods. The bar is 30 stored fields; this is 85 over it, 3.83× 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: Peripherals embassy-nrf/src/chips/nrf52832.rs:14— TooManyFields — 109 stored fields beside 3 methods. The bar is 30 stored fields; this is 79 over it, 3.63× 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: Peripherals embassy-rp/src/lib.rs:320— TooManyFields — 102 stored fields. The bar is 30 stored fields; this is 72 over it, 3.40× 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: Peripherals embassy-nrf/src/chips/nrf52820.rs:10— TooManyFields — 100 stored fields beside 3 methods. The bar is 30 stored fields; this is 70 over it, 3.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: Peripherals embassy-nrf/src/chips/nrf52810.rs:10— TooManyFields — 97 stored fields beside 3 methods. The bar is 30 stored fields; this is 67 over it, 3.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: Peripherals embassy-nrf/src/chips/nrf52811.rs:10— TooManyFields — 97 stored fields beside 3 methods. The bar is 30 stored fields; this is 67 over it, 3.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: Peripherals embassy-nrf/src/chips/nrf52805.rs:10— TooManyFields — 95 stored fields beside 3 methods. The bar is 30 stored fields; this is 65 over it, 3.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: Peripherals embassy-nrf/src/chips/nrf9120.rs:138— TooManyFields — 88 stored fields beside 3 methods. The bar is 30 stored fields; this is 58 over it, 2.93× 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: Peripherals embassy-nrf/src/chips/nrf9160.rs:138— TooManyFields — 88 stored fields beside 3 methods. The bar is 30 stored fields; this is 58 over it, 2.93× 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: Counters embassy-mcxa/src/perf_counters.rs:117— TooManyFields — 84 stored fields beside 1 method. The bar is 30 stored fields; this is 54 over it, 2.80× 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: Report embassy-mcxa/src/perf_counters.rs:110— TooManyFields — 84 stored fields. The bar is 30 stored fields; this is 54 over it, 2.80× 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: Peripherals embassy-rp/src/lib.rs:232— TooManyFields — 72 stored fields beside 3 methods. The bar is 30 stored fields; this is 42 over it, 2.40× 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: Peripherals embassy-nrf/src/chips/nrf51.rs:5— TooManyFields — 70 stored fields beside 3 methods. The bar is 30 stored fields; this is 40 over it, 2.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: Peripherals embassy-ambiq/src/lib.rs:12— TooManyFields — 56 stored fields beside 3 methods. The bar is 30 stored fields; this is 26 over it, 1.87× 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: FlexspiMemConfig embassy-mcxa/src/rom/flexspi_nor.rs:231— TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× 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: Config embassy-stm32/src/rcc/n6.rs:128— TooManyFields — 41 stored fields beside 1 method. 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.
I2c::read_frame (cognitive 62) embassy-stm32/src/i2c/v1.rs:722— I2c::read_frame has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (40 pts), match/switch 7 (15 pts), boolean chains 7 (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.
I2c::write_frame (cognitive 50) embassy-stm32/src/i2c/v1.rs:488— I2c::write_frame has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 7 (13 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.
I2c::execute_read_group (cognitive 37) embassy-stm32/src/i2c/v2.rs:742— I2c::execute_read_group has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 3 (8 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.
I2c::blocking_write_vectored (cognitive 37) embassy-stm32/src/i2c/v2.rs:834— I2c::blocking_write_vectored has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 3 (6 pts), boolean chains 5 (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.
I2c::blocking_read_timeout (cognitive 31) embassy-stm32/src/i2c/v1.rs:293— I2c::blocking_read_timeout has cognitive complexity 31 (threshold 15). Drivers by points: loops 7 (18 pts), if/else 6 (9 pts), boolean chains 2, match/switch 1 (2 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.
I2c::write_bytes (cognitive 30) embassy-stm32/src/i2c/v1.rs:156— I2c::write_bytes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (9 pts), boolean chains 3, match/switch 1 (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.
I2c::execute_read_group_async (cognitive 30) embassy-stm32/src/i2c/v2.rs:1384— I2c::execute_read_group_async has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 2, loops 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.
I2c::write_dma_internal (cognitive 25) embassy-stm32/src/i2c/v2.rs:925— I2c::write_dma_internal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
I2c::write_dma_internal_slave (cognitive 24) embassy-stm32/src/i2c/v2.rs:2238— I2c::write_dma_internal_slave has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (23 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.
I2c::execute_write_group (cognitive 21) embassy-stm32/src/i2c/v2.rs:666— I2c::execute_write_group has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
I2c::read_dma_internal (cognitive 20) embassy-stm32/src/i2c/v2.rs:1061— I2c::read_dma_internal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
I2c::execute_slave_transmit_transfer (cognitive 19) embassy-stm32/src/i2c/v1.rs:1870— I2c::execute_slave_transmit_transfer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 3 (8 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.
I2c::write_internal (cognitive 19) embassy-stm32/src/i2c/v2.rs:507— I2c::write_internal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 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.
I2c::read_dma_internal_slave (cognitive 18) embassy-stm32/src/i2c/v2.rs:2066— I2c::read_dma_internal_slave has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), 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.
I2c::blocking_respond_to_read (cognitive 17) embassy-mcxa/src/i2c/target.rs:572— I2c::blocking_respond_to_read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 3 (4 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.
I2c::write_dma_chunk (cognitive 17) embassy-mcxa/src/i2c/target.rs:889— I2c::write_dma_chunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (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.
I2c::execute_slave_receive_transfer (cognitive 17) embassy-stm32/src/i2c/v1.rs:1767— I2c::execute_slave_receive_transfer has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (7 pts), boolean chains 1 (nesting depth added 8). 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.
I2c::read_dma_group_internal (cognitive 17) embassy-stm32/src/i2c/v2.rs:1470— I2c::read_dma_group_internal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 1 (2 pts), 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.
I2c::slave_read_internal (cognitive 17) embassy-stm32/src/i2c/v2.rs:1724— I2c::slave_read_internal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
I2c::set_configuration (cognitive 16) embassy-mcxa/src/i2c/target.rs:354— I2c::set_configuration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 5). 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.
I2c::async_respond_to_read_internal (cognitive 16) embassy-mcxa/src/i2c/target.rs:1247— I2c::async_respond_to_read_internal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (15 lines × 2) embassy-mcxa/src/i3c/controller.rs:935— embassy-mcxa/src/i3c/controller.rs:935-949 | embassy-mcxa/src/i3c/controller.rs:1119-1133 — both copies are in the same file, so extract the 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) embassy-mcxa/src/i3c/controller.rs:1041— embassy-mcxa/src/i3c/controller.rs:1041-1055 | embassy-mcxa/src/i3c/controller.rs:1364-1378 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:689— embassy-net-esp-hosted/src/proto/fg/mod.rs:689-703 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16101-16115 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (15 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:1367— embassy-net-esp-hosted/src/proto/fg/mod.rs:1367-1381 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17029-17043 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (15 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:8346— embassy-net-esp-hosted/src/proto/fg/mod.rs:8346-8360 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19674-19688 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (15 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:20963— embassy-net-esp-hosted/src/proto/mcu/mod.rs:20963-20977 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21237-21251 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:23594— embassy-net-esp-hosted/src/proto/mcu/mod.rs:23594-23608 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23934-23948 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:41639— embassy-net-esp-hosted/src/proto/mcu/mod.rs:41639-41653 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41850-41864 — both copies are in the same file, so extract the 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) embassy-nrf/src/buffered_uarte/v1.rs:533— embassy-nrf/src/buffered_uarte/v1.rs:533-547 | embassy-nrf/src/buffered_uarte/v2.rs:435-449 — before extracting anything, compare `embassy-nrf/src/buffered_uarte/v1.rs` and `embassy-nrf/src/buffered_uarte/v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (15 lines × 2) embassy-nrf/src/buffered_uarte/v2.rs:355— embassy-nrf/src/buffered_uarte/v2.rs:355-369 | embassy-nrf/src/buffered_uarte/v2.rs:544-558 — both copies are in the same file, so extract the 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) embassy-nxp/src/i2c/lpc55.rs:329— embassy-nxp/src/i2c/lpc55.rs:329-343 | embassy-nxp/src/i2c/lpc55.rs:574-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) embassy-rp/src/psram.rs:269— embassy-rp/src/psram.rs:269-283 | embassy-rp/src/psram.rs:475-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) embassy-stm32/src/adc/v2.rs:88— embassy-stm32/src/adc/v2.rs:88-102 | embassy-stm32/src/adc/v3.rs:146-160 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (15 lines × 2) embassy-stm32/src/dac/mod.rs:313— embassy-stm32/src/dac/mod.rs:313-327 | embassy-stm32/src/dac/mod.rs:348-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.
Duplicated block (15 lines × 2) embassy-stm32/src/eth/v1/ptp.rs:10— embassy-stm32/src/eth/v1/ptp.rs:10-24 | embassy-stm32/src/eth/v2/ptp.rs:10-24 — `embassy-stm32/src/eth/v1/ptp.rs` and `embassy-stm32/src/eth/v2/ptp.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 (15 lines × 2) embassy-stm32/src/i2c/v1.rs:1079— embassy-stm32/src/i2c/v1.rs:1079-1093 | embassy-stm32/src/i2c/v2.rs:1581-1595 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) embassy-stm32/src/i3c/controller.rs:75— embassy-stm32/src/i3c/controller.rs:75-89 | embassy-stm32/src/i3c/controller.rs:133-147 — both copies are in the same file, so extract the 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) embassy-stm32/src/sdmmc/mod.rs:597— embassy-stm32/src/sdmmc/mod.rs:597-611 | embassy-stm32/src/sdmmc/mod.rs:710-724 — both copies are in the same file, so extract the 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) embassy-stm32/src/spi/mod.rs:1718— embassy-stm32/src/spi/mod.rs:1718-1732 | embassy-stm32/src/spi/mod.rs:1784-1798 — both copies are in the same file, so extract the 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) embassy-stm32/src/usb/otg.rs:117— embassy-stm32/src/usb/otg.rs:117-131 | embassy-stm32/src/usb/otg.rs:155-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-ambiq/src/i2c.rs:178— embassy-ambiq/src/i2c.rs:178-196 | embassy-ambiq/src/i2c.rs:278-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-imxrt/src/flexcomm/uart.rs:159— embassy-imxrt/src/flexcomm/uart.rs:159-177 | embassy-imxrt/src/flexcomm/uart.rs:272-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-imxrt/src/flexcomm/uart.rs:632— embassy-imxrt/src/flexcomm/uart.rs:632-650 | embassy-imxrt/src/flexcomm/uart.rs:760-778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:2454— embassy-net-esp-hosted/src/proto/fg/mod.rs:2454-2472 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3692-3710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:8944— embassy-net-esp-hosted/src/proto/fg/mod.rs:8944-8962 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10991-11009 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (19 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:9668— embassy-net-esp-hosted/src/proto/fg/mod.rs:9668-9686 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36734-36752 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (19 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:12061— embassy-net-esp-hosted/src/proto/fg/mod.rs:12061-12079 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12626-12644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:8793— embassy-net-esp-hosted/src/proto/mcu/mod.rs:8793-8811 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34494-34512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:12772— embassy-net-esp-hosted/src/proto/mcu/mod.rs:12772-12790 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41325-41343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:34015— embassy-net-esp-hosted/src/proto/mcu/mod.rs:34015-34033 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34271-34289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:34785— embassy-net-esp-hosted/src/proto/mcu/mod.rs:34785-34803 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35049-35067 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:35916— embassy-net-esp-hosted/src/proto/mcu/mod.rs:35916-35934 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48661-48679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-nrf/src/buffered_uarte/v1.rs:186— embassy-nrf/src/buffered_uarte/v1.rs:186-204 | embassy-nrf/src/buffered_uarte/v2.rs:131-149 — before extracting anything, compare `embassy-nrf/src/buffered_uarte/v1.rs` and `embassy-nrf/src/buffered_uarte/v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (19 lines × 2) embassy-nrf/src/twis.rs:488— embassy-nrf/src/twis.rs:488-506 | embassy-nrf/src/twis.rs:594-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-stm32/src/cordic/mod.rs:387— embassy-stm32/src/cordic/mod.rs:387-405 | embassy-stm32/src/cordic/mod.rs:550-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) embassy-stm32/src/hspi/mod.rs:395— embassy-stm32/src/hspi/mod.rs:395-413 | embassy-stm32/src/ospi/mod.rs:718-736 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (21 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:8091— embassy-net-esp-hosted/src/proto/fg/mod.rs:8091-8111 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19577-19597 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (21 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:8543— embassy-net-esp-hosted/src/proto/fg/mod.rs:8543-8563 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36383-36403 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (21 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11916— embassy-net-esp-hosted/src/proto/fg/mod.rs:11916-11936 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12571-12591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:35369— embassy-net-esp-hosted/src/proto/mcu/mod.rs:35369-35389 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35894-35914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:41515— embassy-net-esp-hosted/src/proto/mcu/mod.rs:41515-41535 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41754-41774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) embassy-nrf/src/buffered_uarte/v1.rs:577— embassy-nrf/src/buffered_uarte/v1.rs:577-597 | embassy-nrf/src/buffered_uarte/v2.rs:479-499 — before extracting anything, compare `embassy-nrf/src/buffered_uarte/v1.rs` and `embassy-nrf/src/buffered_uarte/v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (21 lines × 2) embassy-nrf/src/twim.rs:379— embassy-nrf/src/twim.rs:379-399 | embassy-nrf/src/twis.rs:413-433 — before extracting anything, compare `embassy-nrf/src/twim.rs` and `embassy-nrf/src/twis.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (21 lines × 2) embassy-nxp/src/spi/lpc55.rs:181— embassy-nxp/src/spi/lpc55.rs:181-201 | embassy-nxp/src/usart/lpc55.rs:586-606 — `embassy-nxp/src/spi/lpc55.rs` and `embassy-nxp/src/usart/lpc55.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 48 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 (21 lines × 2) embassy-rp/src/multicore.rs:133— embassy-rp/src/multicore.rs:133-153 | embassy-rp/src/multicore.rs:162-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) embassy-stm32/src/dma/dma_bdma.rs:1396— embassy-stm32/src/dma/dma_bdma.rs:1396-1416 | embassy-stm32/src/dma/dma_bdma.rs:1573-1593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) embassy-stm32/src/dma/gpdma/ringbuffered.rs:112— embassy-stm32/src/dma/gpdma/ringbuffered.rs:112-132 | embassy-stm32/src/dma/gpdma/ringbuffered.rs:292-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) embassy-stm32/src/ospi/mod.rs:620— embassy-stm32/src/ospi/mod.rs:620-640 | embassy-stm32/src/ospi/mod.rs:913-933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) embassy-stm32/src/flash/f2.rs:64— embassy-stm32/src/flash/f2.rs:64-84 | embassy-stm32/src/flash/f4.rs:135-155 — before extracting anything, compare `embassy-stm32/src/flash/f2.rs` and `embassy-stm32/src/flash/f4.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (21 lines × 2) embassy-stm32-wpan/src/bluetooth/gap/advertiser.rs:170— embassy-stm32-wpan/src/bluetooth/gap/advertiser.rs:170-190 | embassy-stm32-wpan/src/bluetooth/gap/advertiser.rs:198-218 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-executor/src/platform/cortex_m.rs:25— embassy-executor/src/platform/cortex_m.rs:25-48 | embassy-stm32/src/executor.rs:55-78 — before extracting anything, compare `embassy-executor/src/platform/cortex_m.rs` and `embassy-stm32/src/executor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 (24 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:21417— embassy-net-esp-hosted/src/proto/mcu/mod.rs:21417-21440 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22348-22371 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:22542— embassy-net-esp-hosted/src/proto/mcu/mod.rs:22542-22565 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22890-22913 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:23042— embassy-net-esp-hosted/src/proto/mcu/mod.rs:23042-23065 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23390-23413 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:25735— embassy-net-esp-hosted/src/proto/mcu/mod.rs:25735-25758 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26612-26635 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:26789— embassy-net-esp-hosted/src/proto/mcu/mod.rs:26789-26812 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27292-27315 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:27532— embassy-net-esp-hosted/src/proto/mcu/mod.rs:27532-27555 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28035-28058 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:38509— embassy-net-esp-hosted/src/proto/mcu/mod.rs:38509-38532 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38857-38880 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-nrf/src/twim.rs:406— embassy-nrf/src/twim.rs:406-429 | embassy-nrf/src/twis.rs:440-463 — before extracting anything, compare `embassy-nrf/src/twim.rs` and `embassy-nrf/src/twis.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (24 lines × 2) embassy-stm32/src/can/fd/message_ram/rxfifo_element.rs:91— embassy-stm32/src/can/fd/message_ram/rxfifo_element.rs:91-114 | embassy-stm32/src/can/fd/message_ram/txbuffer_element.rs:343-366 — 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 (24 lines × 2) embassy-stm32/src/sdmmc/mod.rs:1479— embassy-stm32/src/sdmmc/mod.rs:1479-1502 | embassy-stm32/src/sdmmc/mod.rs:1861-1884 — both copies are in the same file, so extract the 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 (24 lines × 2) embassy-stm32/src/sdmmc/mod.rs:1537— embassy-stm32/src/sdmmc/mod.rs:1537-1560 | embassy-stm32/src/sdmmc/mod.rs:1928-1951 — both copies are in the same file, so extract the 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) embassy-executor-macros/src/macros/main.rs:79— embassy-executor-macros/src/macros/main.rs:79-100 | embassy-executor-macros/src/macros/task.rs:22-43 — 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 (22 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:881— embassy-mcxa/src/lpuart/bbq.rs:881-902 | embassy-mcxa/src/lpuart/bbq.rs:1243-1264 — both copies are in the same file, so extract the 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) embassy-mcxa/src/chips/mcxa2xx.rs:61— embassy-mcxa/src/chips/mcxa2xx.rs:61-82 | embassy-mcxa/src/chips/mcxa5xx.rs:78-99 — before extracting anything, compare `embassy-mcxa/src/chips/mcxa2xx.rs` and `embassy-mcxa/src/chips/mcxa5xx.rs` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the 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 (22 lines × 2) embassy-microchip/src/i2c.rs:311— embassy-microchip/src/i2c.rs:311-332 | embassy-microchip/src/i2c.rs:599-620 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:2387— embassy-net-esp-hosted/src/proto/fg/mod.rs:2387-2408 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3625-3646 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:7106— embassy-net-esp-hosted/src/proto/fg/mod.rs:7106-7127 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24522-24543 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (22 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:9352— embassy-net-esp-hosted/src/proto/fg/mod.rs:9352-9373 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10674-10695 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (22 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:33989— embassy-net-esp-hosted/src/proto/mcu/mod.rs:33989-34010 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34239-34260 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:34759— embassy-net-esp-hosted/src/proto/mcu/mod.rs:34759-34780 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35017-35038 — both copies are in the same file, so extract the 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) embassy-nrf/src/rramc.rs:208— embassy-nrf/src/rramc.rs:208-229 | embassy-nrf/src/rramc.rs:299-320 — both copies are in the same file, so extract the 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) embassy-stm32/src/cryp/mod.rs:669— embassy-stm32/src/cryp/mod.rs:669-690 | embassy-stm32/src/cryp/mod.rs:1236-1257 — both copies are in the same file, so extract the 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) embassy-usb-host/src/class/cdc_acm.rs:188— embassy-usb-host/src/class/cdc_acm.rs:188-209 | embassy-usb-host/src/class/msc.rs:712-733 — 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 (18 lines × 2) embassy-mcxa/src/flexspi.rs:974— embassy-mcxa/src/flexspi.rs:974-991 | embassy-mcxa/src/flexspi.rs:1203-1220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) embassy-mspm0/src/i2c.rs:758— embassy-mspm0/src/i2c.rs:758-775 | embassy-mspm0/src/i2c.rs:819-836 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:620— embassy-net-esp-hosted/src/proto/fg/mod.rs:620-637 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16032-16049 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (18 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:1298— embassy-net-esp-hosted/src/proto/fg/mod.rs:1298-1315 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16960-16977 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (18 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:10815— embassy-net-esp-hosted/src/proto/fg/mod.rs:10815-10832 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48091-48108 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (18 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4547— embassy-net-esp-hosted/src/proto/mcu/mod.rs:4547-4564 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7332-7349 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:19406— embassy-net-esp-hosted/src/proto/mcu/mod.rs:19406-19423 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32239-32256 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:35407— embassy-net-esp-hosted/src/proto/mcu/mod.rs:35407-35424 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35945-35962 — both copies are in the same file, so extract the 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) embassy-nxp/src/casper/lpc55.rs:514— embassy-nxp/src/casper/lpc55.rs:514-531 | embassy-nxp/src/casper/lpc55.rs:555-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.
Duplicated block (18 lines × 2) embassy-stm32/src/rcc/f013.rs:422— embassy-stm32/src/rcc/f013.rs:422-439 | embassy-stm32/src/rcc/f013.rs:451-468 — both copies are in the same file, so extract the 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) embassy-stm32/src/rcc/f247.rs:183— embassy-stm32/src/rcc/f247.rs:183-200 | embassy-stm32/src/rcc/g4.rs:129-146 — before extracting anything, compare `embassy-stm32/src/rcc/f247.rs` and `embassy-stm32/src/rcc/g4.rs` as WHOLE FILES: this scan already matched 5 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.
Duplicated block (18 lines × 2) embassy-usb-host/src/class/hub.rs:61— embassy-usb-host/src/class/hub.rs:61-78 | embassy-usb-host/src/class/kbd.rs:60-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 3) embassy-mcxa/src/ctimer/pwm.rs:204— embassy-mcxa/src/ctimer/pwm.rs:204-216 | embassy-mcxa/src/ctimer/pwm.rs:317-329 | embassy-mcxa/src/ctimer/pwm.rs:453-465 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) embassy-nrf/src/nvmc.rs:165— embassy-nrf/src/nvmc.rs:165-177 | embassy-nrf/src/rramc.rs:212-224 | embassy-nrf/src/rramc.rs:303-315 — 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 (13 lines × 3) embassy-stm32/src/hspi/mod.rs:439— embassy-stm32/src/hspi/mod.rs:439-451 | embassy-stm32/src/ospi/mod.rs:760-772 | embassy-stm32/src/xspi/mod.rs:559-571 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (13 lines × 3) embassy-stm32/src/hspi/mod.rs:473— embassy-stm32/src/hspi/mod.rs:473-485 | embassy-stm32/src/ospi/mod.rs:815-827 | embassy-stm32/src/xspi/mod.rs:612-624 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (13 lines × 3) embassy-stm32/src/hspi/mod.rs:827— embassy-stm32/src/hspi/mod.rs:827-839 | embassy-stm32/src/ospi/mod.rs:1975-1987 | embassy-stm32/src/xspi/mod.rs:1776-1788 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (13 lines × 3) embassy-stm32/src/hspi/mod.rs:904— embassy-stm32/src/hspi/mod.rs:904-916 | embassy-stm32/src/ospi/mod.rs:2050-2062 | embassy-stm32/src/xspi/mod.rs:1853-1865 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (13 lines × 3) embassy-stm32/src/i2c/v1.rs:604— embassy-stm32/src/i2c/v1.rs:604-616 | embassy-stm32/src/i2c/v1.rs:823-835 | embassy-stm32/src/i2c/v1.rs:885-897 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) embassy-stm32/src/i3c/controller.rs:96— embassy-stm32/src/i3c/controller.rs:96-108 | embassy-stm32/src/i3c/controller.rs:115-127 | embassy-stm32/src/i3c/controller.rs:154-166 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) embassy-stm32/src/rcc/f013.rs:194— embassy-stm32/src/rcc/f013.rs:194-206 | embassy-stm32/src/rcc/f247.rs:190-202 | embassy-stm32/src/rcc/g4.rs:136-148 — before extracting anything, compare `embassy-stm32/src/rcc/f013.rs` and `embassy-stm32/src/rcc/f247.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (13 lines × 3) embassy-stm32/src/flash/f2.rs:68— embassy-stm32/src/flash/f2.rs:68-80 | embassy-stm32/src/flash/f4.rs:139-151 | embassy-stm32/src/flash/f7.rs:55-67 — before extracting anything, compare `embassy-stm32/src/flash/f2.rs` and `embassy-stm32/src/flash/f4.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) embassy-usb-host/src/class/cdc_acm.rs:195— embassy-usb-host/src/class/cdc_acm.rs:195-207 | embassy-usb-host/src/class/msc.rs:719-731 | embassy-usb-host/src/class/vcp/cp210x.rs:648-660 — 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 (13 lines × 3) embassy-usb-host/src/descriptor.rs:190— embassy-usb-host/src/descriptor.rs:190-202 | embassy-usb-host/src/descriptor.rs:252-264 | embassy-usb-host/src/descriptor.rs:329-341 — 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) embassy-mcxa/src/spi/controller.rs:929— embassy-mcxa/src/spi/controller.rs:929-935 | embassy-mcxa/src/spi/controller.rs:1011-1017 | embassy-mcxa/src/spi/controller.rs:1042-1048 — 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:6813— embassy-net-esp-hosted/src/proto/fg/mod.rs:6813-6819 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24229-24235 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24666-24672 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (7 lines × 3) embassy-net-esp-hosted/src/proto/mcu/mod.rs:16738— embassy-net-esp-hosted/src/proto/mcu/mod.rs:16738-16744 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34328-34334 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45104-45110 — 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) embassy-nrf/src/buffered_uarte/v1.rs:454— embassy-nrf/src/buffered_uarte/v1.rs:454-460 | embassy-nrf/src/buffered_uarte/v2.rs:358-364 | embassy-nrf/src/buffered_uarte/v2.rs:547-553 — before extracting anything, compare `embassy-nrf/src/buffered_uarte/v1.rs` and `embassy-nrf/src/buffered_uarte/v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-nrf/src/spim.rs:474— embassy-nrf/src/spim.rs:474-480 | embassy-nrf/src/twim.rs:349-355 | embassy-nrf/src/twis.rs:380-386 — before extracting anything, compare `embassy-nrf/src/twim.rs` and `embassy-nrf/src/twis.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-stm32/src/hspi/mod.rs:504— embassy-stm32/src/hspi/mod.rs:504-510 | embassy-stm32/src/hspi/mod.rs:777-783 | embassy-stm32/src/hspi/mod.rs:853-859 — 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) embassy-stm32/src/hspi/mod.rs:926— embassy-stm32/src/hspi/mod.rs:926-932 | embassy-stm32/src/ospi/mod.rs:2072-2078 | embassy-stm32/src/xspi/mod.rs:1875-1881 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (7 lines × 3) embassy-stm32/src/i2c/v2.rs:136— embassy-stm32/src/i2c/v2.rs:136-142 | embassy-stm32/src/i2c/v2.rs:2508-2514 | embassy-stm32/src/i2c/v2.rs:2529-2535 — 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) embassy-stm32/src/timer/input_capture.rs:473— embassy-stm32/src/timer/input_capture.rs:473-479 | embassy-stm32/src/timer/one_pulse.rs:391-397 | embassy-stm32/src/timer/pwm_input.rs:168-174 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) embassy-stm32/src/xspi/mod.rs:643— embassy-stm32/src/xspi/mod.rs:643-649 | embassy-stm32/src/xspi/mod.rs:1726-1732 | embassy-stm32/src/xspi/mod.rs:1802-1808 — 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) embassy-stm32/src/adc/v1.rs:694— embassy-stm32/src/adc/v1.rs:694-700 | embassy-stm32/src/adc/v2.rs:715-721 | embassy-stm32/src/adc/v3.rs:872-878 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (5 lines × 3) embassy-mcxa/src/spi/controller.rs:265— embassy-mcxa/src/spi/controller.rs:265-269 | embassy-mcxa/src/spi/controller.rs:290-295 | embassy-mcxa/src/spi/controller.rs:365-370 — 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) embassy-nrf/src/buffered_uarte/v1.rs:322— embassy-nrf/src/buffered_uarte/v1.rs:322-326 | embassy-nrf/src/buffered_uarte/v1.rs:458-462 | embassy-nrf/src/buffered_uarte/v1.rs:704-708 — 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) embassy-nrf/src/buffered_uarte/v2.rs:229— embassy-nrf/src/buffered_uarte/v2.rs:229-233 | embassy-nrf/src/buffered_uarte/v2.rs:362-366 | embassy-nrf/src/buffered_uarte/v2.rs:551-555 — 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) embassy-rp/src/flash.rs:539— embassy-rp/src/flash.rs:539-543 | embassy-rp/src/flash.rs:572-576 | embassy-rp/src/flash.rs:610-614 — 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) embassy-stm32/src/dma/dma_bdma.rs:477— embassy-stm32/src/dma/dma_bdma.rs:477-481 | embassy-stm32/src/dma/dma_bdma.rs:485-489 | embassy-stm32/src/dma/gpdma/mod.rs:530-534 — 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) embassy-stm32/src/hspi/mod.rs:522— embassy-stm32/src/hspi/mod.rs:522-526 | embassy-stm32/src/ospi/mod.rs:862-866 | embassy-stm32/src/xspi/mod.rs:661-665 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (5 lines × 3) embassy-stm32/src/hspi/mod.rs:541— embassy-stm32/src/hspi/mod.rs:541-546 | embassy-stm32/src/hspi/mod.rs:817-821 | embassy-stm32/src/hspi/mod.rs:893-897 — 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) embassy-stm32/src/hspi/mod.rs:553— embassy-stm32/src/hspi/mod.rs:553-557 | embassy-stm32/src/ospi/mod.rs:893-897 | embassy-stm32/src/xspi/mod.rs:692-696 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (5 lines × 3) embassy-stm32/src/ospi/mod.rs:881— embassy-stm32/src/ospi/mod.rs:881-886 | embassy-stm32/src/ospi/mod.rs:1964-1968 | embassy-stm32/src/ospi/mod.rs:2039-2043 — 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) embassy-stm32/src/rcc/c0.rs:135— embassy-stm32/src/rcc/c0.rs:135-139 | embassy-stm32/src/rcc/f013.rs:212-216 | embassy-stm32/src/rcc/f247.rs:208-212 — before extracting anything, compare `embassy-stm32/src/rcc/f013.rs` and `embassy-stm32/src/rcc/f247.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (5 lines × 3) embassy-stm32/src/ltdc.rs:294— embassy-stm32/src/ltdc.rs:294-298 | embassy-stm32/src/ltdc.rs:354-358 | embassy-stm32/src/ltdc.rs:423-427 — 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.
Runner::run (cognitive 66) embassy-net-adin1110/src/lib.rs:354— Runner::run has cognitive complexity 66 (threshold 15). Drivers by points: if/else 15 (45 pts), match/switch 4 (17 pts), loops 2 (4 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runner::rx (cognitive 59) cyw43/src/runner.rs:1057— Runner::rx has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (49 pts), match/switch 4 (8 pts), boolean chains 2 (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.
Runner::check_status (cognitive 34) cyw43/src/runner.rs:987— Runner::check_status has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runner::run (cognitive 29) embassy-net-adin1110/src/lib.rs:522— Runner::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 3 (10 pts), loops 2 (3 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.
Runner::run (cognitive 25) embassy-net-ppp/src/lib.rs:69— Runner::run has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 7 (20 pts), if/else 1 (4 pts), 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.
Runner::handle_irq (cognitive 21) cyw43/src/runner.rs:891— Runner::handle_irq has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 1 (nesting depth added 11). 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.
Runner::run (cognitive 19) embassy-stm32-wpan/src/net/runner.rs:24— Runner::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), loops 3 (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.
Runner::init (cognitive 18) cyw43/src/runner.rs:486— Runner::init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 6, boolean chains 2 (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.
Runner::run (cognitive 18) embassy-net-esp-hosted/src/lib.rs:243— Runner::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runner::run (cognitive 16) cyw43/src/runner.rs:764— Runner::run 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.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×10
Members sharing a duplicated core (5 members, 50+ identical tokens) embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:54— embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:54-63 | embassy-mspm0/src/sysctl/g151x_351x.rs:54-63 | embassy-mspm0/src/sysctl/g511x_518x.rs:60-71 | embassy-mspm0/src/sysctl/h321x.rs:48-57 | embassy-mspm0/src/sysctl/l_typeb.rs:48-56 — 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) embassy-net-nrf91/src/context.rs:103— embassy-net-nrf91/src/context.rs:103-150 | embassy-net-nrf91/src/context.rs:153-164 | embassy-net-nrf91/src/context.rs:167-178 | embassy-net-nrf91/src/context.rs:308-321 | embassy-net-nrf91/src/context.rs:324-345 — 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) embassy-nxp/src/casper/lpc55.rs:315— embassy-nxp/src/casper/lpc55.rs:315-335 | embassy-nxp/src/casper/lpc55.rs:347-365 | embassy-nxp/src/casper/lpc55.rs:377-397 | embassy-nxp/src/casper/lpc55.rs:412-432 | embassy-nxp/src/casper/lpc55.rs:447-467 — 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) embassy-stm32/src/hash/mod.rs:375— embassy-stm32/src/hash/mod.rs:375-466 | embassy-stm32/src/hash/mod.rs:474-553 | embassy-stm32/src/hash/mod.rs:566-624 | embassy-stm32/src/hash/mod.rs:851-939 | embassy-stm32/src/hash/mod.rs:952-1025 — 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) embassy-stm32/src/hspi/mod.rs:317— embassy-stm32/src/hspi/mod.rs:317-378 | embassy-stm32/src/ospi/mod.rs:554-703 | embassy-stm32/src/ospi/mod.rs:900-967 | embassy-stm32/src/xspi/mod.rs:335-483 | embassy-stm32/src/xspi/mod.rs:699-765 — 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) embassy-stm32/src/jpeg.rs:228— embassy-stm32/src/jpeg.rs:228-261 | embassy-stm32/src/jpeg.rs:276-343 | embassy-stm32/src/jpeg.rs:379-518 | embassy-stm32/src/jpeg.rs:525-612 | embassy-stm32/src/jpeg.rs:617-730 — 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) embassy-stm32/src/rcc/c0.rs:99— embassy-stm32/src/rcc/c0.rs:99-240 | embassy-stm32/src/rcc/f013.rs:178-517 | embassy-stm32/src/rcc/f247.rs:163-379 | embassy-stm32/src/rcc/g0.rs:134-328 | embassy-stm32/src/rcc/g4.rs:126-338 — 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) embassy-stm32/src/sdmmc/mod.rs:589— embassy-stm32/src/sdmmc/mod.rs:589-611 | embassy-stm32/src/sdmmc/mod.rs:703-724 | embassy-stm32/src/sdmmc/mod.rs:744-765 | embassy-stm32/src/sdmmc/mod.rs:825-844 | embassy-stm32/src/sdmmc/mod.rs:896-915 — 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) embassy-stm32-wpan/src/bluetooth/security/mod.rs:989— embassy-stm32-wpan/src/bluetooth/security/mod.rs:989-1028 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1075-1110 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1114-1144 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1252-1268 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1301-1337 — 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) embassy-usb-host/src/class/uac/mod.rs:321— embassy-usb-host/src/class/uac/mod.rs:321-342 | embassy-usb-host/src/class/uac/mod.rs:355-420 | embassy-usb-host/src/class/uac/mod.rs:437-458 | embassy-usb-host/src/class/uac/mod.rs:475-496 | embassy-usb-host/src/class/uac/mod.rs:513-534 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (10 lines × 4) embassy-mcxa/src/spi/controller.rs:257— embassy-mcxa/src/spi/controller.rs:257-267 | embassy-mcxa/src/spi/controller.rs:358-367 | embassy-mcxa/src/spi/controller.rs:903-913 | embassy-mcxa/src/spi/controller.rs:1094-1103 — 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 (10 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:445— embassy-net-esp-hosted/src/proto/fg/mod.rs:445-454 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1902-1911 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6565-6574 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15648-15657 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (10 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:11214— embassy-net-esp-hosted/src/proto/fg/mod.rs:11214-11223 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12379-12388 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48893-48902 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50616-50625 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (10 lines × 4) embassy-stm32/src/cryp/mod.rs:145— embassy-stm32/src/cryp/mod.rs:145-154 | embassy-stm32/src/cryp/mod.rs:187-196 | embassy-stm32/src/cryp/mod.rs:229-238 | embassy-stm32/src/cryp/mod.rs:270-279 — 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 (10 lines × 4) embassy-stm32/src/crypto_driver.rs:284— embassy-stm32/src/crypto_driver.rs:284-293 | embassy-stm32/src/crypto_driver.rs:303-312 | embassy-stm32/src/crypto_driver.rs:332-341 | embassy-stm32/src/crypto_driver.rs:351-360 — 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 (10 lines × 4) embassy-stm32/src/i2c/v1.rs:527— embassy-stm32/src/i2c/v1.rs:527-536 | embassy-stm32/src/i2c/v1.rs:664-679 | embassy-stm32/src/i2c/v1.rs:759-768 | embassy-stm32/src/i2c/v1.rs:844-853 — 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 (10 lines × 4) embassy-stm32/src/ospi/mod.rs:986— embassy-stm32/src/ospi/mod.rs:986-995 | embassy-stm32/src/ospi/mod.rs:1019-1028 | embassy-stm32/src/ospi/mod.rs:1446-1455 | embassy-stm32/src/ospi/mod.rs:1481-1490 — 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 (10 lines × 4) embassy-stm32/src/ospi/mod.rs:1055— embassy-stm32/src/ospi/mod.rs:1055-1064 | embassy-stm32/src/ospi/mod.rs:1088-1097 | embassy-stm32/src/ospi/mod.rs:1519-1528 | embassy-stm32/src/ospi/mod.rs:1554-1563 — 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 (10 lines × 4) embassy-stm32-wpan/src/bluetooth/security/mod.rs:990— embassy-stm32-wpan/src/bluetooth/security/mod.rs:990-999 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1078-1087 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1115-1124 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1304-1313 — 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 (10 lines × 4) cyw43/src/structs.rs:18— cyw43/src/structs.rs:18-27 | cyw43/src/structs.rs:31-41 | embassy-net-esp-hosted/src/lib.rs:51-60 | embassy-net-esp-hosted/src/lib.rs:63-73 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 3) embassy-mcxa/src/dma.rs:1003— embassy-mcxa/src/dma.rs:1003-1013 | embassy-mcxa/src/dma.rs:1412-1422 | embassy-mcxa/src/dma.rs:2372-2382 — 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:285— embassy-net-esp-hosted/src/proto/fg/mod.rs:285-295 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3480-3490 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12184-12194 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (11 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:1896— embassy-net-esp-hosted/src/proto/fg/mod.rs:1896-1906 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2264-2274 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2697-2707 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (11 lines × 3) embassy-net-esp-hosted/src/proto/mcu/mod.rs:20404— embassy-net-esp-hosted/src/proto/mcu/mod.rs:20404-20414 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30819-30829 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38047-38057 — 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:22197— embassy-net-esp-hosted/src/proto/mcu/mod.rs:22197-22207 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25803-25813 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26680-26690 — 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) embassy-nrf/src/uarte.rs:497— embassy-nrf/src/uarte.rs:497-507 | embassy-nrf/src/uarte.rs:697-707 | embassy-nrf/src/uarte.rs:818-828 — 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) embassy-stm32/src/flash/f7.rs:39— embassy-stm32/src/flash/f7.rs:39-49 | embassy-stm32/src/flash/u3.rs:67-77 | embassy-stm32/src/flash/u5.rs:70-80 — before extracting anything, compare `embassy-stm32/src/flash/u3.rs` and `embassy-stm32/src/flash/u5.rs` as WHOLE FILES: this scan already matched 7 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 (11 lines × 3) embassy-stm32-wpan/src/bluetooth/security/mod.rs:991— embassy-stm32-wpan/src/bluetooth/security/mod.rs:991-1001 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1079-1089 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1305-1315 — 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) embassy-usb-host/src/descriptor.rs:164— embassy-usb-host/src/descriptor.rs:164-174 | embassy-usb-host/src/descriptor.rs:226-236 | embassy-usb-host/src/descriptor.rs:293-303 — 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) embassy-net-nrf91/src/context.rs:104— embassy-net-nrf91/src/context.rs:104-112 | embassy-net-nrf91/src/context.rs:309-317 | embassy-net-nrf91/src/context.rs:325-333 — 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) embassy-nrf/src/twis.rs:201— embassy-nrf/src/twis.rs:201-209 | embassy-nrf/src/twis.rs:230-238 | embassy-nrf/src/twis.rs:256-264 — 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) embassy-rp/src/uart/buffered.rs:909— embassy-rp/src/uart/buffered.rs:909-917 | embassy-rp/src/uart/buffered.rs:928-936 | embassy-stm32/src/usart/buffered.rs:1134-1142 — 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 (9 lines × 3) embassy-stm32/src/rcc/h.rs:651— embassy-stm32/src/rcc/h.rs:651-659 | embassy-stm32/src/rcc/u5.rs:491-499 | embassy-stm32/src/rcc/wba.rs:400-408 — before extracting anything, compare `embassy-stm32/src/rcc/u5.rs` and `embassy-stm32/src/rcc/wba.rs` as WHOLE FILES: this scan already matched 10 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.
Duplicated block (9 lines × 3) embassy-stm32/src/timer/low_level.rs:1159— embassy-stm32/src/timer/low_level.rs:1159-1167 | embassy-stm32/src/timer/low_level.rs:1219-1227 | embassy-stm32/src/timer/low_level.rs:1299-1307 — 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) embassy-stm32/src/flash/f2.rs:118— embassy-stm32/src/flash/f2.rs:118-126 | embassy-stm32/src/flash/f4.rs:206-214 | embassy-stm32/src/flash/l.rs:312-320 — before extracting anything, compare `embassy-stm32/src/flash/f2.rs` and `embassy-stm32/src/flash/f4.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-stm32/src/flash/u3.rs:82— embassy-stm32/src/flash/u3.rs:82-90 | embassy-stm32/src/flash/u3.rs:93-101 | embassy-stm32/src/flash/u5.rs:96-104 — before extracting anything, compare `embassy-stm32/src/flash/u3.rs` and `embassy-stm32/src/flash/u5.rs` as WHOLE FILES: this scan already matched 7 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 (9 lines × 3) embassy-stm32-wpan/src/bluetooth/security/mod.rs:990— embassy-stm32-wpan/src/bluetooth/security/mod.rs:990-998 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1115-1123 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1253-1261 — 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) embassy-usb-host/src/class/uac/mod.rs:552— embassy-usb-host/src/class/uac/mod.rs:552-560 | embassy-usb-host/src/class/uac/mod.rs:592-600 | embassy-usb-host/src/class/uac/mod.rs:632-640 — 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 (20 lines × 2) embassy-mcxa/src/ctimer/pwm.rs:271— embassy-mcxa/src/ctimer/pwm.rs:271-290 | embassy-mcxa/src/ctimer/pwm.rs:397-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.
Duplicated block (20 lines × 2) embassy-mcxa/src/ctimer/pwm.rs:316— embassy-mcxa/src/ctimer/pwm.rs:316-335 | embassy-mcxa/src/ctimer/pwm.rs:452-471 — both copies are in the same file, so extract the 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) embassy-mcxa/src/chips/mcxa2xx.rs:21— embassy-mcxa/src/chips/mcxa2xx.rs:21-40 | embassy-mcxa/src/chips/mcxa5xx.rs:25-44 — before extracting anything, compare `embassy-mcxa/src/chips/mcxa2xx.rs` and `embassy-mcxa/src/chips/mcxa5xx.rs` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:20910— embassy-net-esp-hosted/src/proto/mcu/mod.rs:20910-20929 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21161-21180 — both copies are in the same file, so extract the 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:41016— embassy-net-esp-hosted/src/proto/mcu/mod.rs:41016-41035 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41764-41783 — both copies are in the same file, so extract the 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) embassy-nrf/src/pwm.rs:106— embassy-nrf/src/pwm.rs:106-125 | embassy-nrf/src/pwm.rs:842-861 — both copies are in the same file, so extract the 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) embassy-stm32/src/i2c/v2.rs:751— embassy-stm32/src/i2c/v2.rs:751-770 | embassy-stm32/src/i2c/v2.rs:1393-1412 — both copies are in the same file, so extract the 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) embassy-stm32/src/sdmmc/mod.rs:1224— embassy-stm32/src/sdmmc/mod.rs:1224-1243 | embassy-stm32/src/sdmmc/mod.rs:1296-1315 — both copies are in the same file, so extract the 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 × 3) embassy-mcxa/src/spi/controller.rs:304— embassy-mcxa/src/spi/controller.rs:304-315 | embassy-mcxa/src/spi/controller.rs:981-992 | embassy-mcxa/src/spi/controller.rs:1180-1191 — 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:1913— embassy-net-esp-hosted/src/proto/fg/mod.rs:1913-1924 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3019-3030 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3495-3506 — 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:9365— embassy-net-esp-hosted/src/proto/fg/mod.rs:9365-9376 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10687-10698 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22201-22212 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (12 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:9358— embassy-net-esp-hosted/src/proto/fg/mod.rs:9358-9369 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5019-5030 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10680-10691 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (12 lines × 3) embassy-net-esp-hosted/src/proto/mcu/mod.rs:22179— embassy-net-esp-hosted/src/proto/mcu/mod.rs:22179-22190 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25785-25796 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26662-26673 — 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) embassy-stm32/src/dcmipp.rs:610— embassy-stm32/src/dcmipp.rs:610-621 | embassy-stm32/src/dcmipp.rs:818-829 | embassy-stm32/src/dcmipp.rs:1153-1164 — 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) embassy-stm32/src/hspi/mod.rs:69— embassy-stm32/src/hspi/mod.rs:69-80 | embassy-stm32/src/ospi/mod.rs:112-126 | embassy-stm32/src/xspi/mod.rs:65-79 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (12 lines × 3) embassy-stm32/src/flash/h5.rs:69— embassy-stm32/src/flash/h5.rs:69-80 | embassy-stm32/src/flash/h7.rs:93-104 | embassy-stm32/src/flash/h7.rs:139-150 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) embassy-rp/src/spi.rs:160— embassy-rp/src/spi.rs:160-169 | embassy-rp/src/spi.rs:173-182 | embassy-rp/src/spi.rs:186-195 — 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) embassy-stm32/src/hspi/mod.rs:452— embassy-stm32/src/hspi/mod.rs:452-461 | embassy-stm32/src/ospi/mod.rs:782-791 | embassy-stm32/src/xspi/mod.rs:591-600 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (10 lines × 3) embassy-stm32/src/ltdc.rs:314— embassy-stm32/src/ltdc.rs:314-323 | embassy-stm32/src/ltdc.rs:376-385 | embassy-stm32/src/ltdc.rs:451-460 — 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) embassy-sync/src/channel.rs:603— embassy-sync/src/channel.rs:603-612 | embassy-sync/src/channel.rs:629-638 | embassy-sync/src/priority_channel.rs:313-322 — before extracting anything, compare `embassy-sync/src/channel.rs` and `embassy-sync/src/priority_channel.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) embassy-stm32/src/cacheaxi.rs:98— embassy-stm32/src/cacheaxi.rs:98-107 | embassy-stm32/src/cacheaxi.rs:142-151 | embassy-stm32/src/icache.rs:152-161 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) embassy-stm32/src/cacheaxi.rs:110— embassy-stm32/src/cacheaxi.rs:110-119 | embassy-stm32/src/cacheaxi.rs:154-163 | embassy-stm32/src/icache.rs:164-173 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs:326— embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs:326-336 | embassy-stm32-wpan/src/bluetooth/gatt/server.rs:631-640 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:777-787 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) embassy-stm32-wpan/src/bluetooth/gatt/server.rs:433— embassy-stm32-wpan/src/bluetooth/gatt/server.rs:433-443 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:718-727 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:762-772 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:11177— embassy-net-esp-hosted/src/proto/fg/mod.rs:11177-11183 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12342-12348 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48866-48872 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50589-50595 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (7 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:20404— embassy-net-esp-hosted/src/proto/mcu/mod.rs:20404-20410 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30819-30825 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35250-35256 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38047-38053 — 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) embassy-stm32/src/adc/mod.rs:996— embassy-stm32/src/adc/mod.rs:996-1002 | embassy-stm32/src/adc/mod.rs:1056-1062 | embassy-stm32/src/adc/mod.rs:1115-1121 | embassy-stm32/src/adc/mod.rs:1155-1161 — 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) embassy-stm32/src/rcc/h.rs:1109— embassy-stm32/src/rcc/h.rs:1109-1115 | embassy-stm32/src/rcc/h.rs:1141-1147 | embassy-stm32/src/rcc/h.rs:1170-1176 | embassy-stm32/src/rcc/h.rs:1197-1203 — 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) embassy-stm32/src/sdmmc/mod.rs:704— embassy-stm32/src/sdmmc/mod.rs:704-710 | embassy-stm32/src/sdmmc/mod.rs:745-751 | embassy-stm32/src/sdmmc/mod.rs:826-832 | embassy-stm32/src/sdmmc/mod.rs:897-903 — 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) embassy-stm32/src/usb/otg.rs:68— embassy-stm32/src/usb/otg.rs:68-74 | embassy-stm32/src/usb/otg.rs:109-115 | embassy-stm32/src/usb/otg.rs:927-933 | embassy-stm32/src/usb/otg.rs:972-978 — 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) embassy-imxrt/src/flexcomm/uart.rs:872— embassy-imxrt/src/flexcomm/uart.rs:872-878 | embassy-imxrt/src/flexcomm/uart.rs:970-976 | embassy-mcxa/src/lpuart/blocking.rs:294-300 | embassy-mcxa/src/lpuart/blocking.rs:367-373 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) embassy-imxrt/src/flexcomm/uart.rs:880— embassy-imxrt/src/flexcomm/uart.rs:880-886 | embassy-imxrt/src/flexcomm/uart.rs:978-984 | embassy-mcxa/src/lpuart/blocking.rs:302-308 | embassy-mcxa/src/lpuart/blocking.rs:375-381 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 4) embassy-mcxa/src/flexspi.rs:1001— embassy-mcxa/src/flexspi.rs:1001-1011 | embassy-mcxa/src/flexspi.rs:1040-1050 | embassy-mcxa/src/flexspi.rs:1233-1243 | embassy-mcxa/src/flexspi.rs:1276-1286 — 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 (11 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:19217— embassy-net-esp-hosted/src/proto/mcu/mod.rs:19217-19227 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19684-19694 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47061-47071 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47579-47589 — 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 (11 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:27051— embassy-net-esp-hosted/src/proto/mcu/mod.rs:27051-27061 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27379-27389 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27794-27804 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28122-28132 — 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 (11 lines × 4) embassy-stm32/src/crypto_driver.rs:608— embassy-stm32/src/crypto_driver.rs:608-618 | embassy-stm32/src/crypto_driver.rs:632-642 | embassy-stm32/src/crypto_driver.rs:671-681 | embassy-stm32/src/crypto_driver.rs:695-705 — 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 (11 lines × 4) embassy-stm32/src/flash/c.rs:34— embassy-stm32/src/flash/c.rs:34-44 | embassy-stm32/src/flash/h50.rs:37-47 | embassy-stm32/src/flash/l.rs:216-226 | embassy-stm32/src/flash/u0.rs:34-44 — 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.
Duplicated block (11 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:534— embassy-net-esp-hosted/src/proto/fg/mod.rs:534-544 | embassy-net-esp-hosted/src/proto/fg/mod.rs:974-984 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15946-15956 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16386-16396 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (11 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:545— embassy-net-esp-hosted/src/proto/fg/mod.rs:545-555 | embassy-net-esp-hosted/src/proto/fg/mod.rs:985-995 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15957-15967 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16397-16407 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 × 4) embassy-rp/src/spi.rs:160— embassy-rp/src/spi.rs:160-168 | embassy-rp/src/spi.rs:173-181 | embassy-rp/src/spi.rs:186-194 | embassy-rp/src/spi.rs:199-207 — 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) embassy-stm32/src/adc/mod.rs:817— embassy-stm32/src/adc/mod.rs:817-825 | embassy-stm32/src/adc/mod.rs:896-904 | embassy-stm32/src/adc/mod.rs:926-934 | embassy-stm32/src/adc/watchdog.rs:188-196 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 4) embassy-stm32/src/hspi/mod.rs:767— embassy-stm32/src/hspi/mod.rs:767-775 | embassy-stm32/src/hspi/mod.rs:810-818 | embassy-stm32/src/hspi/mod.rs:843-851 | embassy-stm32/src/hspi/mod.rs:886-894 — 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) embassy-stm32/src/ospi/mod.rs:1916— embassy-stm32/src/ospi/mod.rs:1916-1924 | embassy-stm32/src/ospi/mod.rs:1957-1965 | embassy-stm32/src/ospi/mod.rs:1991-1999 | embassy-stm32/src/ospi/mod.rs:2032-2040 — 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) embassy-stm32/src/xspi/mod.rs:1716— embassy-stm32/src/xspi/mod.rs:1716-1724 | embassy-stm32/src/xspi/mod.rs:1759-1767 | embassy-stm32/src/xspi/mod.rs:1792-1800 | embassy-stm32/src/xspi/mod.rs:1835-1843 — 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) embassy-stm32/src/flash/f2.rs:50— embassy-stm32/src/flash/f2.rs:50-58 | embassy-stm32/src/flash/f4.rs:89-97 | embassy-stm32/src/flash/g.rs:92-100 | embassy-stm32/src/flash/l.rs:65-73 — before extracting anything, compare `embassy-stm32/src/flash/f2.rs` and `embassy-stm32/src/flash/f4.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) embassy-stm32-wpan/src/wba/linklayer_plat.rs:431— embassy-stm32-wpan/src/wba/linklayer_plat.rs:431-439 | embassy-stm32/src/flash/u3.rs:149-157 | embassy-stm32/src/flash/u5.rs:129-137 | embassy-stm32/src/flash/u5.rs:140-148 — before extracting anything, compare `embassy-stm32/src/flash/u3.rs` and `embassy-stm32/src/flash/u5.rs` as WHOLE FILES: this scan already matched 7 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.
Off the main sequence: embassy-futures — embassy-futures: abstractness 0.06, instability 0.00, distance 0.94 — zone of pain — concrete and depended on by 23 project(s), so it's rigid to change.
Off the main sequence: embassy-sync — embassy-sync: abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 26 project(s), so it's rigid to change.
Off the main sequence: embassy-time-queue-utils — embassy-time-queue-utils: abstractness 0.00, instability 0.09, distance 0.91 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
Off the main sequence: embassy-crypto — embassy-crypto: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: embassy-time — embassy-time: abstractness 0.09, instability 0.09, distance 0.83 — zone of pain — concrete and depended on by 21 project(s), so it's rigid to change.
Off the main sequence: embassy-hal-internal — embassy-hal-internal: abstractness 0.20, instability 0.00, distance 0.80 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
Off the main sequence: embassy-net-driver-channel — embassy-net-driver-channel: abstractness 0.09, instability 0.18, distance 0.73 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
I2c::read_frame (cyclomatic 29) embassy-stm32/src/i2c/v1.rs:722— I2c::read_frame 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.
I2c::write_frame (cyclomatic 24) embassy-stm32/src/i2c/v1.rs:488— I2c::write_frame 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.
I2c::write_dma_internal (cyclomatic 21) embassy-stm32/src/i2c/v2.rs:925— I2c::write_dma_internal 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.
I2c::write_bytes (cyclomatic 18) embassy-stm32/src/i2c/v1.rs:156— I2c::write_bytes 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.
I2c::blocking_write_vectored (cyclomatic 18) embassy-stm32/src/i2c/v2.rs:834— I2c::blocking_write_vectored 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.
I2c::blocking_read_timeout (cyclomatic 17) embassy-stm32/src/i2c/v1.rs:293— I2c::blocking_read_timeout 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.
Bus::configure_endpoints (cognitive 26) embassy-usb-synopsys-otg/src/lib.rs:1139— Bus::configure_endpoints has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 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.
Bus::endpoint_set_enabled (cognitive 23) embassy-usb-synopsys-otg/src/lib.rs:1472— Bus::endpoint_set_enabled has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, 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.
Bus::endpoint_set_enabled (cognitive 21) embassy-stm32/src/usb/usb.rs:693— Bus::endpoint_set_enabled has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 2 (6 pts), loops 2 (4 pts) (nesting depth added 13). 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.
Bus::poll (cognitive 19) embassy-usb-synopsys-otg/src/lib.rs:1290— Bus::poll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Bus::endpoint_set_enabled (cognitive 16) embassy-nrf/src/usb/mod.rs:320— Bus::endpoint_set_enabled has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (nesting depth added 6). 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.
Bus::endpoint_set_stalled (cognitive 16) embassy-stm32/src/usb/usb.rs:639— Bus::endpoint_set_stalled has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (12 pts), loops 2 (4 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.
Change coupling: cdc_acm.rs ↔ hid.rs embassy-usb-host/src/class/cdc_acm.rs— `embassy-usb-host/src/class/cdc_acm.rs` and `embassy-usb-host/src/class/hid.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `26f55553` Add ConfigurationDescriptorChain.; `a60be159` revert unnecessary style changes from PR #5897; `e2ea7360` Simplify class driver constructors by passing EnumerationInfo — run `git show` on any of them.
Change coupling: sdio.rs ↔ spi.rs cyw43/src/sdio.rs— `cyw43/src/sdio.rs` and `cyw43/src/spi.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `5f8daf96` cyw: trait cleanup; `638b5ce6` cyw: pipe through buf to bus; `4e150249` cyw: make func a u8 — run `git show` on any of them.
Change coupling: mailbox.rs ↔ control.rs embassy-mcxa/src/flexcan/classic/mailbox.rs— `embassy-mcxa/src/flexcan/classic/mailbox.rs` and `embassy-mcxa/src/flexcan/control.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `627d7fda` pulled new nxp-pac, and replaced the manual PAC extension functions w…; `0836c5a3` filter masks; `c79cf06e` pins — run `git show` on any of them.
Change coupling: aci_gap.rs ↔ mod.rs embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs— `embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs` and `embassy-stm32-wpan/src/bluetooth/security/mod.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 6 shared commits counted here, the most recent 3 are `09e7cdfe` wpan: support the LL-only stack, fix the RNG stall and add ST symbol …; `5bf42753` wpan: update stm32-bindings to 0.3.1 and remap library features; `2179f09c` stm32wba6: add missing wpan BLE APIs (adv data, directed adv, RSSI, d… — run `git show` on any of them.
Change coupling: hub.rs ↔ kbd.rs embassy-usb-host/src/class/hub.rs— `embassy-usb-host/src/class/hub.rs` and `embassy-usb-host/src/class/kbd.rs` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 9 shared commits counted here, the most recent 3 are `d81b1fd7` Add InterfaceDescriptorChain.; `f091e22d` Rename USBDescriptor::SIZE to USBDescriptor::BUF_SIZE.; `b7fddff2` Remove unnecessary abstractions — run `git show` on any of them.
Change coupling: deadline.rs ↔ run_queue.rs embassy-executor/src/raw/deadline.rs— `embassy-executor/src/raw/deadline.rs` and `embassy-executor/src/raw/run_queue.rs` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `e1209c55` executor: make Deadline actually private.; `401fac6e` Make requested API changes; `52d17856` Introduce metadata-deadline and let the EDF scheduler use it — run `git show` on any of them.
Duplicated block (12 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:165— embassy-net-esp-hosted/src/proto/fg/mod.rs:165-176 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1732-1743 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2784-2795 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3285-3296 — 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 (12 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:426— embassy-net-esp-hosted/src/proto/fg/mod.rs:426-437 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1849-1860 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6539-6550 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15629-15640 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (12 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:1926— embassy-net-esp-hosted/src/proto/fg/mod.rs:1926-1937 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2282-2293 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3050-3061 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3520-3531 — 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 (12 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:27033— embassy-net-esp-hosted/src/proto/mcu/mod.rs:27033-27044 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27355-27366 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27776-27787 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28098-28109 — 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 (12 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:42288— embassy-net-esp-hosted/src/proto/mcu/mod.rs:42288-42299 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42674-42685 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43060-43071 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43446-43457 — 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 (12 lines × 4) embassy-nxp/src/casper/lpc55.rs:317— embassy-nxp/src/casper/lpc55.rs:317-328 | embassy-nxp/src/casper/lpc55.rs:379-390 | embassy-nxp/src/casper/lpc55.rs:414-425 | embassy-nxp/src/casper/lpc55.rs:449-460 — 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 (8 lines × 3) embassy-net-esp-hosted/src/proto/mcu/mod.rs:50631— embassy-net-esp-hosted/src/proto/mcu/mod.rs:50631-50638 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50644-50651 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50657-50664 — 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 (8 lines × 3) embassy-stm32/src/dcmipp.rs:527— embassy-stm32/src/dcmipp.rs:527-534 | embassy-stm32/src/dcmipp.rs:575-582 | embassy-stm32/src/dcmipp.rs:592-599 — 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 (8 lines × 3) embassy-stm32/src/dcmipp.rs:736— embassy-stm32/src/dcmipp.rs:736-743 | embassy-stm32/src/dcmipp.rs:784-791 | embassy-stm32/src/dcmipp.rs:800-807 — 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 (8 lines × 3) embassy-stm32/src/dcmipp.rs:1071— embassy-stm32/src/dcmipp.rs:1071-1078 | embassy-stm32/src/dcmipp.rs:1119-1126 | embassy-stm32/src/dcmipp.rs:1135-1142 — 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 (8 lines × 3) embassy-stm32/src/i2c/v2.rs:950— embassy-stm32/src/i2c/v2.rs:950-957 | embassy-stm32/src/i2c/v2.rs:1081-1088 | embassy-stm32/src/i2c/v2.rs:1491-1498 — 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 (8 lines × 3) embassy-nrf/src/crypto/pka/driver.rs:100— embassy-nrf/src/crypto/pka/driver.rs:100-107 | embassy-nrf/src/crypto/pka/mod.rs:757-764 | embassy-stm32/src/pka/driver.rs:117-124 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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.
ClockOperator::configure_osc32k_clocks (cyclomatic 48) embassy-mcxa/src/clocks/operator.rs:449— ClockOperator::configure_osc32k_clocks has cyclomatic complexity 48 (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.
ClockOperator::configure_spll (cyclomatic 31) embassy-mcxa/src/clocks/operator.rs:807— ClockOperator::configure_spll has cyclomatic complexity 31 (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.
ClockOperator::configure_voltages (cyclomatic 27) embassy-mcxa/src/clocks/operator.rs:1300— ClockOperator::configure_voltages has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ClockOperator::configure_firc_clocks (cyclomatic 17) embassy-mcxa/src/clocks/operator.rs:91— ClockOperator::configure_firc_clocks 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.
ClockOperator::configure_main_clk (cyclomatic 16) embassy-mcxa/src/clocks/operator.rs:1190— ClockOperator::configure_main_clk 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.
I3c::listen (cognitive 32) embassy-mcxa/src/i3c/target.rs:1276— I3c::listen has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 4, 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.
I3c::async_read_internal (cognitive 29) embassy-mcxa/src/i3c/controller.rs:1101— I3c::async_read_internal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 1, 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.
I3c::async_wait_for_ibi (cognitive 24) embassy-mcxa/src/i3c/controller.rs:1604— I3c::async_wait_for_ibi has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), boolean chains 4, 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.
I3c::calculate_baud_rate_params (cognitive 20) embassy-mcxa/src/i3c/controller.rs:406— I3c::calculate_baud_rate_params has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 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.
I3c::daa (cognitive 17) embassy-mcxa/src/i3c/controller.rs:743— I3c::daa has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 6). 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.
Duplicated block (27 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:5857— embassy-net-esp-hosted/src/proto/fg/mod.rs:5857-5883 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18467-18493 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (27 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:6813— embassy-net-esp-hosted/src/proto/fg/mod.rs:6813-6839 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24229-24255 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (27 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:23539— embassy-net-esp-hosted/src/proto/mcu/mod.rs:23539-23565 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23864-23890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:47177— embassy-net-esp-hosted/src/proto/mcu/mod.rs:47177-47203 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47695-47721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) embassy-stm32/src/xspi/mod.rs:397— embassy-stm32/src/xspi/mod.rs:397-423 | embassy-stm32/src/xspi/mod.rs:718-744 — both copies are in the same file, so extract the 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 (23 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:10748— embassy-net-esp-hosted/src/proto/fg/mod.rs:10748-10770 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48024-48046 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (23 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:29031— embassy-net-esp-hosted/src/proto/mcu/mod.rs:29031-29053 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29379-29401 — both copies are in the same file, so extract the 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 (23 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:46812— embassy-net-esp-hosted/src/proto/mcu/mod.rs:46812-46834 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47330-47352 — both copies are in the same file, so extract the 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 (23 lines × 2) embassy-stm32/src/cryp/mod.rs:694— embassy-stm32/src/cryp/mod.rs:694-716 | embassy-stm32/src/cryp/mod.rs:1261-1283 — both copies are in the same file, so extract the 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 (23 lines × 2) embassy-stm32/src/i2c/v2.rs:1068— embassy-stm32/src/i2c/v2.rs:1068-1090 | embassy-stm32/src/i2c/v2.rs:1478-1500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) embassy-mcxa/src/spi/controller.rs:911— embassy-mcxa/src/spi/controller.rs:911-924 | embassy-mcxa/src/spi/controller.rs:956-970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) embassy-rp/src/clocks.rs:1437— embassy-rp/src/clocks.rs:1437-1450 | embassy-rp/src/clocks.rs:1462-1476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) embassy-stm32/src/dma/gpdma/mod.rs:982— embassy-stm32/src/dma/gpdma/mod.rs:982-995 | embassy-stm32/src/dma/gpdma/mod.rs:1052-1066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) embassy-stm32/src/i2c/v1.rs:650— embassy-stm32/src/i2c/v1.rs:650-664 | embassy-stm32/src/i2c/v1.rs:944-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.
Duplicated block (14–15 lines × 2) embassy-stm32/src/usb/usb_host.rs:649— embassy-stm32/src/usb/usb_host.rs:649-663 | embassy-stm32/src/usb/usb_host.rs:683-696 — both copies are in the same file, so extract the 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 × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:1862— embassy-net-esp-hosted/src/proto/fg/mod.rs:1862-1875 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2953-2966 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3436-3449 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:2255— embassy-net-esp-hosted/src/proto/fg/mod.rs:2255-2268 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3005-3018 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3481-3494 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:9316— embassy-net-esp-hosted/src/proto/fg/mod.rs:9316-9329 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10644-10657 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22182-22195 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:9308— embassy-net-esp-hosted/src/proto/fg/mod.rs:9308-9321 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4893-4906 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10636-10649 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 3) embassy-stm32/src/i2c/v2.rs:972— embassy-stm32/src/i2c/v2.rs:972-985 | embassy-stm32/src/i2c/v2.rs:1101-1114 | embassy-stm32/src/i2c/v2.rs:1511-1524 — 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–12 lines × 2) embassy-mcxa/src/sgi/hash.rs:631— embassy-mcxa/src/sgi/hash.rs:631-642 | embassy-mcxa/src/sgi/hash.rs:695-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.
Duplicated block (11–12 lines × 2) embassy-mspm0/src/uart/buffered.rs:864— embassy-mspm0/src/uart/buffered.rs:864-874 | embassy-rp/src/uart/buffered.rs:315-326 — before extracting anything, compare `embassy-mspm0/src/uart/buffered.rs` and `embassy-rp/src/uart/buffered.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.
Duplicated block (11–12 lines × 2) embassy-nrf/src/spim.rs:620— embassy-nrf/src/spim.rs:620-631 | embassy-nrf/src/spis.rs:531-541 — before extracting anything, compare `embassy-nrf/src/spim.rs` and `embassy-nrf/src/spis.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. If that is what happened, the fix is to keep one copy and have the 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–12 lines × 2) embassy-stm32/src/dcmipp.rs:524— embassy-stm32/src/dcmipp.rs:524-535 | embassy-stm32/src/dcmipp.rs:573-583 — both copies are in the same file, so extract the 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–12 lines × 2) embassy-stm32/src/hspi/mod.rs:343— embassy-stm32/src/hspi/mod.rs:343-354 | embassy-stm32/src/xspi/mod.rs:417-427 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/xspi/mod.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 19 separate duplicated blocks between them, totalling at least 193 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 (8 lines × 4) embassy-mcxa/src/spi/controller.rs:913— embassy-mcxa/src/spi/controller.rs:913-920 | embassy-mcxa/src/spi/controller.rs:958-966 | embassy-mcxa/src/spi/controller.rs:1027-1034 | embassy-mcxa/src/spi/controller.rs:1073-1080 — 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 (8 lines × 4) embassy-nrf/src/uarte.rs:365— embassy-nrf/src/uarte.rs:365-372 | embassy-nrf/src/uarte.rs:379-386 | embassy-nrf/src/uarte.rs:395-402 | embassy-nrf/src/uarte.rs:410-417 — 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 (8 lines × 4) embassy-nxp/src/casper/lpc55.rs:485— embassy-nxp/src/casper/lpc55.rs:485-492 | embassy-nxp/src/casper/lpc55.rs:521-528 | embassy-nxp/src/casper/lpc55.rs:562-569 | embassy-nxp/src/casper/lpc55.rs:603-610 — 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 (8 lines × 4) embassy-stm32/src/crypto_driver.rs:474— embassy-stm32/src/crypto_driver.rs:474-481 | embassy-stm32/src/crypto_driver.rs:504-511 | embassy-stm32/src/crypto_driver.rs:544-551 | embassy-stm32/src/crypto_driver.rs:574-581 — 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 (8 lines × 4) embassy-stm32/src/ospi/mod.rs:644— embassy-stm32/src/ospi/mod.rs:644-651 | embassy-stm32/src/ospi/mod.rs:937-944 | embassy-stm32/src/xspi/mod.rs:417-424 | embassy-stm32/src/xspi/mod.rs:738-745 — `embassy-stm32/src/ospi/mod.rs` and `embassy-stm32/src/xspi/mod.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 21 separate duplicated blocks between them, totalling at least 214 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 (6 lines × 3) embassy-stm32/src/hspi/mod.rs:408— embassy-stm32/src/hspi/mod.rs:408-413 | embassy-stm32/src/ospi/mod.rs:731-736 | embassy-stm32/src/xspi/mod.rs:532-537 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (6 lines × 3) embassy-stm32/src/hspi/mod.rs:512— embassy-stm32/src/hspi/mod.rs:512-517 | embassy-stm32/src/ospi/mod.rs:852-857 | embassy-stm32/src/xspi/mod.rs:651-656 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (6 lines × 3) embassy-stm32/src/rcc/l.rs:712— embassy-stm32/src/rcc/l.rs:712-717 | embassy-stm32/src/rcc/u5.rs:614-619 | embassy-stm32/src/rcc/wba.rs:491-496 — before extracting anything, compare `embassy-stm32/src/rcc/u5.rs` and `embassy-stm32/src/rcc/wba.rs` as WHOLE FILES: this scan already matched 10 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.
Duplicated block (6 lines × 3) embassy-stm32/src/flash/c5.rs:330— embassy-stm32/src/flash/c5.rs:330-335 | embassy-stm32/src/flash/h5.rs:204-209 | embassy-stm32/src/flash/h50.rs:145-150 — before extracting anything, compare `embassy-stm32/src/flash/c5.rs` and `embassy-stm32/src/flash/h5.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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) embassy-nrf/src/crypto/pka/cryptocell/ecc.rs:182— embassy-nrf/src/crypto/pka/cryptocell/ecc.rs:182-187 | embassy-nrf/src/crypto/pka/cryptocell/ecc.rs:212-217 | embassy-nrf/src/crypto/pka/cryptocell/ecc.rs:243-248 — 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.
Regs::init (cyclomatic 23) embassy-stm32/src/adc/v3.rs:173— Regs::init 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.
Regs::configure_sequence (cyclomatic 18) embassy-stm32/src/adc/v3.rs:375— Regs::configure_sequence 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.
Regs::configure_sequence (cyclomatic 16) embassy-stm32/src/adc/v1.rs:296— Regs::configure_sequence 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.
Regs::configure_sequence (cyclomatic 16) embassy-stm32/src/adc/v2.rs:397— Regs::configure_sequence 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.
embassy_nrf::init (cognitive 59) embassy-nrf/src/lib.rs:801— embassy_nrf::init has cognitive complexity 59 (threshold 15). Drivers by points: if/else 32 (41 pts), loops 5 (8 pts), match/switch 7, boolean chains 3 (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.
embassy_nrf::gpiote::handle_gpiote_interrupt (cognitive 22) embassy-nrf/src/gpiote.rs:197— embassy_nrf::gpiote::handle_gpiote_interrupt has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (7 pts), match/switch 1 (4 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
embassy_nrf::crypto::pka::ecc_mul (cognitive 21) embassy-nrf/src/crypto/pka/mod.rs:610— embassy_nrf::crypto::pka::ecc_mul has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
embassy_nrf::crypto::symmetric::aes_cracen::gcm_run (cognitive 16) embassy-nrf/src/crypto/symmetric/aes_cracen.rs:185— embassy_nrf::crypto::symmetric::aes_cracen::gcm_run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
ClockOperator::configure_spll (cognitive 39) embassy-mcxa/src/clocks/operator.rs:807— ClockOperator::configure_spll has cognitive complexity 39 (threshold 15). Drivers by points: if/else 25 (31 pts), loops 2 (3 pts), match/switch 3, boolean chains 2 (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, 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.
ClockOperator::configure_osc32k_clocks (cognitive 27) embassy-mcxa/src/clocks/operator.rs:449— ClockOperator::configure_osc32k_clocks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 5 (8 pts), loops 4 (7 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.
ClockOperator::configure_firc_clocks (cognitive 23) embassy-mcxa/src/clocks/operator.rs:91— ClockOperator::configure_firc_clocks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 3 (5 pts), boolean chains 2, 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, 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.
ClockOperator::configure_voltages (cognitive 20) embassy-mcxa/src/clocks/operator.rs:1300— ClockOperator::configure_voltages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (7 pts), match/switch 7, loops 3 (5 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inner::handle_control_out (cognitive 37) embassy-usb/src/lib.rs:472— Inner::handle_control_out has cognitive complexity 37 (threshold 15). Drivers by points: loops 6 (19 pts), if/else 4 (11 pts), match/switch 4 (7 pts) (nesting depth added 23). 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.
Inner::handle_control_in (cognitive 25) embassy-usb/src/lib.rs:598— Inner::handle_control_in has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 5 (10 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.
Inner::handle_get_descriptor (cognitive 25) embassy-usb/src/lib.rs:695— Inner::handle_get_descriptor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (9 pts), match/switch 2 (4 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.
Inner::handle_bus_event (cognitive 16) embassy-usb/src/lib.rs:416— Inner::handle_bus_event has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (15 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.
InterruptHandler::on_interrupt (cognitive 35) embassy-nrf/src/buffered_uarte/v1.rs:80— InterruptHandler::on_interrupt has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 3 (nesting depth added 18). 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.
InterruptHandler::on_interrupt (cognitive 24) embassy-mcxa/src/i3c/target.rs:1437— InterruptHandler::on_interrupt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InterruptHandler::on_interrupt (cognitive 24) embassy-nrf/src/buffered_uarte/v2.rs:75— InterruptHandler::on_interrupt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (24 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.
InterruptHandler::on_interrupt (cognitive 22) embassy-rp/src/usb/host.rs:1845— InterruptHandler::on_interrupt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 1 (2 pts), match/switch 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.
Regs::configure_sequence (cognitive 30) embassy-stm32/src/adc/v3.rs:375— Regs::configure_sequence has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (4 pts), boolean chains 3, 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.
Regs::configure_sequence (cognitive 29) embassy-stm32/src/adc/v2.rs:397— Regs::configure_sequence has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (5 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.
Regs::configure_sequence (cognitive 22) embassy-stm32/src/adc/v1.rs:296— Regs::configure_sequence has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 2 (6 pts), loops 3 (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.
Regs::init (cognitive 18) embassy-stm32/src/adc/v3.rs:173— Regs::init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 3 (4 pts), boolean chains 2, loops 2 (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.
embassy_usb_host::class::cdc_acm::find_cdc_acm (cognitive 20) embassy-usb-host/src/class/cdc_acm.rs:128— embassy_usb_host::class::cdc_acm::find_cdc_acm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
embassy_usb_host::class::vcp::cp210x::find_cp210x (cognitive 18) embassy-usb-host/src/class/vcp/cp210x.rs:498— embassy_usb_host::class::vcp::cp210x::find_cp210x has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 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.
embassy_usb_host::class::gip::find_gip (cognitive 18) embassy-usb-host/src/class/gip.rs:238— embassy_usb_host::class::gip::find_gip has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 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.
embassy_usb_host::class::ccid::find_ccid (cognitive 16) embassy-usb-host/src/class/ccid.rs:51— embassy_usb_host::class::ccid::find_ccid 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.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (7 members, 50+ identical tokens) embassy-executor/build_common.rs:69— embassy-executor/build_common.rs:69-94 | embassy-hal-internal/build_common.rs:69-94 | embassy-mcxa/build_common.rs:69-94 | embassy-mspm0/build_common.rs:69-94 | embassy-nxp/build_common.rs:69-94 | embassy-stm32/build_common.rs:69-94 | embassy-sync/build_common.rs:69-94 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) embassy-mspm0/src/sysctl/c1103_1104.rs:38— embassy-mspm0/src/sysctl/c1103_1104.rs:38-46 | embassy-mspm0/src/sysctl/c1105_1106.rs:38-46 | embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:43-52 | embassy-mspm0/src/sysctl/g151x_351x.rs:43-52 | embassy-mspm0/src/sysctl/g511x_518x.rs:48-58 | embassy-mspm0/src/sysctl/h321x.rs:38-46 | embassy-mspm0/src/sysctl/l_typeb.rs:38-46 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) embassy-net-esp-hosted/src/proto/fg/mod.rs:10625— embassy-net-esp-hosted/src/proto/fg/mod.rs:10625-10642 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10814-10838 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11016-11040 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9790-9828 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47898-47915 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48090-48114 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48295-48319 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) embassy-net-esp-hosted/src/proto/fg/mod.rs:10643— embassy-net-esp-hosted/src/proto/fg/mod.rs:10643-10659 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10839-10861 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11041-11063 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9829-9863 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47916-47932 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48115-48137 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48320-48342 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Duplicated block (35 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:2953— embassy-net-esp-hosted/src/proto/fg/mod.rs:2953-2987 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3436-3470 — both copies are in the same file, so extract the 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 (35 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:48867— embassy-net-esp-hosted/src/proto/mcu/mod.rs:48867-48901 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50590-50624 — both copies are in the same file, so extract the 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 (35 lines × 2) embassy-stm32/src/hspi/enums.rs:286— embassy-stm32/src/hspi/enums.rs:286-320 | embassy-stm32/src/xspi/enums.rs:378-412 — `embassy-stm32/src/hspi/enums.rs` and `embassy-stm32/src/xspi/enums.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 106 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 (35 lines × 2) embassy-stm32/src/hspi/enums.rs:364— embassy-stm32/src/hspi/enums.rs:364-398 | embassy-stm32/src/xspi/enums.rs:456-490 — `embassy-stm32/src/hspi/enums.rs` and `embassy-stm32/src/xspi/enums.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 106 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 (25 lines × 2) embassy-mcxa/src/lpuart/dma.rs:212— embassy-mcxa/src/lpuart/dma.rs:212-236 | embassy-mcxa/src/lpuart/dma.rs:258-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) embassy-mcxa/src/lpuart/dma.rs:422— embassy-mcxa/src/lpuart/dma.rs:422-446 | embassy-mcxa/src/lpuart/dma.rs:472-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.
Duplicated block (25 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:8781— embassy-net-esp-hosted/src/proto/fg/mod.rs:8781-8805 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10849-10873 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (25 lines × 2) embassy-stm32/src/dma/gpdma/mod.rs:652— embassy-stm32/src/dma/gpdma/mod.rs:652-676 | embassy-stm32/src/dma/gpdma/mod.rs:796-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:6117— embassy-net-esp-hosted/src/proto/fg/mod.rs:6117-6133 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45304-45320 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46204-46220 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:9173— embassy-net-esp-hosted/src/proto/fg/mod.rs:9173-9189 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4552-4568 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10516-10532 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 3) embassy-net-esp-hosted/src/proto/mcu/mod.rs:16623— embassy-net-esp-hosted/src/proto/mcu/mod.rs:16623-16639 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16742-16758 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45108-45124 — 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 (17 lines × 3) embassy-net-esp-hosted/src/proto/mcu/mod.rs:27285— embassy-net-esp-hosted/src/proto/mcu/mod.rs:27285-27301 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27726-27742 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28028-28044 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:1877— embassy-net-esp-hosted/src/proto/fg/mod.rs:1877-1890 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2239-2252 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2989-3002 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3465-3478 — 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 (14 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:3588— embassy-net-esp-hosted/src/proto/mcu/mod.rs:3588-3601 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7205-7218 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11604-11617 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11735-11748 — 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 (14 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:42269— embassy-net-esp-hosted/src/proto/mcu/mod.rs:42269-42282 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42655-42668 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43041-43054 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43427-43440 — 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 (14 lines × 4) embassy-stm32/src/hspi/mod.rs:364— embassy-stm32/src/hspi/mod.rs:364-377 | embassy-stm32/src/ospi/mod.rs:951-964 | embassy-stm32/src/xspi/mod.rs:439-452 | embassy-stm32/src/xspi/mod.rs:749-762 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (13–14 lines × 2) embassy-nrf/src/crypto/rng/cryptocell.rs:144— embassy-nrf/src/crypto/rng/cryptocell.rs:144-157 | embassy-nrf/src/rng.rs:127-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–14 lines × 2) embassy-stm32/src/aes/v3.rs:134— embassy-stm32/src/aes/v3.rs:134-147 | embassy-stm32/src/cryp/mod.rs:1216-1228 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–14 lines × 2) embassy-stm32/src/hspi/mod.rs:815— embassy-stm32/src/hspi/mod.rs:815-827 | embassy-stm32/src/hspi/mod.rs:891-904 — both copies are in the same file, so extract the 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–14 lines × 2) embassy-stm32/src/xspi/mod.rs:1764— embassy-stm32/src/xspi/mod.rs:1764-1776 | embassy-stm32/src/xspi/mod.rs:1840-1853 — both copies are in the same file, so extract the 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–11 lines × 2) embassy-net-esp-hosted/src/lib.rs:289— embassy-net-esp-hosted/src/lib.rs:289-299 | embassy-net-esp-hosted/src/lib.rs:305-314 — both copies are in the same file, so extract the 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–11 lines × 2) embassy-nrf/src/uarte.rs:744— embassy-nrf/src/uarte.rs:744-753 | embassy-nrf/src/uarte.rs:1191-1201 — both copies are in the same file, so extract the 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–11 lines × 2) embassy-stm32/src/ospi/mod.rs:495— embassy-stm32/src/ospi/mod.rs:495-504 | embassy-stm32/src/ospi/mod.rs:521-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) embassy-stm32/src/spi/mod.rs:1269— embassy-stm32/src/spi/mod.rs:1269-1278 | embassy-stm32/src/spi/mod.rs:1404-1414 — both copies are in the same file, so extract the 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 × 4) embassy-imxrt/src/flexcomm/uart.rs:861— embassy-imxrt/src/flexcomm/uart.rs:861-866 | embassy-imxrt/src/flexcomm/uart.rs:961-966 | embassy-mcxa/src/lpuart/blocking.rs:283-288 | embassy-mcxa/src/lpuart/blocking.rs:358-363 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) embassy-mspm0/src/sysctl/c1103_1104.rs:41— embassy-mspm0/src/sysctl/c1103_1104.rs:41-46 | embassy-mspm0/src/sysctl/c1105_1106.rs:41-46 | embassy-mspm0/src/sysctl/h321x.rs:41-46 | embassy-mspm0/src/sysctl/l_typeb.rs:41-46 — 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.
Duplicated block (6 lines × 4) embassy-stm32/src/spi/mod.rs:807— embassy-stm32/src/spi/mod.rs:807-812 | embassy-stm32/src/spi/mod.rs:856-861 | embassy-stm32/src/spi/mod.rs:877-882 | embassy-stm32/src/spi/mod.rs:901-906 — 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 (6 lines × 4) embassy-executor/src/platform/cortex_m.rs:166— embassy-executor/src/platform/cortex_m.rs:166-171 | embassy-mspm0/src/executor.rs:181-186 | embassy-rp/src/executor.rs:187-192 | embassy-stm32/src/executor.rs:207-212 — before extracting anything, compare `embassy-executor/src/platform/cortex_m.rs` and `embassy-mspm0/src/executor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) embassy-executor/src/platform/cortex_m.rs:234— embassy-executor/src/platform/cortex_m.rs:234-238 | embassy-mspm0/src/executor.rs:249-253 | embassy-rp/src/executor.rs:256-260 | embassy-stm32/src/executor.rs:275-279 — before extracting anything, compare `embassy-executor/src/platform/cortex_m.rs` and `embassy-mspm0/src/executor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) embassy-net-nrf91/src/context.rs:160— embassy-net-nrf91/src/context.rs:160-164 | embassy-net-nrf91/src/context.rs:174-178 | embassy-net-nrf91/src/context.rs:316-321 | embassy-net-nrf91/src/context.rs:341-345 — 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 (5 lines × 4) embassy-stm32/src/rcc/f013.rs:181— embassy-stm32/src/rcc/f013.rs:181-185 | embassy-stm32/src/rcc/f247.rs:183-187 | embassy-stm32/src/rcc/g0.rs:142-146 | embassy-stm32/src/rcc/g4.rs:129-133 — before extracting anything, compare `embassy-stm32/src/rcc/f013.rs` and `embassy-stm32/src/rcc/f247.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (5 lines × 4) embassy-stm32/src/flash/c5.rs:137— embassy-stm32/src/flash/c5.rs:137-142 | embassy-stm32/src/flash/h5.rs:58-63 | embassy-stm32/src/flash/h7.rs:85-89 | embassy-stm32/src/flash/h7.rs:131-135 — before extracting anything, compare `embassy-stm32/src/flash/c5.rs` and `embassy-stm32/src/flash/h5.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
r#wifi_init_config::decode (cyclomatic 51) embassy-net-esp-hosted/src/proto/mcu/mod.rs:584— r#wifi_init_config::decode has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
r#wifi_init_config::encode (cyclomatic 25) embassy-net-esp-hosted/src/proto/mcu/mod.rs:1040— r#wifi_init_config::encode has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (r#wifi_init_config::compute_size) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_init_config::compute_size (cyclomatic 25) embassy-net-esp-hosted/src/proto/mcu/mod.rs:1215— r#wifi_init_config::compute_size has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (r#wifi_init_config::encode) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_pkt_rx_ctrl::decode (cyclomatic 41) embassy-net-esp-hosted/src/proto/mcu/mod.rs:7198— r#wifi_pkt_rx_ctrl::decode 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_pkt_rx_ctrl::encode (cyclomatic 20) embassy-net-esp-hosted/src/proto/mcu/mod.rs:7564— r#wifi_pkt_rx_ctrl::encode 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. This shape REPEATS in the file: one other method here (r#wifi_pkt_rx_ctrl::compute_size) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_pkt_rx_ctrl::compute_size (cyclomatic 20) embassy-net-esp-hosted/src/proto/mcu/mod.rs:7704— r#wifi_pkt_rx_ctrl::compute_size 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. This shape REPEATS in the file: one other method here (r#wifi_pkt_rx_ctrl::encode) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_ap_config::decode (cyclomatic 35) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4521— r#wifi_ap_config::decode 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_ap_config::encode (cyclomatic 19) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4866— r#wifi_ap_config::encode has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (r#wifi_ap_config::compute_size) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_ap_config::compute_size (cyclomatic 19) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4997— r#wifi_ap_config::compute_size has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (r#wifi_ap_config::encode) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
Runner::rx (cyclomatic 34) cyw43/src/runner.rs:1057— Runner::rx 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.
Runner::run (cyclomatic 21) embassy-net-adin1110/src/lib.rs:354— Runner::run 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.
Runner::init (cyclomatic 16) cyw43/src/runner.rs:486— Runner::init 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.
r#wifi_sta_config::decode (cyclomatic 29) embassy-net-esp-hosted/src/proto/mcu/mod.rs:5646— r#wifi_sta_config::decode 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_sta_config::encode (cyclomatic 17) embassy-net-esp-hosted/src/proto/mcu/mod.rs:5946— r#wifi_sta_config::encode 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. This shape REPEATS in the file: one other method here (r#wifi_sta_config::compute_size) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_sta_config::compute_size (cyclomatic 17) embassy-net-esp-hosted/src/proto/mcu/mod.rs:6063— r#wifi_sta_config::compute_size 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. This shape REPEATS in the file: one other method here (r#wifi_sta_config::encode) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
Jpeg::decode (cyclomatic 23) embassy-stm32/src/jpeg.rs:379— Jpeg::decode 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.
Jpeg::decode_blocking (cyclomatic 22) embassy-stm32/src/jpeg.rs:617— Jpeg::decode_blocking 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.
Jpeg::encode_blocking (cyclomatic 16) embassy-stm32/src/jpeg.rs:525— Jpeg::encode_blocking 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.
Inner::handle_control_out (cyclomatic 23) embassy-usb/src/lib.rs:472— Inner::handle_control_out has cyclomatic complexity 23 (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.
Inner::handle_control_in (cyclomatic 18) embassy-usb/src/lib.rs:598— Inner::handle_control_in 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.
Inner::handle_get_descriptor (cyclomatic 16) embassy-usb/src/lib.rs:695— Inner::handle_get_descriptor has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
InterruptHandler::on_interrupt (cyclomatic 18) embassy-mcxa/src/i3c/target.rs:1437— InterruptHandler::on_interrupt 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.
InterruptHandler::on_interrupt (cyclomatic 18) embassy-rp/src/usb/host.rs:1845— InterruptHandler::on_interrupt 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.
InterruptHandler::on_interrupt (cyclomatic 17) embassy-nrf/src/buffered_uarte/v1.rs:80— InterruptHandler::on_interrupt 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.
r#wifi_init_config::decode (cognitive 75) embassy-net-esp-hosted/src/proto/mcu/mod.rs:584— r#wifi_init_config::decode has cognitive complexity 75 (threshold 15). Drivers by points: if/else 24 (72 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
r#wifi_init_config::encode (cognitive 24) embassy-net-esp-hosted/src/proto/mcu/mod.rs:1040— r#wifi_init_config::encode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24. 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. This shape REPEATS in the file: one other method here (r#wifi_init_config::compute_size) 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.
r#wifi_init_config::compute_size (cognitive 24) embassy-net-esp-hosted/src/proto/mcu/mod.rs:1215— r#wifi_init_config::compute_size has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24. 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. This shape REPEATS in the file: one other method here (r#wifi_init_config::encode) 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.
r#wifi_pkt_rx_ctrl::decode (cognitive 60) embassy-net-esp-hosted/src/proto/mcu/mod.rs:7198— r#wifi_pkt_rx_ctrl::decode has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (57 pts), match/switch 1 (2 pts), loops 1 (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.
r#wifi_pkt_rx_ctrl::encode (cognitive 19) embassy-net-esp-hosted/src/proto/mcu/mod.rs:7564— r#wifi_pkt_rx_ctrl::encode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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. This shape REPEATS in the file: one other method here (r#wifi_pkt_rx_ctrl::compute_size) 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.
r#wifi_pkt_rx_ctrl::compute_size (cognitive 19) embassy-net-esp-hosted/src/proto/mcu/mod.rs:7704— r#wifi_pkt_rx_ctrl::compute_size has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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. This shape REPEATS in the file: one other method here (r#wifi_pkt_rx_ctrl::encode) 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.
r#wifi_ap_config::decode (cognitive 45) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4521— r#wifi_ap_config::decode has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (42 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
r#wifi_ap_config::encode (cognitive 18) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4866— r#wifi_ap_config::encode 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. This shape REPEATS in the file: one other method here (r#wifi_ap_config::compute_size) 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.
r#wifi_ap_config::compute_size (cognitive 18) embassy-net-esp-hosted/src/proto/mcu/mod.rs:4997— r#wifi_ap_config::compute_size 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. This shape REPEATS in the file: one other method here (r#wifi_ap_config::encode) 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.
Jpeg::decode (cognitive 36) embassy-stm32/src/jpeg.rs:379— Jpeg::decode has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 6, loops 3 (5 pts), 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.
Jpeg::decode_blocking (cognitive 31) embassy-stm32/src/jpeg.rs:617— Jpeg::decode_blocking has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 6, loops 3 (5 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.
Jpeg::encode_blocking (cognitive 21) embassy-stm32/src/jpeg.rs:525— Jpeg::encode_blocking has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 2 (4 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.
r#wifi_sta_config::decode (cognitive 33) embassy-net-esp-hosted/src/proto/mcu/mod.rs:5646— r#wifi_sta_config::decode has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (30 pts), match/switch 1 (2 pts), 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.
r#wifi_sta_config::encode (cognitive 16) embassy-net-esp-hosted/src/proto/mcu/mod.rs:5946— r#wifi_sta_config::encode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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. This shape REPEATS in the file: one other method here (r#wifi_sta_config::compute_size) 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.
r#wifi_sta_config::compute_size (cognitive 16) embassy-net-esp-hosted/src/proto/mcu/mod.rs:6063— r#wifi_sta_config::compute_size has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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. This shape REPEATS in the file: one other method here (r#wifi_sta_config::encode) 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.
embassy_stm32_wpan::wba::linklayer_plat::BLECB_Indication (cognitive 32) embassy-stm32-wpan/src/wba/linklayer_plat.rs:1728— embassy_stm32_wpan::wba::linklayer_plat::BLECB_Indication has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (29 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.
embassy_stm32_wpan::bluetooth::gap_init::init_gap_and_hal (cognitive 20) embassy-stm32-wpan/src/bluetooth/gap_init.rs:269— embassy_stm32_wpan::bluetooth::gap_init::init_gap_and_hal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 pts), 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, 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.
embassy_stm32_wpan::bluetooth::gatt::events::client_events_from_vendor_event (cognitive 16) embassy-stm32-wpan/src/bluetooth/gatt/events.rs:414— embassy_stm32_wpan::bluetooth::gatt::events::client_events_from_vendor_event has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (3 pts), match/switch 2 (3 pts) (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.
Hash::update (cognitive 24) embassy-stm32/src/hash/mod.rs:848— Hash::update has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (6 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.
Hash::start (cognitive 21) embassy-stm32/src/hash/mod.rs:372— Hash::start has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 6). 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.
Hash::finish (cognitive 17) embassy-stm32/src/hash/mod.rs:945— Hash::finish has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, loops 5 (7 pts), boolean chains 2 (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.
embassy_mcxa::clocks::sleep::restart_active_only_clocks (cognitive 17) embassy-mcxa/src/clocks/sleep.rs:111— embassy_mcxa::clocks::sleep::restart_active_only_clocks has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 5, boolean chains 4 (nesting depth added 4). 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.
embassy_mcxa::lpuart::bbq::handler (cognitive 17) embassy-mcxa/src/lpuart/bbq.rs:1725— embassy_mcxa::lpuart::bbq::handler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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.
embassy_mcxa::flexcan::classic::init (cognitive 16) embassy-mcxa/src/flexcan/classic/mod.rs:662— embassy_mcxa::flexcan::classic::init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, match/switch 2 (3 pts) (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.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×3
Edited copy of a member (23 corresponding lines) embassy-stm32/src/crypto_driver.rs:607— embassy-stm32/src/crypto_driver.rs:607-629 | embassy-stm32/src/crypto_driver.rs:670-692 — 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) embassy-stm32/src/crypto_driver.rs:631— embassy-stm32/src/crypto_driver.rs:631-653 | embassy-stm32/src/crypto_driver.rs:694-716 — 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) embassy-net-esp-hosted/src/proto/mcu/mod.rs:34756— embassy-net-esp-hosted/src/proto/mcu/mod.rs:34756-34780 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35007-35038 — 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· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (6 members, 50+ identical tokens) embassy-net-esp-hosted/src/proto/fg/mod.rs:2448— embassy-net-esp-hosted/src/proto/fg/mod.rs:2448-2472 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3686-3710 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9613-9651 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9882-9913 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36679-36717 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36948-36979 — 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) embassy-net-esp-hosted/src/proto/fg/mod.rs:2473— embassy-net-esp-hosted/src/proto/fg/mod.rs:2473-2495 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3711-3733 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9652-9686 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9914-9942 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36718-36752 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36980-37008 — 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) embassy-stm32/src/hspi/mod.rs:766— embassy-stm32/src/hspi/mod.rs:766-806 | embassy-stm32/src/hspi/mod.rs:842-882 | embassy-stm32/src/ospi/mod.rs:1915-1953 | embassy-stm32/src/ospi/mod.rs:1990-2028 | embassy-stm32/src/xspi/mod.rs:1715-1755 | embassy-stm32/src/xspi/mod.rs:1791-1831 — 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.
Duplicated block (28 lines × 2) cyw43/src/sdio.rs:117— cyw43/src/sdio.rs:117-144 | cyw43/src/spi.rs:101-128 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (28 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:9297— embassy-net-esp-hosted/src/proto/fg/mod.rs:9297-9324 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10625-10652 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (28 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:35779— embassy-net-esp-hosted/src/proto/mcu/mod.rs:35779-35806 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48556-48583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:380— embassy-net-esp-hosted/src/proto/fg/mod.rs:380-396 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8802-8818 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10870-10886 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11739-11755 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15583-15599 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25936-25952 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:500— embassy-net-esp-hosted/src/proto/fg/mod.rs:500-516 | embassy-net-esp-hosted/src/proto/fg/mod.rs:940-956 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1305-1321 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15912-15928 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16352-16368 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16967-16983 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:2382— embassy-net-esp-hosted/src/proto/fg/mod.rs:2382-2398 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3620-3636 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9511-9527 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9798-9814 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36577-36593 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36864-36880 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:9195— embassy-net-esp-hosted/src/proto/fg/mod.rs:9195-9211 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10538-10554 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22005-22021 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22136-22152 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:9662— embassy-net-esp-hosted/src/proto/fg/mod.rs:9662-9678 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9924-9940 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36728-36744 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36990-37006 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (17 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:12052— embassy-net-esp-hosted/src/proto/fg/mod.rs:12052-12068 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12617-12633 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50248-50264 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50837-50853 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 3) embassy-executor/src/platform/cortex_m.rs:208— embassy-executor/src/platform/cortex_m.rs:208-223 | embassy-mspm0/src/executor.rs:223-238 | embassy-stm32/src/executor.rs:249-264 — before extracting anything, compare `embassy-executor/src/platform/cortex_m.rs` and `embassy-mspm0/src/executor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) embassy-mcxa/src/spi/controller.rs:553— embassy-mcxa/src/spi/controller.rs:553-568 | embassy-mcxa/src/spi/controller.rs:677-692 | embassy-mcxa/src/spi/controller.rs:767-782 — 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 (16 lines × 3) embassy-nxp/src/i2c/lpc55.rs:160— embassy-nxp/src/i2c/lpc55.rs:160-175 | embassy-nxp/src/spi/lpc55.rs:116-131 | embassy-nxp/src/usart/lpc55.rs:610-625 — `embassy-nxp/src/spi/lpc55.rs` and `embassy-nxp/src/usart/lpc55.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 48 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 (15–16 lines × 2) embassy-mcxa/src/i2c/target.rs:912— embassy-mcxa/src/i2c/target.rs:912-927 | embassy-mcxa/src/spi/controller.rs:632-646 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15–16 lines × 2) embassy-rp/src/i2c.rs:696— embassy-rp/src/i2c.rs:696-710 | embassy-rp/src/i2c_slave.rs:407-422 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15–16 lines × 2) embassy-stm32/src/eth/sma/v2.rs:85— embassy-stm32/src/eth/sma/v2.rs:85-100 | embassy-stm32/src/eth/sma/v2.rs:116-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.
Duplicated block (14 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:5107— embassy-net-esp-hosted/src/proto/fg/mod.rs:5107-5120 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5853-5866 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18463-18476 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45300-45313 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46200-46213 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:8773— embassy-net-esp-hosted/src/proto/fg/mod.rs:8773-8786 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9156-9169 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4541-4554 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10499-10512 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10841-10854 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:9172— embassy-net-esp-hosted/src/proto/fg/mod.rs:9172-9185 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2486-2499 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5692-5705 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9982-9995 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10515-10528 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:155— embassy-net-esp-hosted/src/proto/fg/mod.rs:155-167 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8780-8792 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9163-9175 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10506-10518 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10848-10860 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:8887— embassy-net-esp-hosted/src/proto/fg/mod.rs:8887-8899 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9288-9300 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4880-4892 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10616-10628 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10940-10952 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:9302— embassy-net-esp-hosted/src/proto/fg/mod.rs:9302-9314 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2645-2657 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5981-5993 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10067-10079 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10630-10642 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:377— embassy-net-esp-hosted/src/proto/fg/mod.rs:377-389 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1711-1723 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6472-6484 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15580-15592 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:19199— embassy-net-esp-hosted/src/proto/mcu/mod.rs:19199-19211 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19660-19672 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47043-47055 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47561-47573 — 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 (13 lines × 4) embassy-stm32/src/hspi/mod.rs:590— embassy-stm32/src/hspi/mod.rs:590-602 | embassy-stm32/src/hspi/mod.rs:683-695 | embassy-stm32/src/xspi/mod.rs:783-795 | embassy-stm32/src/xspi/mod.rs:1248-1260 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/xspi/mod.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 19 separate duplicated blocks between them, totalling at least 193 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 (12–13 lines × 2) embassy-mspm0/src/i2c.rs:1072— embassy-mspm0/src/i2c.rs:1072-1084 | embassy-mspm0/src/i2c_target.rs:218-229 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–13 lines × 2) embassy-rp/src/clocks.rs:240— embassy-rp/src/clocks.rs:240-251 | embassy-rp/src/clocks.rs:259-271 — both copies are in the same file, so extract the 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–13 lines × 2) embassy-stm32/src/spi/mod.rs:1571— embassy-stm32/src/spi/mod.rs:1571-1583 | embassy-stm32/src/spi/mod.rs:1662-1673 — both copies are in the same file, so extract the 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–9 lines × 2) embassy-mcxa/src/dma.rs:2552— embassy-mcxa/src/dma.rs:2552-2560 | embassy-mcxa/src/dma.rs:2563-2570 — both copies are in the same file, so extract the 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–9 lines × 2) embassy-mspm0/src/i2c.rs:621— embassy-mspm0/src/i2c.rs:621-628 | embassy-mspm0/src/i2c.rs:787-795 — both copies are in the same file, so extract the 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–9 lines × 2) embassy-stm32/src/rcc/u3.rs:449— embassy-stm32/src/rcc/u3.rs:449-456 | embassy-stm32/src/rcc/u5.rs:463-471 — before extracting anything, compare `embassy-stm32/src/rcc/u3.rs` and `embassy-stm32/src/rcc/u5.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–8 lines × 2) embassy-nrf/src/pwm.rs:140— embassy-nrf/src/pwm.rs:140-147 | embassy-nrf/src/pwm.rs:892-898 — both copies are in the same file, so extract the 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–8 lines × 2) embassy-stm32/src/rcc/c5.rs:179— embassy-stm32/src/rcc/c5.rs:179-185 | embassy-stm32/src/rcc/h.rs:713-720 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–8 lines × 2) embassy-stm32/src/rcc/n6.rs:741— embassy-stm32/src/rcc/n6.rs:741-748 | embassy-stm32/src/rcc/n6.rs:763-769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 7) embassy-mspm0/src/sysctl/c1103_1104.rs:39— embassy-mspm0/src/sysctl/c1103_1104.rs:39-43 | embassy-mspm0/src/sysctl/c1105_1106.rs:39-43 | embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:44-48 | embassy-mspm0/src/sysctl/g151x_351x.rs:44-48 | embassy-mspm0/src/sysctl/g511x_518x.rs:49-53 | embassy-mspm0/src/sysctl/h321x.rs:39-43 | embassy-mspm0/src/sysctl/l_typeb.rs:39-43 — 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 7 call sites, so a change lands once.
Duplicated block (5 lines × 7) embassy-executor/build_common.rs:32— embassy-executor/build_common.rs:32-36 | embassy-hal-internal/build_common.rs:32-36 | embassy-mcxa/build_common.rs:32-36 | embassy-mspm0/build_common.rs:32-36 | embassy-nxp/build_common.rs:32-36 | embassy-stm32/build_common.rs:32-36 | embassy-sync/build_common.rs:32-36 — `embassy-executor/build_common.rs` and `embassy-hal-internal/build_common.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 42 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 (5 lines × 7) embassy-executor/build_common.rs:47— embassy-executor/build_common.rs:47-51 | embassy-hal-internal/build_common.rs:47-51 | embassy-mcxa/build_common.rs:47-51 | embassy-mspm0/build_common.rs:47-51 | embassy-nxp/build_common.rs:47-51 | embassy-stm32/build_common.rs:47-51 | embassy-sync/build_common.rs:47-51 — `embassy-executor/build_common.rs` and `embassy-hal-internal/build_common.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 42 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 (6 lines × 5) embassy-mcxa/src/gpio.rs:1003— embassy-mcxa/src/gpio.rs:1003-1008 | embassy-microchip/src/gpio.rs:140-145 | embassy-mspm0/src/gpio.rs:400-405 | embassy-nxp/src/gpio/rt1xxx.rs:373-378 | embassy-rp/src/gpio.rs:125-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (6 lines × 5) embassy-stm32/src/flash/f0.rs:12— embassy-stm32/src/flash/f0.rs:12-17 | embassy-stm32/src/flash/f1f3.rs:12-17 | embassy-stm32/src/flash/f2.rs:22-27 | embassy-stm32/src/flash/f4.rs:35-40 | embassy-stm32/src/flash/f7.rs:18-23 — before extracting anything, compare `embassy-stm32/src/flash/f0.rs` and `embassy-stm32/src/flash/f1f3.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) embassy-stm32/src/dfsdm/detector.rs:269— embassy-stm32/src/dfsdm/detector.rs:269-274 | embassy-stm32/src/dfsdm/filter.rs:884-892 | embassy-stm32/src/dfsdm/filter.rs:895-903 | embassy-stm32/src/dfsdm/filter.rs:914-922 | embassy-stm32/src/dfsdm/filter.rs:925-933 — 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.
embassy_usb_synopsys_otg::host::on_host_interrupt (cyclomatic 41) embassy-usb-synopsys-otg/src/host.rs:176— embassy_usb_synopsys_otg::host::on_host_interrupt 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.
embassy_usb_synopsys_otg::on_interrupt (cyclomatic 25) embassy-usb-synopsys-otg/src/lib.rs:38— embassy_usb_synopsys_otg::on_interrupt 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.
Channel::configure (cyclomatic 36) embassy-stm32/src/dma/dma_bdma.rs:501— Channel::configure has cyclomatic complexity 36 (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.
Channel::configure (cyclomatic 22) embassy-stm32/src/dma/gpdma/mod.rs:629— Channel::configure 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.
embassy_crypto_test::p384::arith (cyclomatic 32) embassy-crypto-test/src/lib.rs:1035— embassy_crypto_test::p384::arith 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. This shape REPEATS in the file: one other method here (embassy_crypto_test::p256::arith) 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.
embassy_crypto_test::p256::arith (cyclomatic 32) embassy-crypto-test/src/lib.rs:1035— embassy_crypto_test::p256::arith 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. This shape REPEATS in the file: one other method here (embassy_crypto_test::p384::arith) 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.
embassy_executor_macros::macros::task::run (cyclomatic 27) embassy-executor-macros/src/macros/task.rs:21— embassy_executor_macros::macros::task::run has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
embassy_executor_macros::macros::main::run (cyclomatic 22) embassy-executor-macros/src/macros/main.rs:78— embassy_executor_macros::macros::main::run has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
BufferedInterruptHandler::on_interrupt (cyclomatic 24) embassy-mcxa/src/lpuart/buffered.rs:539— BufferedInterruptHandler::on_interrupt 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.
BufferedInterruptHandler::on_interrupt (cyclomatic 18) embassy-rp/src/uart/buffered.rs:689— BufferedInterruptHandler::on_interrupt 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.
UartRx::inner_read_run (cyclomatic 21) embassy-stm32/src/usart/mod.rs:1093— UartRx::inner_read_run 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.
UartRx::read_to_break_with_count (cyclomatic 18) embassy-rp/src/uart/mod.rs:607— UartRx::read_to_break_with_count 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.
I3c::listen (cyclomatic 19) embassy-mcxa/src/i3c/target.rs:1276— I3c::listen 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.
I3c::async_wait_for_ibi (cyclomatic 16) embassy-mcxa/src/i3c/controller.rs:1604— I3c::async_wait_for_ibi 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.
FormatInterrupt::format (cyclomatic 17) cyw43/src/consts.rs:370— FormatInterrupt::format 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. This shape REPEATS in the file: one other method here (FormatInterrupt::fmt) 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. This is NOT this file's highest cyclomatic complexity: EStatus::from (cyclomatic 18) 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 function is counted neither in this dimension's figures nor in its score.
FormatInterrupt::fmt (cyclomatic 17) cyw43/src/consts.rs:404— FormatInterrupt::fmt 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. This shape REPEATS in the file: one other method here (FormatInterrupt::format) 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. This is NOT this file's highest cyclomatic complexity: EStatus::from (cyclomatic 18) 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 function is counted neither in this dimension's figures nor in its score.
embassy_usb_synopsys_otg::host::on_host_interrupt (cognitive 85) embassy-usb-synopsys-otg/src/host.rs:176— embassy_usb_synopsys_otg::host::on_host_interrupt has cognitive complexity 85 (threshold 15). Drivers by points: if/else 28 (55 pts), loops 7 (22 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
embassy_usb_synopsys_otg::on_interrupt (cognitive 52) embassy-usb-synopsys-otg/src/lib.rs:38— embassy_usb_synopsys_otg::on_interrupt has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 6 (15 pts), boolean chains 2, 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.
embassy_rp::clocks::init (cognitive 48) embassy-rp/src/clocks.rs:979— embassy_rp::clocks::init has cognitive complexity 48 (threshold 15). Drivers by points: match/switch 13 (24 pts), if/else 11 (12 pts), loops 10 (12 pts) (nesting depth added 14). 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.
embassy_rp::clocks::find_pll_params (cognitive 32) embassy-rp/src/clocks.rs:905— embassy_rp::clocks::find_pll_params has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 6 (12 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BufferedInterruptHandler::on_interrupt (cognitive 39) embassy-mcxa/src/lpuart/buffered.rs:539— BufferedInterruptHandler::on_interrupt has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 5, loops 2 (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.
BufferedInterruptHandler::on_interrupt (cognitive 28) embassy-rp/src/uart/buffered.rs:689— BufferedInterruptHandler::on_interrupt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 2 (4 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.
StateInner::poll (cognitive 38) embassy-net-nrf91/src/lib.rs:349— StateInner::poll has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (10 pts), match/switch 1 (3 pts), boolean chains 1 (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.
StateInner::handle_data (cognitive 25) embassy-net-nrf91/src/lib.rs:630— StateInner::handle_data has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 4 (8 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.
Channel::configure (cognitive 36) embassy-stm32/src/dma/dma_bdma.rs:501— Channel::configure has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 9 (14 pts), loops 2 (4 pts), boolean chains 2 (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.
Channel::configure (cognitive 19) embassy-stm32/src/dma/gpdma/mod.rs:629— Channel::configure has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 6, boolean chains 4, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioCollectionBuilder::on_other (cognitive 35) embassy-usb-host/src/class/uac/descriptors.rs:179— AudioCollectionBuilder::on_other has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (31 pts), match/switch 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioCollectionBuilder::on_interface (cognitive 19) embassy-usb-host/src/class/uac/descriptors.rs:95— AudioCollectionBuilder::on_interface has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
embassy_crypto_test::p384::arith (cognitive 32) embassy-crypto-test/src/lib.rs:1035— embassy_crypto_test::p384::arith has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21, boolean chains 11. 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. This shape REPEATS in the file: one other method here (embassy_crypto_test::p256::arith) 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.
embassy_crypto_test::p256::arith (cognitive 32) embassy-crypto-test/src/lib.rs:1035— embassy_crypto_test::p256::arith has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21, boolean chains 11. 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. This shape REPEATS in the file: one other method here (embassy_crypto_test::p384::arith) 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.
embassy_executor_macros::macros::task::run (cognitive 30) embassy-executor-macros/src/macros/task.rs:21— embassy_executor_macros::macros::task::run has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 9 (15 pts), if/else 11, boolean chains 2, loops 2 (nesting depth added 6). 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.
embassy_executor_macros::macros::main::run (cognitive 21) embassy-executor-macros/src/macros/main.rs:78— embassy_executor_macros::macros::main::run has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 9 (11 pts), if/else 9, loops 1 (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.
embassy_mspm0::uart::buffered::on_interrupt (cognitive 30) embassy-mspm0/src/uart/buffered.rs:1017— embassy_mspm0::uart::buffered::on_interrupt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 2 (4 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.
embassy_mspm0::uart::set_baudrate_inner (cognitive 19) embassy-mspm0/src/uart/mod.rs:883— embassy_mspm0::uart::set_baudrate_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Ospi::configure_octospim_data_group (cognitive 28) embassy-stm32/src/ospi/mod.rs:419— Ospi::configure_octospim_data_group has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (28 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.
Ospi::configure_octospim_control_group (cognitive 16) embassy-stm32/src/ospi/mod.rs:476— Ospi::configure_octospim_control_group has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UartRx::read_to_break_with_count (cognitive 26) embassy-rp/src/uart/mod.rs:607— UartRx::read_to_break_with_count has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UartRx::inner_read_run (cognitive 21) embassy-stm32/src/usart/mod.rs:1093— UartRx::inner_read_run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 3, 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.
AesDriver::apply_keystream (cognitive 26) embassy-stm32/src/crypto_driver.rs:830— AesDriver::apply_keystream has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (12 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. This shape REPEATS in the file: one other method here (AesDriver::apply_keystream) 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.
AesDriver::apply_keystream (cognitive 26) embassy-stm32/src/crypto_driver.rs:919— AesDriver::apply_keystream has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (12 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. This shape REPEATS in the file: one other method here (AesDriver::apply_keystream) 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.
Spi::blocking_transfer (cognitive 24) embassy-mcxa/src/spi/controller.rs:303— Spi::blocking_transfer has cognitive complexity 24 (threshold 15). Drivers by points: loops 9 (20 pts), if/else 3, boolean chains 1 (nesting depth added 11). 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.
Spi::get_current_config (cognitive 16) embassy-stm32/src/spi/mod.rs:680— Spi::get_current_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 1 (2 pts), boolean chains 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.
Driver::alloc_endpoint (cognitive 23) embassy-usb-synopsys-otg/src/lib.rs:558— Driver::alloc_endpoint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 3 (5 pts), boolean chains 2 (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.
Driver::alloc_endpoint (cognitive 16) embassy-rp/src/usb/device.rs:127— Driver::alloc_endpoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, match/switch 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.
AudioSourceControlHandler::handle_control_in (cognitive 19) embassy-usb/src/class/uac1/source.rs:398— AudioSourceControlHandler::handle_control_in has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioSourceControlHandler::handle_ep_out (cognitive 19) embassy-usb/src/class/uac1/source.rs:567— AudioSourceControlHandler::handle_ep_out has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tc6::process_rx_chunk (cognitive 17) embassy-net-adin1110/src/protocol/tc6.rs:367— Tc6::process_rx_chunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tc6::send_frame_on_port (cognitive 17) embassy-net-adin1110/src/protocol/tc6.rs:486— Tc6::send_frame_on_port has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FormatInterrupt::format (cognitive 16) cyw43/src/consts.rs:370— FormatInterrupt::format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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. This shape REPEATS in the file: one other method here (FormatInterrupt::fmt) 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.
FormatInterrupt::fmt (cognitive 16) cyw43/src/consts.rs:404— FormatInterrupt::fmt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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. This shape REPEATS in the file: one other method here (FormatInterrupt::format) 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.
Near-duplicate member pair (29 shared lines) embassy-stm32/src/ospi/mod.rs:706— embassy-stm32/src/ospi/mod.rs:706-810 | embassy-stm32/src/xspi/mod.rs:486-607 — These two members are variants of one another: 29 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 (29 shared lines) embassy-stm32/src/spi/mod.rs:1650— embassy-stm32/src/spi/mod.rs:1650-1732 | embassy-stm32/src/spi/mod.rs:1741-1798 — These two members are variants of one another: 29 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 (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) embassy-stm32/src/can/fdcan.rs:370— embassy-stm32/src/can/fdcan.rs:370-386 | embassy-stm32/src/can/fdcan.rs:737-753 — 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) embassy-stm32/src/can/fdcan.rs:417— embassy-stm32/src/can/fdcan.rs:417-433 | embassy-stm32/src/can/fdcan.rs:763-779 — 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.
Duplicated block (38 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:2789— embassy-net-esp-hosted/src/proto/fg/mod.rs:2789-2826 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3290-3327 — both copies are in the same file, so extract the 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 (38 lines × 2) embassy-rp/src/block.rs:303— embassy-rp/src/block.rs:303-340 | embassy-rp/src/block.rs:549-586 — both copies are in the same file, so extract the 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 (32 lines × 2) embassy-rp/src/pio_programs/ws2812.rs:142— embassy-rp/src/pio_programs/ws2812.rs:142-173 | embassy-rp/src/pio_programs/ws2812.rs:251-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32 lines × 2) embassy-stm32/src/rcc/u3.rs:213— embassy-stm32/src/rcc/u3.rs:213-244 | embassy-stm32/src/rcc/u5.rs:208-239 — before extracting anything, compare `embassy-stm32/src/rcc/u3.rs` and `embassy-stm32/src/rcc/u5.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (31 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:13395— embassy-net-esp-hosted/src/proto/mcu/mod.rs:13395-13425 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13549-13579 — both copies are in the same file, so extract the 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 (31 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:35254— embassy-net-esp-hosted/src/proto/mcu/mod.rs:35254-35284 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35746-35776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27–28 lines × 2) embassy-mcxa/src/sgi/mod.rs:561— embassy-mcxa/src/sgi/mod.rs:561-588 | embassy-mcxa/src/sgi/mod.rs:612-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.
Duplicated block (27–28 lines × 2) embassy-rp/src/uart/mod.rs:509— embassy-rp/src/uart/mod.rs:509-535 | embassy-rp/src/uart/mod.rs:677-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) embassy-mcxa/src/i3c/controller.rs:1008— embassy-mcxa/src/i3c/controller.rs:1008-1033 | embassy-mcxa/src/i3c/controller.rs:1282-1307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:8896— embassy-net-esp-hosted/src/proto/fg/mod.rs:8896-8921 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10949-10974 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (21 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:8886— embassy-net-esp-hosted/src/proto/fg/mod.rs:8886-8906 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9287-9307 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10615-10635 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10939-10959 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (21 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:19144— embassy-net-esp-hosted/src/proto/mcu/mod.rs:19144-19164 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19590-19610 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46988-47008 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47506-47526 — 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 (18 lines × 4) embassy-mcxa/src/clocks/periph_helpers.rs:519— embassy-mcxa/src/clocks/periph_helpers.rs:519-536 | embassy-mcxa/src/clocks/periph_helpers.rs:661-678 | embassy-mcxa/src/clocks/periph_helpers.rs:1298-1315 | embassy-mcxa/src/clocks/periph_helpers.rs:1796-1813 — 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 (18 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:8932— embassy-net-esp-hosted/src/proto/fg/mod.rs:8932-8949 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9340-9357 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10662-10679 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10979-10996 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (18 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:9188— embassy-net-esp-hosted/src/proto/fg/mod.rs:9188-9205 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10531-10548 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22129-22146 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (18 lines × 3) embassy-net-esp-hosted/src/proto/mcu/mod.rs:38285— embassy-net-esp-hosted/src/proto/mcu/mod.rs:38285-38302 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38732-38749 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39234-39251 — 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 (17 lines × 5) embassy-net-esp-hosted/src/proto/mcu/mod.rs:22766— embassy-net-esp-hosted/src/proto/mcu/mod.rs:22766-22782 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23266-23282 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27109-27125 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27733-27749 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27852-27868 — 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.
Duplicated block (17 lines × 5) embassy-stm32/src/jpeg.rs:238— embassy-stm32/src/jpeg.rs:238-254 | embassy-stm32/src/jpeg.rs:300-316 | embassy-stm32/src/jpeg.rs:403-419 | embassy-stm32/src/jpeg.rs:546-562 | embassy-stm32/src/jpeg.rs:635-651 — 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.
Duplicated block (16 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:145— embassy-net-esp-hosted/src/proto/fg/mod.rs:145-160 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8796-8811 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3342-3357 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10864-10879 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11988-12003 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25930-25945 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:2449— embassy-net-esp-hosted/src/proto/fg/mod.rs:2449-2464 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3687-3702 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9614-9629 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9883-9898 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36680-36695 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36949-36964 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:496— embassy-net-esp-hosted/src/proto/fg/mod.rs:496-509 | embassy-net-esp-hosted/src/proto/fg/mod.rs:807-820 | embassy-net-esp-hosted/src/proto/fg/mod.rs:936-949 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15908-15921 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16219-16232 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16348-16361 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 6) embassy-net-esp-hosted/src/proto/mcu/mod.rs:38282— embassy-net-esp-hosted/src/proto/mcu/mod.rs:38282-38295 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38502-38515 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38729-38742 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39002-39015 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39231-39244 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39450-39463 — 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.
Duplicated block (12 lines × 7) embassy-net-esp-hosted/src/proto/fg/mod.rs:886— embassy-net-esp-hosted/src/proto/fg/mod.rs:886-897 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5780-5791 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10499-10510 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16298-16309 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18390-18401 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32852-32863 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40825-40836 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (12 lines × 7) embassy-net-esp-hosted/src/proto/fg/mod.rs:10648— embassy-net-esp-hosted/src/proto/fg/mod.rs:10648-10659 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10850-10861 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11052-11063 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9852-9863 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47921-47932 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48126-48137 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48331-48342 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (11–12 lines × 3) embassy-stm32/src/aes/common.rs:361— embassy-stm32/src/aes/common.rs:361-372 | embassy-stm32/src/aes/v2.rs:270-280 | embassy-stm32/src/saes/mod.rs:627-638 — before extracting anything, compare `embassy-stm32/src/aes/common.rs` and `embassy-stm32/src/aes/v2.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (11–12 lines × 3) embassy-stm32/src/spi/ringbuffered.rs:201— embassy-stm32/src/spi/ringbuffered.rs:201-211 | embassy-stm32/src/spi/ringbuffered.rs:257-268 | embassy-stm32/src/usart/ringbuffered.rs:261-271 — `embassy-stm32/src/spi/ringbuffered.rs` and `embassy-stm32/src/usart/ringbuffered.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 32 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 (11 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:8933— embassy-net-esp-hosted/src/proto/fg/mod.rs:8933-8943 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9341-9351 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5008-5018 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10663-10673 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10980-10990 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (11 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:9353— embassy-net-esp-hosted/src/proto/fg/mod.rs:9353-9363 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2703-2713 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6092-6102 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10100-10110 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10675-10685 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (10 lines × 8) embassy-net-esp-hosted/src/proto/fg/mod.rs:370— embassy-net-esp-hosted/src/proto/fg/mod.rs:370-379 | embassy-net-esp-hosted/src/proto/fg/mod.rs:617-626 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1295-1304 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6465-6474 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15573-15582 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16029-16038 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16957-16966 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25417-25426 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (10 lines × 8) embassy-net-esp-hosted/src/proto/fg/mod.rs:886— embassy-net-esp-hosted/src/proto/fg/mod.rs:886-895 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3044-3053 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5780-5789 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10499-10508 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16298-16307 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18390-18399 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32852-32861 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40825-40834 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (10 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:285— embassy-net-esp-hosted/src/proto/fg/mod.rs:285-294 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8951-8960 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3480-3489 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10998-11007 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12184-12193 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (10 lines × 5) embassy-stm32/src/rcc/c0.rs:120— embassy-stm32/src/rcc/c0.rs:120-129 | embassy-stm32/src/rcc/f013.rs:197-206 | embassy-stm32/src/rcc/f247.rs:193-202 | embassy-stm32/src/rcc/g0.rs:152-161 | embassy-stm32/src/rcc/g4.rs:139-148 — before extracting anything, compare `embassy-stm32/src/rcc/f013.rs` and `embassy-stm32/src/rcc/f247.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (9 lines × 12) embassy-net-esp-hosted/src/proto/mcu/mod.rs:17941— embassy-net-esp-hosted/src/proto/mcu/mod.rs:17941-17949 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21472-21480 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22403-22411 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25050-25058 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25308-25316 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26431-26439 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37158-37166 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37378-37386 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37598-37606 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41109-41117 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47040-47048 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47558-47566 — all 12 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 × 12) embassy-net-esp-hosted/src/proto/mcu/mod.rs:17958— embassy-net-esp-hosted/src/proto/mcu/mod.rs:17958-17966 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21489-21497 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22420-22428 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25067-25075 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25325-25333 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26448-26456 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37175-37183 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37395-37403 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37615-37623 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41147-41155 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47057-47065 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47575-47583 — all 12 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 × 5) embassy-nxp/src/casper/lpc55.rs:316— embassy-nxp/src/casper/lpc55.rs:316-324 | embassy-nxp/src/casper/lpc55.rs:348-356 | embassy-nxp/src/casper/lpc55.rs:378-386 | embassy-nxp/src/casper/lpc55.rs:413-421 | embassy-nxp/src/casper/lpc55.rs:448-456 — 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.
Duplicated block (9 lines × 5) embassy-imxrt/src/lib.rs:167— embassy-imxrt/src/lib.rs:167-175 | embassy-mspm0/src/lib.rs:240-248 | embassy-nrf/src/gpiote.rs:275-283 | embassy-nxp/src/lib.rs:195-203 | embassy-stm32/src/exti/mod.rs:78-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (8 lines × 5) embassy-rp/src/i2c.rs:493— embassy-rp/src/i2c.rs:493-500 | embassy-rp/src/spi.rs:157-164 | embassy-rp/src/spi.rs:170-177 | embassy-rp/src/spi.rs:183-190 | embassy-rp/src/spi.rs:196-203 — 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.
Duplicated block (8 lines × 5) embassy-rp/src/pio/mod.rs:1328— embassy-rp/src/pio/mod.rs:1328-1337 | embassy-rp/src/spi.rs:160-167 | embassy-rp/src/spi.rs:173-180 | embassy-rp/src/spi.rs:186-193 | embassy-rp/src/spi.rs:199-206 — 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.
Duplicated block (7 lines × 7) embassy-mcxa/src/spi/controller.rs:914— embassy-mcxa/src/spi/controller.rs:914-920 | embassy-mcxa/src/spi/controller.rs:960-966 | embassy-mcxa/src/spi/controller.rs:996-1002 | embassy-mcxa/src/spi/controller.rs:1028-1034 | embassy-mcxa/src/spi/controller.rs:1059-1065 | embassy-mcxa/src/spi/controller.rs:1074-1080 | embassy-mcxa/src/spi/controller.rs:1211-1217 — 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.
Duplicated block (7 lines × 7) embassy-executor/build_common.rs:59— embassy-executor/build_common.rs:59-65 | embassy-hal-internal/build_common.rs:59-65 | embassy-mcxa/build_common.rs:59-65 | embassy-mspm0/build_common.rs:59-65 | embassy-nxp/build_common.rs:59-65 | embassy-stm32/build_common.rs:59-65 | embassy-sync/build_common.rs:59-65 — `embassy-executor/build_common.rs` and `embassy-hal-internal/build_common.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 42 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 (5 lines × 5) embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:55— embassy-mspm0/src/sysctl/g110x_150x_310x_350x.rs:55-59 | embassy-mspm0/src/sysctl/g151x_351x.rs:55-59 | embassy-mspm0/src/sysctl/g511x_518x.rs:61-65 | embassy-mspm0/src/sysctl/h321x.rs:49-54 | embassy-mspm0/src/sysctl/l_typeb.rs:49-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (5 lines × 5) embassy-nxp/src/i2c/lpc55.rs:252— embassy-nxp/src/i2c/lpc55.rs:252-256 | embassy-nxp/src/spi/lpc55.rs:182-186 | embassy-nxp/src/spi/lpc55.rs:193-197 | embassy-nxp/src/usart/lpc55.rs:587-591 | embassy-nxp/src/usart/lpc55.rs:598-602 — `embassy-nxp/src/spi/lpc55.rs` and `embassy-nxp/src/usart/lpc55.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 48 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 (3–5 lines × 3) embassy-stm32/src/hash/mod.rs:450— embassy-stm32/src/hash/mod.rs:450-452 | embassy-stm32/src/hash/mod.rs:512-516 | embassy-stm32/src/hash/mod.rs:574-578 — 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 (3–5 lines × 3) embassy-usb-host/src/descriptor.rs:1039— embassy-usb-host/src/descriptor.rs:1039-1041 | embassy-usb-host/src/descriptor.rs:1133-1137 | embassy-usb-host/src/descriptor.rs:1191-1195 — 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 × 84) embassy-net-esp-hosted/src/proto/fg/mod.rs:1072— embassy-net-esp-hosted/src/proto/fg/mod.rs:1072-1082 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1212-1222 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1458-1468 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4310-4320 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4502-4512 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4642-4652 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5380-5390 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5576-5586 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6020-6030 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6270-6280 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6976-6986 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7778-7788 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16484-16494 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16874-16884 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17120-17130 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17260-17270 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17452-17462 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17592-17602 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17732-17742 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18186-18196 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18630-18640 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18889-18899 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19029-19039 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19343-19353 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19852-19862 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19992-20002 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20132-20142 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20272-20282 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20641-20651 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20781-20791 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21661-21671 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21801-21811 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21941-21951 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22702-22712 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23202-23212 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23702-23712 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24146-24156 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24392-24402 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24841-24851 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28356-28366 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28746-28756 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29190-29200 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29703-29713 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29899-29909 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30149-30159 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30539-30549 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30735-30745 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30994-31004 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32176-32186 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33039-33049 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33179-33189 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33529-33539 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33669-33679 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33809-33819 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38222-38232 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38418-38428 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38669-38679 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39171-39181 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39367-39377 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39619-39629 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40247-40257 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41990-42000 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42130-42140 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42376-42386 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42516-42526 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42762-42772 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42902-42912 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43148-43158 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43288-43298 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43534-43544 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43674-43684 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43920-43930 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44060-44070 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44514-44524 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44654-44664 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44850-44860 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45240-45250 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45436-45446 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45682-45692 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45944-45954 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46140-46150 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46336-46346 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46528-46538 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46724-46734 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (11 lines × 84) embassy-net-esp-hosted/src/proto/fg/mod.rs:1083— embassy-net-esp-hosted/src/proto/fg/mod.rs:1083-1093 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1223-1233 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1469-1479 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4321-4331 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4513-4523 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4653-4663 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5391-5401 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5587-5597 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6031-6041 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6281-6291 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6987-6997 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7789-7799 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16495-16505 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16885-16895 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17131-17141 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17271-17281 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17463-17473 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17603-17613 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17743-17753 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18197-18207 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18641-18651 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18900-18910 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19040-19050 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19354-19364 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19863-19873 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20003-20013 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20143-20153 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20283-20293 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20652-20662 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20792-20802 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21672-21682 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21812-21822 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21952-21962 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22713-22723 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23213-23223 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23713-23723 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24157-24167 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24403-24413 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24852-24862 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28367-28377 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28757-28767 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29201-29211 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29714-29724 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29910-29920 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30160-30170 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30550-30560 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30746-30756 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31005-31015 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32187-32197 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33050-33060 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33190-33200 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33540-33550 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33680-33690 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33820-33830 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38233-38243 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38429-38439 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38680-38690 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39182-39192 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39378-39388 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39630-39640 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40258-40268 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42001-42011 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42141-42151 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42387-42397 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42527-42537 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42773-42783 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42913-42923 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43159-43169 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43299-43309 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43545-43555 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43685-43695 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43931-43941 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44071-44081 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44525-44535 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44665-44675 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44861-44871 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45251-45261 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45447-45457 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45693-45703 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45955-45965 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46151-46161 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46347-46357 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46539-46549 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46735-46745 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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.
Rpc::decode (cyclomatic 161) embassy-net-esp-hosted/src/proto/mcu/mod.rs:48859— Rpc::decode has cyclomatic complexity 161 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CtrlMsg::decode (cyclomatic 99) embassy-net-esp-hosted/src/proto/fg/mod.rs:11170— CtrlMsg::decode has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
embassy_nrf::init (cyclomatic 52) embassy-nrf/src/lib.rs:801— embassy_nrf::init has cyclomatic complexity 52 (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.
embassy_rp::clocks::init (cyclomatic 45) embassy-rp/src/clocks.rs:979— embassy_rp::clocks::init has cyclomatic complexity 45 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Psram::init_psram (cyclomatic 43) embassy-rp/src/psram.rs:445— Psram::init_psram 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.
Comp::configure_raw (cyclomatic 34) embassy-stm32/src/comp.rs:500— Comp::configure_raw has cyclomatic complexity 34 (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.
LsConfig::init (cyclomatic 33) embassy-stm32/src/rcc/bd.rs:154— LsConfig::init has cyclomatic complexity 33 (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.
ReportDescriptor::parse (cyclomatic 33) embassy-usb-host/src/class/hid_report.rs:240— ReportDescriptor::parse 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.
CtrlEvent::decode (cyclomatic 27) embassy-net-esp-hosted/src/proto/fg/mod.rs:12335— CtrlEvent::decode 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.
RpcEvent::decode (cyclomatic 25) embassy-net-esp-hosted/src/proto/mcu/mod.rs:50582— RpcEvent::decode 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
StateMachine::set_config (cyclomatic 23) embassy-rp/src/pio/mod.rs:790— StateMachine::set_config has cyclomatic complexity 23 (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.
r#esp_app_desc::decode (cyclomatic 22) embassy-net-esp-hosted/src/proto/mcu/mod.rs:14514— r#esp_app_desc::decode 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
SimplePwm::set_frequency (cyclomatic 21) embassy-mspm0/src/tim/simple_pwm.rs:109— SimplePwm::set_frequency 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.
Rpc_Req_ExtCoex::decode (cyclomatic 21) embassy-net-esp-hosted/src/proto/mcu/mod.rs:39856— Rpc_Req_ExtCoex::decode 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
StorageDevice::acquire (cyclomatic 21) embassy-stm32/src/sdmmc/sd.rs:164— StorageDevice::acquire 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.
OtgHost::wait_for_device_event (cyclomatic 21) embassy-usb-synopsys-otg/src/host.rs:685— OtgHost::wait_for_device_event 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.
embassy_mspm0::uart::buffered::on_interrupt (cyclomatic 20) embassy-mspm0/src/uart/buffered.rs:1017— embassy_mspm0::uart::buffered::on_interrupt 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.
Rpc_Resp_GetCoprocessorFwVersion::decode (cyclomatic 20) embassy-net-esp-hosted/src/proto/mcu/mod.rs:31275— Rpc_Resp_GetCoprocessorFwVersion::decode 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 is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
HCI::process_event (cyclomatic 20) embassy-stm32-wpan/src/bluetooth/mod.rs:674— HCI::process_event 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.
CtrlMsg_Resp_GetSoftAPConfig::decode (cyclomatic 19) embassy-net-esp-hosted/src/proto/fg/mod.rs:2753— CtrlMsg_Resp_GetSoftAPConfig::decode 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. This is NOT this file's highest cyclomatic complexity: CtrlMsg::encode (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
CtrlMsg_Resp_GetDhcpDnsStatus::decode (cyclomatic 19) embassy-net-esp-hosted/src/proto/fg/mod.rs:8080— CtrlMsg_Resp_GetDhcpDnsStatus::decode 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. This is NOT this file's highest cyclomatic complexity: CtrlMsg::encode (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
CtrlMsg_Event_SetDhcpDnsStatus::decode (cyclomatic 19) embassy-net-esp-hosted/src/proto/fg/mod.rs:10181— CtrlMsg_Event_SetDhcpDnsStatus::decode 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. This is NOT this file's highest cyclomatic complexity: CtrlMsg::encode (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
Rpc_Resp_GetDhcpDnsStatus::decode (cyclomatic 19) embassy-net-esp-hosted/src/proto/mcu/mod.rs:32534— Rpc_Resp_GetDhcpDnsStatus::decode 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. This shape REPEATS in the file: one other method here (Rpc_Event_DhcpDnsStatus::decode) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
Rpc_Event_DhcpDnsStatus::decode (cyclomatic 19) embassy-net-esp-hosted/src/proto/mcu/mod.rs:40507— Rpc_Event_DhcpDnsStatus::decode 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. This shape REPEATS in the file: one other method here (Rpc_Resp_GetDhcpDnsStatus::decode) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
ParsedAdvData::parse (cyclomatic 19) embassy-stm32-wpan/src/bluetooth/gap/scanner.rs:290— ParsedAdvData::parse 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.
MainClkConfig::set_clock_source_and_rate (cyclomatic 18) embassy-imxrt/src/clocks.rs:990— MainClkConfig::set_clock_source_and_rate 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.
StateInner::poll (cyclomatic 18) embassy-net-nrf91/src/lib.rs:349— StateInner::poll 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.
Twim::setup_operations (cyclomatic 18) embassy-nrf/src/twim.rs:520— Twim::setup_operations 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.
AudioCollectionBuilder::on_other (cyclomatic 18) embassy-usb-host/src/class/uac/descriptors.rs:179— AudioCollectionBuilder::on_other 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. This is NOT this file's highest cyclomatic complexity: TerminalType::from (cyclomatic 38) 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 function is counted neither in this dimension's figures nor in its score.
CtrlMsg_Req_StartSoftAP::decode (cyclomatic 17) embassy-net-esp-hosted/src/proto/fg/mod.rs:3254— CtrlMsg_Req_StartSoftAP::decode 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. This is NOT this file's highest cyclomatic complexity: CtrlMsg::encode (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
CtrlMsg_Req_SetDhcpDnsStatus::decode (cyclomatic 17) embassy-net-esp-hosted/src/proto/fg/mod.rs:7403— CtrlMsg_Req_SetDhcpDnsStatus::decode 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. This is NOT this file's highest cyclomatic complexity: CtrlMsg::encode (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_csi_config::decode (cyclomatic 17) embassy-net-esp-hosted/src/proto/mcu/mod.rs:8314— r#wifi_csi_config::decode 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. This shape REPEATS in the file: one other method here (r#wifi_ftm_report_entry::decode) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_ftm_report_entry::decode (cyclomatic 17) embassy-net-esp-hosted/src/proto/mcu/mod.rs:11973— r#wifi_ftm_report_entry::decode 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. This shape REPEATS in the file: one other method here (r#wifi_csi_config::decode) 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
Rpc_Req_SetDhcpDnsStatus::decode (cyclomatic 17) embassy-net-esp-hosted/src/proto/mcu/mod.rs:31801— Rpc_Req_SetDhcpDnsStatus::decode 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
Lcd::new (cyclomatic 17) embassy-stm32/src/lcd.rs:166— Lcd::new has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
MainPllClkConfig::set_clock_rate (cyclomatic 16) embassy-imxrt/src/clocks.rs:713— MainPllClkConfig::set_clock_rate 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.
CtrlMsg_Resp_GetFwVersion::decode (cyclomatic 16) embassy-net-esp-hosted/src/proto/fg/mod.rs:6503— CtrlMsg_Resp_GetFwVersion::decode 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. This is NOT this file's highest cyclomatic complexity: CtrlMsg::encode (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
r#wifi_event_ftm_report::decode (cyclomatic 16) embassy-net-esp-hosted/src/proto/mcu/mod.rs:12380— r#wifi_event_ftm_report::decode 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. This is NOT this file's highest cyclomatic complexity: Rpc::encode (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
Symmetric::aes_payload_raw (cyclomatic 16) embassy-nrf/src/crypto/symmetric/aes.rs:677— Symmetric::aes_payload_raw 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.
embassy_stm32_wpan::bluetooth::gap_init::init_gap_and_hal (cyclomatic 16) embassy-stm32-wpan/src/bluetooth/gap_init.rs:269— embassy_stm32_wpan::bluetooth::gap_init::init_gap_and_hal 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.
embassy_usb_host::class::msc::run_cycle (cyclomatic 16) embassy-usb-host/src/class/msc.rs:474— embassy_usb_host::class::msc::run_cycle 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.
Driver::alloc_endpoint (cyclomatic 16) embassy-usb-synopsys-otg/src/lib.rs:558— Driver::alloc_endpoint 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.
Repeated repair: embassy-rp/src/pio_programs/uart.rs embassy-rp/src/pio_programs/uart.rs:132— embassy-rp/src/pio_programs/uart.rs changed 14 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is PioUartTx::flush at line 132), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fixes docs”; “fix minor mistakes”; “fix unused imports”; “fix-wrong-baud-rate-truncation”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 01:34:38 +00:00' --until='2026-09-29 01:34:38 +00:00' --full-history --no-merges -- embassy-rp/src/pio_programs/uart.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.
TodoComment repeated across 11 files embassy-nrf/src/lib.rs:101— The identical TodoComment appears in 11 files (21 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 21 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
Rpc::decode (cognitive 468) embassy-net-esp-hosted/src/proto/mcu/mod.rs:48859— Rpc::decode has cognitive complexity 468 (threshold 15). Drivers by points: if/else 79 (351 pts), loops 39 (115 pts), match/switch 1 (2 pts) (nesting depth added 349). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtrlMsg::decode (cognitive 279) embassy-net-esp-hosted/src/proto/fg/mod.rs:11170— CtrlMsg::decode has cognitive complexity 279 (threshold 15). Drivers by points: if/else 48 (210 pts), loops 23 (67 pts), match/switch 1 (2 pts) (nesting depth added 207). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtrlEvent::decode (cognitive 63) embassy-net-esp-hosted/src/proto/fg/mod.rs:12335— CtrlEvent::decode has cognitive complexity 63 (threshold 15). Drivers by points: if/else 12 (48 pts), loops 5 (13 pts), match/switch 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReportDescriptor::parse (cognitive 62) embassy-usb-host/src/class/hid_report.rs:240— ReportDescriptor::parse has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (51 pts), loops 2 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 39). 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.
RpcEvent::decode (cognitive 60) embassy-net-esp-hosted/src/proto/mcu/mod.rs:50582— RpcEvent::decode has cognitive complexity 60 (threshold 15). Drivers by points: if/else 11 (45 pts), loops 5 (13 pts), match/switch 1 (2 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Psram::init_psram (cognitive 54) embassy-rp/src/psram.rs:445— Psram::init_psram has cognitive complexity 54 (threshold 15). Drivers by points: match/switch 12 (29 pts), if/else 15 (24 pts), boolean chains 1 (nesting depth added 26). 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.
LsConfig::init (cognitive 45) embassy-stm32/src/rcc/bd.rs:154— LsConfig::init has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 8 (16 pts), match/switch 5 (6 pts), boolean chains 4 (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.
OtgHost::wait_for_device_event (cognitive 43) embassy-usb-synopsys-otg/src/host.rs:685— OtgHost::wait_for_device_event has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 3 (8 pts), loops 3 (7 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.
HCI::process_event (cognitive 38) embassy-stm32-wpan/src/bluetooth/mod.rs:674— HCI::process_event has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (35 pts), match/switch 2 (3 pts) (nesting depth added 20). 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.
StorageDevice::acquire (cognitive 37) embassy-stm32/src/sdmmc/sd.rs:164— StorageDevice::acquire has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 4, match/switch 2, loops 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.
HubHandler::wait_for_event (cognitive 36) embassy-usb-host/src/class/hub.rs:137— HubHandler::wait_for_event has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimplePwm::set_frequency (cognitive 34) embassy-mspm0/src/tim/simple_pwm.rs:109— SimplePwm::set_frequency has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (4 pts), match/switch 3 (4 pts), boolean chains 2 (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.
ParsedAdvData::parse (cognitive 34) embassy-stm32-wpan/src/bluetooth/gap/scanner.rs:290— ParsedAdvData::parse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 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.
MainClkConfig::set_clock_source_and_rate (cognitive 31) embassy-imxrt/src/clocks.rs:990— MainClkConfig::set_clock_source_and_rate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 3 (9 pts), boolean chains 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.
Rpc_Req_ExtCoex::decode (cognitive 30) embassy-net-esp-hosted/src/proto/mcu/mod.rs:39856— Rpc_Req_ExtCoex::decode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Control::control_in (cognitive 29) embassy-usb/src/class/hid.rs:565— Control::control_in has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 5 (11 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.
Twim::setup_operations (cognitive 28) embassy-nrf/src/twim.rs:520— Twim::setup_operations has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (26 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.
r#wifi_config::decode (cognitive 27) embassy-net-esp-hosted/src/proto/mcu/mod.rs:6234— r#wifi_config::decode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (18 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Rpc_Resp_GetCoprocessorFwVersion::decode (cognitive 27) embassy-net-esp-hosted/src/proto/mcu/mod.rs:31275— Rpc_Resp_GetCoprocessorFwVersion::decode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainPllClkConfig::set_clock_rate (cognitive 26) embassy-imxrt/src/clocks.rs:713— MainPllClkConfig::set_clock_rate has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 5 (10 pts), loops 1 (3 pts), boolean chains 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.
StateMachine::set_config (cognitive 26) embassy-rp/src/pio/mod.rs:790— StateMachine::set_config has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, loops 4 (6 pts), match/switch 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.
Uart::init (cognitive 25) embassy-rp/src/uart/mod.rs:933— Uart::init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (25 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.
CtrlMsg_Resp_GetSoftAPConfig::decode (cognitive 24) embassy-net-esp-hosted/src/proto/fg/mod.rs:2753— CtrlMsg_Resp_GetSoftAPConfig::decode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
r#wifi_csi_config::decode (cognitive 24) embassy-net-esp-hosted/src/proto/mcu/mod.rs:8314— r#wifi_csi_config::decode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (r#wifi_ftm_report_entry::decode) 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.
r#wifi_ftm_report_entry::decode (cognitive 24) embassy-net-esp-hosted/src/proto/mcu/mod.rs:11973— r#wifi_ftm_report_entry::decode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (r#wifi_csi_config::decode) 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.
Executor::run (cognitive 23) embassy-mcxa/src/executor.rs:95— Executor::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (5 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.
Rng::fill_bytes (cognitive 23) embassy-stm32/src/rng.rs:445— Rng::fill_bytes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 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.
BtRunner::upload_bluetooth_firmware (cognitive 21) cyw43/src/bluetooth.rs:229— BtRunner::upload_bluetooth_firmware has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 5 (8 pts) (nesting depth added 11). 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.
CtrlMsg_Req_StartSoftAP::decode (cognitive 21) embassy-net-esp-hosted/src/proto/fg/mod.rs:3254— CtrlMsg_Req_StartSoftAP::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 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.
CtrlMsg_Resp_GetFwVersion::decode (cognitive 21) embassy-net-esp-hosted/src/proto/fg/mod.rs:6503— CtrlMsg_Resp_GetFwVersion::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 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.
CtrlMsg_Resp_GetDhcpDnsStatus::decode (cognitive 21) embassy-net-esp-hosted/src/proto/fg/mod.rs:8080— CtrlMsg_Resp_GetDhcpDnsStatus::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 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.
CtrlMsg_Event_SetDhcpDnsStatus::decode (cognitive 21) embassy-net-esp-hosted/src/proto/fg/mod.rs:10181— CtrlMsg_Event_SetDhcpDnsStatus::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 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.
r#wifi_event_ftm_report::decode (cognitive 21) embassy-net-esp-hosted/src/proto/mcu/mod.rs:12380— r#wifi_event_ftm_report::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 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.
r#wifi_itwt_setup_config::decode (cognitive 21) embassy-net-esp-hosted/src/proto/mcu/mod.rs:13794— r#wifi_itwt_setup_config::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 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.
Rpc_Resp_GetDhcpDnsStatus::decode (cognitive 21) embassy-net-esp-hosted/src/proto/mcu/mod.rs:32534— Rpc_Resp_GetDhcpDnsStatus::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 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. This shape REPEATS in the file: one other method here (Rpc_Event_DhcpDnsStatus::decode) 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.
Rpc_Event_DhcpDnsStatus::decode (cognitive 21) embassy-net-esp-hosted/src/proto/mcu/mod.rs:40507— Rpc_Event_DhcpDnsStatus::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 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. This shape REPEATS in the file: one other method here (Rpc_Resp_GetDhcpDnsStatus::decode) 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.
Backend::process_serial_data (cognitive 21) embassy-net-esp-hosted/src/rpc/mod.rs:113— Backend::process_serial_data has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 3 (5 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Symmetric::aes_payload_raw (cognitive 21) embassy-nrf/src/crypto/symmetric/aes.rs:677— Symmetric::aes_payload_raw has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 10). 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.
DfuState::control_out (cognitive 21) embassy-usb/src/class/dfu/dfu_mode.rs:90— DfuState::control_out has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (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.
Rpc_Event_StaItwtSuspend::decode (cognitive 20) embassy-net-esp-hosted/src/proto/mcu/mod.rs:41504— Rpc_Event_StaItwtSuspend::decode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (2 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.
PlanarSink::push (cognitive 20) embassy-stm32/src/jpeg.rs:858— PlanarSink::push has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Xspi::configure_command (cognitive 20) embassy-stm32/src/xspi/mod.rs:486— Xspi::configure_command has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2 (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.
StreamingHasher::finalize (cognitive 19) embassy-mcxa/src/sgi/hash.rs:483— StreamingHasher::finalize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IT0InterruptHandler::on_interrupt (cognitive 19) embassy-stm32/src/can/fdcan.rs:44— IT0InterruptHandler::on_interrupt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 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.
DmaChannel::setup_transfers (cognitive 18) embassy-mcxa/src/dma.rs:815— DmaChannel::setup_transfers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (18 pts) (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.
embassy_net_adin1110::new_tc6 (cognitive 18) embassy-net-adin1110/src/lib.rs:862— embassy_net_adin1110::new_tc6 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CtrlMsg_Resp_GetAPConfig::decode (cognitive 18) embassy-net-esp-hosted/src/proto/fg/mod.rs:1691— CtrlMsg_Resp_GetAPConfig::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), 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.
CtrlMsg_Req_SetDhcpDnsStatus::decode (cognitive 18) embassy-net-esp-hosted/src/proto/fg/mod.rs:7403— CtrlMsg_Req_SetDhcpDnsStatus::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), 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.
CtrlMsg_Event_StationConnectedToAP::decode (cognitive 18) embassy-net-esp-hosted/src/proto/fg/mod.rs:9132— CtrlMsg_Event_StationConnectedToAP::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), 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.
r#wifi_ant_config::decode (cognitive 18) embassy-net-esp-hosted/src/proto/mcu/mod.rs:9359— r#wifi_ant_config::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), 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. This shape REPEATS in the file: one other method here (Rpc_GpioConfig::decode) 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.
r#esp_app_desc::decode (cognitive 18) embassy-net-esp-hosted/src/proto/mcu/mod.rs:14514— r#esp_app_desc::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), 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.
Rpc_Req_SetDhcpDnsStatus::decode (cognitive 18) embassy-net-esp-hosted/src/proto/mcu/mod.rs:31801— Rpc_Req_SetDhcpDnsStatus::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), 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.
Rpc_Resp_MemMonitor::decode (cognitive 18) embassy-net-esp-hosted/src/proto/mcu/mod.rs:35725— Rpc_Resp_MemMonitor::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), 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.
Rpc_GpioConfig::decode (cognitive 18) embassy-net-esp-hosted/src/proto/mcu/mod.rs:37792— Rpc_GpioConfig::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), 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. This shape REPEATS in the file: one other method here (r#wifi_ant_config::decode) 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.
Timings::new (cognitive 18) embassy-stm32/src/i2c/v1.rs:2111— Timings::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 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.
Allocator::allocate (cognitive 17) embassy-nrf/src/usb/mod.rs:755— Allocator::allocate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (4 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.
Saes::payload_blocking (cognitive 17) embassy-stm32/src/saes/mod.rs:684— Saes::payload_blocking has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, 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.
RingBufferedUartRx::wait_for_data_or_idle (cognitive 17) embassy-stm32/src/usart/ringbuffered.rs:284— RingBufferedUartRx::wait_for_data_or_idle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (4 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.
Sequencer::select_next_task (cognitive 17) embassy-stm32-wpan/src/wba/util_seq.rs:204— Sequencer::select_next_task has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UacHandler::output (cognitive 17) embassy-usb-host/src/class/uac/mod.rs:227— UacHandler::output has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2, 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.
RtcClkConfig::set_clock_rate (cognitive 16) embassy-imxrt/src/clocks.rs:1170— RtcClkConfig::set_clock_rate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 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.
ChaChaPolyContext::run (cognitive 16) embassy-nrf/src/crypto/symmetric/chacha_cracen.rs:122— ChaChaPolyContext::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
I2cSlave::poll_listen (cognitive 16) embassy-rp/src/i2c_slave.rs:280— I2cSlave::poll_listen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4 (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.
Cordic32::blocking_calc (cognitive 16) embassy-stm32/src/cordic/mod.rs:271— Cordic32::blocking_calc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), 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.
Endpoint::write (cognitive 16) embassy-stm32/src/usb/usb.rs:985— Endpoint::write has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D22 · Internal API Consistency· Inconsistent SPI command method naming and signatures between SpiBusCyw43 and PioSpi. SpiBusCyw43 uses 'cmd_write' and 'cmd_read', while PioSpi uses 'write' and 'cmd_read'. Additionally, 'cmd_write' takes a slice for data, while 'write' also takes a slice, but the naming difference ('cmd_' prefix) is inconsistent across the two bus implementations. · ×1
Inconsistent SPI command method naming and signatures between SpiBusCyw43 and PioSpi. SpiBusCyw43 uses 'cmd_write' and 'cmd_read', while PioSpi uses 'write' and 'cmd_read'. Additionally, 'cmd_write' takes a slice for data, while 'write' also takes a slice, but the naming difference ('cmd_' prefix) is inconsistent across the two bus implementations. — Unify the method names to either 'cmd_write'/'cmd_read' or 'write'/'read' across both SpiBusCyw43 and PioSpi for consistency. (signatures: SpiBusCyw43.cmd_write(write: &[u32]): u32 | SpiBusCyw43.cmd_read(write: u32, read: &mut [u32]): u32 | PioSpi.write(write: &[u32]): u32 | PioSpi.cmd_read(cmd: u32, read: &mut [u32]): u32)
D22 · Internal API Consistency· Inconsistent naming between BootLoaderConfig and FirmwareUpdaterConfig for similar configuration loading methods. BootLoaderConfig has 'from_linkerfile_blocking', while FirmwareUpdaterConfig has both 'from_linkerfile' (non-blocking?) and 'from_linkerfile_blocking'. The presence of both blocking and non-blocking variants in one struct but only blocking in the other is inconsistent. · ×1
Inconsistent naming between BootLoaderConfig and FirmwareUpdaterConfig for similar configuration loading methods. BootLoaderConfig has 'from_linkerfile_blocking', while FirmwareUpdaterConfig has both 'from_linkerfile' (non-blocking?) and 'from_linkerfile_blocking'. The presence of both blocking and non-blocking variants in one struct but only blocking in the other is inconsistent. — Standardize the naming convention. Either both should have 'from_linkerfile' and 'from_linkerfile_blocking', or both should only have 'from_linkerfile_blocking' if non-blocking is not supported. (signatures: BootLoaderConfig.from_linkerfile_blocking(active_flash: NoopRawMutex, dfu_flash: NoopRawMutex, state_flash: NoopRawMutex): Self | FirmwareUpdaterConfig.from_linkerfile(dfu_flash: NoopRawMutex, state_flash: NoopRawMutex): Self | FirmwareUpdaterConfig.from_linkerfile_blocking(dfu_flash: NoopRawMutex, state_flash: NoopRawMutex): Self)
TooManyFunctions: embassy_nrf::crypto::pka::cryptocell::engine embassy-nrf/src/crypto/pka/cryptocell/engine.rs:59— TooManyFunctions — 48 free functions. The bar is 30 free functions; this is 18 over it, 1.60× 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 family (7 members, 28 shared lines) · ×1
Near-duplicate member family (7 members, 28 shared lines) embassy-mcxa/src/clocks/periph_helpers.rs:429— embassy-mcxa/src/clocks/periph_helpers.rs:429-543 | embassy-mcxa/src/clocks/periph_helpers.rs:583-685 | embassy-mcxa/src/clocks/periph_helpers.rs:818-934 | embassy-mcxa/src/clocks/periph_helpers.rs:1231-1322 | embassy-mcxa/src/clocks/periph_helpers.rs:1386-1503 | embassy-mcxa/src/clocks/periph_helpers.rs:1564-1682 | embassy-mcxa/src/clocks/periph_helpers.rs:1733-1820 — These 7 members are variants of one another: a block of 28 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 (6 members, 15 shared lines) · ×1
Near-duplicate member family (6 members, 15 shared lines) embassy-stm32/src/hspi/mod.rs:809— embassy-stm32/src/hspi/mod.rs:809-839 | embassy-stm32/src/hspi/mod.rs:885-916 | embassy-stm32/src/ospi/mod.rs:1956-1987 | embassy-stm32/src/ospi/mod.rs:2031-2062 | embassy-stm32/src/xspi/mod.rs:1758-1788 | embassy-stm32/src/xspi/mod.rs:1834-1865 — These 6 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 21 shared lines) · ×1
Near-duplicate member family (4 members, 21 shared lines) embassy-net-esp-hosted/src/proto/fg/mod.rs:1891— embassy-net-esp-hosted/src/proto/fg/mod.rs:1891-1937 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2253-2293 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3003-3061 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3479-3531 — These 4 members are variants of one another: a block of 21 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, 20 shared lines) · ×1
Near-duplicate member family (3 members, 20 shared lines) embassy-stm32/src/hspi/mod.rs:488— embassy-stm32/src/hspi/mod.rs:488-526 | embassy-stm32/src/ospi/mod.rs:830-866 | embassy-stm32/src/xspi/mod.rs:627-665 — These 3 members are variants of one another: a block of 20 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 16 shared lines) · ×1
Near-duplicate member family (3 members, 16 shared lines) embassy-nxp/src/i2c/lpc55.rs:159— embassy-nxp/src/i2c/lpc55.rs:159-181 | embassy-nxp/src/spi/lpc55.rs:115-137 | embassy-nxp/src/usart/lpc55.rs:609-631 — These 3 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 15 shared lines) · ×1
Near-duplicate member family (3 members, 15 shared lines) embassy-stm32/src/ltdc.rs:293— embassy-stm32/src/ltdc.rs:293-323 | embassy-stm32/src/ltdc.rs:353-385 | embassy-stm32/src/ltdc.rs:422-460 — These 3 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (95 shared lines) embassy-stm32/src/rcc/u3.rs:186— embassy-stm32/src/rcc/u3.rs:186-499 | embassy-stm32/src/rcc/u5.rs:180-561 — These two members are variants of one another: 95 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 (61 shared lines) embassy-stm32/src/cryp/mod.rs:668— embassy-stm32/src/cryp/mod.rs:668-749 | embassy-stm32/src/cryp/mod.rs:1235-1310 — 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.
Near-duplicate member pair (59 shared lines) embassy-stm32/src/sdmmc/mod.rs:1476— embassy-stm32/src/sdmmc/mod.rs:1476-1563 | embassy-stm32/src/sdmmc/mod.rs:1858-1954 — These two members are variants of one another: 59 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) embassy-stm32/src/crypto_driver.rs:830— embassy-stm32/src/crypto_driver.rs:830-906 | embassy-stm32/src/crypto_driver.rs:919-989 — 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 (51 shared lines) embassy-stm32/src/i2c/v2.rs:1067— embassy-stm32/src/i2c/v2.rs:1067-1173 | embassy-stm32/src/i2c/v2.rs:1477-1575 — 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.
Near-duplicate member pair (48 shared lines) embassy-stm32/src/cryp/mod.rs:862— embassy-stm32/src/cryp/mod.rs:862-938 | embassy-stm32/src/cryp/mod.rs:1440-1534 — These two members are variants of one another: 48 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) embassy-mcxa/src/chips/mcxa2xx.rs:8— embassy-mcxa/src/chips/mcxa2xx.rs:8-82 | embassy-mcxa/src/chips/mcxa5xx.rs:8-99 — 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 (42 shared lines) embassy-stm32/src/rcc/u5.rs:610— embassy-stm32/src/rcc/u5.rs:610-705 | embassy-stm32/src/rcc/wba.rs:487-575 — 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.
Near-duplicate member pair (40 shared lines) embassy-stm32/src/sdmmc/mod.rs:1223— embassy-stm32/src/sdmmc/mod.rs:1223-1290 | embassy-stm32/src/sdmmc/mod.rs:1295-1361 — 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.
Near-duplicate member pair (38 shared lines) embassy-boot/src/firmware_updater/asynch.rs:90— embassy-boot/src/firmware_updater/asynch.rs:90-146 | embassy-boot/src/firmware_updater/blocking.rs:125-181 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (25 shared lines) embassy-mcxa/src/spi/controller.rs:980— embassy-mcxa/src/spi/controller.rs:980-1091 | embassy-mcxa/src/spi/controller.rs:1179-1233 — These two members are variants of one another: 25 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 (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) embassy-stm32/src/xspi/mod.rs:1136— embassy-stm32/src/xspi/mod.rs:1136-1170 | embassy-stm32/src/xspi/mod.rs:1199-1233 — 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 (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) embassy-net-esp-hosted/src/proto/fg/mod.rs:7643— embassy-net-esp-hosted/src/proto/fg/mod.rs:7643-7701 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32041-32099 — 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 (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) embassy-nrf/src/twis.rs:511— embassy-nrf/src/twis.rs:511-534 | embassy-nrf/src/twis.rs:622-649 — 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 (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) embassy-stm32/src/timer/complementary_pwm.rs:137— embassy-stm32/src/timer/complementary_pwm.rs:137-168 | embassy-stm32/src/timer/simple_pwm.rs:260-288 — 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 (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) embassy-stm32/src/qspi/mod.rs:609— embassy-stm32/src/qspi/mod.rs:609-633 | embassy-stm32/src/qspi/mod.rs:651-675 — 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 (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) embassy-stm32/src/xspi/mod.rs:825— embassy-stm32/src/xspi/mod.rs:825-858 | embassy-stm32/src/xspi/mod.rs:1292-1325 — 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 copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) embassy-stm32/src/sdmmc/mod.rs:634— embassy-stm32/src/sdmmc/mod.rs:634-656 | embassy-stm32/src/sdmmc/mod.rs:744-765 — 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· Members sharing a duplicated core (362 members, 50+ identical tokens) · ×1
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) embassy-ambiq/src/time_driver.rs:155— embassy-ambiq/src/time_driver.rs:155-165 | embassy-ambiq/src/time_driver.rs:314-324 | embassy-imxrt/src/time_driver.rs:240-251 | embassy-imxrt/src/time_driver.rs:390-401 | embassy-mcxa/src/ostimer.rs:186-197 | embassy-microchip/src/time_driver.rs:164-175 | embassy-mspm0/src/time_driver/tim.rs:310-322 | embassy-nrf/src/time_driver.rs:452-462 | embassy-nxp/src/time_driver/pit.rs:48-60 | embassy-nxp/src/time_driver/rtc.rs:158-169 | embassy-rp/src/time_driver.rs:46-57 | embassy-stm32/src/time_driver/lptim.rs:404-415 | embassy-stm32/src/time_driver/tim.rs:377-388 | embassy-time/src/driver_cmsdk/mod.rs:324-335 — 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 (12 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (12 members, 50+ identical tokens) embassy-ambiq/src/time_driver.rs:110— embassy-ambiq/src/time_driver.rs:110-115 | embassy-ambiq/src/time_driver.rs:256-261 | embassy-imxrt/src/time_driver.rs:222-227 | embassy-imxrt/src/time_driver.rs:362-367 | embassy-mcxa/src/ostimer.rs:148-153 | embassy-microchip/src/time_driver.rs:148-153 | embassy-mspm0/src/time_driver/tim.rs:231-237 | embassy-nrf/src/time_driver.rs:342-358 | embassy-rp/src/time_driver.rs:104-109 | embassy-stm32/src/time_driver/lptim.rs:278-284 | embassy-stm32/src/time_driver/tim.rs:246-251 | embassy-time/src/driver_cmsdk/mod.rs:227-243 — These 12 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 12 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 12 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) embassy-stm32/src/crypto_driver.rs:385— embassy-stm32/src/crypto_driver.rs:385-393 | embassy-stm32/src/crypto_driver.rs:401-409 | embassy-stm32/src/crypto_driver.rs:427-435 | embassy-stm32/src/crypto_driver.rs:443-451 | embassy-stm32/src/crypto_driver.rs:469-491 | embassy-stm32/src/crypto_driver.rs:499-521 | embassy-stm32/src/crypto_driver.rs:539-561 | embassy-stm32/src/crypto_driver.rs:569-591 — 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.
Duplicated block (74 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:7414— embassy-net-esp-hosted/src/proto/fg/mod.rs:7414-7487 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8101-8174 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10192-10265 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31812-31885 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32545-32618 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40518-40591 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (64–65 lines × 2) embassy-mcxa/src/spi/controller.rs:687— embassy-mcxa/src/spi/controller.rs:687-751 | embassy-mcxa/src/spi/controller.rs:777-840 — both copies are in the same file, so extract the 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 (62 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:7579— embassy-net-esp-hosted/src/proto/fg/mod.rs:7579-7640 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8281-8342 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10375-10436 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31977-32038 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32728-32789 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40701-40762 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (53 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:7647— embassy-net-esp-hosted/src/proto/fg/mod.rs:7647-7699 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8355-8407 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10450-10502 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32045-32097 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32803-32855 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40776-40828 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (45 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:11178— embassy-net-esp-hosted/src/proto/fg/mod.rs:11178-11222 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12343-12387 — both copies are in the same file, so extract the 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 (37 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:34682— embassy-net-esp-hosted/src/proto/mcu/mod.rs:34682-34718 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34925-34961 — both copies are in the same file, so extract the 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 (36 lines × 2) embassy-net-esp-hosted/src/proto/fg/mod.rs:3013— embassy-net-esp-hosted/src/proto/fg/mod.rs:3013-3048 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3489-3524 — both copies are in the same file, so extract the 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 (33 lines × 2) embassy-net-esp-hosted/src/proto/mcu/mod.rs:33920— embassy-net-esp-hosted/src/proto/mcu/mod.rs:33920-33952 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34155-34187 — both copies are in the same file, so extract the 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 (29–33 lines × 2) embassy-stm32/src/cryp/mod.rs:876— embassy-stm32/src/cryp/mod.rs:876-904 | embassy-stm32/src/cryp/mod.rs:1454-1486 — both copies are in the same file, so extract the 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 (29–32 lines × 2) embassy-embedded-hal/src/shared_bus/asynch/spi.rs:91— embassy-embedded-hal/src/shared_bus/asynch/spi.rs:91-122 | embassy-embedded-hal/src/shared_bus/asynch/spi.rs:185-213 — both copies are in the same file, so extract the 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 (2–32 lines × 4) embassy-stm32/src/cryp/mod.rs:767— embassy-stm32/src/cryp/mod.rs:767-798 | embassy-stm32/src/cryp/mod.rs:950-951 | embassy-stm32/src/cryp/mod.rs:1333-1364 | embassy-stm32/src/cryp/mod.rs:1550-1551 — 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 (31 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:9516— embassy-net-esp-hosted/src/proto/fg/mod.rs:9516-9546 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9803-9833 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36582-36612 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36869-36899 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (29 lines × 2) embassy-stm32/src/flash/u3.rs:168— embassy-stm32/src/flash/u3.rs:168-196 | embassy-stm32/src/flash/u5.rs:159-187 — before extracting anything, compare `embassy-stm32/src/flash/u3.rs` and `embassy-stm32/src/flash/u5.rs` as WHOLE FILES: this scan already matched 7 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 (24–28 lines × 2) embassy-stm32/src/jpeg.rs:412— embassy-stm32/src/jpeg.rs:412-439 | embassy-stm32/src/jpeg.rs:644-667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 3) embassy-stm32/src/hspi/enums.rs:161— embassy-stm32/src/hspi/enums.rs:161-187 | embassy-stm32/src/ospi/enums.rs:175-201 | embassy-stm32/src/xspi/enums.rs:141-167 — `embassy-stm32/src/hspi/enums.rs` and `embassy-stm32/src/xspi/enums.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 106 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 (24–26 lines × 3) embassy-stm32/src/i2c/v1.rs:527— embassy-stm32/src/i2c/v1.rs:527-552 | embassy-stm32/src/i2c/v1.rs:759-784 | embassy-stm32/src/i2c/v1.rs:844-867 — 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 (24–26 lines × 2) embassy-stm32/src/crypto_driver.rs:862— embassy-stm32/src/crypto_driver.rs:862-887 | embassy-stm32/src/crypto_driver.rs:948-971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25–26 lines × 2) embassy-stm32/src/timer/complementary_pwm.rs:144— embassy-stm32/src/timer/complementary_pwm.rs:144-168 | embassy-stm32/src/timer/simple_pwm.rs:263-288 — before extracting anything, compare `embassy-stm32/src/timer/complementary_pwm.rs` and `embassy-stm32/src/timer/simple_pwm.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 7) embassy-executor/build_common.rs:70— embassy-executor/build_common.rs:70-94 | embassy-hal-internal/build_common.rs:70-94 | embassy-mcxa/build_common.rs:70-94 | embassy-mspm0/build_common.rs:70-94 | embassy-nxp/build_common.rs:70-94 | embassy-stm32/build_common.rs:70-94 | embassy-sync/build_common.rs:70-94 — `embassy-executor/build_common.rs` and `embassy-hal-internal/build_common.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 42 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 (25 lines × 3) embassy-mcxa/src/i2c/controller.rs:1201— embassy-mcxa/src/i2c/controller.rs:1201-1225 | embassy-mcxa/src/i2c/target.rs:782-806 | embassy-mcxa/src/i3c/controller.rs:1073-1097 — before extracting anything, compare `embassy-mcxa/src/i2c/controller.rs` and `embassy-mcxa/src/i2c/target.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (24 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:9619— embassy-net-esp-hosted/src/proto/fg/mod.rs:9619-9642 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9888-9911 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36685-36708 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36954-36977 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (15–24 lines × 2) embassy-stm32/src/hspi/mod.rs:444— embassy-stm32/src/hspi/mod.rs:444-458 | embassy-stm32/src/ospi/mod.rs:765-788 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (23 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:1722— embassy-net-esp-hosted/src/proto/fg/mod.rs:1722-1744 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2774-2796 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3275-3297 — 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 (20–23 lines × 2) embassy-rp/src/otp.rs:94— embassy-rp/src/otp.rs:94-113 | embassy-rp/src/otp.rs:119-141 — both copies are in the same file, so extract the 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 × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:8770— embassy-net-esp-hosted/src/proto/fg/mod.rs:8770-8791 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9153-9174 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10496-10517 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10838-10859 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (19–22 lines × 3) embassy-mcxa/src/spi/controller.rs:603— embassy-mcxa/src/spi/controller.rs:603-624 | embassy-mcxa/src/spi/controller.rs:746-764 | embassy-mcxa/src/spi/controller.rs:835-853 — 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 (20–22 lines × 2) embassy-stm32/src/crypto_driver.rs:831— embassy-stm32/src/crypto_driver.rs:831-852 | embassy-stm32/src/crypto_driver.rs:920-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.
Duplicated block (21 lines × 3) embassy-net-esp-hosted/src/proto/fg/mod.rs:9543— embassy-net-esp-hosted/src/proto/fg/mod.rs:9543-9563 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36609-36629 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41770-41790 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (20–21 lines × 2) embassy-stm32/src/hash/mod.rs:604— embassy-stm32/src/hash/mod.rs:604-624 | embassy-stm32/src/hash/mod.rs:1006-1025 — both copies are in the same file, so extract the 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 × 7) embassy-net-esp-hosted/src/proto/fg/mod.rs:10580— embassy-net-esp-hosted/src/proto/fg/mod.rs:10580-10599 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10761-10780 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10963-10982 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9721-9740 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47853-47872 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48037-48056 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48242-48261 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (20 lines × 4) embassy-net-esp-hosted/src/proto/mcu/mod.rs:42220— embassy-net-esp-hosted/src/proto/mcu/mod.rs:42220-42239 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42606-42625 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42992-43011 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43378-43397 — 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 (16–20 lines × 2) embassy-imxrt/src/flexcomm/spi.rs:347— embassy-imxrt/src/flexcomm/spi.rs:347-362 | embassy-imxrt/src/flexcomm/spi.rs:467-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–20 lines × 2) embassy-stm32/src/hspi/mod.rs:69— embassy-stm32/src/hspi/mod.rs:69-85 | embassy-stm32/src/ospi/mod.rs:112-131 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (19 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:1752— embassy-net-esp-hosted/src/proto/fg/mod.rs:1752-1770 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2131-2149 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2396-2414 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2834-2852 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3325-3343 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3634-3652 — 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.
Duplicated block (19 lines × 4) embassy-net-esp-hosted/src/proto/fg/mod.rs:11906— embassy-net-esp-hosted/src/proto/fg/mod.rs:11906-11924 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12561-12579 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50029-50047 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50788-50806 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16–19 lines × 3) embassy-mcxa/src/clocks/periph_helpers.rs:909— embassy-mcxa/src/clocks/periph_helpers.rs:909-927 | embassy-mcxa/src/clocks/periph_helpers.rs:1480-1495 | embassy-mcxa/src/clocks/periph_helpers.rs:1659-1675 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–19 lines × 2) embassy-mcxa/src/i3c/target.rs:1852— embassy-mcxa/src/i3c/target.rs:1852-1865 | embassy-mcxa/src/lpuart/bbq.rs:1522-1540 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–19 lines × 2) embassy-usb-host/src/class/msc.rs:360— embassy-usb-host/src/class/msc.rs:360-378 | embassy-usb-host/src/class/vcp/cp210x.rs:504-520 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–18 lines × 4) embassy-stm32/src/rcc/h.rs:1116— embassy-stm32/src/rcc/h.rs:1116-1133 | embassy-stm32/src/rcc/h.rs:1147-1162 | embassy-stm32/src/rcc/h.rs:1174-1186 | embassy-stm32/src/rcc/h.rs:1204-1219 — 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 (15–18 lines × 3) embassy-stm32/src/aes/common.rs:386— embassy-stm32/src/aes/common.rs:386-402 | embassy-stm32/src/aes/v2.rs:293-307 | embassy-stm32/src/saes/mod.rs:651-668 — before extracting anything, compare `embassy-stm32/src/aes/common.rs` and `embassy-stm32/src/aes/v2.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (17–18 lines × 2) embassy-rp/src/uart/buffered.rs:109— embassy-rp/src/uart/buffered.rs:109-125 | embassy-rp/src/uart/buffered.rs:146-163 — both copies are in the same file, so extract the 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–18 lines × 2) embassy-stm32/src/i2c/v2.rs:176— embassy-stm32/src/i2c/v2.rs:176-193 | embassy-stm32/src/i2c/v2.rs:213-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 95) embassy-net-esp-hosted/src/proto/fg/mod.rs:627— embassy-net-esp-hosted/src/proto/fg/mod.rs:627-643 | embassy-net-esp-hosted/src/proto/fg/mod.rs:821-837 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1038-1054 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1178-1194 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1424-1440 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3862-3878 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4091-4107 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4276-4292 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4468-4484 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4608-4624 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5346-5362 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5542-5558 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5715-5731 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5986-6002 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6236-6252 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6942-6958 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7744-7760 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10266-10282 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16039-16055 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16233-16249 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16450-16466 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16840-16856 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17086-17102 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17226-17242 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17418-17434 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17558-17574 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17698-17714 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18152-18168 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18325-18341 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18596-18612 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18855-18871 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18995-19011 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19309-19325 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19818-19834 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19958-19974 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20098-20114 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20238-20254 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20607-20623 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20747-20763 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21627-21643 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21767-21783 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21907-21923 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22668-22684 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23168-23184 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23668-23684 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24112-24128 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24358-24374 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24807-24823 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28322-28338 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28712-28728 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29156-29172 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29669-29685 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29865-29881 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30115-30131 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30505-30521 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30701-30717 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30960-30976 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32142-32158 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32619-32635 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33005-33021 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33145-33161 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33495-33511 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33635-33651 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33775-33791 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38188-38204 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38384-38400 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38635-38651 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39137-39153 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39333-39349 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39585-39601 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40213-40229 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40592-40608 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41956-41972 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42096-42112 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42342-42358 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42482-42498 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42728-42744 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42868-42884 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43114-43130 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43254-43270 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43500-43516 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43640-43656 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43886-43902 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44026-44042 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44480-44496 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44620-44636 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44816-44832 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45206-45222 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45402-45418 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45648-45664 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45910-45926 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46106-46122 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46302-46318 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46494-46510 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46690-46706 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14–17 lines × 7) embassy-mcxa/src/clocks/periph_helpers.rs:513— embassy-mcxa/src/clocks/periph_helpers.rs:513-529 | embassy-mcxa/src/clocks/periph_helpers.rs:656-671 | embassy-mcxa/src/clocks/periph_helpers.rs:903-919 | embassy-mcxa/src/clocks/periph_helpers.rs:1293-1308 | embassy-mcxa/src/clocks/periph_helpers.rs:1475-1488 | embassy-mcxa/src/clocks/periph_helpers.rs:1653-1667 | embassy-mcxa/src/clocks/periph_helpers.rs:1792-1806 — 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.
Duplicated block (15–17 lines × 2) embassy-executor/src/platform/cortex_m.rs:20— embassy-executor/src/platform/cortex_m.rs:20-34 | embassy-mspm0/src/executor.rs:35-51 — before extracting anything, compare `embassy-executor/src/platform/cortex_m.rs` and `embassy-mspm0/src/executor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–17 lines × 2) embassy-mcxa/src/i2c/controller.rs:1366— embassy-mcxa/src/i2c/controller.rs:1366-1378 | embassy-mcxa/src/i3c/controller.rs:1315-1331 — `embassy-mcxa/src/i2c/controller.rs` and `embassy-mcxa/src/i3c/controller.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 73 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 (11–17 lines × 2) embassy-stm32/src/sdmmc/mod.rs:1512— embassy-stm32/src/sdmmc/mod.rs:1512-1522 | embassy-stm32/src/sdmmc/mod.rs:1899-1915 — both copies are in the same file, so extract the 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 × 8) embassy-net-esp-hosted/src/proto/fg/mod.rs:814— embassy-net-esp-hosted/src/proto/fg/mod.rs:814-829 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2819-2834 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5708-5723 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10259-10274 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16226-16241 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18318-18333 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32612-32627 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40585-40600 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:9179— embassy-net-esp-hosted/src/proto/fg/mod.rs:9179-9194 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3352-3367 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3596-3611 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4558-4573 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10522-10537 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (16 lines × 4) embassy-mcxa/src/i2c/controller.rs:362— embassy-mcxa/src/i2c/controller.rs:362-377 | embassy-mcxa/src/i2c/target.rs:325-340 | embassy-mcxa/src/i3c/controller.rs:343-358 | embassy-mcxa/src/i3c/target.rs:374-389 — before extracting anything, compare `embassy-mcxa/src/i2c/controller.rs` and `embassy-mcxa/src/i2c/target.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–16 lines × 2) embassy-nrf/src/crypto/symmetric/aes.rs:424— embassy-nrf/src/crypto/symmetric/aes.rs:424-439 | embassy-nrf/src/crypto/symmetric/chacha.rs:59-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 6) embassy-net-esp-hosted/src/proto/fg/mod.rs:2474— embassy-net-esp-hosted/src/proto/fg/mod.rs:2474-2488 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3712-3726 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9653-9667 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9915-9929 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36719-36733 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36981-36995 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (12–15 lines × 4) embassy-mcxa/src/i2c/controller.rs:1363— embassy-mcxa/src/i2c/controller.rs:1363-1376 | embassy-mcxa/src/i2c/target.rs:909-923 | embassy-mcxa/src/i3c/controller.rs:1312-1325 | embassy-mcxa/src/spi/controller.rs:629-640 — before extracting anything, compare `embassy-mcxa/src/i2c/controller.rs` and `embassy-mcxa/src/i2c/target.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (15 lines × 3) embassy-net-esp-hosted/src/proto/mcu/mod.rs:33926— embassy-net-esp-hosted/src/proto/mcu/mod.rs:33926-33940 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34161-34175 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34482-34496 — 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–15 lines × 2) embassy-embedded-hal/src/shared_bus/asynch/spi.rs:74— embassy-embedded-hal/src/shared_bus/asynch/spi.rs:74-88 | embassy-embedded-hal/src/shared_bus/asynch/spi.rs:171-182 — both copies are in the same file, so extract the 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 × 10) embassy-net-esp-hosted/src/proto/mcu/mod.rs:9688— embassy-net-esp-hosted/src/proto/mcu/mod.rs:9688-9701 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12744-12757 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22535-22548 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22762-22775 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23035-23048 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23262-23275 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26785-26798 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27105-27118 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27528-27541 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27848-27861 — 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.
Duplicated block (14 lines × 9) embassy-net-esp-hosted/src/proto/fg/mod.rs:817— embassy-net-esp-hosted/src/proto/fg/mod.rs:817-830 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1740-1753 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2822-2835 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5711-5724 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10262-10275 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16229-16242 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18321-18334 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32615-32628 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40588-40601 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 8) embassy-net-esp-hosted/src/proto/fg/mod.rs:7410— embassy-net-esp-hosted/src/proto/fg/mod.rs:7410-7423 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10188-10201 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19137-19150 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19403-19416 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31808-31821 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32236-32249 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32541-32554 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40514-40527 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (14 lines × 7) embassy-net-esp-hosted/src/proto/fg/mod.rs:10629— embassy-net-esp-hosted/src/proto/fg/mod.rs:10629-10642 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10825-10838 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11027-11040 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9815-9828 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47902-47915 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48101-48114 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48306-48319 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (3–14 lines × 3) embassy-hal-internal/src/atomic_ring_buffer.rs:255— embassy-hal-internal/src/atomic_ring_buffer.rs:255-268 | embassy-hal-internal/src/atomic_ring_buffer.rs:293-306 | embassy-hal-internal/src/atomic_ring_buffer.rs:442-444 — 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–14 lines × 2) embassy-stm32/src/cryp/mod.rs:1591— embassy-stm32/src/cryp/mod.rs:1591-1604 | embassy-stm32/src/cryp/mod.rs:1626-1632 — both copies are in the same file, so extract the 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–14 lines × 2) embassy-stm32/src/spi/mod.rs:1283— embassy-stm32/src/spi/mod.rs:1283-1294 | embassy-stm32/src/spi/mod.rs:1497-1510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 7) embassy-net-esp-hosted/src/proto/fg/mod.rs:868— embassy-net-esp-hosted/src/proto/fg/mod.rs:868-880 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5762-5774 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10433-10445 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16280-16292 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18372-18384 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32786-32798 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40759-40771 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 6) embassy-stm32/src/hspi/mod.rs:786— embassy-stm32/src/hspi/mod.rs:786-798 | embassy-stm32/src/hspi/mod.rs:862-874 | embassy-stm32/src/ospi/mod.rs:1933-1945 | embassy-stm32/src/ospi/mod.rs:2008-2020 | embassy-stm32/src/xspi/mod.rs:1735-1747 | embassy-stm32/src/xspi/mod.rs:1811-1823 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (12–13 lines × 3) embassy-stm32/src/aes/common.rs:511— embassy-stm32/src/aes/common.rs:511-523 | embassy-stm32/src/aes/v2.rs:355-366 | embassy-stm32/src/saes/mod.rs:731-743 — before extracting anything, compare `embassy-stm32/src/aes/common.rs` and `embassy-stm32/src/aes/v2.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (8–13 lines × 2) embassy-mcxa/src/i2c/controller.rs:1252— embassy-mcxa/src/i2c/controller.rs:1252-1259 | embassy-mcxa/src/i2c/target.rs:814-826 — before extracting anything, compare `embassy-mcxa/src/i2c/controller.rs` and `embassy-mcxa/src/i2c/target.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–13 lines × 2) embassy-nrf/src/usb/usbhs.rs:353— embassy-nrf/src/usb/usbhs.rs:353-363 | embassy-stm32/src/usb/otg.rs:1049-1061 — 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–13 lines × 2) embassy-stm32/src/aes/common.rs:494— embassy-stm32/src/aes/common.rs:494-506 | embassy-stm32/src/aes/v2.rs:342-351 — before extracting anything, compare `embassy-stm32/src/aes/common.rs` and `embassy-stm32/src/aes/v2.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (12 lines × 54) embassy-net-esp-hosted/src/proto/fg/mod.rs:716— embassy-net-esp-hosted/src/proto/fg/mod.rs:716-727 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1106-1117 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1492-1503 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2508-2519 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3746-3757 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3975-3986 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4204-4215 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4536-4547 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5610-5621 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6304-6315 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7010-7021 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7812-7823 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16128-16139 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16518-16529 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17154-17165 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17486-17497 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17626-17637 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17766-17777 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18220-18231 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18923-18934 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19746-19757 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19886-19897 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20026-20037 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20166-20177 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20675-20686 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20815-20826 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21294-21305 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21555-21566 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21695-21706 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21835-21846 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22225-22236 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23736-23747 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24426-24437 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24875-24886 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25133-25144 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25485-25496 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25831-25842 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26514-26525 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28390-28401 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28780-28791 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30183-30194 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31028-31039 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33073-33084 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33563-33574 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33703-33714 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41884-41895 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42024-42035 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42410-42421 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42796-42807 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43182-43193 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43568-43579 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43954-43965 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44548-44559 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44884-44895 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (12 lines × 8) embassy-net-esp-hosted/src/proto/fg/mod.rs:867— embassy-net-esp-hosted/src/proto/fg/mod.rs:867-878 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2982-2993 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5761-5772 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10432-10443 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16279-16290 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18371-18382 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32785-32796 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40758-40769 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (12 lines × 5) embassy-net-esp-hosted/src/proto/fg/mod.rs:246— embassy-net-esp-hosted/src/proto/fg/mod.rs:246-257 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8908-8919 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3442-3453 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10961-10972 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12130-12141 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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–12 lines × 2) embassy-rp/src/clocks.rs:913— embassy-rp/src/clocks.rs:913-924 | embassy-rp/src/clocks.rs:944-952 — both copies are in the same file, so extract the 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 × 9) embassy-net-esp-hosted/src/proto/fg/mod.rs:131— embassy-net-esp-hosted/src/proto/fg/mod.rs:131-141 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1698-1708 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2760-2770 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2473-2483 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4528-4538 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5653-5663 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10492-10502 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10834-10844 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11322-11332 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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–11 lines × 3) embassy-stm32/src/i2c/v1.rs:179— embassy-stm32/src/i2c/v1.rs:179-189 | embassy-stm32/src/i2c/v1.rs:309-319 | embassy-stm32/src/i2c/v1.rs:341-349 — 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 (2–11 lines × 4) embassy-stm32/src/flash/f2.rs:130— embassy-stm32/src/flash/f2.rs:130-140 | embassy-stm32/src/flash/f4.rs:218-228 | embassy-stm32/src/flash/g.rs:240-241 | embassy-stm32/src/flash/l.rs:325-335 — before extracting anything, compare `embassy-stm32/src/flash/f2.rs` and `embassy-stm32/src/flash/f4.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–10 lines × 3) embassy-mcxa/src/clocks/periph_helpers.rs:894— embassy-mcxa/src/clocks/periph_helpers.rs:894-903 | embassy-mcxa/src/clocks/periph_helpers.rs:1148-1157 | embassy-mcxa/src/clocks/periph_helpers.rs:1285-1293 — 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 (8–10 lines × 2) cyw43/src/runner.rs:1254— cyw43/src/runner.rs:1254-1263 | embassy-net-esp-hosted/src/lib.rs:412-419 — 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 (2–10 lines × 3) embassy-nrf/src/uarte.rs:841— embassy-nrf/src/uarte.rs:841-842 | embassy-nrf/src/uarte.rs:990-999 | embassy-nrf/src/uarte.rs:1053-1062 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–10 lines × 2) embassy-stm32/src/jpeg.rs:380— embassy-stm32/src/jpeg.rs:380-389 | embassy-stm32/src/jpeg.rs:618-623 — both copies are in the same file, so extract the 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) embassy-stm32/src/usart/buffered.rs:748— embassy-stm32/src/usart/buffered.rs:748-757 | embassy-stm32/src/usart/buffered.rs:788-796 — both copies are in the same file, so extract the 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 × 11) embassy-net-esp-hosted/src/proto/fg/mod.rs:275— embassy-net-esp-hosted/src/proto/fg/mod.rs:275-283 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1892-1900 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2254-2262 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3004-3012 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3480-3488 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2693-2701 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4998-5006 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6064-6072 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10659-10667 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10976-10984 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11389-11397 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 × 7) embassy-net-esp-hosted/src/proto/fg/mod.rs:441— embassy-net-esp-hosted/src/proto/fg/mod.rs:441-449 | embassy-net-esp-hosted/src/proto/fg/mod.rs:688-696 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1366-1374 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6561-6569 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15644-15652 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16100-16108 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17028-17036 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (8–9 lines × 6) embassy-stm32/src/hspi/mod.rs:494— embassy-stm32/src/hspi/mod.rs:494-502 | embassy-stm32/src/hspi/mod.rs:535-542 | embassy-stm32/src/ospi/mod.rs:836-844 | embassy-stm32/src/ospi/mod.rs:875-882 | embassy-stm32/src/xspi/mod.rs:633-641 | embassy-stm32/src/xspi/mod.rs:674-681 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 × 6) embassy-stm32/src/hspi/mod.rs:823— embassy-stm32/src/hspi/mod.rs:823-831 | embassy-stm32/src/hspi/mod.rs:900-908 | embassy-stm32/src/ospi/mod.rs:1971-1979 | embassy-stm32/src/ospi/mod.rs:2046-2054 | embassy-stm32/src/xspi/mod.rs:1772-1780 | embassy-stm32/src/xspi/mod.rs:1849-1857 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (8–9 lines × 5) embassy-usb-host/src/class/uac/mod.rs:331— embassy-usb-host/src/class/uac/mod.rs:331-339 | embassy-usb-host/src/class/uac/mod.rs:366-373 | embassy-usb-host/src/class/uac/mod.rs:447-455 | embassy-usb-host/src/class/uac/mod.rs:485-493 | embassy-usb-host/src/class/uac/mod.rs:523-531 — 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.
Duplicated block (8–9 lines × 3) embassy-stm32/src/hsem/mod.rs:150— embassy-stm32/src/hsem/mod.rs:150-157 | embassy-stm32/src/hsem/mod.rs:179-186 | embassy-stm32/src/hsem/mod.rs:226-234 — 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 (8 lines × 36) embassy-net-esp-hosted/src/proto/mcu/mod.rs:48908— embassy-net-esp-hosted/src/proto/mcu/mod.rs:48908-48915 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48921-48928 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48934-48941 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48947-48954 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48960-48967 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48985-48992 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48998-49005 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49011-49018 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49024-49031 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49037-49044 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49050-49057 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49063-49070 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49076-49083 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49089-49096 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49102-49109 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49115-49122 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49128-49135 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49141-49148 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49154-49161 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49167-49174 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49180-49187 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49193-49200 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49206-49213 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49219-49226 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49232-49239 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49245-49252 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49258-49265 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49271-49278 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49284-49291 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49297-49304 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49310-49317 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49323-49330 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49336-49343 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49349-49356 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49362-49369 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:49375-49382 — all 36 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 (8 lines × 21) embassy-net-esp-hosted/src/proto/fg/mod.rs:11229— embassy-net-esp-hosted/src/proto/fg/mod.rs:11229-11236 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11242-11249 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11255-11262 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11268-11275 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11281-11288 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11294-11301 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11307-11314 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11320-11327 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11333-11340 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11346-11353 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11359-11366 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11372-11379 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11385-11392 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11398-11405 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11411-11418 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11424-11431 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11437-11444 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11450-11457 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11463-11470 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11476-11483 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11489-11496 — all 21 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–8 lines × 14) embassy-ambiq/src/time_driver.rs:158— embassy-ambiq/src/time_driver.rs:158-165 | embassy-ambiq/src/time_driver.rs:317-324 | embassy-imxrt/src/time_driver.rs:244-251 | embassy-imxrt/src/time_driver.rs:394-401 | embassy-mcxa/src/ostimer.rs:190-197 | embassy-microchip/src/time_driver.rs:168-175 | embassy-mspm0/src/time_driver/tim.rs:311-315 | embassy-nrf/src/time_driver.rs:455-462 | embassy-nxp/src/time_driver/pit.rs:52-60 | embassy-nxp/src/time_driver/rtc.rs:162-169 | embassy-rp/src/time_driver.rs:50-57 | embassy-stm32/src/time_driver/lptim.rs:408-415 | embassy-stm32/src/time_driver/tim.rs:381-388 | embassy-time/src/driver_cmsdk/mod.rs:328-335 — there are 14 copies across 12 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 14 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6–8 lines × 2) embassy-stm32/src/spi/mod.rs:1707— embassy-stm32/src/spi/mod.rs:1707-1712 | embassy-stm32/src/spi/mod.rs:1774-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.
Duplicated block (7 lines × 12) embassy-net-esp-hosted/src/proto/mcu/mod.rs:9688— embassy-net-esp-hosted/src/proto/mcu/mod.rs:9688-9694 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12744-12750 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22535-22541 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22762-22768 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23035-23041 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23262-23268 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26785-26791 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27105-27111 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27528-27534 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27848-27854 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29023-29029 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29250-29256 — all 12 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 × 11) embassy-net-esp-hosted/src/proto/fg/mod.rs:131— embassy-net-esp-hosted/src/proto/fg/mod.rs:131-137 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1698-1704 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2091-2097 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2760-2766 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3261-3267 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2473-2479 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4528-4534 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5653-5659 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10492-10498 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10834-10840 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11322-11328 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (7 lines × 6) embassy-rp/src/i2c.rs:494— embassy-rp/src/i2c.rs:494-500 | embassy-rp/src/pio/mod.rs:1326-1334 | embassy-rp/src/spi.rs:158-164 | embassy-rp/src/spi.rs:171-177 | embassy-rp/src/spi.rs:184-190 | embassy-rp/src/spi.rs:197-203 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (2–7 lines × 12) embassy-ambiq/src/time_driver.rs:111— embassy-ambiq/src/time_driver.rs:111-112 | embassy-ambiq/src/time_driver.rs:257-258 | embassy-imxrt/src/time_driver.rs:223-224 | embassy-imxrt/src/time_driver.rs:363-364 | embassy-mcxa/src/ostimer.rs:149-150 | embassy-microchip/src/time_driver.rs:149-150 | embassy-mspm0/src/time_driver/tim.rs:232-234 | embassy-nrf/src/time_driver.rs:350-355 | embassy-rp/src/time_driver.rs:105-106 | embassy-stm32/src/time_driver/lptim.rs:280-281 | embassy-stm32/src/time_driver/tim.rs:247-248 | embassy-time/src/driver_cmsdk/mod.rs:234-240 — there are 12 copies across 10 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 12 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (4–7 lines × 4) embassy-stm32/src/cryp/mod.rs:1013— embassy-stm32/src/cryp/mod.rs:1013-1016 | embassy-stm32/src/cryp/mod.rs:1017-1023 | embassy-stm32/src/cryp/mod.rs:1025-1031 | embassy-stm32/src/cryp/mod.rs:1032-1036 — 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 (6 lines × 6) embassy-stm32/src/hspi/mod.rs:815— embassy-stm32/src/hspi/mod.rs:815-820 | embassy-stm32/src/hspi/mod.rs:891-896 | embassy-stm32/src/ospi/mod.rs:1962-1967 | embassy-stm32/src/ospi/mod.rs:2037-2042 | embassy-stm32/src/xspi/mod.rs:1764-1769 | embassy-stm32/src/xspi/mod.rs:1840-1845 — `embassy-stm32/src/hspi/mod.rs` and `embassy-stm32/src/ospi/mod.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 19 separate duplicated blocks between them, totalling at least 220 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 (5–6 lines × 5) embassy-nxp/src/spi/lpc55.rs:185— embassy-nxp/src/spi/lpc55.rs:185-190 | embassy-nxp/src/spi/lpc55.rs:196-200 | embassy-nxp/src/spi/lpc55.rs:206-211 | embassy-nxp/src/usart/lpc55.rs:590-595 | embassy-nxp/src/usart/lpc55.rs:601-605 — `embassy-nxp/src/spi/lpc55.rs` and `embassy-nxp/src/usart/lpc55.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 48 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 (5–6 lines × 3) embassy-stm32/src/flash/f2.rs:68— embassy-stm32/src/flash/f2.rs:68-73 | embassy-stm32/src/flash/f4.rs:107-111 | embassy-stm32/src/flash/f4.rs:139-144 — before extracting anything, compare `embassy-stm32/src/flash/f2.rs` and `embassy-stm32/src/flash/f4.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (5 lines × 8) embassy-stm32/src/crypto_driver.rs:386— embassy-stm32/src/crypto_driver.rs:386-390 | embassy-stm32/src/crypto_driver.rs:402-406 | embassy-stm32/src/crypto_driver.rs:428-432 | embassy-stm32/src/crypto_driver.rs:444-448 | embassy-stm32/src/crypto_driver.rs:470-474 | embassy-stm32/src/crypto_driver.rs:500-504 | embassy-stm32/src/crypto_driver.rs:540-544 | embassy-stm32/src/crypto_driver.rs:570-574 — 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.
Duplicated block (4–5 lines × 3) embassy-mcxa/src/spi/controller.rs:1004— embassy-mcxa/src/spi/controller.rs:1004-1008 | embassy-mcxa/src/spi/controller.rs:1036-1039 | embassy-mcxa/src/spi/controller.rs:1082-1086 — 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 (22 lines × 27) cyw43/src/fmt.rs:267— cyw43/src/fmt.rs:267-288 | embassy-boot-nrf/src/fmt.rs:248-269 | embassy-boot-rp/src/fmt.rs:248-269 | embassy-boot-stm32/src/fmt.rs:248-269 | embassy-boot/src/fmt.rs:248-269 | embassy-executor/src/fmt.rs:248-269 | embassy-futures/src/fmt.rs:248-269 | embassy-hal-internal/src/fmt.rs:248-269 | embassy-imxrt/src/fmt.rs:235-256 | embassy-microchip/src/fmt.rs:235-256 | embassy-mspm0/src/fmt.rs:248-269 | embassy-net-adin1110/src/fmt.rs:248-269 | embassy-net-driver-channel/src/fmt.rs:248-269 | embassy-net-enc28j60/src/fmt.rs:248-269 | embassy-net-esp-hosted/src/fmt.rs:248-269 | embassy-net-nrf91/src/fmt.rs:252-273 | embassy-net-ppp/src/fmt.rs:248-269 | embassy-net/src/fmt.rs:248-269 | embassy-nrf/src/fmt.rs:248-269 | embassy-nxp/src/fmt.rs:261-282 | embassy-rp/src/fmt.rs:248-269 | embassy-stm32/src/fmt.rs:280-301 | embassy-sync/src/fmt.rs:248-269 | embassy-time/src/fmt.rs:248-269 | embassy-usb-dfu/src/fmt.rs:248-269 | embassy-usb-synopsys-otg/src/fmt.rs:248-269 | embassy-usb/src/fmt.rs:248-269 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 27 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 27 times.
Duplicated block (641 lines × 3) embassy-nrf/src/chips/nrf54l05_app.rs:203— embassy-nrf/src/chips/nrf54l05_app.rs:203-843 | embassy-nrf/src/chips/nrf54l10_app.rs:203-843 | embassy-nrf/src/chips/nrf54l15_app.rs:203-843 — 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 (237 lines × 2) embassy-nrf/src/chips/nrf9120.rs:138— embassy-nrf/src/chips/nrf9120.rs:138-374 | embassy-nrf/src/chips/nrf9160.rs:138-374 — 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 (63 lines × 2) embassy-nrf/src/time.rs:11— embassy-nrf/src/time.rs:11-73 | embassy-rp/src/time.rs:11-73 — 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 (133 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:386— embassy-nrf/src/crypto/pka/driver.rs:386-530 | embassy-stm32/src/pka/driver.rs:483-615 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (127 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:392— embassy-nrf/src/crypto/pka/driver.rs:392-530 | embassy-stm32/src/pka/driver.rs:489-615 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (121 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:398— embassy-nrf/src/crypto/pka/driver.rs:398-530 | embassy-stm32/src/pka/driver.rs:495-615 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (114 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:405— embassy-nrf/src/crypto/pka/driver.rs:405-530 | embassy-stm32/src/pka/driver.rs:502-615 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (144 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:386— embassy-nrf/src/crypto/pka/driver.rs:386-541 | embassy-stm32/src/pka/driver.rs:483-626 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (138 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:392— embassy-nrf/src/crypto/pka/driver.rs:392-541 | embassy-stm32/src/pka/driver.rs:489-626 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (132 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:398— embassy-nrf/src/crypto/pka/driver.rs:398-541 | embassy-stm32/src/pka/driver.rs:495-626 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (125 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:405— embassy-nrf/src/crypto/pka/driver.rs:405-541 | embassy-stm32/src/pka/driver.rs:502-626 — before extracting anything, compare `embassy-nrf/src/crypto/pka/driver.rs` and `embassy-stm32/src/pka/driver.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 1170 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 (65 lines × 5) embassy-crypto/src/aes.rs:244— embassy-crypto/src/aes.rs:244-460 | embassy-crypto/src/aes.rs:244-456 | embassy-crypto/src/chacha.rs:96-168 | embassy-crypto/src/chacha.rs:96-160 | embassy-crypto/src/chacha.rs:96-164 — 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.
Duplicated block (52 lines × 5) embassy-crypto/src/aes.rs:257— embassy-crypto/src/aes.rs:257-460 | embassy-crypto/src/aes.rs:257-456 | embassy-crypto/src/chacha.rs:109-168 | embassy-crypto/src/chacha.rs:109-160 | embassy-crypto/src/chacha.rs:109-164 — 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.
Duplicated block (5 lines × 45) embassy-net-esp-hosted/src/proto/fg/mod.rs:5084— embassy-net-esp-hosted/src/proto/fg/mod.rs:5084-5091 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:1883-1887 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2389-2396 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2450-2457 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2854-2861 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4337-4341 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4483-4490 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5462-5469 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5501-5505 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7870-7874 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8626-8630 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15301-15305 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15337-15341 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17862-17866 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18694-18698 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19117-19121 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19553-19557 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20340-20344 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21390-21397 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22321-22328 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24646-24650 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24971-24975 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25229-25233 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26081-26085 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26351-26355 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26762-26769 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27255-27262 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27505-27512 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27998-28005 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29504-29511 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30799-30803 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35194-35198 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35230-35234 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35670-35677 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35709-35716 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37075-37082 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37295-37302 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37515-37522 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38027-38031 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40909-40913 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45746-45753 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46961-46965 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47479-47483 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48467-48474 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48506-48513 — `embassy-net-esp-hosted/src/proto/fg/mod.rs` and `embassy-net-esp-hosted/src/proto/mcu/mod.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 123 separate duplicated blocks between them, totalling at least 1912 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 (13 lines × 8) embassy-mcxa/src/clocks/periph_helpers.rs:531— embassy-mcxa/src/clocks/periph_helpers.rs:531-543 | embassy-mcxa/src/clocks/periph_helpers.rs:673-685 | embassy-mcxa/src/clocks/periph_helpers.rs:921-934 | embassy-mcxa/src/clocks/periph_helpers.rs:1005-1018 | embassy-mcxa/src/clocks/periph_helpers.rs:1310-1322 | embassy-mcxa/src/clocks/periph_helpers.rs:1490-1503 | embassy-mcxa/src/clocks/periph_helpers.rs:1669-1682 | embassy-mcxa/src/clocks/periph_helpers.rs:1808-1820 — 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.
End-of-life runtime: Rust 1.97 — rust-toolchain.toml declares Rust 1.97 as this project's toolchain file, and Rust 1.97, superseded by 1.98 on 2026-08-20 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-08-20 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 24 significant file(s) lose their only recent owner: embassy-stm32-wpan/src/wb/shci.rs, embassy-stm32-wpan/src/wb/sub/mac.rs, embassy-stm32/src/eth/v1/descriptors.rs, cyw43/src/sdio.rs, embassy-stm32-wpan/src/wb/mod.rs, embassy-stm32-wpan/src/net/responses.rs, embassy-stm32-wpan/src/wb/unsafe_linked_list.rs, cyw43/src/fmt.rs (+16 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 20 significant file(s) lose their only recent owner: embassy-stm32-wpan/src/bluetooth/security/mod.rs, embassy-usb-host/src/class/hid_report.rs, embassy-stm32/src/tamp/mod.rs, embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs, embassy-stm32/src/i3c/controller.rs, embassy-stm32-wpan/src/bluetooth/gap/scanner.rs, embassy-stm32-wpan/src/bluetooth/gatt/client.rs, embassy-stm32-wpan/src/bluetooth/gap/types.rs (+12 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 10 significant file(s) lose their only recent owner: embassy-mcxa/src/flexcan/classic/mod.rs, embassy-mcxa/src/flexcan/classic/mailbox.rs, embassy-mcxa/src/flexcan/classic/asynchronous.rs, embassy-mcxa/src/flexcan/classic/blocking.rs, embassy-mcxa/src/flexcan/classic/timing.rs, embassy-mcxa/src/flexcan/filter.rs, embassy-mcxa/src/flexcan/mod.rs, embassy-mcxa/src/flexcan/id.rs (+2 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 7 significant file(s) lose their only recent owner: embassy-net-esp-hosted/src/proto/mcu/mod.rs, embassy-net-esp-hosted/src/rpc/mcu.rs, embassy-net-esp-hosted/src/rpc/mod.rs, embassy-net-esp-hosted/src/iface/hd_spi.rs, embassy-net-esp-hosted/src/bluetooth.rs, embassy-net-esp-hosted/src/proto/mod.rs, embassy-net-esp-hosted/src/rpc/ioctl_ctx.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 6 significant file(s) lose their only recent owner: embassy-imxrt/src/flexcomm/uart.rs, embassy-imxrt/src/time_driver.rs, embassy-sync/src/waitqueue/atomic_waker.rs, embassy-imxrt/src/dma.rs, embassy-mcxa/src/reset_reason.rs, embassy-mcxa/src/inputmux.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 5 significant file(s) lose their only recent owner: embassy-nrf/src/sqspi/mod.rs, embassy-nrf/src/sqspi/regs.rs, embassy-net-nrf91/src/context.rs, embassy-nrf/src/vpr.rs, embassy-nrf/src/ppib.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 4 significant file(s) lose their only recent owner: embassy-mspm0/src/low_power/mod.rs, embassy-mspm0/src/low_power/full.rs, embassy-mspm0/src/low_power/c110x.rs, embassy-mspm0/src/low_power/h321x.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 3 significant file(s) lose their only recent owner: embassy-ambiq/src/gpio.rs, embassy-ambiq/src/i2c.rs, embassy-ambiq/src/iom.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 3 significant file(s) lose their only recent owner: embassy-stm32/src/executor.rs, embassy-net/src/route.rs, embassy-net/src/neighbor.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 27 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (113 single-owned of 757 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 757 of the 918 production source files in this repository met that bar). They are anonymized user #10 (2 file(s)), anonymized user #11 (2 file(s)), anonymized user #12 (2 file(s)), anonymized user #13 (2 file(s)), anonymized user #14 (1 file(s)), anonymized user #15 (1 file(s)) (+21 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 9 of 48 project(s) overshoot their size bounds, lowering Project Cohesion to 6.3/10. The most over is `embassy-nrf` (35040 LoC, 2944 public types across 13 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 33 of 757 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 757 of the 918 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: embassy-stm32/src/can/bxcan/filter.rs, embassy-stm32/src/can/fd/message_ram/txbuffer_element.rs, embassy-net-adin1110/src/crc32.rs, embassy-stm32/src/tsc/acquisition_banks.rs, embassy-embedded-hal/src/flash/concat_flash.rs, embassy-usb-dfu/src/fmt.rs, embassy-stm32/src/can/fd/message_ram/enums.rs, embassy-stm32/src/tsc/io_pin.rs (and 25 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P1 · CI/CD gates· CI build step not evidenced · ×1
CI build step not evidenced — A CI pipeline exists but no build step was matched — changes may merge without the build ever running. A build step may be invoked directly as a command, or declared as a task that a runner named in the pipeline resolves.
Logging is not universal — Only 35/37 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `cyw43-firmware`, `embassy-executor-macros`.
No SAST — No static application security testing detected. For this repository's stack, add cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 4536 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a0eb6b-cf16-7122-b30f-ee44b59608d6 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 3 · Warnings: 2144 · Recommendations: 18 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-09-2026 @ 04:28 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.