Public report of embassy-rs/embassy, published 27 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 27 October 2026, 06:22 UTC · Survey ID cd_53e7fed03c984e7583eb5099b01aad31

embassy-rs/embassy

Measured 27 October 2026, 06:16 UTC, at code version c287925

No regression since the last survey Supply-chain provenance & signing: not measured

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.

CAI score 68out of 100 Strong
CriticalWeakAdequateStrongExemplary
Up 1 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 410,706 lines of product code in 47 projects, tests not counted · Estimated rebuild effort: about 4.7 person-years · Weakest lens: Production Readiness, 51

Findings by how serious they are

7 critical 2201 serious 86 minor

15 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 06:16 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

56of 56 dimensions measured by tools.
2263of 2294 findings point to an exact file and line, so you can open each one in the code. The other 31 concern the repository as a whole, such as missing documentation.
56dimensions across 7 lenses, read from 410,706 lines of product code in 47 projects.
Chapters

Executive summary

embassy-rs/embassy meets our standard for a preview release, though we found no automated security scanning of the code, its secrets or its dependencies. It scores 68 out of 100 and is rated Strong, and four of its seven critical findings are security problems.

Production Readiness, at 51, is the weakest lens and counts most in the score. The best first step is adding automated security scanning, worth about 10 points. Recording design decisions comes next, worth about 3 points. Raising Production Readiness to 62 would lift the score to about 74.

Three pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Three parts of the code are no longer understood by anyone working on it. Pinning each tool to an exact version and having someone learn the forgotten files would close both risks. Giving the pull-request workflow read-only access would fix the pipeline that outsiders can trigger with write access.

The product code is 410,706 lines, about €680,000 to rebuild.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 51 · counts for 46%Maturity 77 · counts for 25%Security and Compliance 85 · counts for 14%Code Health 87 · counts for 8%Architecture 95 · counts for 4%Event Sourcing 100 · counts for 2%Performance 100 · counts for 1%

If Production Readiness rose from 51 to 62, the lowest score rated Strong, the score would rise from 68 to about 74.

Code composition: what the lines of code are
Product code 76%Tests 24%
New since the last survey: 102 findings

These 102 critical or serious findings weren't in the previous survey, on 13 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · embassy_stm32_wpan::wb::fus::boot (cyclomatic 23) embassy-stm32-wpan/src/wb/fus.rs
  • Cyclomatic Complexity · StateInner::handle_data (cyclomatic 20) embassy-net-nrf91/src/lib.rs
  • Cyclomatic Complexity · LptmrConfig::pre_enable_config (cyclomatic 17) embassy-mcxa/src/clocks/periph_helpers.rs
  • Cognitive Complexity · embassy_stm32_wpan::wb::fus::boot (cognitive 66) embassy-stm32-wpan/src/wb/fus.rs
  • Cognitive Complexity · embassy_mcxa::i2c::controller::compute_baud_params (cognitive 19) embassy-mcxa/src/i2c/controller.rs
  • Cognitive Complexity · Regs::configure_sequence (cognitive 19) embassy-stm32/src/adc/v3_h7_adc3.rs
  • Cognitive Complexity · MscClass::write (cognitive 19) embassy-usb/src/class/msc/device/transfer.rs
  • Cognitive Complexity · embassy_stm32_wpan::wb::fus::request_upgrade (cognitive 18) embassy-stm32-wpan/src/wb/fus.rs
  • Cognitive Complexity · BtRunner::handle_irq (cognitive 17) cyw43/src/bluetooth.rs
  • Cognitive Complexity · InterruptHandler::on_interrupt (cognitive 17) embassy-nrf/src/usb/mod.rs
  • Cognitive Complexity · Runner::run (cognitive 16) embassy-net-wiznet/src/lib.rs
  • Cognitive Complexity · embassy_rp::block::sha256 (cognitive 16) embassy-rp/src/block.rs
  • God Classes · FileTooLong: hashcrypt/lpc55.rs embassy-nxp/src/hashcrypt/lpc55.rs
  • God Classes · FileTooLong: src/block.rs embassy-rp/src/block.rs
  • God Classes · TooManyMethods: I2c embassy-rp/src/i2c.rs
  • God Classes · FileTooLong: rom/flexspi_nor.rs embassy-mcxa/src/rom/flexspi_nor.rs
  • God Classes · TooManyMethods: RawSocket embassy-net/src/raw.rs
  • Code Duplication · Near-duplicate member pair (51 shared lines) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Near-duplicate member pair (47 shared lines) embassy-mcxa/src/chips/mcxa2xx.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) embassy-nrf/src/twis.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) embassy-stm32/src/sdmmc/mod.rs
  • Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) embassy-ambiq/src/time_driver.rs
  • Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) embassy-ambiq/src/time_driver.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) embassy-net-nrf91/src/context.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) embassy-stm32/src/rcc/c0.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) embassy-stm32/src/sdmmc/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-mcxa/src/i2c/controller.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-mcxa/src/i2c/controller.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/adc/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/adc/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/usart/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/usb/otg.rs
  • Code Duplication · Duplicated block (32 lines × 2) embassy-rp/src/pio_programs/ws2812.rs
  • Code Duplication · Duplicated block (25 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (25 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (24 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (20 lines × 2) embassy-mcxa/src/chips/mcxa2xx.rs
  • Code Duplication · Duplicated block (20 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (20 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (19 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (19 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (17–19 lines × 2) embassy-usb/src/class/msc/host/mod.rs
  • Code Duplication · Duplicated block (18 lines × 4) embassy-mcxa/src/clocks/periph_helpers.rs
  • Code Duplication · Duplicated block (18 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (17 lines × 4) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (17 lines × 3) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (17 lines × 3) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (17 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (15 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (14 lines × 2) embassy-rp/src/pio/mod.rs
  • Code Duplication · Duplicated block (13 lines × 3) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (13 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (13 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (13 lines × 2) embassy-stm32/src/dma/ringbuffer.rs
  • Code Duplication · Duplicated block (12 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (12 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (12 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (11–12 lines × 2) embassy-stm32/src/eth/sma/v2.rs
  • Code Duplication · Duplicated block (10–11 lines × 2) embassy-rp/src/pio_programs/ir_nec.rs
  • Code Duplication · Duplicated block (11 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (11 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (11 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (10–11 lines × 2) embassy-stm32/src/spi/mod.rs
  • Code Duplication · Duplicated block (10 lines × 5) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (10 lines × 5) embassy-nxp/src/hashcrypt/lpc55.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-usb/src/class/msc/device/transfer.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-stm32/src/dac/mod.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (6 lines × 2) embassy-stm32/src/usb/usb.rs
  • Code Duplication · Duplicated block (3–5 lines × 3) embassy-stm32/src/adc/v2.rs
  • Code Duplication · Duplicated block (38 lines × 3) embassy-crypto-stub/src/aes.rs
  • Code Duplication · Duplicated block (38 lines × 4) embassy-crypto-stub/src/aes.rs
  • Code Duplication · Duplicated block (38 lines × 2) embassy-crypto-stub/src/ec.rs
  • Code Duplication · Duplicated block (5 lines × 2) embassy-stm32/src/adc/v3.rs
  • Code Duplication · Duplicated block (5 lines × 2) embassy-stm32/src/adc/v3.rs
  • Coupling · Unstable project embassy-stm32
  • Cohesion (LCOM4) · Low cohesion: Regs (LCOM4 46) embassy-nrf/src/sqspi/regs.rs
  • Cohesion (LCOM4) · Low cohesion: GenericHashcrypt (LCOM4 5) embassy-nxp/src/hashcrypt/lpc55.rs
  • Cohesion (LCOM4) · Low cohesion: Config (LCOM4 5) embassy-usb/src/class/msc/device/config.rs
  • Cohesion (LCOM4) · Low cohesion: Flash (LCOM4 4) embassy-stm32/src/flash/common.rs
  • Cohesion (LCOM4) · Low cohesion: ControllerAdapter (LCOM4 4) embassy-stm32-wpan/src/wb/sub/ble.rs
  • Churn × Complexity Hotspots · Hotspot: cyw43/src/events.rs cyw43/src/events.rs
  • Churn × Complexity Hotspots · Hotspot: embassy-rp/src/uart/mod.rs embassy-rp/src/uart/mod.rs
  • Churn × Complexity Hotspots · Hotspot: embassy-net-nrf91/src/lib.rs embassy-net-nrf91/src/lib.rs
  • Churn × Complexity Hotspots · Hotspot: embassy-stm32/src/rcc/g0.rs embassy-stm32/src/rcc/g0.rs
  • Churn × Complexity Hotspots · Hotspot: embassy-nrf/src/buffered_uarte/v1.rs embassy-nrf/src/buffered_uarte/v1.rs
  • Churn × Complexity Hotspots · Hotspot: embassy-stm32/src/rcc/f013.rs embassy-stm32/src/rcc/f013.rs
  • Churn × Complexity Hotspots · Hotspot: embassy-executor-macros/src/macros/main.rs embassy-executor-macros/src/macros/main.rs
  • Churn × Complexity Hotspots · Hotspot: embassy-executor-macros/src/macros/task.rs embassy-executor-macros/src/macros/task.rs
  • Explicit Debt · TodoComment repeated across 11 files embassy-usb/src/class/cdc_ncm/device/mod.rs
  • Knowledge Freshness · Orphaned knowledge embassy-rp/src/aon_timer/mod.rs
  • Knowledge Freshness · Orphaned knowledge embassy-stm32/src/dma2d/mod.rs
  • Knowledge Freshness · Orphaned knowledge embassy-stm32/src/tsc/pin_groups.rs
  • Change Coupling · Change coupling: low_power.rs ↔ low_power.rs embassy-stm32/src/low_power.rs

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 131 findings

These 131 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · MscClass::process_cbw (cyclomatic 27) embassy-usb/src/class/msc/device/mod.rs
  • Cyclomatic Complexity · FirmwareUpgrader::boot (cyclomatic 23) embassy-stm32-wpan/src/wb/fus.rs
  • Cyclomatic Complexity · StorageDevice::acquire (cyclomatic 21) embassy-stm32/src/sdmmc/sd.rs
  • Cyclomatic Complexity · Lcd::new (cyclomatic 17) embassy-stm32/src/lcd.rs
  • Cyclomatic Complexity · embassy_usb::class::msc::host::run_cycle (cyclomatic 16) embassy-usb/src/class/msc/host.rs
  • Cognitive Complexity · FirmwareUpgrader::boot (cognitive 66) embassy-stm32-wpan/src/wb/fus.rs
  • Cognitive Complexity · StorageDevice::acquire (cognitive 37) embassy-stm32/src/sdmmc/sd.rs
  • Cognitive Complexity · embassy_stm32::flash::h5::blocking_wait_ready (cognitive 21) embassy-stm32/src/flash/h5.rs
  • Cognitive Complexity · embassy_stm32::flash::l::wait_ready_blocking (cognitive 20) embassy-stm32/src/flash/l.rs
  • Cognitive Complexity · MscClass::write (cognitive 20) embassy-usb/src/class/msc/device/mod.rs
  • Cognitive Complexity · embassy_stm32::flash::c5::blocking_wait_ready (cognitive 18) embassy-stm32/src/flash/c5.rs
  • Cognitive Complexity · MscClass::process_cbw (cognitive 17) embassy-usb/src/class/msc/device/mod.rs
  • God Classes · FileTooLong: device/mod.rs embassy-usb/src/class/msc/device/mod.rs
  • God Classes · ClassTooLong: MscClass embassy-usb/src/class/msc/device/mod.rs
  • God Classes · FileTooLong: msc/host.rs embassy-usb/src/class/msc/host.rs
  • Code Duplication · Near-duplicate member pair (59 shared lines) embassy-stm32/src/sdmmc/mod.rs
  • Code Duplication · Near-duplicate member pair (47 shared lines) embassy-mcxa/src/chips/mcxa2xx.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) embassy-nrf/src/twis.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) embassy-stm32/src/sdmmc/mod.rs
  • Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) embassy-ambiq/src/time_driver.rs
  • Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) embassy-ambiq/src/time_driver.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) embassy-net-nrf91/src/context.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) embassy-stm32/src/rcc/c0.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) embassy-stm32/src/sdmmc/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-mcxa/src/i2c/controller.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-mcxa/src/i2c/controller.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/adc/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/adc/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/flash/c.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/flash/c5.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/usart/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) embassy-stm32/src/usb/otg.rs
  • Code Duplication · Duplicated block (32 lines × 2) embassy-rp/src/pio_programs/ws2812.rs
  • Code Duplication · Duplicated block (29 lines × 2) embassy-stm32/src/flash/u3.rs
  • Code Duplication · Duplicated block (24 lines × 2) embassy-stm32/src/sdmmc/mod.rs
  • Code Duplication · Duplicated block (24 lines × 2) embassy-stm32/src/sdmmc/mod.rs
  • Code Duplication · Duplicated block (21 lines × 2) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Duplicated block (20 lines × 2) embassy-mcxa/src/chips/mcxa2xx.rs
  • Code Duplication · Duplicated block (17–19 lines × 2) embassy-usb/src/class/msc/host.rs
  • Code Duplication · Duplicated block (18 lines × 4) embassy-mcxa/src/clocks/periph_helpers.rs
  • Code Duplication · Duplicated block (17 lines × 2) embassy-stm32/src/flash/f0.rs
  • Code Duplication · Duplicated block (11–17 lines × 2) embassy-stm32/src/sdmmc/mod.rs
  • Code Duplication · Duplicated block (15–16 lines × 2) embassy-stm32/src/eth/sma/v2.rs
  • Code Duplication · Duplicated block (16 lines × 2) embassy-stm32/src/flash/c.rs
  • Code Duplication · Duplicated block (14 lines × 2) embassy-rp/src/pio/mod.rs
  • Code Duplication · Duplicated block (14 lines × 2) embassy-stm32/src/flash/c5.rs
  • Code Duplication · Duplicated block (13 lines × 3) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Duplicated block (13 lines × 2) embassy-stm32/src/dma/ringbuffer/mod.rs
  • Code Duplication · Duplicated block (13 lines × 2) embassy-stm32/src/flash/h7.rs
  • Code Duplication · Duplicated block (13 lines × 2) embassy-stm32/src/sdmmc/sd.rs
  • Code Duplication · Duplicated block (12 lines × 3) embassy-stm32/src/flash/h5.rs
  • Code Duplication · Duplicated block (12 lines × 2) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Duplicated block (12 lines × 2) embassy-usb/src/class/msc/host.rs
  • Code Duplication · Duplicated block (11 lines × 4) embassy-stm32/src/flash/c.rs
  • Code Duplication · Duplicated block (2–11 lines × 4) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Duplicated block (11 lines × 3) embassy-stm32/src/flash/f7.rs
  • Code Duplication · Duplicated block (11 lines × 2) embassy-mspm0/src/uart/buffered.rs
  • Code Duplication · Duplicated block (11 lines × 2) embassy-stm32/src/flash/g.rs
  • Code Duplication · Duplicated block (11 lines × 2) embassy-stm32/src/flash/u3.rs
  • Code Duplication · Duplicated block (10–11 lines × 2) embassy-stm32/src/spi/mod.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-stm32/src/flash/c5.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-stm32/src/flash/f4.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-stm32/src/flash/h7.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-stm32/src/flash/u3.rs
  • Code Duplication · Duplicated block (9 lines × 4) embassy-stm32-wpan/src/wba/linklayer_plat.rs
  • Code Duplication · Duplicated block (9 lines × 4) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Duplicated block (9 lines × 3) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Duplicated block (9 lines × 3) embassy-stm32/src/flash/u3.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-boot/src/firmware_updater/asynch.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-mspm0/src/uart/buffered.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-stm32/src/flash/f0.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-stm32/src/flash/h5.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-stm32/src/flash/h7.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-stm32/src/flash/h7.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-stm32/src/flash/u3.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-usb/src/class/msc/device/mod.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-stm32/src/flash/g.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-stm32/src/flash/g.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-stm32/src/flash/h7.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-stm32/src/sdmmc/sd.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-usb/src/class/msc/device/mod.rs
  • Code Duplication · Duplicated block (8 lines × 2) embassy-usb/src/class/msc/device/mod.rs
  • Code Duplication · Duplicated block (7 lines × 2) embassy-stm32/src/flash/g.rs
  • Code Duplication · Duplicated block (7 lines × 2) embassy-stm32/src/flash/u3.rs
  • Code Duplication · Duplicated block (7 lines × 2) embassy-stm32/src/flash/u5.rs
  • Code Duplication · Duplicated block (7 lines × 2) embassy-usb/src/class/msc/device/mod.rs
  • Code Duplication · Duplicated block (6 lines × 3) embassy-stm32/src/flash/c5.rs
  • Code Duplication · Duplicated block (6 lines × 2) embassy-stm32/src/usb/usb.rs
  • Code Duplication · Duplicated block (6 lines × 2) embassy-usb/src/class/msc/device/mod.rs
  • Code Duplication · Duplicated block (5 lines × 4) embassy-stm32/src/flash/c5.rs
  • Code Duplication · Duplicated block (5 lines × 3) embassy-stm32/src/flash/f2.rs
  • Code Duplication · Duplicated block (5 lines × 2) embassy-usb/src/class/msc/device/mod.rs
  • Code Duplication · Duplicated block (12 lines × 2) embassy-imxrt/src/time_driver.rs
  • Code Duplication · Duplicated block (7 lines × 2) embassy-stm32/src/flash/asynch.rs
  • Code Duplication · Duplicated block (10 lines × 2) embassy-stm32/src/flash/c.rs
  • Code Duplication · Duplicated block (6 lines × 5) embassy-stm32/src/flash/f0.rs
  • Code Duplication · Duplicated block (9 lines × 2) embassy-stm32/src/flash/f2.rs
Rebuild cost: about €680,000 · Estimate
Cost to rebuild€230,000 to €1,100,000, for 3,791 to 12,026 hours of work, about 4.7 person-years for 2 to 9 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×1.0 at a score of 68. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 410,706 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Add a SAST step to CI running what this repository's stack ships: 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.
Raises the score by about 10 points · Medium effort · Security & performance tooling
2
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 3 points · Low effort · ADR Quality
3
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.
Raises the score by about 3 points · Medium effort · Release Hygiene

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €680,000 to build again, about 4.7 person-years of work. Its weakest lens is Production Readiness, at 51 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Add a SAST step to CI running what this repository's stack ships: 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. Of all the actions in this report, it raises the score most for the work it takes: about 10 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.1 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 217,065 lines over the last 90 days, which is about 880,319 lines a year. At that pace, the extra work comes to an estimated 49.2 to 295.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch embassy-boot embassy-boot embassy-crypto embassy-crypto embassy-boot->embassy-crypto embassy-embedded-hal embassy-embedded-hal embassy-boot->embassy-embedded-hal embassy-sync embassy-sync embassy-boot->embassy-sync embassy-futures embassy-futures embassy-embedded-hal->embassy-futures embassy-embedded-hal->embassy-sync embassy-time embassy-time embassy-embedded-hal->embassy-time embassy-executor embassy-executor embassy-time-driver embassy-time-driver embassy-executor->embassy-time-driver embassy-hal-internal embassy-hal-internal embassy-imxrt embassy-imxrt embassy-imxrt->embassy-embedded-hal embassy-imxrt->embassy-futures embassy-imxrt->embassy-hal-internal embassy-imxrt->embassy-sync embassy-imxrt->embassy-time embassy-imxrt->embassy-time-driver embassy-time-queue-utils embassy-time-queue-utils embassy-imxrt->embassy-time-queue-utils embassy-mcxa embassy-mcxa embassy-mcxa->embassy-embedded-hal embassy-mcxa->embassy-executor embassy-mcxa->embassy-futures embassy-mcxa->embassy-hal-internal embassy-mcxa->embassy-sync embassy-mcxa->embassy-time embassy-mcxa->embassy-time-driver embassy-mcxa->embassy-time-queue-utils embassy-mspm0 embassy-mspm0 embassy-mspm0->embassy-embedded-hal embassy-mspm0->embassy-executor embassy-mspm0->embassy-hal-internal embassy-mspm0->embassy-sync embassy-mspm0->embassy-time-driver embassy-mspm0->embassy-time-queue-utils embassy-net-driver-channel embassy-net-driver-channel embassy-net-driver-channel->embassy-sync embassy-nrf embassy-nrf embassy-nrf->embassy-crypto embassy-nrf->embassy-embedded-hal embassy-nrf->embassy-futures embassy-nrf->embassy-hal-internal embassy-nrf->embassy-net-driver-channel embassy-nrf->embassy-sync embassy-nrf->embassy-time embassy-nrf->embassy-time-driver embassy-nrf->embassy-time-queue-utils embassy-nxp embassy-nxp embassy-nxp->embassy-futures embassy-nxp->embassy-hal-internal embassy-nxp->embassy-sync embassy-nxp->embassy-time embassy-nxp->embassy-time-driver embassy-nxp->embassy-time-queue-utils embassy-rp embassy-rp embassy-rp->embassy-crypto embassy-rp->embassy-embedded-hal embassy-rp->embassy-executor embassy-rp->embassy-futures embassy-rp->embassy-hal-internal embassy-rp->embassy-sync embassy-rp->embassy-time embassy-rp->embassy-time-driver embassy-rp->embassy-time-queue-utils embassy-stm32 embassy-stm32 embassy-stm32->embassy-crypto embassy-stm32->embassy-embedded-hal embassy-stm32->embassy-executor embassy-stm32->embassy-futures embassy-stm32->embassy-hal-internal embassy-stm32->embassy-sync embassy-stm32->embassy-time embassy-stm32->embassy-time-driver embassy-stm32->embassy-time-queue-utils embassy-stm32-wpan embassy-stm32-wpan embassy-stm32-wpan->embassy-crypto embassy-stm32-wpan->embassy-futures embassy-stm32-wpan->embassy-hal-internal embassy-stm32-wpan->embassy-net-driver-channel embassy-stm32-wpan->embassy-stm32 embassy-stm32-wpan->embassy-sync embassy-stm32-wpan->embassy-time embassy-time->embassy-time-driver embassy-time->embassy-time-queue-utils embassy-usb embassy-usb embassy-usb->embassy-futures embassy-usb->embassy-net-driver-channel embassy-usb->embassy-sync embassy-usb->embassy-time __more__ +27 more projects

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

1166 modules, with 3812 dependencies between them. 9 loops run through 188 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 cyw43.events2 embassy_crypto.driver3 embassy_crypto_rand4 embassy_hal_internal.interrupt5 embassy_mcxa.clocks.types6 embassy_net_enc28j60.traits7 embassy_sync.waitqueue.atomic_waker8 embassy_time.duration9 embassy_ambiq.gpio10 embassy_crypto_rustcrypto.aes.aes128_cbc_impl11 embassy_nrf.config12 embassy_stm32.can.fd.message_ram.generic13 embassy_ambiq.i2c14 embassy_crypto.aes15 embassy_crypto.hash16 embassy_usb_synopsys_otg.otg_v117 embassy_embedded_hal18 embassy_imxrt.crc19 embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel20 embassy_nrf.i2s21 embassy_hal_internal.peripheral22 embassy_nrf.time23 embassy_imxrt.dma24 embassy_imxrt.gpio25 embassy_stm32.rcc26 cyw43.bluetooth27 cyw4328 cyw43.runner29 embassy_imxrt.flexcomm.uart30 embassy_nrf.crypto.symmetric31 embassy_executor.raw32 embassy_mcxa.dma33 embassy_rp.pio34 embassy_usb_driver35 embassy_mcxa.i2c.controller36 embassy_stm32.adc37 embassy_mcxa.i2c.target38 embassy_mcxa.i3c.controller39 embassy_nrf.sqspi.regs40 embassy_mcxa.flexspi
1 cyw43.events
2 embassy_crypto.driver
3 embassy_crypto_rand
4 embassy_hal_internal.interrupt
5 embassy_mcxa.clocks.types
6 embassy_net_enc28j60.traits
7 embassy_sync.waitqueue.atomic_waker
8 embassy_time.duration
9 embassy_ambiq.gpio5
10 embassy_crypto_rustcrypto.aes.aes128_cbc_impl2
11 embassy_nrf.config1
12 embassy_stm32.can.fd.message_ram.generic21
13 embassy_ambiq.i2c411
14 embassy_crypto.aes14
15 embassy_crypto.hash15
16 embassy_usb_synopsys_otg.otg_v111
17 embassy_embedded_hal2
18 embassy_imxrt.crc12
19 embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel113
20 embassy_nrf.i2s1111215
21 embassy_hal_internal.peripheral11
22 embassy_nrf.time11
23 embassy_imxrt.dma14
24 embassy_imxrt.gpio1715
25 embassy_stm32.rcc2112
26 cyw43.bluetooth11
27 cyw4311
28 cyw43.runner11
29 embassy_imxrt.flexcomm.uart43441821
30 embassy_nrf.crypto.symmetric11
31 embassy_executor.raw1
32 embassy_mcxa.dma21113211
33 embassy_rp.pio5311144111
34 embassy_usb_driver111
35 embassy_mcxa.i2c.controller222111111
36 embassy_stm32.adc12112211221
37 embassy_mcxa.i2c.target222111111
38 embassy_mcxa.i3c.controller122211111214
39 embassy_nrf.sqspi.regs9111215
40 embassy_mcxa.flexspi2191141231
Uses a module listed above itPart of a loopThe module itself
1 cyw43.events2 embassy_crypto.driver3 embassy_crypto_rand4 embassy_hal_internal.interrupt5 embassy_mcxa.clocks.types6 embassy_net_enc28j60.traits7 embassy_sync.waitqueue.atomic_waker8 embassy_time.duration9 embassy_ambiq.gpio10 embassy_crypto_rustcrypto.aes.aes128_cbc_impl11 embassy_nrf.config12 embassy_stm32.can.fd.message_ram.generic13 embassy_ambiq.i2c14 embassy_crypto.aes15 embassy_crypto.hash16 embassy_usb_synopsys_otg.otg_v117 embassy_embedded_hal18 embassy_imxrt.crc19 embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel20 embassy_nrf.i2s21 embassy_hal_internal.peripheral22 embassy_nrf.time23 embassy_imxrt.dma24 embassy_imxrt.gpio25 embassy_stm32.rcc26 cyw43.bluetooth27 cyw4328 cyw43.runner29 embassy_imxrt.flexcomm.uart30 embassy_nrf.crypto.symmetric31 embassy_executor.raw32 embassy_mcxa.dma33 embassy_rp.pio34 embassy_usb_driver35 embassy_mcxa.i2c.controller36 embassy_stm32.adc37 embassy_mcxa.i2c.target38 embassy_mcxa.i3c.controller39 embassy_nrf.sqspi.regs40 embassy_mcxa.flexspicyw43.events1embassy_crypto.driver2embassy_crypto_rand3embassy_hal_internal.interrupt4embassy_mcxa.clocks.types5embassy_net_enc28j60.traits6embassy_sync.waitqueue.atomic_waker7embassy_time.duration8embassy_ambiq.gpio9embassy_crypto_rustcrypto.aes.aes128_cbc_impl10embassy_nrf.config11embassy_stm32.can.fd.message_ram.generic12embassy_ambiq.i2c13embassy_crypto.aes14embassy_crypto.hash15embassy_usb_synopsys_otg.otg_v116embassy_embedded_hal17embassy_imxrt.crc18embassy_imxrt.chips.mimxrt633s.interrupts.interrupt.typelevel19embassy_nrf.i2s20embassy_hal_internal.peripheral21embassy_nrf.time22embassy_imxrt.dma23embassy_imxrt.gpio24embassy_stm32.rcc25cyw43.bluetooth26cyw4327cyw43.runner28embassy_imxrt.flexcomm.uart29embassy_nrf.crypto.symmetric30embassy_executor.raw31embassy_mcxa.dma32embassy_rp.pio33embassy_usb_driver34embassy_mcxa.i2c.controller35embassy_stm32.adc36embassy_mcxa.i2c.target37embassy_mcxa.i3c.controller38embassy_nrf.sqspi.regs39embassy_mcxa.flexspi4052121411141511212113111121511111417152112111111434418211112111321153111441111112221111111211221122122211111112221111121491112152191141231+1126 more modules (most-connected shown)

At a glance — Code Health · 87% · Exemplary ·

At a glance — Architecture · 95% · Exemplary ·

At a glance — Maturity · 77% · Strong ·

At a glance — Readiness · 51% · Adequate · gated by P3 ·

At a glance — Security · 85% · Strong ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection4High / Critical

Roadmap

First, integrate automated security and performance checks into the CI pipeline to prevent regressions from reaching production. Second, enforce strict release hygiene by stamping version numbers in build manifests to ensure full traceability. Third, establish a formal process for documenting significant architectural decisions by creating an ADR folder with dated records. Finally, ensure all code merges are gated by an explicit CI step that runs the full test suite.

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

Do thisHelpsEffortDimension
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.+10.1 ptsMediumSecurity & performance tooling
Resolve the 1 No ADRs found finding(s) in ADR Quality.+3.1 ptsLowADR Quality
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.+3.5 ptsMediumRelease Hygiene
Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with mod.rs (2), pin_groups.rs.+1.7 ptsLowKnowledge Freshness
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+2.6 ptsMediumArchitecture documentation
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml.+1.0 ptsLowPlatform End-of-Life
Run the test suite in CI via an explicit runner step for your stack, and gate merges on it.+2.0 ptsMediumCI/CD gates
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.+1.8 ptsMediumObservability

File quality

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

FileScoreBandWorst signal
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
embassy-stm32/src/jpeg.rs5.5MixedCyclomatic Complexity: Jpeg::decode (cyclomatic 23)
embassy-mcxa/src/i3c/controller.rs5.5MixedCyclomatic Complexity: I3c::async_wait_for_ibi (cyclomatic 16)
embassy-nxp/src/hashcrypt/lpc55.rs5.5MixedGod Classes: FileTooLong: hashcrypt/lpc55.rs
embassy-stm32/src/dfsdm/detector.rs5.5MixedCode Duplication: Duplicated block (8 lines × 2)
embassy-stm32-wpan/src/bluetooth/mod.rs5.5MixedCyclomatic Complexity: HCI::process_event (cyclomatic 17)
embassy-stm32/src/dcmipp.rs5.5MixedGod Classes: FileTooLong: src/dcmipp.rs
embassy-stm32-wpan/src/bluetooth/security/mod.rs5.5MixedGod Classes: FileTooLong: security/mod.rs
embassy-stm32/src/comp.rs5.6MixedCyclomatic Complexity: Comp::configure_raw (cyclomatic 34)
embassy-stm32/src/cordic/mod.rs5.6MixedCognitive Complexity: Cordic32::blocking_calc (cognitive 16)
embassy-stm32/src/pka/mod.rs5.6MixedGod Classes: TooManyMethods: Pka
embassy-stm32/src/adc/mod.rs5.6MixedGod Classes: FileTooLong: adc/mod.rs
embassy-stm32/src/ltdc.rs5.7MixedGod Classes: FileTooLong: src/ltdc.rs
embassy-stm32/src/opamp.rs5.7MixedCode Duplication: Duplicated block (16 lines × 2)
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
embassy-stm32-neochrom/src/driver.rs5.9MixedGod Classes: TooManyMethods: NeoChrom
embassy-mcxa/src/flexcan/classic/mailbox.rs5.9MixedGod Classes: FunctionTooLong: embassy_mcxa::flexcan::classic::mailbox::rx::setup
embassy-stm32/src/cacheaxi.rs5.9MixedCode Duplication: Duplicated block (7 lines × 2)
embassy-net-esp-hosted/src/proto/mcu/mod.rs6.0MixedExplicit Debt: TodoComment
embassy-stm32/src/rcc/h.rs6.0MixedExplicit 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 — 7

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

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

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

Could not be resolved — 15

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. 56 of 56 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 56 dimensions across the health lenses
D1D2D3D4D5D6D9D11D13D14D15D16D17D19D20D26D28D29D34D35D44AX10AX3AX4AX8AX9ES1ES2M1M2M3M4P1P10P2P3P6PF3X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X29X3X30

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2263 of 2294 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a17c00-d8a0-720c-97e4-febc6ea370ed.

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

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — 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.
  • 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 — 144 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.
  • 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 cyw43/src/events.rs, embassy-crypto-test/src/lib.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.
  • D19 Documentation Quality — 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. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • 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.
  • 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 decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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.
  • 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.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • 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").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • 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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • 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.

Dimensions

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

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

131 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Rpc::decode at 161. A further 54 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. 28 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-usb/src/class/uac/terminal_type.rs (TerminalType::try_from at 64), embassy-stm32/src/hspi/enums.rs (FIFOThresholdLevel::into at 32), and 23 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.

embassy_stm32::rcc::h::init (cyclomatic 83) · ×22embassy-stm32/src/rcc/h.rs:328
ClockOperator::configure_osc32k_clocks (cyclomatic 48) · ×5embassy-mcxa/src/clocks/operator.rs:452
I2c::read_frame (cyclomatic 29) · ×5embassy-stm32/src/i2c/v1.rs:722
Regs::init (cyclomatic 24) · ×4embassy-stm32/src/adc/v3.rs:198
InterruptHandler::on_interrupt (cyclomatic 18) · ×4embassy-mcxa/src/i3c/target.rs:1437

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

What to do

  1. Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with Rpc::decode (cyclomatic 161). — Refactoring it lifts Cyclomatic Complexity from 5.5 to about 5.8/10.
  2. 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.

D2 · Cognitive Complexity4.4 / 10Weak✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

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

227 method(s) exceeded the cognitive complexity threshold of 15; the worst was Rpc::decode at 468.

embassy_stm32::rcc::n6::init_osc (cognitive 86) · ×22embassy-stm32/src/rcc/n6.rs:890
I2c::read_frame (cognitive 62) · ×19embassy-stm32/src/i2c/v1.rs:722
Runner::run (cognitive 61) · ×10embassy-net-adin1110/src/lib.rs:354
Bus::endpoint_set_stalled (cognitive 37) · ×7embassy-stm32/src/usb/usb.rs:931
InterruptHandler::on_interrupt (cognitive 35) · ×6embassy-nrf/src/buffered_uarte/v1.rs:89

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

What to do

  1. Bring the 2 bodies over 120 down to 120 or less in Cognitive Complexity — start with Rpc::decode (cognitive 468), CtrlMsg::decode (cognitive 279). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cognitive Complexity from 4.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. 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.

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.

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

287 god class(es) detected.

FileTooLong: mcu/mod.rs · ×118embassy-net-esp-hosted/src/proto/mcu/mod.rs
TooManyMethods: Timer · ×56embassy-stm32/src/timer/low_level.rs:452
MethodTooLong: Rpc.decode · ×33embassy-net-esp-hosted/src/proto/mcu/mod.rs:48859
ClassTooLong: Ospi · ×33embassy-stm32/src/ospi/mod.rs:245
FunctionTooLong: embassy_stm32::rcc::h::init · ×26embassy-stm32/src/rcc/h.rs:328

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

What to do

  1. Resolve the 118 FileTooLong finding(s) in God Classes — start with mod.rs (28), lib.rs (7), gpio.rs (7). — One of this dimension's main actionable groups (118 warning-level).
  2. Resolve the 56 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 (56 warning-level).
  3. Resolve the 33 MethodTooLong finding(s) in God Classes — start with mod.rs (17), operator.rs (4), runner.rs (2). — One of this dimension's main actionable groups (33 warning-level).
  4. 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.

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

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.

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

1051 duplicated block group(s) detected. A further 72 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (8 lines × 2) · ×69embassy-executor-macros/src/macros/main.rs:127
Duplicated block (11 lines × 2) · ×54cyw43/src/bluetooth.rs:130
Duplicated block (10 lines × 2) · ×54embassy-mcxa/src/adc.rs:416
Duplicated block (6 lines × 2) · ×54cyw43/src/lib.rs:523
Duplicated block (9 lines × 2) · ×53cyw43/src/bluetooth.rs:564

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

What to do

  1. Resolve the 69 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (23), controller.rs (5), v1.rs (3). — One of this dimension's main actionable groups (69 warning-level).
  2. Resolve the 54 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with mod.rs (23), lpc55.rs (3), v3.rs (3). — One of this dimension's main actionable groups (54 warning-level).
  3. Resolve the 54 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with mod.rs (13), bbq.rs (5), controller.rs (3). — One of this dimension's main actionable groups (54 warning-level).
  4. 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.

D5 · Coupling8.2 / 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.

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

47 production modules (Cargo), 0 dependency cycle(s), 3 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, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: embassy-futures · ×7
Unstable project embassy-nrf
Unstable project embassy-rp
Unstable project embassy-stm32

What to do

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

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

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

56 of 3324 classes have LCOM4 above 3.

Low cohesion: Regs (LCOM4 46) · ×56embassy-nrf/src/sqspi/regs.rs:43

What to do

  1. Resolve the 56 Low cohesion finding(s) in Cohesion (LCOM4) — start with mod.rs (17), adc.rs (2), device.rs (2). — One of this dimension's main actionable groups (56 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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.

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

543 test methods: 526 unit, 17 integration, 0 BDD, 0 e2e. The Rust suite contributes 543 `#[test]` function(s) across 95 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.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

0 flaky across 1 measured tier(s). Rust (embassy-usb-driver, 95 test files): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

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

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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

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

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

0 of 469 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository commits no Cargo.lock, so its graph was resolved here: its manifests' `[dependencies]` and `[build-dependencies]` closed over the crates.io index, each crate at the newest release its requirement admits (what a fresh `cargo generate-lockfile` picks, not a graph the repository has pinned). Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 5 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under MIT OR Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: embassy-stm32/src/dma/dma_bdma/mod.rs (17×40=680); embassy-rp/src/usb/host.rs (36×18=648); cyw43/src/runner.rs (18×33=594) Repeated repair below the complexity floor: embassy-rp/src/pio_programs/uart.rs (8 of 12 changes were fixes); embassy-usb/src/class/uac/device/function.rs (3 of 5 changes were fixes)

Hotspot: embassy-stm32/src/dma/dma_bdma/mod.rs · ×41embassy-stm32/src/dma/dma_bdma/mod.rs:502
Repeated repair: embassy-rp/src/pio_programs/uart.rs · ×2embassy-rp/src/pio_programs/uart.rs:132

What to do

  1. Resolve the 41 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (7), lib.rs (4), host.rs (2). — One of this dimension's main actionable groups (41 warning-level).
  2. Resolve the 2 Repeated repair finding(s) in Churn × Complexity Hotspots — start with uart.rs, function.rs. — One of this dimension's main actionable groups (2 warning-level).

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

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.

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

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 780 of the 941 production source files in this repository: 160 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.

Off-boarding risk: anonymized user #1 · ×11
Further sole-owners (lower concentration)

What to do

  1. Resolve the 11 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (11 recommendation-level).
  2. 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.

D17 · Explicit Debt9.8 / 10Stronggated by 314 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

334 deducted task-comment markers across 410706 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 · ×294embassy-usb-synopsys-otg/src/lib.rs:1651
FixmeComment · ×19embassy-usb/src/host/descriptor.rs:136
TodoComment repeated across 11 filesembassy-usb/src/class/cdc_ncm/device/mod.rs:197

What to do

  1. Resolve the 294 TodoComment finding(s) in Explicit Debt — start with mod.rs (48), periph_helpers.rs (26), lib.rs (21). — One of this dimension's main actionable groups (294 warning-level).
  2. Resolve the 19 FixmeComment finding(s) in Explicit Debt — start with mod.rs (8), descriptor.rs, ringbuffered.rs. — One of this dimension's main actionable groups (19 warning-level).
  3. Resolve the 1 TodoComment repeated across 11 files finding(s) in Explicit Debt — start with mod.rs. — One of this dimension's main actionable groups (1 warning-level).
  4. 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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.

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

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

10 of 47 build units (Cargo) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

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

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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.

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)9.5 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

4 finding(s): 0 critical, 3 high, 1 medium, 0 low. 3 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 7 file(s) — `cyw43/src/runner.rs` (line 412, line 501, line 594, …), `embassy-executor/src/platform/aarch32.rs` (line 275, line 276, line 277), `embassy-stm32-wpan/src/bluetooth/security/mod.rs` (line 35), `embassy-stm32-wpan/src/wb/fus.rs` (line 48), `embassy-stm32/src/eth/ring.rs` (line 199, line 564), … (+2 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  2. No action in Static Analysis (SAST) — all 3 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 (3 issue-level, 0 of them charged here).

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

D34 · Knowledge Freshness9.4 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

46 of 781 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is embassy-rp/src/aon_timer/mod.rs. Counted over 781 of the 941 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×3embassy-rp/src/aon_timer/mod.rs:1
Orphaned file · ×43embassy-mspm0/src/i2c_target.rs:1
Further orphaned files (smaller)

What to do

  1. Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with mod.rs (2), pin_groups.rs. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 43 Orphaned file finding(s) in Knowledge Freshness — start with build_common.rs (3), filter.rs (2), fmt.rs (2). — One of this dimension's main actionable groups (43 recommendation-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: mailbox.rs↔control.rs 73%; sdio.rs↔spi.rs 64%; server.rs↔mod.rs 60%

Change coupling: mailbox.rs ↔ control.rs · ×5embassy-mcxa/src/flexcan/classic/mailbox.rs:1
Change-coupling hub: server.rs → aci_gap.rs, command.rs, mod.rsembassy-stm32-wpan/src/bluetooth/gatt/server.rs

What to do

  1. Resolve the 5 Change coupling finding(s) in Change Coupling — start with mailbox.rs, sdio.rs, aci_gap.rs. — One of this dimension's main actionable groups (5 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with server.rs. — One of this dimension's main actionable groups (1 warning-level).

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

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

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

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

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

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.97rust-toolchain.toml:1

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — 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.

Frontend & cross-cutting dimensions

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

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

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

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.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

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

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

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

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

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

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

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

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

M1 · Documentation (README)7.8 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 68 of 161 project(s) that lack one — worth up to 0.8 pts.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

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

Maturity · Maturity — Whether the 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.

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.
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability6.8 / 10Strong✓ Tool-verified

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

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

  • Only 34/36 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.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • 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 4885 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.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

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.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

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

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

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

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

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

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

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

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

X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health87%ExemplarySolid.
Architecture95%ExemplarySolid.
Maturity77%StrongSolid.
Readiness51%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security85%StrongSolid.
Event Sourcing100%ExemplaryStrongest area.
Performance100%ExemplarySolid.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • D36 Supply-chain Provenance & Signing — 2 observation(s) recorded · 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.
  • X10 Duplicated predicate — 23 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 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.

  • 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 — 60 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~131417 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.
  • D12 Dependency Hygiene — Not scored — 144 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.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Python, Rust not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 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.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).
  • 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): 434 value object(s); 12 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 — Not assessed, and this one is on us: 139 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this 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#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python, Rust 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 applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb.
  • S1 Web-Security Posture — No web surface: 948 Rust file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation and obsolete TLS versions, and none was found. This repository serves no HTTP of its own — no HTTP-server crate (actix-web, axum, Rocket, warp, poem, tide, salvo, tonic, a hyper server, …) among its Cargo manifests' run-time dependencies, and no server started in its production source — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker. If this codebase starts serving HTTP, the dimension reactivates automatically.
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.

Critical — 7 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×3
  • Orphaned knowledge embassy-rp/src/aon_timer/mod.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge embassy-stm32/src/dma2d/mod.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge embassy-stm32/src/tsc/pin_groups.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
Serious — 2201 finding(s)
D17 · Explicit Debt · TodoComment · ×294
  • TodoComment embassy-usb-synopsys-otg/src/lib.rs:1651 — // TODO: enable the peripheral once enable/disable semantics are cleared up in embassy-usb — 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-usb-synopsys-otg/src/lib.rs:1657 — // TODO: disable the peripheral once enable/disable semantics are cleared up in embassy-usb — 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-usb-synopsys-otg/src/otg_v1.rs:206 — // TODO: https://github.com/nfeske/dwc_otg/blob/177687793c884a9ffc2e5b08acf99cf75990a88c/dwc_otg/dwc_otg_regs.h#L724
  • TodoComment embassy-usb-driver/src/lib.rs:535 — // TODO: remove before releasing embassy-usb-driver v0.3 — 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-usb/src/device/mod.rs:591 — // TODO check it is valid (not out of range) — 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-usb/src/class/uac/host/descriptors.rs:947 — // TODO: Encoder, decoder descriptors — 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-usb/src/class/gud/device.rs:663 — // TODO: Support deferred control responses in embassy-usb before making this async, — 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-usb/src/class/gud/device.rs:833 — // TODO: STATUS_ON_SET and FULL_UPDATE — 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-usb/src/class/gud/device.rs:835 — // TODO: LZ4 compression — 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-usb/src/class/dfu/device/dfu_mode.rs:192 — //TODO: Configurable poll timeout, ability to add string for Vendor error — 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-usb/src/class/dfu/device/dfu_mode.rs:201 — //TODO: FirmwareUpdater does not provide a way of reading the active partition, can't upload. — 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-time-driver/src/lib.rs:31 — //! todo!() — 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-time-driver/src/lib.rs:35 — //! todo!() — 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-time-driver/src/lib.rs:66 — //! todo!() — 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-sync/src/rpc_service.rs:160 — // TODO: this is fixed at ≥8-byte alignment. Is there a better option? — 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-sync/src/rpc_service.rs:336 — // TODO: check that waking inside the lock is ok — 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-sync/src/rpc_service.rs:342 — // TODO: recreating the wait future each poll... Check if ok — 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-stm32-wpan/src/lib.rs:20 — // TODO: Fix — 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-stm32-wpan/src/wba/linklayer_plat.rs:1218 — // TODO: Pull in update from latest stm32-generated-data — 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-stm32-wpan/src/wba/util_seq.rs:280 — // TODO: this appears to do nothing (will be optimized away) — 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-stm32-wpan/src/wb/mod.rs:82 — // TODO: document what the user should do after calling init to use the mac_802_15_4 subsystem — 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-stm32-wpan/src/wb/tables.rs:241 — // TODO: use later — 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-stm32-wpan/src/wb/tables.rs:249 — // TODO: use later — 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-stm32-wpan/src/net/commands.rs:399 — // TODO: map the rest of these — 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-stm32-wpan/src/net/runner.rs:33 — // TODO: respond to association requests, 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.
  • + 269 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×118
  • 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 — 1957 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 1457 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: i2c/v2.rs embassy-stm32/src/i2c/v2.rs — FileTooLong — 1704 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 93% of them inside a single declaration: I2c (9 blocks, 115-2802). The bar is 500 significant lines; this is 1204 over it, 3.41× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: 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: spi/mod.rs embassy-stm32/src/spi/mod.rs — FileTooLong — 1553 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, 348-2529). The bar is 500 significant lines; this is 1053 over it, 3.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: 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-2221). 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: 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 — 1287 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: Sdmmc (10 blocks, 345-1908). The bar is 500 significant lines; this is 787 over it, 2.57× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/dma.rs embassy-mcxa/src/dma.rs — FileTooLong — 1283 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 783 over it, 2.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs embassy-usb-synopsys-otg/src/lib.rs — FileTooLong — 1243 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 743 over it, 2.49× 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: lpuart/bbq.rs embassy-mcxa/src/lpuart/bbq.rs — FileTooLong — 1214 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 714 over it, 2.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: usb/host.rs embassy-rp/src/usb/host.rs — FileTooLong — 1202 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 702 over it, 2.40× 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: 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/usb.rs embassy-stm32/src/usb/usb.rs — FileTooLong — 1122 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 622 over it, 2.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs embassy-crypto-test/src/lib.rs — FileTooLong — 1110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 610 over it, 2.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: 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: clocks/periph_helpers.rs embassy-mcxa/src/clocks/periph_helpers.rs — FileTooLong — 1067 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 567 over it, 2.13× 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/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: 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 — 1017 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 517 over it, 2.03× 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 — 1005 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 505 over it, 2.01× 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.
  • + 93 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×69
  • Duplicated block (8 lines × 2) embassy-executor-macros/src/macros/main.rs:127 — embassy-executor-macros/src/macros/main.rs:127-134 | embassy-executor-macros/src/macros/task.rs:82-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:1642 — embassy-mcxa/src/i2c/controller.rs:1642-1649 | embassy-mcxa/src/i2c/controller.rs:1747-1755 — both copies are in the same file, so extract the block into 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.
  • + 44 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×56
  • TooManyMethods: Timer embassy-stm32/src/timer/low_level.rs:452 — TooManyMethods — 151 methods. The bar is 30 methods; this is 121 over it, 5.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: I2c embassy-stm32/src/i2c/mod.rs:137 — TooManyMethods — 115 methods, declared across 3 files: i2c/v1.rs (55), i2c/v2.rs (54), i2c/mod.rs (6). The bar is 30 methods; this is 85 over it, 3.83× 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: 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: 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: ComplementaryPwm embassy-stm32/src/timer/complementary_pwm.rs:72 — TooManyMethods — 78 methods. The bar is 30 methods; this is 48 over it, 2.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.
  • 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: 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: DmaChannel embassy-mcxa/src/dma.rs:816 — TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • 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: 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:101 — TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× 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: Registers embassy-stm32/src/can/fd/peripheral.rs:20 — 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.
  • + 31 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×56
  • Low cohesion: Regs (LCOM4 46) embassy-nrf/src/sqspi/regs.rs:43 — Regs's methods fall into 46 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 46 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SecurityManager (LCOM4 24) embassy-stm32-wpan/src/bluetooth/security/mod.rs:589 — SecurityManager's methods fall into 24 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 24 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: GattClient (LCOM4 19) embassy-stm32-wpan/src/bluetooth/gatt/client.rs:26 — GattClient's methods fall into 19 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 19 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Adc (LCOM4 16) embassy-stm32/src/adc/mod.rs:786 — Adc's methods fall into 16 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 16 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: GattServer (LCOM4 14) embassy-stm32-wpan/src/bluetooth/gatt/server.rs:54 — GattServer's methods fall into 14 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 14 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: StateMachine (LCOM4 12) embassy-rp/src/pio/mod.rs:545 — StateMachine's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: OpAmp (LCOM4 12) embassy-stm32/src/opamp.rs:57 — OpAmp's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Timer (LCOM4 11) embassy-stm32/src/lptim/timer/mod.rs:20 — Timer's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Adc (LCOM4 9) embassy-mspm0/src/adc.rs:182 — Adc's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Symmetric (LCOM4 9) embassy-nrf/src/crypto/symmetric/mod.rs:155 — Symmetric's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Cacheaxi (LCOM4 9) embassy-stm32/src/cacheaxi.rs:61 — Cacheaxi's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Pka (LCOM4 8) embassy-nrf/src/crypto/pka/mod.rs:253 — Pka's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Tamp (LCOM4 8) embassy-stm32/src/tamp/mod.rs:430 — Tamp's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Tsc (LCOM4 8) embassy-stm32/src/tsc/tsc.rs:33 — Tsc's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Transceiver (LCOM4 7) embassy-stm32/src/dfsdm/transceiver.rs:55 — Transceiver's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Icache (LCOM4 7) embassy-stm32/src/icache.rs:98 — Icache's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Ltdc (LCOM4 7) embassy-stm32/src/ltdc.rs:141 — Ltdc's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: NeoChrom (LCOM4 7) embassy-stm32-neochrom/src/driver.rs:74 — NeoChrom's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: RomApi (LCOM4 6) embassy-mcxa/src/rom/mod.rs:58 — RomApi's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Aes (LCOM4 6) embassy-stm32/src/aes/v2.rs:56 — Aes's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Pipe1 (LCOM4 6) embassy-stm32/src/dcmipp.rs:648 — Pipe1's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DsiHost (LCOM4 6) embassy-stm32/src/dsihost/mod.rs:87 — DsiHost's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Lcd (LCOM4 6) embassy-stm32/src/lcd.rs:214 — Lcd's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: I3c (LCOM4 5) embassy-mcxa/src/i3c/controller.rs:322 — I3c's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: GenericHashcrypt (LCOM4 5) embassy-nxp/src/hashcrypt/lpc55.rs:62 — GenericHashcrypt's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • + 31 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×54
  • Duplicated block (11 lines × 2) cyw43/src/bluetooth.rs:130 — cyw43/src/bluetooth.rs:130-140 | 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:29 — embassy-boot/src/firmware_updater/asynch.rs:29-39 | embassy-boot/src/firmware_updater/blocking.rs:59-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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-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/lpuart/bbq.rs:1073 — embassy-mcxa/src/lpuart/bbq.rs:1073-1083 | embassy-mcxa/src/lpuart/bbq.rs:1484-1494 — both copies are in the same file, so extract the block into 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:46 — embassy-mspm0/src/mathacl.rs:46-56 | 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-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:714 — embassy-nrf/src/twis.rs:714-724 | embassy-nrf/src/twis.rs:747-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 (11 lines × 2) embassy-nrf/src/uarte.rs:390 — embassy-nrf/src/uarte.rs:390-400 | embassy-nrf/src/uarte.rs:421-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 (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:1614 — embassy-rp/src/clocks.rs:1614-1624 | embassy-rp/src/clocks.rs:1708-1718 — both copies are in the same file, so extract the block into 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-stm32/src/adc/v3.rs:421 — embassy-stm32/src/adc/v3.rs:421-431 | embassy-stm32/src/adc/v3_h7_adc3.rs:220-230 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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-stm32/src/adc/v3.rs:480 — embassy-stm32/src/adc/v3.rs:480-490 | embassy-stm32/src/adc/v3_h7_adc3.rs:234-244 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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-stm32/src/adc/v3.rs:560 — embassy-stm32/src/adc/v3.rs:560-570 | embassy-stm32/src/adc/v3_h7_adc3.rs:295-305 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • + 29 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×54
  • 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:686 — embassy-mcxa/src/dma.rs:686-695 | embassy-mcxa/src/dma.rs:760-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 (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/i2c/controller.rs:766 — embassy-mcxa/src/i2c/controller.rs:766-775 | embassy-mcxa/src/i2c/controller.rs:818-827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:497 — embassy-mcxa/src/lpuart/bbq.rs:497-506 | embassy-mcxa/src/lpuart/bbq.rs:521-530 — both copies are in the same file, so extract the block into 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:547 — embassy-mcxa/src/lpuart/bbq.rs:547-556 | embassy-mcxa/src/lpuart/bbq.rs:597-606 — both copies are in the same file, so extract the block into 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:543 — embassy-mcxa/src/lpuart/bbq.rs:543-552 | embassy-mcxa/src/lpuart/bbq.rs:567-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:571 — embassy-mcxa/src/lpuart/bbq.rs:571-580 | embassy-mcxa/src/lpuart/bbq.rs:624-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) embassy-mcxa/src/lpuart/bbq.rs:593 — embassy-mcxa/src/lpuart/bbq.rs:593-602 | embassy-mcxa/src/lpuart/bbq.rs:620-629 — both copies are in the same file, so extract the block into 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:214 — embassy-nrf/src/buffered_uarte/v1.rs:214-223 | embassy-nrf/src/buffered_uarte/v2.rs:158-167 — 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:429-438 — 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 14 separate duplicated blocks between them, totalling at least 1221 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:389 — embassy-nrf/src/crypto/pka/driver.rs:389-398 | embassy-stm32/src/pka/driver.rs:489-498 — 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 14 separate duplicated blocks between them, totalling at least 1221 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:109 — embassy-nrf/src/saadc.rs:109-118 | embassy-nrf/src/saadc.rs:124-133 — both copies are in the same file, so extract the block into 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:329 — embassy-nrf/src/twim.rs:329-338 | embassy-nrf/src/twis.rs:358-367 — 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:177 — embassy-rp/src/pio_programs/ws2812.rs:177-186 | embassy-rp/src/pio_programs/ws2812.rs:286-295 — both copies are in the same file, so extract the block into 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-wpan/src/bluetooth/mod.rs:153 — embassy-stm32-wpan/src/bluetooth/mod.rs:153-162 | embassy-stm32-wpan/src/bluetooth/mod.rs:906-915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) embassy-stm32-wpan/src/wba/controller.rs:263 — embassy-stm32-wpan/src/wba/controller.rs:263-272 | embassy-stm32-wpan/src/wba/controller.rs:279-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) embassy-stm32/src/adc/v3.rs:404 — embassy-stm32/src/adc/v3.rs:404-413 | embassy-stm32/src/adc/v3_h7_adc3.rs:205-214 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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-stm32/src/adc/v3.rs:722 — embassy-stm32/src/adc/v3.rs:722-731 | embassy-stm32/src/adc/v3_h7_adc3.rs:430-439 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • + 29 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×54
  • Duplicated block (6 lines × 2) cyw43/src/lib.rs:523 — cyw43/src/lib.rs:523-528 | cyw43/src/lib.rs:559-564 — both copies are in the same file, so extract the block into 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-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:458 — embassy-nrf/src/buffered_uarte/v1.rs:458-463 | embassy-nrf/src/buffered_uarte/v1.rs:704-709 — both copies are in the same file, so extract the block into 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/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-nrf/src/spim.rs:325 — embassy-nrf/src/spim.rs:325-330 | embassy-nrf/src/spim.rs:572-577 — both copies are in the same file, so extract the block into 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:245 — embassy-nrf/src/spis.rs:245-250 | embassy-nrf/src/spis.rs:457-462 — both copies are in the same file, so extract the block into 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-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:663 — embassy-rp/src/gpio.rs:663-668 | embassy-rp/src/pio/mod.rs:246-251 — 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:927 — embassy-rp/src/gpio.rs:927-932 | embassy-rp/src/gpio.rs:951-956 — both copies are in the same file, so extract the block into 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 (6 lines × 2) embassy-stm32/src/dfsdm/codegen.rs:274 — embassy-stm32/src/dfsdm/codegen.rs:274-279 | embassy-stm32/src/dfsdm/codegen.rs:295-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 29 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×53
  • Duplicated block (9 lines × 2) cyw43/src/bluetooth.rs:564 — cyw43/src/bluetooth.rs:564-572 | 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:263 — cyw43/src/sdio.rs:263-271 | cyw43/src/sdio.rs:300-308 — both copies are in the same file, so extract the block into 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-rp/src/lib.rs:55 — embassy-boot-rp/src/lib.rs:55-63 | embassy-boot-stm32/src/lib.rs:53-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • 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:412 — embassy-mcxa/src/lpuart/bbq.rs:412-420 | embassy-mcxa/src/lpuart/bbq.rs:447-455 — both copies are in the same file, so extract the block into 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-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:1022 — embassy-mspm0/src/uart/buffered.rs:1022-1030 | 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 33 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:351 — embassy-net-enc28j60/src/lib.rs:351-359 | embassy-net-enc28j60/src/lib.rs:366-374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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:186 — embassy-nrf/src/rramc.rs:186-194 | embassy-nrf/src/rramc.rs:276-284 — both copies are in the same file, so extract the block into 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:376 — embassy-nrf/src/uarte.rs:376-384 | embassy-nrf/src/uarte.rs:406-414 — both copies are in the same file, so extract the block into 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:737 — embassy-nrf/src/uarte.rs:737-745 | embassy-nrf/src/uarte.rs:1185-1193 — both copies are in the same file, so extract the block into 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:488 — embassy-rp/src/spi.rs:488-496 | embassy-rp/src/spi.rs:575-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 (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 (9 lines × 2) embassy-stm32/src/adc/v3.rs:577 — embassy-stm32/src/adc/v3.rs:577-585 | embassy-stm32/src/adc/v3_h7_adc3.rs:311-319 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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-stm32/src/atomic.rs:28 — embassy-stm32/src/atomic.rs:28-36 | embassy-stm32/src/atomic.rs:60-68 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 28 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×51
  • 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:2398 — embassy-mcxa/src/lpuart/bbq.rs:2398-2402 | embassy-mcxa/src/lpuart/bbq.rs:2418-2422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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-mspm0/src/uart/buffered.rs:763 — embassy-mspm0/src/uart/buffered.rs:763-767 | embassy-stm32/src/usart/buffered.rs:714-718 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) 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 14 separate duplicated blocks between them, totalling at least 1221 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:1023 — embassy-nrf/src/uarte.rs:1023-1027 | embassy-nrf/src/uarte.rs:1279-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 (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-wpan/src/bluetooth/gap/types.rs:234 — embassy-stm32-wpan/src/bluetooth/gap/types.rs:234-238 | embassy-stm32-wpan/src/bluetooth/gap/types.rs:246-250 — both copies are in the same file, so extract the block into 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:383 — embassy-stm32/src/can/fdcan.rs:383-387 | embassy-stm32/src/can/fdcan.rs:770-774 — both copies are in the same file, so extract the block into 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:450 — embassy-stm32/src/can/fdcan.rs:450-454 | embassy-stm32/src/can/fdcan.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: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.
  • + 26 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×48
  • 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:178 — embassy-net-esp-hosted/src/rpc/mod.rs:178-184 | embassy-net-esp-hosted/src/rpc/mod.rs:203-209 — both copies are in the same file, so extract the block into 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:117 — embassy-nrf/src/buffered_uarte/v1.rs:117-123 | embassy-nrf/src/buffered_uarte/v1.rs:148-154 — both copies are in the same file, so extract the block into 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:292 — embassy-nrf/src/uarte.rs:292-298 | embassy-nrf/src/uarte.rs:921-927 — both copies are in the same file, so extract the block into 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:199 — embassy-rp/src/pio_programs/ws2812.rs:199-205 | embassy-rp/src/pio_programs/ws2812.rs:308-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 (7 lines × 2) embassy-rp/src/usb/host.rs:560 — embassy-rp/src/usb/host.rs:560-566 | embassy-rp/src/usb/host.rs:811-817 — both copies are in the same file, so extract the block into 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:1185 — embassy-rp/src/usb/host.rs:1185-1191 | embassy-rp/src/usb/host.rs:1206-1212 — both copies are in the same file, so extract the block into 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-wpan/src/wba/controller.rs:330 — embassy-stm32-wpan/src/wba/controller.rs:330-336 | embassy-stm32-wpan/src/wba/controller.rs:354-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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/dma/dma_bdma/mod.rs:566 — embassy-stm32/src/dma/dma_bdma/mod.rs:566-572 | embassy-stm32/src/dma/dma_bdma/mod.rs:640-646 — both copies are in the same file, so extract the block into 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.
  • + 23 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×44
  • Duplicated block (12 lines × 2) cyw43/src/bluetooth.rs:580 — cyw43/src/bluetooth.rs:580-591 | 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:1371 — embassy-crypto-test/src/lib.rs:1371-1382 | embassy-crypto-test/src/lib.rs:1553-1564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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-mspm0/src/uart/buffered.rs:854 — embassy-mspm0/src/uart/buffered.rs:854-865 | embassy-rp/src/uart/buffered.rs:330-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 33 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-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:826 — embassy-nrf/src/uarte.rs:826-837 | embassy-nrf/src/uarte.rs:1153-1164 — both copies are in the same file, so extract the block into 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-nxp/src/hashcrypt/lpc55.rs:557 — embassy-nxp/src/hashcrypt/lpc55.rs:557-568 | embassy-nxp/src/hashcrypt/lpc55.rs:592-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs:834 — embassy-nxp/src/hashcrypt/lpc55.rs:834-845 | embassy-nxp/src/hashcrypt/lpc55.rs:882-893 — both copies are in the same file, so extract the block into 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:248 — embassy-rp/src/pio_programs/step_dir.rs:248-259 | 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-rp/src/uart/mod.rs:466 — embassy-rp/src/uart/mod.rs:466-477 | embassy-rp/src/uart/mod.rs:622-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) embassy-stm32/src/adc/v3.rs:302 — embassy-stm32/src/adc/v3.rs:302-313 | embassy-stm32/src/adc/v3_h7_adc3.rs:147-158 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) 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/dfsdm/filter.rs:535 — embassy-stm32/src/dfsdm/filter.rs:535-546 | embassy-stm32/src/dfsdm/filter.rs:748-759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 19 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×41
  • Hotspot: embassy-stm32/src/dma/dma_bdma/mod.rs embassy-stm32/src/dma/dma_bdma/mod.rs:502 — embassy-stm32/src/dma/dma_bdma/mod.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in Channel::configure at line 502. 2 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- embassy-stm32/src/dma/dma_bdma/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-rp/src/usb/host.rs embassy-rp/src/usb/host.rs:1955 — embassy-rp/src/usb/host.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in InterruptHandler::on_interrupt at line 1955. 8 of those changes were fix/bug commits, and the other 28 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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: cyw43/src/runner.rs cyw43/src/runner.rs:1113 — cyw43/src/runner.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Runner::rx at line 1113. 2 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-usb-synopsys-otg/src/lib.rs embassy-usb-synopsys-otg/src/lib.rs:39 — embassy-usb-synopsys-otg/src/lib.rs changed 17 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 39. 1 of those changes was a fix/bug commit, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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/rcc/h.rs embassy-stm32/src/rcc/h.rs:328 — embassy-stm32/src/rcc/h.rs changed 5 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-usb/src/class/msc/device/mod.rs embassy-usb/src/class/msc/device/mod.rs:245 — embassy-usb/src/class/msc/device/mod.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in MscClass::execute at line 245. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- embassy-usb/src/class/msc/device/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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-stm32/src/adc/v3.rs embassy-stm32/src/adc/v3.rs:198 — embassy-stm32/src/adc/v3.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Regs::init at line 198. 5 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-mcxa/src/dma.rs embassy-mcxa/src/dma.rs:2938 — embassy-mcxa/src/dma.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in embassy_mcxa::dma::on_interrupt at line 2938. 1 of those changes was a fix/bug commit, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- embassy-mcxa/src/dma.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/events.rs cyw43/src/events.rs:11 — cyw43/src/events.rs changed 2 times in last 90 days, max cyclomatic complexity 147 in Event::from at line 11. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- cyw43/src/events.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:839 — embassy-mcxa/src/clocks/periph_helpers.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in LptmrConfig::pre_enable_config at line 839. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-crypto-test/src/lib.rs embassy-crypto-test/src/lib.rs:1040 — embassy-crypto-test/src/lib.rs changed 8 times in last 90 days, max cyclomatic complexity 32 in embassy_crypto_test::p256::arith at line 1040. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-stm32/src/i2c/v2.rs embassy-stm32/src/i2c/v2.rs:864 — embassy-stm32/src/i2c/v2.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in I2c::blocking_write_vectored at line 864. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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/usb/usb.rs embassy-stm32/src/usb/usb.rs:931 — embassy-stm32/src/usb/usb.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Bus::endpoint_set_stalled at line 931. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- embassy-stm32/src/usb/usb.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/src/class/hub/host.rs embassy-usb/src/class/hub/host.rs:143 — embassy-usb/src/class/hub/host.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in HubHandler::wait_for_event at line 143. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- embassy-usb/src/class/hub/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-wpan/src/wb/fus.rs embassy-stm32-wpan/src/wb/fus.rs:306 — embassy-stm32-wpan/src/wb/fus.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in embassy_stm32_wpan::wb::fus::boot at line 306. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- embassy-stm32-wpan/src/wb/fus.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 15 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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/low_power.rs embassy-stm32/src/low_power.rs:258 — embassy-stm32/src/low_power.rs changed 11 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 258. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-net-adin1110/src/lib.rs embassy-net-adin1110/src/lib.rs:354 — embassy-net-adin1110/src/lib.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-stm32/src/usart/mod.rs embassy-stm32/src/usart/mod.rs:1093 — embassy-stm32/src/usart/mod.rs changed 10 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-rp/src/uart/mod.rs embassy-rp/src/uart/mod.rs:613 — embassy-rp/src/uart/mod.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in UartRx::read_to_break_with_count at line 613. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- embassy-rp/src/uart/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/l.rs embassy-stm32/src/rcc/l.rs:178 — embassy-stm32/src/rcc/l.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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-rp/src/pio/mod.rs embassy-rp/src/pio/mod.rs:790 — embassy-rp/src/pio/mod.rs changed 8 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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/rcc/n6.rs embassy-stm32/src/rcc/n6.rs:890 — embassy-stm32/src/rcc/n6.rs changed 3 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. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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: embassy-stm32/src/rcc/bd.rs embassy-stm32/src/rcc/bd.rs:154 — embassy-stm32/src/rcc/bd.rs changed 5 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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.
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×41
  • 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-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:188 — embassy-net-nrf91/src/context.rs:188-200 | embassy-net-nrf91/src/context.rs:206-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 (13 lines × 2) embassy-nrf/src/buffered_uarte/v1.rs:490 — embassy-nrf/src/buffered_uarte/v1.rs:490-502 | embassy-nrf/src/buffered_uarte/v2.rs:391-403 — 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:564 — embassy-nrf/src/buffered_uarte/v1.rs:564-576 | embassy-nrf/src/buffered_uarte/v2.rs:465-477 — 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:646 — embassy-nrf/src/spim.rs:646-658 | embassy-nrf/src/spis.rs:556-568 — 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:503 — embassy-nrf/src/uarte.rs:503-515 | embassy-nrf/src/uarte.rs:625-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs:741 — embassy-nxp/src/hashcrypt/lpc55.rs:741-753 | embassy-nxp/src/hashcrypt/lpc55.rs:786-798 — both copies are in the same file, so extract the block into 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-nxp/src/hashcrypt/lpc55.rs:960 — embassy-nxp/src/hashcrypt/lpc55.rs:960-972 | embassy-nxp/src/hashcrypt/lpc55.rs:1001-1013 — both copies are in the same file, so extract the block into 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:502 — embassy-rp/src/uart/mod.rs:502-514 | embassy-rp/src/uart/mod.rs:671-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 (13 lines × 2) embassy-stm32-wpan/src/bluetooth/mod.rs:700 — embassy-stm32-wpan/src/bluetooth/mod.rs:700-712 | embassy-stm32-wpan/src/bluetooth/mod.rs:722-734 — both copies are in the same file, so extract the block into 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/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/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 (13 lines × 2) embassy-stm32/src/dma/ringbuffer.rs:216 — embassy-stm32/src/dma/ringbuffer.rs:216-228 | embassy-stm32/src/dma/ringbuffer.rs:450-462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×40
  • Duplicated block (14 lines × 2) embassy-boot/src/boot_loader.rs:115 — embassy-boot/src/boot_loader.rs:115-128 | embassy-boot/src/firmware_updater/blocking.rs:66-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (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/controller.rs:674 — embassy-mcxa/src/i2c/controller.rs:674-687 | embassy-mcxa/src/i2c/target.rs:321-334 — before extracting anything, compare `embassy-mcxa/src/i2c/controller.rs` and `embassy-mcxa/src/i2c/target.rs` as WHOLE FILES: this scan already matched 6 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 (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/i3c/controller.rs:339 — embassy-mcxa/src/i3c/controller.rs:339-352 | embassy-mcxa/src/i3c/target.rs:370-383 — before extracting anything, compare `embassy-mcxa/src/i3c/controller.rs` and `embassy-mcxa/src/i3c/target.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 (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:91 — embassy-nrf/src/buffered_uarte/v1.rs:91-104 | embassy-nrf/src/buffered_uarte/v2.rs:84-97 — 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.
  • + 15 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×33
  • 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: Channel.configure embassy-stm32/src/dma/dma_bdma/mod.rs:502 — MethodTooLong — configure runs 228 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 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ClockOperator.configure_spll embassy-mcxa/src/clocks/operator.rs:810 — 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: 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: LsConfig.init embassy-stm32/src/rcc/bd.rs:154 — MethodTooLong — init runs 162 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 62 over it, 1.62× 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: Runner.init cyw43/src/runner.rs:456 — 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:371 — MethodTooLong — new_inner runs 146 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 46 over it, 1.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 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: Runner.rx cyw43/src/runner.rs:1113 — MethodTooLong — rx runs 133 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 33 over it, 1.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.
  • 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 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.
  • MethodTooLong: MidiClass.build embassy-usb/src/class/midi/device/mod.rs:179 — MethodTooLong — build 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:452 — 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:694 — MethodTooLong — process_event 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:447 — 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:83 — 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/src/class/hid/host/hid_report.rs:241 — 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:1303 — 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.
  • MethodTooLong: Ospi.new_inner embassy-stm32/src/ospi/mod.rs:534 — MethodTooLong — new_inner runs 113 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 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 8 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×33
  • 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-2221. 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: 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: Sdmmc embassy-stm32/src/sdmmc/mod.rs:345 — ClassTooLong — 989 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, 10 blocks, lines 345-1908. The bar is 400 significant lines; this is 589 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.
  • ClassTooLong: Spi embassy-stm32/src/spi/mod.rs:348 — ClassTooLong — 966 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 348-2529. The bar is 400 significant lines; this is 566 over it, 2.42× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Runner cyw43/src/runner.rs:90 — ClassTooLong — 878 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 2 blocks, lines 90-1466. The bar is 400 significant lines; this is 478 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.
  • 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: ClockOperator embassy-mcxa/src/clocks/operator.rs:37 — ClassTooLong — 804 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-1586. The bar is 400 significant lines; this is 404 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: 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-2860. 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 — 587 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 151 methods, 12 blocks, lines 452-1791. The bar is 400 significant lines; this is 187 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: 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: I2c embassy-mcxa/src/i2c/controller.rs:612 — ClassTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 17 blocks, lines 612-1948. The bar is 400 significant lines; this is 165 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: 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: Channel embassy-rp/src/usb/host.rs:513 — ClassTooLong — 553 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 513-1648. The bar is 400 significant lines; this is 153 over it, 1.38× 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:816 — ClassTooLong — 524 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 59 methods, 4 blocks, lines 816-2709. The bar is 400 significant lines; this is 124 over it, 1.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: 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: I2c embassy-rp/src/i2c.rs:199 — ClassTooLong — 497 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 13 blocks, lines 199-1129. The bar is 400 significant lines; this is 97 over it, 1.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HCI embassy-stm32-wpan/src/bluetooth/mod.rs:101 — ClassTooLong — 492 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 53 methods, 4 blocks, lines 101-1074. The bar is 400 significant lines; this is 92 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • 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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×31
  • Duplicated block (17 lines × 2) cyw43/src/lib.rs:530 — cyw43/src/lib.rs:530-546 | cyw43/src/lib.rs:566-582 — both copies are in the same file, so extract the block into 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-macros/src/macros/main.rs:92 — embassy-executor-macros/src/macros/main.rs:92-108 | embassy-executor-macros/src/macros/task.rs:35-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (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-mcxa/src/lpuart/bbq.rs:689 — embassy-mcxa/src/lpuart/bbq.rs:689-705 | embassy-mcxa/src/lpuart/bbq.rs:1270-1286 — both copies are in the same file, so extract the block into 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: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:524 — embassy-nrf/src/twis.rs:524-540 | embassy-nrf/src/twis.rs:636-652 — both copies are in the same file, so extract the block into 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/adc/v3.rs:246 — embassy-stm32/src/adc/v3.rs:246-262 | embassy-stm32/src/adc/v3_h7_adc3.rs:116-132 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×27
  • Duplicated block (16 lines × 2) cyw43/src/bluetooth.rs:594 — cyw43/src/bluetooth.rs:594-609 | 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:193 — embassy-boot/src/firmware_updater/asynch.rs:193-208 | embassy-boot/src/firmware_updater/blocking.rs:246-261 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (16 lines × 2) embassy-mcxa/src/clocks/operator.rs:568 — embassy-mcxa/src/clocks/operator.rs:568-583 | embassy-mcxa/src/clocks/operator.rs:655-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 (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:550 — embassy-nrf/src/twis.rs:550-565 | embassy-nrf/src/twis.rs:576-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 (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 (16 lines × 2) embassy-stm32/src/opamp.rs:184 — embassy-stm32/src/opamp.rs:184-199 | embassy-stm32/src/opamp.rs:309-324 — both copies are in the same file, so extract the block into 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/ospi/mod.rs:952 — embassy-stm32/src/ospi/mod.rs:952-967 | embassy-stm32/src/xspi/mod.rs:750-765 — `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.
  • + 2 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×26
  • 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 268 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 168 over it, 2.68× 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:980 — 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:791 — 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:34 — FunctionTooLong — embassy_executor_macros::macros::task::run runs 141 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 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • 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_stm32::rcc::g0::init embassy-stm32/src/rcc/g0.rs:167 — FunctionTooLong — embassy_stm32::rcc::g0::init 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_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:2602 — 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::dfsdm::codegen::gen_split embassy-stm32/src/dfsdm/codegen.rs:254 — FunctionTooLong — embassy_stm32::dfsdm::codegen::gen_split runs 130 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 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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 111 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 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • 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_usb_synopsys_otg::on_interrupt embassy-usb-synopsys-otg/src/lib.rs:39 — FunctionTooLong — embassy_usb_synopsys_otg::on_interrupt runs 106 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 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: embassy_executor_macros::macros::main::run embassy-executor-macros/src/macros/main.rs:91 — FunctionTooLong — embassy_executor_macros::macros::main::run runs 104 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 4 over it, 1.04× 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.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×24
  • 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:673 — embassy-mcxa/src/i2c/controller.rs:673-705 | 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:1669 — embassy-mcxa/src/i2c/controller.rs:1669-1775 | 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:542 — embassy-mcxa/src/lpuart/bbq.rs:542-556 | embassy-mcxa/src/lpuart/bbq.rs:566-580 | embassy-mcxa/src/lpuart/bbq.rs:592-606 | embassy-mcxa/src/lpuart/bbq.rs:619-633 — 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:818 — embassy-stm32/src/adc/mod.rs:818-850 | embassy-stm32/src/adc/mod.rs:902-917 | embassy-stm32/src/adc/mod.rs:932-944 | 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:998 — embassy-stm32/src/adc/mod.rs:998-1034 | embassy-stm32/src/adc/mod.rs:1060-1095 | embassy-stm32/src/adc/mod.rs:1117-1132 | embassy-stm32/src/adc/mod.rs:1157-1174 — 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:818 — embassy-stm32/src/spi/mod.rs:818-864 | embassy-stm32/src/spi/mod.rs:867-883 | embassy-stm32/src/spi/mod.rs:888-904 | embassy-stm32/src/spi/mod.rs:912-928 — 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:1666 — embassy-stm32/src/usart/mod.rs:1666-1681 | embassy-stm32/src/usart/mod.rs:1847-1862 | embassy-stm32/src/usart/mod.rs:2041-2056 | embassy-stm32/src/usart/mod.rs:2191-2206 — 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:961-998 | embassy-stm32/src/usb/otg.rs:1006-1047 — 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-usb/src/class/uac/host/mod.rs:321 — embassy-usb/src/class/uac/host/mod.rs:321-342 | embassy-usb/src/class/uac/host/mod.rs:437-458 | embassy-usb/src/class/uac/host/mod.rs:475-496 | embassy-usb/src/class/uac/host/mod.rs:513-534 — 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.
D1 · Cyclomatic Complexity · embassy_stm32 · ×22
  • 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::l::init (cyclomatic 62) embassy-stm32/src/rcc/l.rs:178 — embassy_stm32::rcc::l::init has cyclomatic complexity 62 (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::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::g0::init (cyclomatic 32) embassy-stm32/src/rcc/g0.rs:167 — embassy_stm32::rcc::g0::init has cyclomatic complexity 32 (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::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 27) embassy-stm32/src/usart/buffered.rs:35 — embassy_stm32::usart::buffered::on_interrupt 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.
  • embassy_stm32::usart::configure (cyclomatic 26) embassy-stm32/src/usart/mod.rs:2602 — 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::low_power::platform::exit_stop (cyclomatic 20) embassy-stm32/src/low_power.rs:258 — 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::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::rcc::l::pll::init_pll (cyclomatic 20) embassy-stm32/src/rcc/l.rs:725 — 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::dma::dma_bdma::on_irq (cyclomatic 18) embassy-stm32/src/dma/dma_bdma/mod.rs:18 — 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.
D2 · Cognitive Complexity · embassy_stm32 · ×22
  • 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 47) embassy-stm32/src/usart/buffered.rs:35 — embassy_stm32::usart::buffered::on_interrupt has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (38 pts), loops 2 (5 pts), boolean chains 4 (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.
  • 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 34) embassy-stm32/src/rcc/l.rs:178 — embassy_stm32::rcc::l::init has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (13 pts), match/switch 11, 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/mod.rs:18 — 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:725 — 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::init_hw (cognitive 24) embassy-stm32/src/lib.rs:791 — 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::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::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:2602 — 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::rcc::g0::init (cognitive 22) embassy-stm32/src/rcc/g0.rs:167 — embassy_stm32::rcc::g0::init has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (8 pts), match/switch 7 (8 pts), if/else 5 (6 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • embassy_stm32::spi::transfer_words (cognitive 22) embassy-stm32/src/spi/mod.rs:2227 — 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::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::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::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.
D3 · God Classes · TooManyFields · ×20
  • 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: Report embassy-mcxa/src/perf_counters.rs:113 — TooManyFields — 86 stored fields. The bar is 30 stored fields; this is 56 over it, 2.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: 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:264 — 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.
D17 · Explicit Debt · FixmeComment · ×19
  • FixmeComment embassy-usb/src/host/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/uac/device/mod.rs:14 — /// 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.
  • 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/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/dma/gpdma/ringbuffered.rs:3 — //! 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/can/fdcan.rs:1124 — // 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-rp/src/usb/host.rs:922 — // 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/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-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-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/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/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/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/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/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-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/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.
D2 · Cognitive Complexity · I2c · ×19
  • 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:772 — 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:864 — 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:1650 — 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_slave (cognitive 24) embassy-stm32/src/i2c/v2.rs:2494 — 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:696 — 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::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:537 — 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:2316 — 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::slave_read_internal (cognitive 17) embassy-stm32/src/i2c/v2.rs:1974 — 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.
  • I2c::write_dma_internal (cognitive 16) embassy-stm32/src/i2c/v2.rs:1211 — I2c::write_dma_internal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×19
  • 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:195 — embassy-nrf/src/buffered_uarte/v1.rs:195-213 | embassy-nrf/src/buffered_uarte/v2.rs:139-157 — 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/crypto/pka/driver.rs:345 — embassy-nrf/src/crypto/pka/driver.rs:345-363 | embassy-stm32/src/pka/driver.rs:279-297 — 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 14 separate duplicated blocks between them, totalling at least 1221 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 (19 lines × 2) embassy-nrf/src/twis.rs:499 — embassy-nrf/src/twis.rs:499-517 | embassy-nrf/src/twis.rs:605-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 (19 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs:616 — embassy-nxp/src/hashcrypt/lpc55.rs:616-634 | embassy-nxp/src/hashcrypt/lpc55.rs:820-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 (19 lines × 2) embassy-stm32/src/adc/v3.rs:495 — embassy-stm32/src/adc/v3.rs:495-513 | embassy-stm32/src/adc/v3_h7_adc3.rs:248-266 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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-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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×19
  • 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:542 — embassy-nrf/src/buffered_uarte/v1.rs:542-556 | embassy-nrf/src/buffered_uarte/v2.rs:443-457 — 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:363 — embassy-nrf/src/buffered_uarte/v2.rs:363-377 | embassy-nrf/src/buffered_uarte/v2.rs:552-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 (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:270 — embassy-rp/src/psram.rs:270-284 | embassy-rp/src/psram.rs:477-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) embassy-stm32/src/adc/v3.rs:613 — embassy-stm32/src/adc/v3.rs:613-627 | embassy-stm32/src/adc/v3_h7_adc3.rs:344-358 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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:1832-1846 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:485 — embassy-stm32/src/sdmmc/mod.rs:485-499 | embassy-stm32/src/sdmmc/mod.rs:598-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 (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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×14
  • 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-mcxa/src/lpuart/bbq.rs:1851 — embassy-mcxa/src/lpuart/bbq.rs:1851-1868 | embassy-mcxa/src/lpuart/bbq.rs:1952-1969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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-nxp/src/hashcrypt/lpc55.rs:657 — embassy-nxp/src/hashcrypt/lpc55.rs:657-674 | embassy-nxp/src/hashcrypt/lpc55.rs:869-886 — both copies are in the same file, so extract the block into 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/src/class/hid/host/kbd.rs:63 — embassy-usb/src/class/hid/host/kbd.rs:63-80 | embassy-usb/src/class/hub/host.rs:65-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×13
  • 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:586 — embassy-nrf/src/buffered_uarte/v1.rs:586-606 | embassy-nrf/src/buffered_uarte/v2.rs:487-507 — 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:392 — embassy-nrf/src/twim.rs:392-412 | embassy-nrf/src/twis.rs:424-444 — 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:139 — embassy-rp/src/multicore.rs:139-159 | embassy-rp/src/multicore.rs:168-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) embassy-stm32-wpan/src/bluetooth/gap/advertiser.rs:165 — embassy-stm32-wpan/src/bluetooth/gap/advertiser.rs:165-185 | embassy-stm32-wpan/src/bluetooth/gap/advertiser.rs:193-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 (21 lines × 2) embassy-stm32/src/dma/dma_bdma/ringbuffered.rs:59 — embassy-stm32/src/dma/dma_bdma/ringbuffered.rs:59-79 | embassy-stm32/src/dma/dma_bdma/ringbuffered.rs:231-251 — both copies are in the same file, so extract the block into 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:113 — embassy-stm32/src/dma/gpdma/ringbuffered.rs:113-133 | embassy-stm32/src/dma/gpdma/ringbuffered.rs:288-308 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×13
  • 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:174 — embassy-nrf/src/nvmc.rs:174-186 | embassy-nrf/src/rramc.rs:221-233 | embassy-nrf/src/rramc.rs:312-324 — 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-nxp/src/hashcrypt/lpc55.rs:711 — embassy-nxp/src/hashcrypt/lpc55.rs:711-723 | embassy-nxp/src/hashcrypt/lpc55.rs:756-768 | embassy-nxp/src/hashcrypt/lpc55.rs:808-820 — 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/adc/v2.rs:644 — embassy-stm32/src/adc/v2.rs:644-656 | embassy-stm32/src/adc/v3.rs:696-708 | embassy-stm32/src/adc/v3_h7_adc3.rs:410-422 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (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-usb/src/class/cdc_acm/host.rs:146 — embassy-usb/src/class/cdc_acm/host.rs:146-158 | embassy-usb/src/class/msc/host/mod.rs:365-377 | embassy-usb/src/class/vcp/host/cp210x.rs:576-588 — 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/src/host/descriptor.rs:190 — embassy-usb/src/host/descriptor.rs:190-202 | embassy-usb/src/host/descriptor.rs:252-264 | embassy-usb/src/host/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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×13
  • 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:463 — embassy-nrf/src/buffered_uarte/v1.rs:463-469 | embassy-nrf/src/buffered_uarte/v2.rs:366-372 | embassy-nrf/src/buffered_uarte/v2.rs:555-561 — 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:485 — embassy-nrf/src/spim.rs:485-491 | embassy-nrf/src/twim.rs:362-368 | embassy-nrf/src/twis.rs:391-397 — 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:139 — embassy-stm32/src/i2c/v2.rs:139-145 | embassy-stm32/src/i2c/v2.rs:2770-2776 | embassy-stm32/src/i2c/v2.rs:2791-2797 — 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/i2c/v2.rs:1241 — embassy-stm32/src/i2c/v2.rs:1241-1247 | embassy-stm32/src/i2c/v2.rs:1369-1375 | embassy-stm32/src/i2c/v2.rs:1763-1769 — 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:900-906 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) embassy-stm32/src/adc/v2.rs:677 — embassy-stm32/src/adc/v2.rs:677-683 | embassy-stm32/src/adc/v3.rs:740-746 | embassy-stm32/src/adc/v3_h7_adc3.rs:448-454 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×12
  • 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:331 — embassy-nrf/src/buffered_uarte/v1.rs:331-335 | embassy-nrf/src/buffered_uarte/v1.rs:467-471 | embassy-nrf/src/buffered_uarte/v1.rs:713-717 — 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:237 — embassy-nrf/src/buffered_uarte/v2.rs:237-241 | embassy-nrf/src/buffered_uarte/v2.rs:370-374 | embassy-nrf/src/buffered_uarte/v2.rs:559-563 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • 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/adc/v2.rs:555 — embassy-stm32/src/adc/v2.rs:555-559 | embassy-stm32/src/adc/v3.rs:623-627 | embassy-stm32/src/adc/v3_h7_adc3.rs:354-358 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) embassy-stm32/src/dma/dma_bdma/mod.rs:478 — embassy-stm32/src/dma/dma_bdma/mod.rs:478-482 | embassy-stm32/src/dma/dma_bdma/mod.rs:486-490 | 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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×11
  • 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:419 — embassy-nrf/src/twim.rs:419-442 | embassy-nrf/src/twis.rs:451-474 — 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-nxp/src/hashcrypt/lpc55.rs:712 — embassy-nxp/src/hashcrypt/lpc55.rs:712-735 | embassy-nxp/src/hashcrypt/lpc55.rs:757-780 — both copies are in the same file, so extract the block into 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/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.
D2 · Cognitive Complexity · Runner · ×10
  • Runner::run (cognitive 61) embassy-net-adin1110/src/lib.rs:354 — Runner::run has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (40 pts), match/switch 4 (17 pts), loops 2 (4 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Runner::rx (cognitive 55) cyw43/src/runner.rs:1113 — Runner::rx has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (47 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Runner::check_status (cognitive 30) cyw43/src/runner.rs:1003 — Runner::check_status has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Runner::run (cognitive 28) embassy-net-ppp/src/lib.rs:69 — Runner::run has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 6 (16 pts), if/else 4 (11 pts), loops 1 (nesting depth added 17). 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 26) cyw43/src/runner.rs:775 — Runner::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (12 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.
  • Runner::run (cognitive 26) embassy-net-adin1110/src/lib.rs:516 — Runner::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 3 (10 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Runner::handle_irq (cognitive 21) cyw43/src/runner.rs:928 — 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::init (cognitive 18) cyw43/src/runner.rs:456 — 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) embassy-net-wiznet/src/lib.rs:65 — Runner::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×10
  • 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:217 — embassy-nrf/src/rramc.rs:217-238 | embassy-nrf/src/rramc.rs:308-329 — both copies are in the same file, so extract the block into 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/src/class/cdc_acm/host.rs:139 — embassy-usb/src/class/cdc_acm/host.rs:139-160 | embassy-usb/src/class/msc/host/mod.rs:358-379 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×10
  • 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-wpan/src/bluetooth/security/mod.rs:985 — embassy-stm32-wpan/src/bluetooth/security/mod.rs:985-994 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1073-1082 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1110-1119 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1299-1308 — 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/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) 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×9
  • 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:107 — embassy-net-nrf91/src/context.rs:107-157 | embassy-net-nrf91/src/context.rs:160-171 | embassy-net-nrf91/src/context.rs:174-185 | embassy-net-nrf91/src/context.rs:315-328 | embassy-net-nrf91/src/context.rs:331-352 — 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-wpan/src/bluetooth/security/mod.rs:984 — embassy-stm32-wpan/src/bluetooth/security/mod.rs:984-1023 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1070-1105 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1109-1139 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1247-1263 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1296-1332 — 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:167-377 | 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:477 — embassy-stm32/src/sdmmc/mod.rs:477-499 | embassy-stm32/src/sdmmc/mod.rs:591-612 | embassy-stm32/src/sdmmc/mod.rs:632-653 | embassy-stm32/src/sdmmc/mod.rs:713-732 | embassy-stm32/src/sdmmc/mod.rs:784-803 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×9
  • 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-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-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:117 — embassy-nrf/src/pwm.rs:117-136 | embassy-nrf/src/pwm.rs:853-872 — both copies are in the same file, so extract the block into 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-nxp/src/hashcrypt/lpc55.rs:473 — embassy-nxp/src/hashcrypt/lpc55.rs:473-492 | embassy-nxp/src/hashcrypt/lpc55.rs:505-524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) embassy-nxp/src/hashcrypt/lpc55.rs:679 — embassy-nxp/src/hashcrypt/lpc55.rs:679-698 | embassy-nxp/src/hashcrypt/lpc55.rs:892-911 — both copies are in the same file, so extract the block into 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:1104 — embassy-stm32/src/sdmmc/mod.rs:1104-1123 | embassy-stm32/src/sdmmc/mod.rs:1176-1195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×9
  • Duplicated block (10 lines × 3) embassy-rp/src/spi.rs:161 — embassy-rp/src/spi.rs:161-170 | embassy-rp/src/spi.rs:174-183 | embassy-rp/src/spi.rs:187-196 — 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/i2c/v2.rs:1361 — embassy-stm32/src/i2c/v2.rs:1361-1370 | embassy-stm32/src/i2c/v2.rs:1755-1764 | embassy-stm32/src/i2c/v2.rs:2382-2391 — 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/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-wpan/src/bluetooth/gap/aci_gap.rs:315 — embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs:315-325 | embassy-stm32-wpan/src/bluetooth/gatt/server.rs:630-639 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:772-782 — 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:432 — embassy-stm32-wpan/src/bluetooth/gatt/server.rs:432-442 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:713-722 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:757-767 — 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: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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×9
  • Duplicated block (9 lines × 3) embassy-net-nrf91/src/context.rs:108 — embassy-net-nrf91/src/context.rs:108-116 | embassy-net-nrf91/src/context.rs:316-324 | embassy-net-nrf91/src/context.rs:332-340 — 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:212 — embassy-nrf/src/twis.rs:212-220 | embassy-nrf/src/twis.rs:241-249 | embassy-nrf/src/twis.rs:267-275 — 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:919 — embassy-rp/src/uart/buffered.rs:919-927 | embassy-rp/src/uart/buffered.rs:938-946 | embassy-stm32/src/usart/buffered.rs:1138-1146 — 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-wpan/src/bluetooth/security/mod.rs:985 — embassy-stm32-wpan/src/bluetooth/security/mod.rs:985-993 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1110-1118 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1248-1256 — 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/adc/v2.rs:560 — embassy-stm32/src/adc/v2.rs:560-568 | embassy-stm32/src/adc/v3.rs:628-636 | embassy-stm32/src/adc/v3_h7_adc3.rs:359-367 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (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/spi/mod.rs:1622 — embassy-stm32/src/spi/mod.rs:1622-1630 | embassy-stm32/src/spi/mod.rs:1717-1725 | embassy-stm32/src/spi/mod.rs:1805-1813 — 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/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-usb/src/class/uac/host/mod.rs:552 — embassy-usb/src/class/uac/host/mod.rs:552-560 | embassy-usb/src/class/uac/host/mod.rs:592-600 | embassy-usb/src/class/uac/host/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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×8
  • Duplicated block (11 lines × 3) embassy-mcxa/src/dma.rs:1231 — embassy-mcxa/src/dma.rs:1231-1241 | embassy-mcxa/src/dma.rs:1640-1650 | embassy-mcxa/src/dma.rs:2647-2657 — 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:508 — embassy-nrf/src/uarte.rs:508-518 | embassy-nrf/src/uarte.rs:708-718 | embassy-nrf/src/uarte.rs:829-839 — 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-wpan/src/bluetooth/security/mod.rs:986 — embassy-stm32-wpan/src/bluetooth/security/mod.rs:986-996 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1074-1084 | embassy-stm32-wpan/src/bluetooth/security/mod.rs:1300-1310 — 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/src/host/descriptor.rs:164 — embassy-usb/src/host/descriptor.rs:164-174 | embassy-usb/src/host/descriptor.rs:226-236 | embassy-usb/src/host/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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×8
  • 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/adc/v2.rs:516 — embassy-stm32/src/adc/v2.rs:516-523 | embassy-stm32/src/adc/v3.rs:580-587 | embassy-stm32/src/adc/v3_h7_adc3.rs:314-321 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) embassy-stm32/src/adc/v2.rs:549 — embassy-stm32/src/adc/v2.rs:549-556 | embassy-stm32/src/adc/v3.rs:612-619 | embassy-stm32/src/adc/v3_h7_adc3.rs:343-350 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (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:1263 — embassy-stm32/src/i2c/v2.rs:1263-1270 | embassy-stm32/src/i2c/v2.rs:1388-1395 | embassy-stm32/src/i2c/v2.rs:1782-1789 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×8
  • 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:1003 — embassy-stm32/src/adc/mod.rs:1003-1009 | embassy-stm32/src/adc/mod.rs:1063-1069 | embassy-stm32/src/adc/mod.rs:1122-1128 | embassy-stm32/src/adc/mod.rs:1162-1168 — 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:592 — embassy-stm32/src/sdmmc/mod.rs:592-598 | embassy-stm32/src/sdmmc/mod.rs:633-639 | embassy-stm32/src/sdmmc/mod.rs:714-720 | embassy-stm32/src/sdmmc/mod.rs:785-791 — 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:962-968 | embassy-stm32/src/usb/otg.rs:1007-1013 — 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.
D2 · Cognitive Complexity · Bus · ×7
  • Bus::endpoint_set_stalled (cognitive 37) embassy-stm32/src/usb/usb.rs:931 — Bus::endpoint_set_stalled has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 5 (7 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Bus::endpoint_set_enabled (cognitive 30) embassy-stm32/src/usb/usb.rs:1033 — Bus::endpoint_set_enabled has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (8 pts), boolean chains 5, loops 2 (4 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.
  • Bus::configure_endpoints (cognitive 26) embassy-usb-synopsys-otg/src/lib.rs:1223 — 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::poll (cognitive 23) embassy-stm32/src/usb/usb.rs:851 — Bus::poll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (9 pts), match/switch 1 (4 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.
  • Bus::endpoint_set_enabled (cognitive 23) embassy-usb-synopsys-otg/src/lib.rs:1556 — 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::poll (cognitive 19) embassy-usb-synopsys-otg/src/lib.rs:1374 — 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:348 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×7
  • 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.
D5 · Coupling · Off the main sequence · ×7
  • 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 16 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 20 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 8 project(s), so it's rigid to change.
  • Off the main sequence: embassy-time — embassy-time: abstractness 0.09, instability 0.10, distance 0.81 — zone of pain — concrete and depended on by 18 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.10, distance 0.81 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
  • Off the main sequence: embassy-hal-internal — embassy-hal-internal: abstractness 0.21, instability 0.00, distance 0.79 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
D2 · Cognitive Complexity · InterruptHandler · ×6
  • InterruptHandler::on_interrupt (cognitive 35) embassy-nrf/src/buffered_uarte/v1.rs:89 — 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 28) embassy-stm32/src/usb/usb.rs:41 — InterruptHandler::on_interrupt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • 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:83 — 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:1955 — 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.
  • InterruptHandler::on_interrupt (cognitive 17) embassy-nrf/src/usb/mod.rs:41 — InterruptHandler::on_interrupt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×6
  • 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/i2c/v2.rs:1351 — embassy-stm32/src/i2c/v2.rs:1351-1377 | embassy-stm32/src/i2c/v2.rs:1745-1771 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×6
  • 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-nxp/src/hashcrypt/lpc55.rs:934 — embassy-nxp/src/hashcrypt/lpc55.rs:934-958 | embassy-nxp/src/hashcrypt/lpc55.rs:975-999 — both copies are in the same file, so extract the block into 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-stm32/src/adc/v3.rs:677 — embassy-stm32/src/adc/v3.rs:677-701 | embassy-stm32/src/adc/v3_h7_adc3.rs:391-415 — before extracting anything, compare `embassy-stm32/src/adc/v3.rs` and `embassy-stm32/src/adc/v3_h7_adc3.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 270 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 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.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×6
  • 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 (17 lines × 3) embassy-nxp/src/hashcrypt/lpc55.rs:545 — embassy-nxp/src/hashcrypt/lpc55.rs:545-561 | embassy-nxp/src/hashcrypt/lpc55.rs:729-745 | embassy-nxp/src/hashcrypt/lpc55.rs:948-964 — 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-nxp/src/hashcrypt/lpc55.rs:580 — embassy-nxp/src/hashcrypt/lpc55.rs:580-596 | embassy-nxp/src/hashcrypt/lpc55.rs:774-790 | embassy-nxp/src/hashcrypt/lpc55.rs:989-1005 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×6
  • 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×6
  • 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:896 — embassy-mspm0/src/uart/buffered.rs:896-906 | embassy-rp/src/uart/buffered.rs:316-327 — 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 33 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:631 — embassy-nrf/src/spim.rs:631-642 | embassy-nrf/src/spis.rs:542-552 — 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/eth/sma/v2.rs:99 — embassy-stm32/src/eth/sma/v2.rs:99-109 | embassy-stm32/src/eth/sma/v2.rs:127-138 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×6
  • 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-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.
D1 · Cyclomatic Complexity · ClockOperator · ×5
  • ClockOperator::configure_osc32k_clocks (cyclomatic 48) embassy-mcxa/src/clocks/operator.rs:452 — 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:810 — 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:1303 — 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:94 — 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:1193 — 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.
D1 · Cyclomatic Complexity · I2c · ×5
  • 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_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:864 — 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.
D2 · Cognitive Complexity · embassy_stm32_wpan · ×5
  • embassy_stm32_wpan::wb::fus::boot (cognitive 66) embassy-stm32-wpan/src/wb/fus.rs:306 — embassy_stm32_wpan::wb::fus::boot has cognitive complexity 66 (threshold 15). Drivers by points: if/else 9 (38 pts), loops 4 (14 pts), match/switch 3 (10 pts), boolean chains 4 (nesting depth added 46). 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.
  • embassy_stm32_wpan::bluetooth::gatt::events::client_events_from_vendor_event (cognitive 35) embassy-stm32-wpan/src/bluetooth/gatt/events.rs:404 — embassy_stm32_wpan::bluetooth::gatt::events::client_events_from_vendor_event has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (8 pts), match/switch 2 (3 pts) (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • 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::wb::fus::request_upgrade (cognitive 18) embassy-stm32-wpan/src/wb/fus.rs:169 — embassy_stm32_wpan::wb::fus::request_upgrade has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, match/switch 3 (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.
D2 · Cognitive Complexity · embassy_mcxa · ×5
  • embassy_mcxa::lpuart::bbq::handler (cognitive 46) embassy-mcxa/src/lpuart/bbq.rs:2212 — embassy_mcxa::lpuart::bbq::handler has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 3 (15 pts), boolean chains 5 (nesting depth added 26). 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.
  • embassy_mcxa::dma::on_interrupt (cognitive 23) embassy-mcxa/src/dma.rs:2938 — embassy_mcxa::dma::on_interrupt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • embassy_mcxa::i2c::controller::compute_baud_params (cognitive 19) embassy-mcxa/src/i2c/controller.rs:445 — embassy_mcxa::i2c::controller::compute_baud_params has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • 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::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.
D2 · Cognitive Complexity · I3c · ×5
  • 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.
D2 · Cognitive Complexity · Regs · ×5
  • Regs::configure_sequence (cognitive 30) embassy-stm32/src/adc/v3.rs:403 — 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 19) embassy-stm32/src/adc/v3.rs:198 — Regs::init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 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.
  • Regs::configure_sequence (cognitive 19) embassy-stm32/src/adc/v3_h7_adc3.rs:204 — Regs::configure_sequence has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · embassy_usb · ×5
  • embassy_usb::class::cdc_acm::host::find_cdc_acm (cognitive 20) embassy-usb/src/class/cdc_acm/host.rs:79 — embassy_usb::class::cdc_acm::host::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::class::gip::host::find_gip (cognitive 18) embassy-usb/src/class/gip/host.rs:238 — embassy_usb::class::gip::host::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::class::vcp::host::cp210x::find_cp210x (cognitive 18) embassy-usb/src/class/vcp/host/cp210x.rs:426 — embassy_usb::class::vcp::host::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::class::gud::device::validate_state_check (cognitive 17) embassy-usb/src/class/gud/device.rs:1158 — embassy_usb::class::gud::device::validate_state_check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • embassy_usb::class::ccid::host::find_ccid (cognitive 16) embassy-usb/src/class/ccid/host.rs:51 — embassy_usb::class::ccid::host::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.
D35 · Change Coupling · Change coupling · ×5
  • Change coupling: mailbox.rs ↔ control.rs embassy-mcxa/src/flexcan/classic/mailbox.rs:1 — `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: sdio.rs ↔ spi.rs cyw43/src/sdio.rs:1 — `cyw43/src/sdio.rs` and `cyw43/src/spi.rs` change together 64% of the time (9 of the 14 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 `4adb2311` cyw: refactor to use write struct and some cleanup; `5f8daf96` cyw: trait cleanup; `638b5ce6` cyw: pipe through buf to bus — run `git show` on any of them.
  • Change coupling: aci_gap.rs ↔ mod.rs embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs:1 — `embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs` and `embassy-stm32-wpan/src/bluetooth/security/mod.rs` change together 55% of the time (6 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 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: low_power.rs ↔ low_power.rs embassy-stm32/src/low_power.rs:1 — `embassy-stm32/src/low_power.rs` and `embassy-stm32/src/rtc/low_power.rs` change together 50% of the time (10 of the 20 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 10 shared commits counted here, the most recent 3 are `0fe787a3` stm32/lp: remove chrono dependency for calc; `8d8803a0` stm32wl5x low-power both cores; `94d608af` Added more examples for stm32u3, rtc, and low power. — run `git show` on any of them.
  • Change coupling: deadline.rs ↔ run_queue.rs embassy-executor/src/raw/deadline.rs:1 — `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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×5
  • 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:1438 — embassy-rp/src/clocks.rs:1438-1451 | embassy-rp/src/clocks.rs:1463-1477 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×5
  • 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:755 — embassy-nrf/src/uarte.rs:755-764 | embassy-nrf/src/uarte.rs:1202-1212 — both copies are in the same file, so extract the block into 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-rp/src/pio_programs/ir_nec.rs:182 — embassy-rp/src/pio_programs/ir_nec.rs:182-192 | embassy-rp/src/pio_programs/uart.rs:234-243 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • 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:1284 — embassy-stm32/src/spi/mod.rs:1284-1293 | embassy-stm32/src/spi/mod.rs:1419-1429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×5
  • Duplicated block (9 lines × 4) embassy-rp/src/spi.rs:161 — embassy-rp/src/spi.rs:161-169 | embassy-rp/src/spi.rs:174-182 | embassy-rp/src/spi.rs:187-195 | embassy-rp/src/spi.rs:200-208 — 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:824 — embassy-stm32/src/adc/mod.rs:824-832 | embassy-stm32/src/adc/mod.rs:903-911 | embassy-stm32/src/adc/mod.rs:933-941 | 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×5
  • 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:376 — embassy-nrf/src/uarte.rs:376-383 | embassy-nrf/src/uarte.rs:390-397 | embassy-nrf/src/uarte.rs:406-413 | embassy-nrf/src/uarte.rs:421-428 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×5
  • 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:729 — embassy-stm32/src/rcc/l.rs:729-734 | 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/adc/v2.rs:670 — embassy-stm32/src/adc/v2.rs:670-675 | embassy-stm32/src/adc/v3.rs:733-738 | embassy-stm32/src/adc/v3_h7_adc3.rs:441-446 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 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.
D1 · Cyclomatic Complexity · Regs · ×4
  • Regs::init (cyclomatic 24) embassy-stm32/src/adc/v3.rs:198 — Regs::init has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Regs::configure_sequence (cyclomatic 18) embassy-stm32/src/adc/v3.rs:403 — 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.
D1 · Cyclomatic Complexity · InterruptHandler · ×4
  • 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:1955 — 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:89 — 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.
  • InterruptHandler::on_interrupt (cyclomatic 17) embassy-stm32/src/usb/usb.rs:41 — 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.
D2 · Cognitive Complexity · embassy_nrf · ×4
  • 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.
D2 · Cognitive Complexity · Control · ×4
  • Control::control_in (cognitive 40) embassy-usb/src/class/gud/device.rs:814 — Control::control_in has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 5 (10 pts), match/switch 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/device.rs:453 — 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.
  • Control::control_out (cognitive 25) embassy-usb/src/class/gud/device.rs:951 — Control::control_out has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Control::join (cognitive 17) cyw43/src/control.rs:346 — Control::join has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
D2 · Cognitive Complexity · Inner · ×4
  • Inner::handle_control_out (cognitive 40) embassy-usb/src/device/mod.rs:492 — Inner::handle_control_out has cognitive complexity 40 (threshold 15). Drivers by points: loops 6 (19 pts), if/else 5 (14 pts), match/switch 4 (7 pts) (nesting depth added 25). 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 30) embassy-usb/src/device/mod.rs:620 — Inner::handle_control_in has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 5 (10 pts), boolean chains 3 (nesting depth added 15). 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/device/mod.rs:722 — 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/device/mod.rs:436 — 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.
D2 · Cognitive Complexity · ClockOperator · ×4
  • ClockOperator::configure_spll (cognitive 39) embassy-mcxa/src/clocks/operator.rs:810 — 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:452 — 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:94 — 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:1303 — 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.
D2 · Cognitive Complexity · embassy_crypto_test · ×4
  • embassy_crypto_test::p256::arith (cognitive 32) embassy-crypto-test/src/lib.rs:1040 — 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_crypto_test::p384::arith (cognitive 32) embassy-crypto-test/src/lib.rs:1040 — 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::decompress (cognitive 17) embassy-crypto-test/src/lib.rs:1280 — embassy_crypto_test::p256::decompress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (embassy_crypto_test::p384::decompress) 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::p384::decompress (cognitive 17) embassy-crypto-test/src/lib.rs:1280 — embassy_crypto_test::p384::decompress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (embassy_crypto_test::p256::decompress) 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.
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.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×4
  • 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 (17 lines × 4) embassy-nxp/src/hashcrypt/lpc55.rs:539 — embassy-nxp/src/hashcrypt/lpc55.rs:539-555 | embassy-nxp/src/hashcrypt/lpc55.rs:574-590 | embassy-nxp/src/hashcrypt/lpc55.rs:723-739 | embassy-nxp/src/hashcrypt/lpc55.rs:768-784 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×4
  • Duplicated block (13 lines × 4) embassy-mcxa/src/i2c/controller.rs:678 — embassy-mcxa/src/i2c/controller.rs:678-690 | embassy-mcxa/src/i2c/target.rs:325-337 | embassy-mcxa/src/i3c/controller.rs:343-355 | embassy-mcxa/src/i3c/target.rs:374-386 — before extracting anything, compare `embassy-mcxa/src/i2c/controller.rs` and `embassy-mcxa/src/i2c/target.rs` as WHOLE FILES: this scan already matched 6 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 (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.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×4
  • 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-nxp/src/hashcrypt/lpc55.rs:555 — embassy-nxp/src/hashcrypt/lpc55.rs:555-564 | embassy-nxp/src/hashcrypt/lpc55.rs:628-637 | embassy-nxp/src/hashcrypt/lpc55.rs:739-748 | embassy-nxp/src/hashcrypt/lpc55.rs:832-841 | embassy-nxp/src/hashcrypt/lpc55.rs:958-967 — 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 (10 lines × 5) embassy-nxp/src/hashcrypt/lpc55.rs:590 — embassy-nxp/src/hashcrypt/lpc55.rs:590-599 | embassy-nxp/src/hashcrypt/lpc55.rs:668-677 | embassy-nxp/src/hashcrypt/lpc55.rs:784-793 | embassy-nxp/src/hashcrypt/lpc55.rs:880-889 | embassy-nxp/src/hashcrypt/lpc55.rs:999-1008 — 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 (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:185-194 | 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×4
  • 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:822 — embassy-stm32/src/spi/mod.rs:822-827 | embassy-stm32/src/spi/mod.rs:871-876 | embassy-stm32/src/spi/mod.rs:892-897 | embassy-stm32/src/spi/mod.rs:916-921 — 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.
D1 · Cyclomatic Complexity · r#wifi_init_config · ×3
  • 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.
D1 · Cyclomatic Complexity · r#wifi_pkt_rx_ctrl · ×3
  • 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.
D1 · Cyclomatic Complexity · r#wifi_ap_config · ×3
  • 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.
D1 · Cyclomatic Complexity · Runner · ×3
  • Runner::rx (cyclomatic 33) cyw43/src/runner.rs:1113 — Runner::rx 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.
  • Runner::run (cyclomatic 20) embassy-net-adin1110/src/lib.rs:354 — Runner::run has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Runner::init (cyclomatic 16) cyw43/src/runner.rs:456 — 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.
D1 · Cyclomatic Complexity · r#wifi_sta_config · ×3
  • 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.
D1 · Cyclomatic Complexity · embassy_stm32_wpan · ×3
  • embassy_stm32_wpan::bluetooth::gatt::events::client_events_from_vendor_event (cyclomatic 25) embassy-stm32-wpan/src/bluetooth/gatt/events.rs:404 — embassy_stm32_wpan::bluetooth::gatt::events::client_events_from_vendor_event 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.
  • embassy_stm32_wpan::wb::fus::boot (cyclomatic 23) embassy-stm32-wpan/src/wb/fus.rs:306 — embassy_stm32_wpan::wb::fus::boot 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.
  • 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.
D1 · Cyclomatic Complexity · Jpeg · ×3
  • 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.
D1 · Cyclomatic Complexity · Inner · ×3
  • Inner::handle_control_out (cyclomatic 23) embassy-usb/src/device/mod.rs:492 — 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 21) embassy-usb/src/device/mod.rs:620 — Inner::handle_control_in 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.
  • Inner::handle_get_descriptor (cyclomatic 16) embassy-usb/src/device/mod.rs:722 — 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.
D2 · Cognitive Complexity · r#wifi_init_config · ×3
  • 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.
D2 · Cognitive Complexity · r#wifi_pkt_rx_ctrl · ×3
  • 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.
D2 · Cognitive Complexity · embassy_rp · ×3
  • embassy_rp::clocks::init (cognitive 48) embassy-rp/src/clocks.rs:980 — 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 27) embassy-rp/src/clocks.rs:910 — embassy_rp::clocks::find_pll_params has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 6 (12 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.
  • embassy_rp::block::sha256 (cognitive 16) embassy-rp/src/block.rs:966 — embassy_rp::block::sha256 has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 4 (6 pts) (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · r#wifi_ap_config · ×3
  • 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.
D2 · Cognitive Complexity · Jpeg · ×3
  • 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.
D2 · Cognitive Complexity · r#wifi_sta_config · ×3
  • 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.
D2 · Cognitive Complexity · Spi · ×3
  • 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:695 — 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.
  • Spi::read (cognitive 16) embassy-stm32/src/spi/mod.rs:1671 — Spi::read has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 4 (7 pts), loops 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.
D2 · Cognitive Complexity · Hash · ×3
  • 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.
D2 · Cognitive Complexity · Driver · ×3
  • Driver::wait_for_device_event (cognitive 23) embassy-rp/src/usb/host.rs:1781 — Driver::wait_for_device_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Driver::alloc_endpoint (cognitive 23) embassy-usb-synopsys-otg/src/lib.rs:627 — 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:130 — 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.
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.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×3
  • 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 (38 lines × 2) embassy-crypto-stub/src/ec.rs:19 — embassy-crypto-stub/src/ec.rs:19-130 | embassy-crypto-stub/src/hash.rs:10-47 — before extracting anything, compare `embassy-crypto-stub/src/ec.rs` and `embassy-crypto-stub/src/hash.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 442 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×3
  • Duplicated block (28 lines × 2) cyw43/src/sdio.rs:123 — cyw43/src/sdio.rs:123-150 | cyw43/src/spi.rs:100-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • 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.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×3
  • 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 (18 lines × 3) embassy-usb/src/class/uac/host/mod.rs:438 — embassy-usb/src/class/uac/host/mod.rs:438-455 | embassy-usb/src/class/uac/host/mod.rs:476-493 | embassy-usb/src/class/uac/host/mod.rs:514-531 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (17 lines × 6) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×3
  • Duplicated block (8–9 lines × 2) embassy-mcxa/src/dma.rs:2863 — embassy-mcxa/src/dma.rs:2863-2871 | embassy-mcxa/src/dma.rs:2874-2881 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×3
  • Duplicated block (7–8 lines × 2) embassy-nrf/src/pwm.rs:151 — embassy-nrf/src/pwm.rs:151-158 | embassy-nrf/src/pwm.rs:903-909 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×3
  • 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:167 — embassy-net-nrf91/src/context.rs:167-171 | embassy-net-nrf91/src/context.rs:181-185 | embassy-net-nrf91/src/context.rs:323-328 | embassy-net-nrf91/src/context.rs:348-352 — 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:175-179 | 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.
D4 · Code Duplication · Duplicated block (3–5 lines × 3) · ×3
  • Duplicated block (3–5 lines × 3) embassy-stm32/src/adc/v2.rs:369 — embassy-stm32/src/adc/v2.rs:369-371 | embassy-stm32/src/adc/v3.rs:389-393 | embassy-stm32/src/adc/v3_h7_adc3.rs:190-194 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (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/src/host/descriptor.rs:1039 — embassy-usb/src/host/descriptor.rs:1039-1041 | embassy-usb/src/host/descriptor.rs:1133-1137 | embassy-usb/src/host/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.
D1 · Cyclomatic Complexity · embassy_usb_synopsys_otg · ×2
  • 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:39 — 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.
D1 · Cyclomatic Complexity · Channel · ×2
  • Channel::configure (cyclomatic 40) embassy-stm32/src/dma/dma_bdma/mod.rs:502 — Channel::configure has cyclomatic complexity 40 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • 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.
D1 · Cyclomatic Complexity · embassy_crypto_test · ×2
  • embassy_crypto_test::p256::arith (cyclomatic 32) embassy-crypto-test/src/lib.rs:1040 — 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_crypto_test::p384::arith (cyclomatic 32) embassy-crypto-test/src/lib.rs:1040 — 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.
D1 · Cyclomatic Complexity · Control · ×2
  • Control::control_in (cyclomatic 30) embassy-usb/src/class/gud/device.rs:814 — Control::control_in has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Control::control_out (cyclomatic 20) embassy-usb/src/class/gud/device.rs:951 — Control::control_out has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · embassy_executor_macros · ×2
  • embassy_executor_macros::macros::task::run (cyclomatic 27) embassy-executor-macros/src/macros/task.rs:34 — 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 21) embassy-executor-macros/src/macros/main.rs:91 — embassy_executor_macros::macros::main::run has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Bus · ×2
  • Bus::endpoint_set_stalled (cyclomatic 25) embassy-stm32/src/usb/usb.rs:931 — Bus::endpoint_set_stalled 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.
  • Bus::endpoint_set_enabled (cyclomatic 19) embassy-stm32/src/usb/usb.rs:1033 — Bus::endpoint_set_enabled has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · BufferedInterruptHandler · ×2
  • 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 20) embassy-rp/src/uart/buffered.rs:687 — BufferedInterruptHandler::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.
D1 · Cyclomatic Complexity · embassy_mcxa · ×2
  • embassy_mcxa::lpuart::bbq::handler (cyclomatic 21) embassy-mcxa/src/lpuart/bbq.rs:2212 — embassy_mcxa::lpuart::bbq::handler 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_mcxa::dma::on_interrupt (cyclomatic 19) embassy-mcxa/src/dma.rs:2938 — embassy_mcxa::dma::on_interrupt 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.
D1 · Cyclomatic Complexity · UartRx · ×2
  • 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:613 — 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.
D1 · Cyclomatic Complexity · StateInner · ×2
  • StateInner::handle_data (cyclomatic 20) embassy-net-nrf91/src/lib.rs:634 — StateInner::handle_data 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.
  • StateInner::poll (cyclomatic 18) embassy-net-nrf91/src/lib.rs:353 — 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.
D1 · Cyclomatic Complexity · I3c · ×2
  • 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.
D1 · Cyclomatic Complexity · FormatInterrupt · ×2
  • 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.
D1 · Cyclomatic Complexity · Driver · ×2
  • Driver::wait_for_device_event (cyclomatic 16) embassy-rp/src/usb/host.rs:1781 — Driver::wait_for_device_event 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.
  • Driver::alloc_endpoint (cyclomatic 16) embassy-usb-synopsys-otg/src/lib.rs:627 — 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×2
  • 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 12 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: “deps: remove fixed”; “fixes docs”; “fix minor mistakes”; “fix unused imports”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +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.
  • Repeated repair: embassy-usb/src/class/uac/device/function.rs embassy-usb/src/class/uac/device/function.rs:279 — embassy-usb/src/class/uac/device/function.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is Control::interface_set_request at line 279), 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: “usb: fix operation on targets without u32”; “fix(usb-uac): filter out unsupported controls before counting and indexing channel data”; “refactor: fix several names”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 01:31:57 +00:00' --until='2026-10-27 01:31:57 +00:00' --full-history --no-merges -- embassy-usb/src/class/uac/device/function.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.
D2 · Cognitive Complexity · embassy_usb_synopsys_otg · ×2
  • 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 50) embassy-usb-synopsys-otg/src/lib.rs:39 — embassy_usb_synopsys_otg::on_interrupt has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 5 (11 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Channel · ×2
  • Channel::configure (cognitive 48) embassy-stm32/src/dma/dma_bdma/mod.rs:502 — Channel::configure has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 9 (14 pts), loops 4 (11 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • 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.
D2 · Cognitive Complexity · BufferedInterruptHandler · ×2
  • 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 35) embassy-rp/src/uart/buffered.rs:687 — BufferedInterruptHandler::on_interrupt has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StateInner · ×2
  • StateInner::poll (cognitive 38) embassy-net-nrf91/src/lib.rs:353 — 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 38) embassy-net-nrf91/src/lib.rs:634 — StateInner::handle_data has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 5 (13 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.
D2 · Cognitive Complexity · embassy_mspm0 · ×2
  • embassy_mspm0::uart::buffered::on_interrupt (cognitive 34) embassy-mspm0/src/uart/buffered.rs:1040 — embassy_mspm0::uart::buffered::on_interrupt has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 2 (5 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.
  • 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.
D2 · Cognitive Complexity · embassy_executor_macros · ×2
  • embassy_executor_macros::macros::task::run (cognitive 30) embassy-executor-macros/src/macros/task.rs:34 — 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 20) embassy-executor-macros/src/macros/main.rs:91 — embassy_executor_macros::macros::main::run has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 8 (10 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.
D2 · Cognitive Complexity · Ospi · ×2
  • 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.
D2 · Cognitive Complexity · AudioCollectionBuilder · ×2
  • AudioCollectionBuilder::on_other (cognitive 27) embassy-usb/src/class/uac/host/descriptors.rs:180 — AudioCollectionBuilder::on_other has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 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.
  • AudioCollectionBuilder::on_interface (cognitive 19) embassy-usb/src/class/uac/host/descriptors.rs:96 — 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.
D2 · Cognitive Complexity · UartRx · ×2
  • UartRx::read_to_break_with_count (cognitive 26) embassy-rp/src/uart/mod.rs:613 — 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.
D2 · Cognitive Complexity · AesDriver · ×2
  • 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.
D2 · Cognitive Complexity · BtRunner · ×2
  • BtRunner::upload_bluetooth_firmware (cognitive 21) cyw43/src/bluetooth.rs:232 — 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.
  • BtRunner::handle_irq (cognitive 17) cyw43/src/bluetooth.rs:472 — BtRunner::handle_irq has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 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.
D2 · Cognitive Complexity · Tc6 · ×2
  • 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.
D2 · Cognitive Complexity · Endpoint · ×2
  • Endpoint::write (cognitive 17) embassy-stm32/src/usb/usb.rs:1425 — Endpoint::write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 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.
  • Endpoint::read (cognitive 16) embassy-stm32/src/usb/usb.rs:1355 — Endpoint::read 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.
D2 · Cognitive Complexity · FormatInterrupt · ×2
  • 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.
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:380 — embassy-stm32/src/can/fdcan.rs:380-396 | embassy-stm32/src/can/fdcan.rs:767-783 — 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:447 — embassy-stm32/src/can/fdcan.rs:447-463 | embassy-stm32/src/can/fdcan.rs:793-809 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) embassy-rp/src/pio_programs/ws2812.rs:141 — embassy-rp/src/pio_programs/ws2812.rs:141-172 | embassy-rp/src/pio_programs/ws2812.rs:250-281 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×2
  • 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:515 — embassy-rp/src/uart/mod.rs:515-541 | embassy-rp/src/uart/mod.rs:684-711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (21 lines × 4) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×2
  • Duplicated block (18 lines × 4) embassy-mcxa/src/clocks/periph_helpers.rs:634 — embassy-mcxa/src/clocks/periph_helpers.rs:634-651 | embassy-mcxa/src/clocks/periph_helpers.rs:776-793 | embassy-mcxa/src/clocks/periph_helpers.rs:1530-1547 | embassy-mcxa/src/clocks/periph_helpers.rs:2028-2045 — 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.
D4 · Code Duplication · Duplicated block (17 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 6) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • 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:837 — embassy-rp/src/i2c.rs:837-851 | 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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • 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 (15 lines × 3) embassy-stm32/src/adc/v2.rs:88 — embassy-stm32/src/adc/v2.rs:88-102 | embassy-stm32/src/adc/v3.rs:171-185 | embassy-stm32/src/adc/v3_h7_adc3.rs:67-81 — before extracting anything, compare `embassy-stm32/src/adc/v2.rs` and `embassy-stm32/src/adc/v3.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 6) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • 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:242 — embassy-rp/src/clocks.rs:242-253 | embassy-rp/src/clocks.rs:261-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×2
  • 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:262-272 — `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.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 8) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) embassy-microchip/src/time_driver.rs:104 — embassy-microchip/src/time_driver.rs:104-112 | embassy-stm32/src/time_driver/lptim.rs:265-274 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9–10 lines × 2) embassy-stm32/src/usart/buffered.rs:764 — embassy-stm32/src/usart/buffered.rs:764-773 | embassy-stm32/src/usart/buffered.rs:804-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 12) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×2
  • 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:197-205 | embassy-stm32/src/exti/mod.rs:77-85 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) embassy-rp/src/i2c.rs:559 — embassy-rp/src/i2c.rs:559-566 | embassy-rp/src/spi.rs:158-165 | embassy-rp/src/spi.rs:171-178 | embassy-rp/src/spi.rs:184-191 | embassy-rp/src/spi.rs:197-204 — 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:1349 — embassy-rp/src/pio/mod.rs:1349-1358 | embassy-rp/src/spi.rs:161-168 | embassy-rp/src/spi.rs:174-181 | embassy-rp/src/spi.rs:187-194 | embassy-rp/src/spi.rs:200-207 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×2
  • 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/dfsdm/detector.rs:295 — embassy-stm32/src/dfsdm/detector.rs:295-300 | embassy-stm32/src/dfsdm/filter.rs:919-927 | embassy-stm32/src/dfsdm/filter.rs:930-938 | embassy-stm32/src/dfsdm/filter.rs:970-978 | embassy-stm32/src/dfsdm/filter.rs:981-989 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 84) · ×2
  • 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.
D1 · Cyclomatic Complexity · Rpc · ×1
  • 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.
D1 · Cyclomatic Complexity · CtrlMsg · ×1
  • 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.
D1 · Cyclomatic Complexity · embassy_nrf · ×1
  • 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.
D1 · Cyclomatic Complexity · embassy_rp · ×1
  • embassy_rp::clocks::init (cyclomatic 45) embassy-rp/src/clocks.rs:980 — 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.
D1 · Cyclomatic Complexity · Psram · ×1
  • Psram::init_psram (cyclomatic 43) embassy-rp/src/psram.rs:447 — 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.
D1 · Cyclomatic Complexity · Comp · ×1
  • 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.
D1 · Cyclomatic Complexity · LsConfig · ×1
  • 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.
D1 · Cyclomatic Complexity · ReportDescriptor · ×1
  • ReportDescriptor::parse (cyclomatic 33) embassy-usb/src/class/hid/host/hid_report.rs:241 — 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.
D1 · Cyclomatic Complexity · CtrlEvent · ×1
  • 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.
D1 · Cyclomatic Complexity · CodeIndexNumber · ×1
  • CodeIndexNumber::try_from_event (cyclomatic 26) embassy-usb/src/class/midi/packet.rs:317 — CodeIndexNumber::try_from_event has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RpcEvent · ×1
  • 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.
D1 · Cyclomatic Complexity · StateMachine · ×1
  • 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.
D1 · Cyclomatic Complexity · r#esp_app_desc · ×1
  • 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.
D1 · Cyclomatic Complexity · SimplePwm · ×1
  • 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.
D1 · Cyclomatic Complexity · embassy_mspm0 · ×1
  • embassy_mspm0::uart::buffered::on_interrupt (cyclomatic 21) embassy-mspm0/src/uart/buffered.rs:1040 — embassy_mspm0::uart::buffered::on_interrupt has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Rpc_Req_ExtCoex · ×1
  • 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.
D1 · Cyclomatic Complexity · HubHandler · ×1
  • HubHandler::wait_for_event (cyclomatic 21) embassy-usb/src/class/hub/host.rs:143 — HubHandler::wait_for_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.
D1 · Cyclomatic Complexity · OtgHost · ×1
  • 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.
D1 · Cyclomatic Complexity · Rpc_Resp_GetCoprocessorFwVersion · ×1
  • 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.
D1 · Cyclomatic Complexity · CtrlMsg_Resp_GetSoftAPConfig · ×1
  • 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.
D1 · Cyclomatic Complexity · CtrlMsg_Resp_GetDhcpDnsStatus · ×1
  • 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.
D1 · Cyclomatic Complexity · CtrlMsg_Event_SetDhcpDnsStatus · ×1
  • 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.
D1 · Cyclomatic Complexity · Rpc_Resp_GetDhcpDnsStatus · ×1
  • 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.
D1 · Cyclomatic Complexity · Rpc_Event_DhcpDnsStatus · ×1
  • 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.
D1 · Cyclomatic Complexity · ParsedAdvData · ×1
  • ParsedAdvData::parse (cyclomatic 19) embassy-stm32-wpan/src/bluetooth/gap/scanner.rs:289 — 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.
D1 · Cyclomatic Complexity · MainClkConfig · ×1
  • 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.
D1 · Cyclomatic Complexity · Twim · ×1
  • Twim::setup_operations (cyclomatic 18) embassy-nrf/src/twim.rs:533 — 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.
D1 · Cyclomatic Complexity · LptmrConfig · ×1
  • LptmrConfig::pre_enable_config (cyclomatic 17) embassy-mcxa/src/clocks/periph_helpers.rs:839 — LptmrConfig::pre_enable_config has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BbqState · ×1
  • BbqState::publish_continuous_partial (cyclomatic 17) embassy-mcxa/src/lpuart/bbq.rs:1896 — BbqState::publish_continuous_partial 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.
D1 · Cyclomatic Complexity · CtrlMsg_Req_StartSoftAP · ×1
  • 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.
D1 · Cyclomatic Complexity · CtrlMsg_Req_SetDhcpDnsStatus · ×1
  • 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.
D1 · Cyclomatic Complexity · r#wifi_csi_config · ×1
  • 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.
D1 · Cyclomatic Complexity · r#wifi_ftm_report_entry · ×1
  • 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.
D1 · Cyclomatic Complexity · Rpc_Req_SetDhcpDnsStatus · ×1
  • 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.
D1 · Cyclomatic Complexity · HCI · ×1
  • HCI::process_event (cyclomatic 17) embassy-stm32-wpan/src/bluetooth/mod.rs:694 — HCI::process_event has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AudioCollectionBuilder · ×1
  • AudioCollectionBuilder::on_other (cyclomatic 17) embassy-usb/src/class/uac/host/descriptors.rs:180 — AudioCollectionBuilder::on_other has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MainPllClkConfig · ×1
  • 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.
D1 · Cyclomatic Complexity · CtrlMsg_Resp_GetFwVersion · ×1
  • 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.
D1 · Cyclomatic Complexity · r#wifi_event_ftm_report · ×1
  • 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.
D1 · Cyclomatic Complexity · Symmetric · ×1
  • 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.
D1 · Cyclomatic Complexity · embassy_usb · ×1
  • embassy_usb::class::gud::device::validate_state_check (cyclomatic 16) embassy-usb/src/class/gud/device.rs:1158 — embassy_usb::class::gud::device::validate_state_check 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.
D17 · Explicit Debt · TodoComment repeated across 11 files · ×1
  • TodoComment repeated across 11 files embassy-usb/src/class/cdc_ncm/device/mod.rs:197 — 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.)
D2 · Cognitive Complexity · Rpc · ×1
  • 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.
D2 · Cognitive Complexity · CtrlMsg · ×1
  • 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.
D2 · Cognitive Complexity · CtrlEvent · ×1
  • 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.
D2 · Cognitive Complexity · ReportDescriptor · ×1
  • ReportDescriptor::parse (cognitive 62) embassy-usb/src/class/hid/host/hid_report.rs:241 — 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.
D2 · Cognitive Complexity · RpcEvent · ×1
  • 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.
D2 · Cognitive Complexity · HubHandler · ×1
  • HubHandler::wait_for_event (cognitive 55) embassy-usb/src/class/hub/host.rs:143 — HubHandler::wait_for_event has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (44 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Psram · ×1
  • Psram::init_psram (cognitive 54) embassy-rp/src/psram.rs:447 — 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.
D2 · Cognitive Complexity · LsConfig · ×1
  • 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.
D2 · Cognitive Complexity · OtgHost · ×1
  • 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.
D2 · Cognitive Complexity · SimplePwm · ×1
  • 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.
D2 · Cognitive Complexity · ParsedAdvData · ×1
  • ParsedAdvData::parse (cognitive 34) embassy-stm32-wpan/src/bluetooth/gap/scanner.rs:289 — 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.
D2 · Cognitive Complexity · MainClkConfig · ×1
  • 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.
D2 · Cognitive Complexity · Rpc_Req_ExtCoex · ×1
  • 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.
D2 · Cognitive Complexity · Twim · ×1
  • Twim::setup_operations (cognitive 28) embassy-nrf/src/twim.rs:533 — 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.
D2 · Cognitive Complexity · r#wifi_config · ×1
  • 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.
D2 · Cognitive Complexity · Rpc_Resp_GetCoprocessorFwVersion · ×1
  • 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.
D2 · Cognitive Complexity · MainPllClkConfig · ×1
  • 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.
D2 · Cognitive Complexity · StateMachine · ×1
  • 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.
D2 · Cognitive Complexity · Uart · ×1
  • Uart::init (cognitive 25) embassy-rp/src/uart/mod.rs:942 — 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.
D2 · Cognitive Complexity · HCI · ×1
  • HCI::process_event (cognitive 25) embassy-stm32-wpan/src/bluetooth/mod.rs:694 — HCI::process_event has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CtrlMsg_Resp_GetSoftAPConfig · ×1
  • 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.
D2 · Cognitive Complexity · r#wifi_csi_config · ×1
  • 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.
D2 · Cognitive Complexity · r#wifi_ftm_report_entry · ×1
  • 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.
D2 · Cognitive Complexity · CodeIndexNumber · ×1
  • CodeIndexNumber::try_from_event (cognitive 24) embassy-usb/src/class/midi/packet.rs:317 — CodeIndexNumber::try_from_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, match/switch 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.
D2 · Cognitive Complexity · Executor · ×1
  • 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.
D2 · Cognitive Complexity · Rng · ×1
  • 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.
D2 · Cognitive Complexity · CtrlMsg_Req_StartSoftAP · ×1
  • 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.
D2 · Cognitive Complexity · CtrlMsg_Resp_GetFwVersion · ×1
  • 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.
D2 · Cognitive Complexity · CtrlMsg_Resp_GetDhcpDnsStatus · ×1
  • 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.
D2 · Cognitive Complexity · CtrlMsg_Event_SetDhcpDnsStatus · ×1
  • 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.
D2 · Cognitive Complexity · r#wifi_event_ftm_report · ×1
  • 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.
D2 · Cognitive Complexity · r#wifi_itwt_setup_config · ×1
  • 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.
D2 · Cognitive Complexity · Rpc_Resp_GetDhcpDnsStatus · ×1
  • 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.
D2 · Cognitive Complexity · Rpc_Event_DhcpDnsStatus · ×1
  • 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.
D2 · Cognitive Complexity · Backend · ×1
  • Backend::process_serial_data (cognitive 21) embassy-net-esp-hosted/src/rpc/mod.rs:164 — 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.
D2 · Cognitive Complexity · Symmetric · ×1
  • 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.
D2 · Cognitive Complexity · DfuState · ×1
  • DfuState::control_out (cognitive 21) embassy-usb/src/class/dfu/device/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.
D2 · Cognitive Complexity · Rpc_Event_StaItwtSuspend · ×1
  • 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.
D2 · Cognitive Complexity · PlanarSink · ×1
  • PlanarSink::push (cognitive 20) embassy-stm32/src/jpeg.rs:860 — 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.
D2 · Cognitive Complexity · Xspi · ×1
  • 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.
D2 · Cognitive Complexity · StreamingHasher · ×1
  • 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.
D2 · Cognitive Complexity · IT0InterruptHandler · ×1
  • 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.
D2 · Cognitive Complexity · MscClass · ×1
  • MscClass::write (cognitive 19) embassy-usb/src/class/msc/device/transfer.rs:86 — MscClass::write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DmaChannel · ×1
  • DmaChannel::setup_transfers (cognitive 18) embassy-mcxa/src/dma.rs:1043 — 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.
D2 · Cognitive Complexity · embassy_net_adin1110 · ×1
  • embassy_net_adin1110::new_tc6 (cognitive 18) embassy-net-adin1110/src/lib.rs:850 — 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.
D2 · Cognitive Complexity · CtrlMsg_Resp_GetAPConfig · ×1
  • 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.
D2 · Cognitive Complexity · CtrlMsg_Req_SetDhcpDnsStatus · ×1
  • 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.
D2 · Cognitive Complexity · CtrlMsg_Event_StationConnectedToAP · ×1
  • 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.
D2 · Cognitive Complexity · r#wifi_ant_config · ×1
  • 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.
D2 · Cognitive Complexity · r#esp_app_desc · ×1
  • 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.
D2 · Cognitive Complexity · Rpc_Req_SetDhcpDnsStatus · ×1
  • 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.
D2 · Cognitive Complexity · Rpc_Resp_MemMonitor · ×1
  • 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.
D2 · Cognitive Complexity · Rpc_GpioConfig · ×1
  • 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.
D2 · Cognitive Complexity · Timings · ×1
  • 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.
D2 · Cognitive Complexity · Allocator · ×1
  • Allocator::allocate (cognitive 17) embassy-nrf/src/usb/mod.rs:810 — 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.
D2 · Cognitive Complexity · Saes · ×1
  • 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.
D2 · Cognitive Complexity · RingBufferedUartRx · ×1
  • RingBufferedUartRx::wait_for_data_or_idle (cognitive 17) embassy-stm32/src/usart/ringbuffered.rs:285 — 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.
D2 · Cognitive Complexity · Sequencer · ×1
  • 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.
D2 · Cognitive Complexity · UacHandler · ×1
  • UacHandler::output (cognitive 17) embassy-usb/src/class/uac/host/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.
D2 · Cognitive Complexity · RtcClkConfig · ×1
  • 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.
D2 · Cognitive Complexity · ChaChaPolyContext · ×1
  • 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.
D2 · Cognitive Complexity · I2cSlave · ×1
  • 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.
D2 · Cognitive Complexity · Cordic32 · ×1
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyFunctions · ×1
  • 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.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: server.rs → aci_gap.rs, command.rs, mod.rs embassy-stm32-wpan/src/bluetooth/gatt/server.rs — `embassy-stm32-wpan/src/bluetooth/gatt/server.rs` changes together with 3 other files — `embassy-stm32-wpan/src/bluetooth/gap/aci_gap.rs`, `embassy-stm32-wpan/src/bluetooth/hci/command.rs`, `embassy-stm32-wpan/src/bluetooth/security/mod.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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:544 — embassy-mcxa/src/clocks/periph_helpers.rs:544-658 | embassy-mcxa/src/clocks/periph_helpers.rs:698-800 | embassy-mcxa/src/clocks/periph_helpers.rs:1050-1166 | embassy-mcxa/src/clocks/periph_helpers.rs:1463-1554 | embassy-mcxa/src/clocks/periph_helpers.rs:1618-1735 | embassy-mcxa/src/clocks/periph_helpers.rs:1796-1914 | embassy-mcxa/src/clocks/periph_helpers.rs:1965-2052 — 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.
D4 · Code Duplication · Near-duplicate member pair (95 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (61 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (53 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (51 shared lines) · ×1
  • Near-duplicate member pair (51 shared lines) embassy-stm32/src/adc/v3.rs:403 — embassy-stm32/src/adc/v3.rs:403-513 | embassy-stm32/src/adc/v3_h7_adc3.rs:204-266 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (48 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (47 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (42 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) embassy-stm32/src/sdmmc/mod.rs:1103 — embassy-stm32/src/sdmmc/mod.rs:1103-1170 | embassy-stm32/src/sdmmc/mod.rs:1175-1241 — These two members are variants of one another: 40 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (29 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (25 shared lines) · ×1
  • 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:522 — embassy-nrf/src/twis.rs:522-545 | embassy-nrf/src/twis.rs:633-660 — 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:261-289 — 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:522 — embassy-stm32/src/sdmmc/mod.rs:522-544 | embassy-stm32/src/sdmmc/mod.rs:632-653 — 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
  • Members sharing a duplicated core (362 members, 50+ identical tokens) embassy-net-esp-hosted/src/proto/fg/mod.rs:128 — embassy-net-esp-hosted/src/proto/fg/mod.rs:128-183 | embassy-net-esp-hosted/src/proto/fg/mod.rs:367-396 | embassy-net-esp-hosted/src/proto/fg/mod.rs:493-516 | embassy-net-esp-hosted/src/proto/fg/mod.rs:614-643 | embassy-net-esp-hosted/src/proto/fg/mod.rs:714-727 | embassy-net-esp-hosted/src/proto/fg/mod.rs:804-837 | embassy-net-esp-hosted/src/proto/fg/mod.rs:933-956 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1031-1054 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1104-1117 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1171-1194 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1292-1321 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1417-1440 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1490-1503 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1695-1770 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2088-2149 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2375-2414 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2506-2519 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2757-2852 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3258-3343 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3613-3652 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3744-3757 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3835-3878 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3973-3986 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4064-4107 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4202-4215 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4269-4292 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4367-4386 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4461-4484 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4534-4547 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4601-4624 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4791-4846 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5104-5154 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5339-5362 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5437-5460 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5535-5558 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5608-5621 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5698-5731 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5850-5883 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5979-6002 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6100-6133 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6229-6252 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6302-6315 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6507-6586 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6810-6839 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6935-6958 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7008-7021 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7098-7127 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7407-7494 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7737-7760 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7810-7823 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8084-8181 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8446-8465 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8540-8563 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8753-8818 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9136-9211 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9504-9563 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9791-9840 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10185-10282 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10570-10599 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10741-10780 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10943-10982 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11174-11513 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12339-12444 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:588-841 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:1497-1556 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:1741-1774 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:1922-1952 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2116-2149 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2470-2549 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2896-2926 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3093-3126 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3319-3374 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3585-3628 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3770-3803 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3924-3957 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4525-4704 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5650-5801 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6238-6275 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6462-6501 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6621-6654 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7202-7405 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7909-7935 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8074-8097 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8318-8401 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8753-8811 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9058-9091 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9165-9188 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9363-9426 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9685-9740 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9972-10021 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10208-10251 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10489-10554 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10831-10886 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11070-11103 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11200-11219 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11319-11344 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11443-11476 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11601-11634 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11732-11755 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11977-12060 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12384-12463 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12741-12790 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12929-12952 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13028-13047 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13147-13176 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13273-13292 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13392-13425 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13546-13579 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13798-13871 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:14076-14109 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:14518-14635 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15007-15040 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15161-15194 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15354-15381 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15570-15599 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15744-15787 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15905-15928 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16026-16055 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16126-16139 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16216-16249 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16345-16368 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16443-16466 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16516-16529 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16606-16639 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16735-16758 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16833-16856 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16954-16983 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17079-17102 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17152-17165 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17219-17242 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17317-17336 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17411-17434 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17484-17497 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17551-17574 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17624-17637 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17691-17714 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17764-17777 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17879-17909 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18047-18070 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18145-18168 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18218-18231 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18308-18341 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18460-18493 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18589-18612 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18711-18731 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18848-18871 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18921-18934 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18988-19011 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19134-19164 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19302-19325 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19400-19423 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19570-19610 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19744-19757 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19811-19834 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19884-19897 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19951-19974 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20024-20037 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20091-20114 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20164-20177 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20231-20254 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20401-20441 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20600-20623 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20673-20686 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20740-20763 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20813-20826 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20903-20936 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21032-21055 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21154-21197 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21292-21305 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21410-21440 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21553-21566 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21620-21643 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21693-21706 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21760-21783 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21833-21846 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21900-21923 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21998-22021 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22119-22152 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22223-22236 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22341-22371 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22532-22565 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22661-22684 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22759-22782 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22880-22913 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23032-23065 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23161-23184 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23259-23282 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23380-23413 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23532-23565 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23661-23684 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23734-23747 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23847-23890 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24007-24030 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24105-24128 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24226-24255 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24351-24374 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24424-24437 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24514-24543 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24663-24683 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24800-24823 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24873-24886 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24988-25018 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25131-25144 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25246-25276 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25414-25433 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25483-25496 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25573-25606 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25725-25758 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25829-25842 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25919-25952 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26120-26160 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26368-26398 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26512-26525 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26602-26635 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26782-26812 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26973-27006 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27102-27125 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27275-27315 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27525-27555 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27716-27749 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27845-27868 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28018-28058 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28217-28240 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28315-28338 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28388-28401 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28478-28511 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28607-28630 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28705-28728 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28778-28791 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28868-28901 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29020-29053 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29149-29172 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29247-29270 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29368-29401 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29524-29544 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29662-29685 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29760-29783 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29858-29881 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29979-30012 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30108-30131 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30181-30194 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30271-30304 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30400-30423 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30498-30521 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30596-30619 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30694-30717 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30816-30836 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30953-30976 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31026-31039 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31279-31378 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31805-31892 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32135-32158 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32233-32256 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32538-32635 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32900-32923 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32998-33021 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33071-33084 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33138-33161 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33309-33350 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33488-33511 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33561-33574 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33628-33651 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33701-33714 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33768-33791 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33913-33952 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34138-34187 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34325-34348 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34469-34512 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34675-34718 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34908-34961 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35247-35304 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35729-35806 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36102-36135 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36255-36284 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36380-36403 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36570-36629 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36857-36906 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37095-37125 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37315-37345 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37535-37565 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37796-37859 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38044-38064 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38181-38204 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38279-38302 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38377-38400 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38499-38532 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38628-38651 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38726-38749 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38847-38880 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38999-39032 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39130-39153 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39228-39251 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39326-39349 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39447-39480 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39578-39601 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39860-39963 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40206-40229 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40511-40608 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40992-41052 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41300-41343 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41508-41565 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41747-41790 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41882-41895 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41949-41972 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42022-42035 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42089-42112 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42210-42239 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42335-42358 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42408-42421 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42475-42498 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42596-42625 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42721-42744 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42794-42807 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42861-42884 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42982-43011 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43107-43130 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43180-43193 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43247-43270 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43368-43397 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43493-43516 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43566-43579 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43633-43656 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43754-43783 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43879-43902 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43952-43965 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44019-44042 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44232-44293 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44473-44496 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44546-44559 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44613-44636 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44711-44734 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44809-44832 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44882-44895 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44972-45005 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45101-45124 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45199-45222 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45297-45320 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45395-45418 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45516-45545 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45641-45664 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45766-45786 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45903-45926 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46001-46024 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46099-46122 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46197-46220 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46295-46318 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46393-46412 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46487-46510 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46585-46608 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46683-46706 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46805-46834 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46978-47008 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47170-47203 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47323-47352 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47496-47526 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47688-47721 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47843-47872 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48017-48056 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48222-48261 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48526-48583 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48863-49399 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50586-50681 — These 362 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 362 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 362 times.
D4 · Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (13 members, 50+ identical tokens) 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-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:413-424 | embassy-stm32/src/time_driver/tim.rs:377-388 | embassy-time/src/driver_cmsdk/mod.rs:332-343 — These 13 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 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-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:287-293 | embassy-stm32/src/time_driver/tim.rs:246-251 | embassy-time/src/driver_cmsdk/mod.rs:235-251 — These 11 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 11 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 11 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.
D4 · Code Duplication · Duplicated block (74 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (64–65 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (62 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (53 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (29–33 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (29–32 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (2–32 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (31 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (24–28 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (27 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (24–26 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (24–26 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • 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:264-289 — 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.
D4 · Code Duplication · Duplicated block (25 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) embassy-mcxa/src/i2c/controller.rs:1540 — embassy-mcxa/src/i2c/controller.rs:1540-1564 | 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 6 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.
D4 · Code Duplication · Duplicated block (24 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15–24 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (22 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (19–22 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–20 lines × 3) · ×1
  • Duplicated block (14–20 lines × 3) embassy-stm32/src/spi/mod.rs:1577 — embassy-stm32/src/spi/mod.rs:1577-1596 | embassy-stm32/src/spi/mod.rs:1680-1693 | embassy-stm32/src/spi/mod.rs:1782-1795 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (16–20 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (19 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (19 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16–19 lines × 3) · ×1
  • Duplicated block (16–19 lines × 3) embassy-mcxa/src/clocks/periph_helpers.rs:1141 — embassy-mcxa/src/clocks/periph_helpers.rs:1141-1159 | embassy-mcxa/src/clocks/periph_helpers.rs:1712-1727 | embassy-mcxa/src/clocks/periph_helpers.rs:1891-1907 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (14–19 lines × 2) · ×1
  • 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:1727-1745 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) embassy-usb/src/class/msc/host/mod.rs:266 — embassy-usb/src/class/msc/host/mod.rs:266-284 | embassy-usb/src/class/vcp/host/cp210x.rs:432-448 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (13–18 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15–18 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • 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:147-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17 lines × 95) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–17 lines × 7) · ×1
  • Duplicated block (14–17 lines × 7) embassy-mcxa/src/clocks/periph_helpers.rs:628 — embassy-mcxa/src/clocks/periph_helpers.rs:628-644 | embassy-mcxa/src/clocks/periph_helpers.rs:771-786 | embassy-mcxa/src/clocks/periph_helpers.rs:1135-1151 | embassy-mcxa/src/clocks/periph_helpers.rs:1525-1540 | embassy-mcxa/src/clocks/periph_helpers.rs:1707-1720 | embassy-mcxa/src/clocks/periph_helpers.rs:1885-1899 | embassy-mcxa/src/clocks/periph_helpers.rs:2024-2038 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) embassy-mcxa/src/i2c/controller.rs:1705 — embassy-mcxa/src/i2c/controller.rs:1705-1717 | 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 70 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.
D4 · Code Duplication · Duplicated block (16 lines × 8) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12–15 lines × 4) · ×1
  • Duplicated block (12–15 lines × 4) embassy-mcxa/src/i2c/controller.rs:1702 — embassy-mcxa/src/i2c/controller.rs:1702-1715 | 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 6 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.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 148) · ×1
  • Duplicated block (14 lines × 148) embassy-net-esp-hosted/src/proto/fg/mod.rs:1034 — embassy-net-esp-hosted/src/proto/fg/mod.rs:1034-1047 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1174-1187 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1420-1433 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2378-2391 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3616-3629 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4272-4285 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4464-4477 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4604-4617 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5342-5355 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5538-5551 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5982-5995 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6232-6245 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6510-6523 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6938-6951 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7101-7114 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7740-7753 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8087-8100 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8756-8769 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9139-9152 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9507-9520 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9794-9807 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10744-10757 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10946-10959 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16446-16459 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16609-16622 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16836-16849 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17082-17095 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17222-17235 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17414-17427 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17554-17567 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17694-17707 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17882-17895 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18148-18161 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18592-18605 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18851-18864 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18991-19004 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19305-19318 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19573-19586 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19814-19827 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19954-19967 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20094-20107 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20234-20247 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20603-20616 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20743-20756 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20906-20919 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21157-21170 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21413-21426 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21623-21636 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21763-21776 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21903-21916 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22122-22135 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22344-22357 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22664-22677 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22883-22896 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23164-23177 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23383-23396 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23664-23677 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23850-23863 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24108-24121 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24354-24367 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24517-24530 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24803-24816 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24991-25004 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25249-25262 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25576-25589 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25728-25741 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25922-25935 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26371-26384 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26605-26618 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26976-26989 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27278-27291 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27719-27732 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28021-28034 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28318-28331 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28481-28494 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28708-28721 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28871-28884 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29152-29165 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29371-29384 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29665-29678 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29861-29874 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30111-30124 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30274-30287 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30501-30514 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30697-30710 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30956-30969 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31282-31295 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32138-32151 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33001-33014 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33141-33154 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33491-33504 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33631-33644 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33771-33784 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34141-34154 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34472-34485 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34911-34924 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35732-35745 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36105-36118 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36573-36586 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36860-36873 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37098-37111 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37318-37331 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37538-37551 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38184-38197 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38380-38393 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38631-38644 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38850-38863 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39133-39146 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39329-39342 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39581-39594 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40209-40222 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40995-41008 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41303-41316 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41511-41524 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41750-41763 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41952-41965 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42092-42105 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42338-42351 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42478-42491 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42724-42737 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42864-42877 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43110-43123 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43250-43263 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43496-43509 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43636-43649 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43882-43895 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44022-44035 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44476-44489 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44616-44629 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44812-44825 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44975-44988 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45202-45215 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45398-45411 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45644-45657 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45906-45919 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46102-46115 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46298-46311 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46490-46503 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46686-46699 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46808-46821 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46981-46994 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47173-47186 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47326-47339 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47499-47512 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47691-47704 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48020-48033 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48225-48238 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48529-48542 — `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.
D4 · Code Duplication · Duplicated block (14 lines × 10) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 9) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 8) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (3–14 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7–14 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) embassy-stm32/src/spi/mod.rs:1298 — embassy-stm32/src/spi/mod.rs:1298-1309 | embassy-stm32/src/spi/mod.rs:1512-1525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–13 lines × 2) · ×1
  • Duplicated block (8–13 lines × 2) embassy-mcxa/src/i2c/controller.rs:1591 — embassy-mcxa/src/i2c/controller.rs:1591-1598 | 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 6 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • 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:1084-1096 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12 lines × 54) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12 lines × 8) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) embassy-rp/src/clocks.rs:918 — embassy-rp/src/clocks.rs:918-929 | embassy-rp/src/clocks.rs:949-957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) embassy-stm32/src/spi/mod.rs:1617 — embassy-stm32/src/spi/mod.rs:1617-1628 | embassy-stm32/src/spi/mod.rs:1802-1811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 9) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) embassy-mcxa/src/clocks/periph_helpers.rs:1126 — embassy-mcxa/src/clocks/periph_helpers.rs:1126-1135 | embassy-mcxa/src/clocks/periph_helpers.rs:1380-1389 | embassy-mcxa/src/clocks/periph_helpers.rs:1517-1525 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (2–10 lines × 3) · ×1
  • Duplicated block (2–10 lines × 3) embassy-nrf/src/uarte.rs:852 — embassy-nrf/src/uarte.rs:852-853 | embassy-nrf/src/uarte.rs:1001-1010 | embassy-nrf/src/uarte.rs:1064-1073 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6–10 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 11) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) embassy-stm32/src/hsem/mod.rs:123 — embassy-stm32/src/hsem/mod.rs:123-130 | embassy-stm32/src/hsem/mod.rs:152-159 | embassy-stm32/src/hsem/mod.rs:199-207 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 36) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 21) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5–8 lines × 13) · ×1
  • Duplicated block (5–8 lines × 13) 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-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:417-424 | embassy-stm32/src/time_driver/tim.rs:381-388 | embassy-time/src/driver_cmsdk/mod.rs:336-343 — there are 13 copies across 11 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 13 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5–8 lines × 3) · ×1
  • Duplicated block (5–8 lines × 3) embassy-stm32-wpan/src/bluetooth/gatt/events.rs:473 — embassy-stm32-wpan/src/bluetooth/gatt/events.rs:473-480 | embassy-stm32-wpan/src/bluetooth/gatt/events.rs:482-489 | embassy-stm32-wpan/src/bluetooth/gatt/events.rs:490-494 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 12) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 11) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) embassy-rp/src/i2c.rs:560 — embassy-rp/src/i2c.rs:560-566 | embassy-rp/src/pio/mod.rs:1347-1355 | embassy-rp/src/spi.rs:159-165 | embassy-rp/src/spi.rs:172-178 | embassy-rp/src/spi.rs:185-191 | embassy-rp/src/spi.rs:198-204 — 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.
D4 · Code Duplication · Duplicated block (2–7 lines × 11) · ×1
  • Duplicated block (2–7 lines × 11) 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-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:289-290 | embassy-stm32/src/time_driver/tim.rs:247-248 | embassy-time/src/driver_cmsdk/mod.rs:242-248 — there are 11 copies across 9 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 11 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (4–7 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 362) · ×1
  • Duplicated block (6 lines × 362) embassy-net-esp-hosted/src/proto/fg/mod.rs:129 — embassy-net-esp-hosted/src/proto/fg/mod.rs:129-134 | embassy-net-esp-hosted/src/proto/fg/mod.rs:368-373 | embassy-net-esp-hosted/src/proto/fg/mod.rs:494-499 | embassy-net-esp-hosted/src/proto/fg/mod.rs:615-620 | embassy-net-esp-hosted/src/proto/fg/mod.rs:715-720 | embassy-net-esp-hosted/src/proto/fg/mod.rs:805-810 | embassy-net-esp-hosted/src/proto/fg/mod.rs:934-939 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1032-1037 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1105-1110 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1172-1177 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1293-1298 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1418-1423 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1491-1496 | embassy-net-esp-hosted/src/proto/fg/mod.rs:1696-1701 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2089-2094 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2376-2381 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2507-2512 | embassy-net-esp-hosted/src/proto/fg/mod.rs:2758-2763 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3259-3264 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3614-3619 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3745-3750 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3836-3841 | embassy-net-esp-hosted/src/proto/fg/mod.rs:3974-3979 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4065-4070 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4203-4208 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4270-4275 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4368-4373 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4462-4467 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4535-4540 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4602-4607 | embassy-net-esp-hosted/src/proto/fg/mod.rs:4792-4797 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5105-5110 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5340-5345 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5438-5443 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5536-5541 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5609-5614 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5699-5704 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5851-5856 | embassy-net-esp-hosted/src/proto/fg/mod.rs:5980-5985 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6101-6106 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6230-6235 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6303-6308 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6508-6513 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6811-6816 | embassy-net-esp-hosted/src/proto/fg/mod.rs:6936-6941 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7009-7014 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7099-7104 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7408-7413 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7738-7743 | embassy-net-esp-hosted/src/proto/fg/mod.rs:7811-7816 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8085-8090 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8447-8452 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8541-8546 | embassy-net-esp-hosted/src/proto/fg/mod.rs:8754-8759 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9137-9142 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9505-9510 | embassy-net-esp-hosted/src/proto/fg/mod.rs:9792-9797 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10186-10191 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10571-10576 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10742-10747 | embassy-net-esp-hosted/src/proto/fg/mod.rs:10944-10949 | embassy-net-esp-hosted/src/proto/fg/mod.rs:11175-11180 | embassy-net-esp-hosted/src/proto/fg/mod.rs:12340-12345 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:589-594 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:1498-1503 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:1742-1747 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:1923-1928 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2117-2122 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2471-2476 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:2897-2902 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3094-3099 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3320-3325 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3586-3591 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3771-3776 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:3925-3930 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:4526-4531 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:5651-5656 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6239-6244 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6463-6468 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:6622-6627 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7203-7208 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:7910-7915 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8075-8080 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8319-8324 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:8754-8759 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9059-9064 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9166-9171 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9364-9369 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9686-9691 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:9973-9978 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10209-10214 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10490-10495 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:10832-10837 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11071-11076 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11201-11206 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11320-11325 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11444-11449 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11602-11607 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11733-11738 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:11978-11983 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12385-12390 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12742-12747 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:12930-12935 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13029-13034 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13148-13153 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13274-13279 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13393-13398 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13547-13552 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:13799-13804 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:14077-14082 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:14519-14524 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15008-15013 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15162-15167 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15355-15360 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15571-15576 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15745-15750 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:15906-15911 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16027-16032 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16127-16132 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16217-16222 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16346-16351 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16444-16449 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16517-16522 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16607-16612 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16736-16741 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16834-16839 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:16955-16960 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17080-17085 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17153-17158 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17220-17225 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17318-17323 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17412-17417 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17485-17490 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17552-17557 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17625-17630 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17692-17697 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17765-17770 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:17880-17885 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18048-18053 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18146-18151 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18219-18224 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18309-18314 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18461-18466 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18590-18595 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18712-18717 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18849-18854 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18922-18927 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:18989-18994 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19135-19140 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19303-19308 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19401-19406 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19571-19576 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19745-19750 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19812-19817 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19885-19890 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:19952-19957 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20025-20030 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20092-20097 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20165-20170 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20232-20237 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20402-20407 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20601-20606 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20674-20679 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20741-20746 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20814-20819 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:20904-20909 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21033-21038 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21155-21160 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21293-21298 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21411-21416 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21554-21559 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21621-21626 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21694-21699 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21761-21766 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21834-21839 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21901-21906 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:21999-22004 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22120-22125 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22224-22229 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22342-22347 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22533-22538 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22662-22667 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22760-22765 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:22881-22886 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23033-23038 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23162-23167 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23260-23265 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23381-23386 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23533-23538 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23662-23667 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23735-23740 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:23848-23853 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24008-24013 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24106-24111 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24227-24232 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24352-24357 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24425-24430 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24515-24520 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24664-24669 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24801-24806 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24874-24879 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:24989-24994 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25132-25137 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25247-25252 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25415-25420 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25484-25489 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25574-25579 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25726-25731 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25830-25835 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:25920-25925 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26121-26126 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26369-26374 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26513-26518 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26603-26608 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26783-26788 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:26974-26979 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27103-27108 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27276-27281 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27526-27531 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27717-27722 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:27846-27851 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28019-28024 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28218-28223 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28316-28321 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28389-28394 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28479-28484 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28608-28613 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28706-28711 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28779-28784 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:28869-28874 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29021-29026 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29150-29155 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29248-29253 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29369-29374 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29525-29530 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29663-29668 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29761-29766 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29859-29864 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:29980-29985 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30109-30114 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30182-30187 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30272-30277 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30401-30406 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30499-30504 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30597-30602 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30695-30700 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30817-30822 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:30954-30959 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31027-31032 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31280-31285 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:31806-31811 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32136-32141 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32234-32239 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32539-32544 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32901-32906 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:32999-33004 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33072-33077 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33139-33144 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33310-33315 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33489-33494 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33562-33567 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33629-33634 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33702-33707 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33769-33774 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:33914-33919 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34139-34144 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34326-34331 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34470-34475 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34676-34681 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:34909-34914 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35248-35253 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:35730-35735 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36103-36108 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36256-36261 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36381-36386 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36571-36576 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:36858-36863 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37096-37101 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37316-37321 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37536-37541 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:37797-37802 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38045-38050 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38182-38187 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38280-38285 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38378-38383 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38500-38505 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38629-38634 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38727-38732 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:38848-38853 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39000-39005 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39131-39136 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39229-39234 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39327-39332 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39448-39453 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39579-39584 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:39861-39866 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40207-40212 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40512-40517 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:40993-40998 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41301-41306 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41509-41514 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41748-41753 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41883-41888 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:41950-41955 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42023-42028 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42090-42095 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42211-42216 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42336-42341 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42409-42414 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42476-42481 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42597-42602 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42722-42727 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42795-42800 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42862-42867 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:42983-42988 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43108-43113 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43181-43186 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43248-43253 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43369-43374 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43494-43499 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43567-43572 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43634-43639 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43755-43760 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43880-43885 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:43953-43958 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44020-44025 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44233-44238 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44474-44479 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44547-44552 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44614-44619 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44712-44717 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44810-44815 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44883-44888 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:44973-44978 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45102-45107 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45200-45205 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45298-45303 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45396-45401 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45517-45522 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45642-45647 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45767-45772 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:45904-45909 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46002-46007 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46100-46105 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46198-46203 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46296-46301 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46394-46399 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46488-46493 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46586-46591 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46684-46689 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46806-46811 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:46979-46984 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47171-47176 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47324-47329 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47497-47502 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47689-47694 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:47844-47849 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48018-48023 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48223-48228 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48527-48532 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:48864-48869 | embassy-net-esp-hosted/src/proto/mcu/mod.rs:50587-50592 — `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.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (22 lines × 27) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (38 lines × 3) · ×1
  • Duplicated block (38 lines × 3) embassy-crypto-stub/src/aes.rs:20 — embassy-crypto-stub/src/aes.rs:20-184 | embassy-crypto-stub/src/ec.rs:19-130 | embassy-crypto-stub/src/hash.rs:10-47 — before extracting anything, compare `embassy-crypto-stub/src/ec.rs` and `embassy-crypto-stub/src/hash.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 442 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (38 lines × 4) · ×1
  • Duplicated block (38 lines × 4) embassy-crypto-stub/src/aes.rs:20 — embassy-crypto-stub/src/aes.rs:20-184 | embassy-crypto-stub/src/chacha.rs:12-60 | embassy-crypto-stub/src/ec.rs:19-130 | embassy-crypto-stub/src/hash.rs:10-47 — before extracting anything, compare `embassy-crypto-stub/src/ec.rs` and `embassy-crypto-stub/src/hash.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 442 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (670 lines × 3) · ×1
  • Duplicated block (670 lines × 3) embassy-nrf/src/chips/nrf54l05_app.rs:203 — embassy-nrf/src/chips/nrf54l05_app.rs:203-872 | embassy-nrf/src/chips/nrf54l10_app.rs:203-872 | embassy-nrf/src/chips/nrf54l15_app.rs:203-872 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
D4 · Code Duplication · Duplicated block (237 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (63 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (137 lines × 2) · ×1
  • Duplicated block (137 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:424 — embassy-nrf/src/crypto/pka/driver.rs:424-572 | embassy-stm32/src/pka/driver.rs:524-660 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (148 lines × 2) · ×1
  • Duplicated block (148 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:424 — embassy-nrf/src/crypto/pka/driver.rs:424-583 | embassy-stm32/src/pka/driver.rs:524-671 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (131 lines × 2) · ×1
  • Duplicated block (131 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:430 — embassy-nrf/src/crypto/pka/driver.rs:430-572 | embassy-stm32/src/pka/driver.rs:530-660 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (142 lines × 2) · ×1
  • Duplicated block (142 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:430 — embassy-nrf/src/crypto/pka/driver.rs:430-583 | embassy-stm32/src/pka/driver.rs:530-671 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (125 lines × 2) · ×1
  • Duplicated block (125 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:436 — embassy-nrf/src/crypto/pka/driver.rs:436-572 | embassy-stm32/src/pka/driver.rs:536-660 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (136 lines × 2) · ×1
  • Duplicated block (136 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:436 — embassy-nrf/src/crypto/pka/driver.rs:436-583 | embassy-stm32/src/pka/driver.rs:536-671 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (118 lines × 2) · ×1
  • Duplicated block (118 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:443 — embassy-nrf/src/crypto/pka/driver.rs:443-572 | embassy-stm32/src/pka/driver.rs:543-660 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (129 lines × 2) · ×1
  • Duplicated block (129 lines × 2) embassy-nrf/src/crypto/pka/driver.rs:443 — embassy-nrf/src/crypto/pka/driver.rs:443-583 | embassy-stm32/src/pka/driver.rs:543-671 — 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 14 separate duplicated blocks between them, totalling at least 1221 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (65 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (52 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 45) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 8) · ×1
  • Duplicated block (13 lines × 8) embassy-mcxa/src/clocks/periph_helpers.rs:646 — embassy-mcxa/src/clocks/periph_helpers.rs:646-658 | embassy-mcxa/src/clocks/periph_helpers.rs:788-800 | embassy-mcxa/src/clocks/periph_helpers.rs:1153-1166 | embassy-mcxa/src/clocks/periph_helpers.rs:1237-1250 | embassy-mcxa/src/clocks/periph_helpers.rs:1542-1554 | embassy-mcxa/src/clocks/periph_helpers.rs:1722-1735 | embassy-mcxa/src/clocks/periph_helpers.rs:1901-1914 | embassy-mcxa/src/clocks/periph_helpers.rs:2040-2052 — 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.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.97 rust-toolchain.toml:1 — 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.
D5 · Coupling · Unstable project embassy-nrf · ×1
  • Unstable project embassy-nrf — embassy-nrf has instability 0.92 with 1 dependents.
D5 · Coupling · Unstable project embassy-rp · ×1
  • Unstable project embassy-rp — embassy-rp has instability 0.83 with 2 dependents.
D5 · Coupling · Unstable project embassy-stm32 · ×1
  • Unstable project embassy-stm32 — embassy-stm32 has instability 0.86 with 2 dependents.
Minor — 86 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×43
  • Orphaned file embassy-mspm0/src/i2c_target.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/can/bxcan/filter.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-mcxa/src/cdog.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-nrf/src/ipc.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/flash/eeprom.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-net-adin1110/src/crc32.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-microchip/src/tach.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/tsc/acquisition_banks.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-embedded-hal/src/flash/concat_flash.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-usb-dfu/src/fmt.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/can/fd/message_ram/enums.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/tsc/io_pin.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-rp/src/datetime/epoch.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-net-wiznet/src/fmt.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-net-adin1110/src/mdio.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/tsc/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/tsc/config.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-rp/src/critical_section_impl.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/dsihost/phy.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-net-wiznet/src/chip/w6300.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/can/fd/message_ram/extended_filter.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/can/fd/message_ram/common.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/can/fd/message_ram/standard_filter.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/can/fd/message_ram/generic.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file embassy-stm32/src/can/fd/message_ram/txevent_element.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 18 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×23
  • Duplicated predicate embassy-stm32/src/hspi/mod.rs:518 — `!T::REGS.sr().read().tcf() && !T::REGS.sr().read().ftf()` appears character-identically in 3 files — embassy-stm32/src/hspi/mod.rs, embassy-stm32/src/ospi/mod.rs, embassy-stm32/src/xspi/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-executor/src/platform/cortex_m.rs:18 — `!cfg!(feature = "executor-interrupt") || context == THREAD_PENDER` appears character-identically in 3 files — embassy-executor/src/platform/cortex_m.rs, embassy-rp/src/executor.rs, embassy-stm32/src/executor.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/spi/ringbuffered.rs:78 — `!dma_buf.is_empty() && dma_buf.len() <= 0xFFFF` appears character-identically in 3 files — embassy-stm32/src/spi/ringbuffered.rs, embassy-stm32/src/timer/simple_pwm.rs, embassy-stm32/src/usart/ringbuffered.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/adc/v3.rs:533 — `!matches!(mode, ConversionMode::NoDma) && !dfsdm` appears character-identically in 2 files — embassy-stm32/src/adc/v3.rs, embassy-stm32/src/adc/v3_h7_adc3.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-nrf/src/crypto/rng/cryptocell.rs:40 — `!state.ptr.is_null() && state.ptr != state.end` appears character-identically in 2 files — embassy-nrf/src/crypto/rng/cryptocell.rs, embassy-nrf/src/rng.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/rcc/u5.rs:626 — `Hertz::mhz(4) <= ref_freq && ref_freq <= Hertz::mhz(16)` appears character-identically in 2 files — embassy-stm32/src/rcc/u5.rs, embassy-stm32/src/rcc/wba.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/eth/v1/ptp.rs:92 — `addend != 0 && addend <= u64::from(u32::MAX)` appears character-identically in 2 files — embassy-stm32/src/eth/v1/ptp.rs, embassy-stm32/src/eth/v2/ptp.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/rcc/u3.rs:314 — `cr.msikon() == false || cr.msikrdy() == true` appears character-identically in 2 files — embassy-stm32/src/rcc/u3.rs, embassy-stm32/src/rcc/u5.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/rcc/u3.rs:260 — `cr.msison() == false || cr.msisrdy() == true` appears character-identically in 2 files — embassy-stm32/src/rcc/u3.rs, embassy-stm32/src/rcc/u5.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/aes/common.rs:354 — `ctx.header_len == 0 && ctx.aad_buffer_len == 0` appears character-identically in 2 files — embassy-stm32/src/aes/common.rs, embassy-stm32/src/saes/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/dma/gpdma/linked_list.rs:134 — `dir == Dir::MemoryToPeripheral && incr_mem` appears character-identically in 2 files — embassy-stm32/src/dma/gpdma/linked_list.rs, embassy-stm32/src/dma/gpdma/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/dma/gpdma/linked_list.rs:135 — `dir == Dir::PeripheralToMemory && incr_mem` appears character-identically in 2 files — embassy-stm32/src/dma/gpdma/linked_list.rs, embassy-stm32/src/dma/gpdma/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/adc/v3.rs:555 — `matches!(mode, ConversionMode::Repeated(None)) || dfsdm_cont` appears character-identically in 2 files — embassy-stm32/src/adc/v3.rs, embassy-stm32/src/adc/v3_h7_adc3.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-embedded-hal/src/flash/partition/asynch.rs:34 — `offset % T::READ_SIZE as u32 != 0 || offset % T::WRITE_SIZE as u32 != 0 || offset % T::ERASE_SIZE as u32 != 0` appears character-identically in 2 files — embassy-embedded-hal/src/flash/partition/asynch.rs, embassy-embedded-hal/src/flash/partition/blocking.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-nrf/src/nvmc.rs:129 — `offset as usize >= FLASH_SIZE || offset as usize + bytes.len() > FLASH_SIZE` appears character-identically in 2 files — embassy-nrf/src/nvmc.rs, embassy-nrf/src/rramc.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-usb-synopsys-otg/src/host.rs:478 — `phy_type.internal() && !phy_type.high_speed()` appears character-identically in 2 files — embassy-usb-synopsys-otg/src/host.rs, embassy-usb-synopsys-otg/src/lib.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-usb-synopsys-otg/src/host.rs:479 — `phy_type.internal() && phy_type.high_speed()` appears character-identically in 2 files — embassy-usb-synopsys-otg/src/host.rs, embassy-usb-synopsys-otg/src/lib.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/usart/mod.rs:1102 — `r.cr3().read().hdsel() && r.cr1().read().te()` appears character-identically in 2 files — embassy-stm32/src/usart/mod.rs, embassy-stm32/src/usart/ringbuffered.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/adc/v3.rs:593 — `self.cr().read().adstart() && !self.cr().read().addis()` appears character-identically in 2 files — embassy-stm32/src/adc/v3.rs, embassy-stm32/src/adc/v3_h7_adc3.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/adc/v3.rs:793 — `self.cr().read().jadstart() && !self.cr().read().addis()` appears character-identically in 2 files — embassy-stm32/src/adc/v3.rs, embassy-stm32/src/adc/v3_h7_adc3.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-embedded-hal/src/flash/partition/asynch.rs:38 — `size % T::READ_SIZE as u32 != 0 || size % T::WRITE_SIZE as u32 != 0 || size % T::ERASE_SIZE as u32 != 0` appears character-identically in 2 files — embassy-embedded-hal/src/flash/partition/asynch.rs, embassy-embedded-hal/src/flash/partition/blocking.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-boot/src/firmware_updater/asynch.rs:285 — `state == State::Boot || state == State::DfuDetach || state == State::Revert` appears character-identically in 2 files — embassy-boot/src/firmware_updater/asynch.rs, embassy-boot/src/firmware_updater/blocking.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate embassy-stm32/src/rcc/u5.rs:638 — `vco_freq >= vco_min && vco_freq <= vco_max` appears character-identically in 2 files — embassy-stm32/src/rcc/u5.rs, embassy-stm32/src/rcc/wba.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D16 · Bus Factor · Off-boarding risk · ×11
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 19 significant file(s) lose their only recent owner: embassy-stm32-wpan/src/wb/shci.rs, embassy-stm32-wpan/src/wb/fus.rs, embassy-crypto/src/aes.rs, cyw43/src/structs.rs, embassy-stm32-wpan/src/wb/sub/mac.rs, embassy-stm32-wpan/src/wb/mod.rs, cyw43/src/sdio.rs, embassy-stm32-wpan/src/wb/sub/sys.rs (+11 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 18 significant file(s) lose their only recent owner: embassy-stm32-neochrom/src/driver.rs, embassy-stm32/src/tamp/mod.rs, embassy-stm32/src/i3c/controller.rs, embassy-stm32-wpan/src/bluetooth/gatt/client.rs, embassy-stm32-neochrom/src/gpu2d_bridge.rs, embassy-stm32/src/gfxmmu.rs, embassy-stm32/src/icache.rs, embassy-stm32-wpan/src/bluetooth/gatt/types.rs (+10 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 12 significant file(s) lose their only recent owner: embassy-executor/src/platform/aarch32.rs, embassy-stm32/src/adc/internal.rs, embassy-stm32/src/executor.rs, embassy-nrf/src/crypto/cracen/mod.rs, embassy-net/src/route.rs, embassy-net/src/neighbor.rs, embassy-net/src/iface/dhcpv4_server.rs, embassy-crypto/src/ed25519.rs (+4 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 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 #5 — If anonymized user #5 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 #6 — If anonymized user #6 becomes unavailable, 7 significant file(s) lose their only recent owner: embassy-stm32/src/dfsdm/filter.rs, embassy-stm32/src/dfsdm/transceiver.rs, embassy-stm32/src/dfsdm/config.rs, embassy-stm32/src/dfsdm/types.rs, embassy-stm32/src/dfsdm/codegen.rs, embassy-stm32/src/dfsdm/mod.rs, embassy-stm32/src/dfsdm/splits.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 5 significant file(s) lose their only recent owner: embassy-imxrt/src/flexcomm/uart.rs, embassy-imxrt/src/time_driver.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 #8 — If anonymized user #8 becomes unavailable, 4 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-crypto/src/hkdf.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 4 significant file(s) lose their only recent owner: embassy-usb/src/class/midi/host/descriptors.rs, embassy-usb/src/class/midi/host/mod.rs, embassy-usb/src/class/ccid/host.rs, embassy-usb/src/class/midi/host/transport.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #10 — If anonymized user #10 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 #11 — If anonymized user #11 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.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 17 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 780 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 780 of the 941 production source files in this repository met that bar). They are anonymized user #12 (2 file(s)), anonymized user #13 (2 file(s)), anonymized user #14 (2 file(s)), anonymized user #15 (1 file(s)), anonymized user #16 (1 file(s)), anonymized user #17 (1 file(s)) (+11 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: embassy-stm32/src/dcmipp.rs, embassy-stm32/src/csi.rs, embassy-nxp/src/hashcrypt/lpc55.rs, embassy-nxp/src/time_driver/pit.rs, embassy-stm32/src/dts/mod.rs, embassy-embedded-hal/src/shared_bus/mod.rs, embassy-sync/src/rpc_service.rs, embassy-mspm0/src/tim/simple_pwm.rs (+12 more).
D20 · ADR Quality · No ADRs found · ×1
  • 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 — 10 of 47 project(s) overshoot their size bounds, lowering Project Cohesion to 6.0/10. The most over is `embassy-nrf` (35288 LoC, 2944 module-visible 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 · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 43 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: embassy-mspm0/src/i2c_target.rs, embassy-stm32/src/can/bxcan/filter.rs, embassy-mcxa/src/cdog.rs, embassy-nrf/src/ipc.rs, embassy-stm32/src/flash/eeprom.rs, embassy-net-adin1110/src/crc32.rs, embassy-microchip/src/tach.rs, embassy-stm32/src/tsc/acquisition_banks.rs (and 35 more) (46 orphaned of 781 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 781 of the 941 production source files in this repository met that bar). 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • 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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 34/36 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`.
P3 · Security & performance tooling · No SAST · ×1
  • 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 4885 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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e33e15938ecc4b3c87da916fd7415ceb/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e33e15938ecc4b3c87da916fd7415ceb/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .4artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).0—

Run 01a17c00-d8a0-720c-97e4-febc6ea370ed · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

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