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

wasmerio/wasmer

Measured 14 November 2026, 06:44 UTC, at code version b72787f

CAI score 46out of 100 Weak
CriticalWeakAdequateStrongExemplary
No change since the last survey

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

A large codebase: 275,576 lines of product code in 30 projects, tests not counted · Estimated rebuild effort: about 1.9 person-years · Weakest lens: Security and Compliance, 35

Findings by how serious they are

156 critical 2242 serious 217 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 06:44 UTC

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

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

57of 57 dimensions measured by tools.
2576of 2615 findings point to an exact file and line, so you can open each one in the code. The other 39 concern the repository as a whole, such as missing documentation.
57dimensions across 8 lenses, read from 275,576 lines of product code in 30 projects.
Chapters

Executive summary

wasmerio/wasmer falls short of our standard for production because we found no access checks on the code's endpoints or handlers and it has pipeline tools referenced by a changeable name. It scores 46 out of 100 and is rated Weak, and 143 of its 156 critical findings are security problems.

Security and Compliance, at 35, is the weakest lens and counts most in the score. The best first step is adding access checks, worth about 8 points. Adding text alternatives comes next, worth about 6 points. Raising Security and Compliance to 70 would lift the score to about 54.

Ninety-three pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Seventeen secrets can leak from the build pipeline, and ten pipeline steps run downloads nobody checks. Pinning each tool to an exact version, limiting each secret to its own step and checking each download against a checksum would close these risks. Fixing the weaknesses the scanner points to would fix the eight security weaknesses in the code, and the seven pipeline steps that install packages without pinning their versions need the packages they install pinned to exact versions. The five parts of the code nobody has worked on for a long time need someone to learn and document them before anyone changes them.

The product code is 275,576 lines, about €270,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

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

If Security and Compliance rose from 35 to 70, the lowest score rated Strong, the score would rise from 46 to about 54.

Code composition: what the lines of code are
Product code 91%Tests 9%
New since the last survey: 670 findings

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

  • Cyclomatic Complexity · wasmer_compiler_cranelift::elf::emit_local_function (cyclomatic 25) lib/compiler-cranelift/src/elf.rs
  • Cognitive Complexity · wasmer_compiler_cranelift::elf::emit_local_function (cognitive 47) lib/compiler-cranelift/src/elf.rs
  • Cognitive Complexity · FuncGen::finalize (cognitive 17) lib/compiler-singlepass/src/codegen.rs
  • Cognitive Complexity · wasmer_wasix::syscalls::wasi::path_unlink_file::path_unlink_file_internal (cognitive 16) lib/wasix/src/syscalls/wasi/path_unlink_file.rs
  • God Classes · FileTooLong: engine/mapped_binary.rs lib/compiler/src/engine/mapped_binary.rs
  • God Classes · MethodTooLong: MachineX86_64.f64_min lib/compiler-singlepass/src/machine_x64.rs
  • God Classes · MethodTooLong: MachineX86_64.f32_min lib/compiler-singlepass/src/machine_x64.rs
  • God Classes · TooManyMethods: Artifact lib/compiler/src/engine/artifact.rs
  • God Classes · MethodTooLong: FuncGen.finalize lib/compiler-singlepass/src/codegen.rs
  • God Classes · MethodTooLong: MachineX86_64.f64_max lib/compiler-singlepass/src/machine_x64.rs
  • God Classes · MethodTooLong: MachineX86_64.f32_max lib/compiler-singlepass/src/machine_x64.rs
  • God Classes · FileTooLong: wasix/path_open2.rs lib/wasix/src/syscalls/wasix/path_open2.rs
  • Code Duplication · Near-duplicate member family (35 members, 24 shared lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Near-duplicate member family (24 members, 31 shared lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Near-duplicate member family (18 members, 31 shared lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Near-duplicate member family (7 members, 26 shared lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Near-duplicate member family (7 members, 25 shared lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Near-duplicate member family (4 members, 25 shared lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Near-duplicate member pair (70 shared lines) lib/api/src/backend/sys/entities/function/typed.rs
  • Code Duplication · Near-duplicate member pair (53 shared lines) lib/api/src/backend/sys/entities/function/mod.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) lib/compiler-cranelift/src/func_environ.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/compiler-llvm/src/translator/intrinsics.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) lib/backend-api/src/query.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) lib/virtual-fs/src/mem_fs/filesystem.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/api/src/entities/function/inner.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/backend-api/src/query.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-cranelift/src/func_environ.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-llvm/src/translator/intrinsics.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-singlepass/src/emitter_x64.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-singlepass/src/emitter_x64.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/virtual-fs/src/cow_file.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/wasix/src/syscalls/wasi/path_filestat_set_times.rs
  • Code Duplication · Edited copy of a member (148 corresponding lines) lib/wasix/src/lib.rs
  • Code Duplication · Edited copy of a member (129 corresponding lines) lib/compiler-singlepass/src/emitter_arm64.rs
  • Code Duplication · Edited copy of a member (137 corresponding lines) lib/compiler-singlepass/src/emitter_arm64.rs
  • Code Duplication · Edited copy of a member (145 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Edited copy of a member (122 corresponding lines) lib/compiler-singlepass/src/emitter_riscv.rs
  • Code Duplication · Edited copy of a member (87 corresponding lines) lib/wasix/src/runners/wasi.rs
  • Code Duplication · Edited copy of a member (67 corresponding lines) lib/api/src/backend/js/entities/module.rs
  • Code Duplication · Edited copy of a member (57 corresponding lines) lib/compiler-cranelift/src/func_environ.rs
  • Code Duplication · Edited copy of a member (42 corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs
  • Code Duplication · Edited copy of a member (53 corresponding lines) lib/virtual-net/src/client.rs
  • Code Duplication · Edited copy of a member (107 corresponding lines) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Edited copy of a member (49 corresponding lines) lib/wasix/src/syscalls/wasix/proc_exec3.rs
  • Code Duplication · Edited copy of a member (38 corresponding lines) lib/compiler/src/abi.rs
  • Code Duplication · Edited copy of a member (55 corresponding lines) lib/wasix/src/syscalls/wasix/proc_spawn2.rs
  • Code Duplication · Edited copy of a member (73 corresponding lines) lib/wasix/src/syscalls/wasi/path_open.rs
  • Code Duplication · Edited copy of a member (36 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Edited copy of a member (43 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Edited copy of a member (70 corresponding lines) lib/api/src/utils/polyfill.rs
  • Code Duplication · Edited copy of a member (44 corresponding lines) lib/wasix/src/net/socket.rs
  • Code Duplication · Edited copy of a member (54 corresponding lines) lib/compiler-llvm/src/translator/trampoline.rs
  • Code Duplication · Edited copy of a member (57 corresponding lines) lib/wasix/src/runtime/resolver/backend_source.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) lib/virtual-fs/src/mem_fs/filesystem.rs
  • Code Duplication · Edited copy of a member (79 corresponding lines) lib/wasix/src/syscalls/wasix/fd_pipe.rs
  • Code Duplication · Edited copies of one member (4 members, 35+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Edited copy of a member (32 corresponding lines) lib/wasix/src/syscalls/wasix/port_addr_list.rs
  • Code Duplication · Edited copy of a member (59 corresponding lines) lib/cli/src/commands/app/create.rs
  • Code Duplication · Edited copies of one member (4 members, 31+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Edited copy of a member (34 corresponding lines) lib/types/src/module.rs
  • Code Duplication · Edited copy of a member (35 corresponding lines) lib/api/src/utils/polyfill.rs
  • Code Duplication · Edited copy of a member (34 corresponding lines) lib/wasix/src/net/mod.rs
  • Code Duplication · Edited copy of a member (52 corresponding lines) lib/wasix/src/syscalls/wasix/sock_send.rs
  • Code Duplication · Edited copy of a member (43 corresponding lines) lib/backend-api/src/subscription.rs
  • Code Duplication · Edited copy of a member (55 corresponding lines) lib/wasix/src/runtime/package_loader/load_package_tree.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Edited copy of a member (47 corresponding lines) lib/cli/src/commands/app/secrets/create.rs
  • Code Duplication · Edited copy of a member (26 corresponding lines) lib/config/src/package/mod.rs
  • Code Duplication · Edited copy of a member (40 corresponding lines) lib/cli/src/commands/app/secrets/create.rs
  • Code Duplication · Edited copy of a member (47 corresponding lines) lib/compiler-cranelift/src/elf.rs
  • Code Duplication · Edited copy of a member (41 corresponding lines) lib/compiler-cranelift/src/translator/code_translator.rs
  • Code Duplication · Edited copy of a member (38 corresponding lines) lib/wasix/src/syscalls/wasi/fd_allocate.rs
  • Code Duplication · Edited copy of a member (39 corresponding lines) lib/compiler/src/engine/artifact.rs
  • Code Duplication · Edited copy of a member (25 corresponding lines) lib/api/src/entities/instance.rs
  • Code Duplication · Edited copy of a member (37 corresponding lines) lib/api/src/backend/sys/entities/function/mod.rs
  • Code Duplication · Edited copy of a member (30 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs
  • Code Duplication · Edited copy of a member (23 corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs
  • Code Duplication · Edited copy of a member (34 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Edited copy of a member (43 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Edited copies of one member (6 members, 23+ corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs
  • Code Duplication · Edited copy of a member (34 corresponding lines) lib/vm/src/table.rs
  • Code Duplication · Edited copy of a member (29 corresponding lines) lib/wasix/src/syscalls/wasix/sock_bind.rs
  • Code Duplication · Edited copy of a member (44 corresponding lines) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Edited copy of a member (27 corresponding lines) lib/virtual-net/src/host.rs
  • Code Duplication · Edited copies of one member (3 members, 42+ corresponding lines) lib/compiler-singlepass/src/arm64_decl.rs
  • Code Duplication · Edited copy of a member (30 corresponding lines) lib/wasix/src/syscalls/wasix/sock_open.rs
  • Code Duplication · Edited copy of a member (31 corresponding lines) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Edited copy of a member (26 corresponding lines) lib/wasix/src/syscalls/wasi/args_sizes_get.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Edited copy of a member (27 corresponding lines) lib/wasix/src/os/task/process.rs
  • Code Duplication · Edited copy of a member (31 corresponding lines) lib/wasix/src/syscalls/wasi/fd_write.rs
  • Code Duplication · Edited copy of a member (41 corresponding lines) lib/cli/src/commands/app/util.rs
  • Code Duplication · Edited copy of a member (30 corresponding lines) lib/virtual-fs/src/mount_fs.rs

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

Fixed since the last survey: 798 findings

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

  • Cyclomatic Complexity · make-release.make_release (cyclomatic 69) scripts/make-release.py
  • Cyclomatic Complexity · LLVMFunctionCodeGenerator::build_m0_indirect_call (cyclomatic 16) lib/compiler-llvm/src/translator/code.rs
  • Cognitive Complexity · make-release.make_release (cognitive 132) scripts/make-release.py
  • Cognitive Complexity · LLVMFunctionCodeGenerator::build_m0_indirect_call (cognitive 34) lib/compiler-llvm/src/translator/code.rs
  • Cognitive Complexity · Publisher.publish (cognitive 19) scripts/publish.py
  • Cognitive Complexity · FileSystem::rename (cognitive 16) lib/virtual-fs/src/mem_fs/filesystem.rs
  • Cognitive Complexity · wasmer-perf-record.annotate_function (cognitive 16) scripts/wasmer-perf-record.py
  • God Classes · MethodTooLong: LLVMFunctionCodeGenerator.build_m0_indirect_call lib/compiler-llvm/src/translator/code.rs
  • God Classes · ClassTooLong: FileSystem lib/virtual-fs/src/mem_fs/filesystem.rs
  • Code Duplication · Near-duplicate member pair (67 shared lines) lib/sys-utils/src/memory/fd_memory/memories.rs
  • Code Duplication · Near-duplicate member pair (44 shared lines) lib/compiler-cranelift/src/func_environ.rs
  • Code Duplication · Edited copy of a member (14 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Members sharing a duplicated core (49 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) lib/compiler-cranelift/src/func_environ.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/api/src/backend/js/entities/function/mod.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/compiler-llvm/src/translator/intrinsics.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) lib/virtual-fs/src/mem_fs/filesystem.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/api/src/entities/function/inner.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-cranelift/src/elf.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-cranelift/src/func_environ.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-llvm/src/translator/intrinsics.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-singlepass/src/emitter_x64.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-singlepass/src/emitter_x64.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_arm64.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (27–28 lines × 2) lib/api/src/backend/sys/entities/function/typed.rs
  • Code Duplication · Duplicated block (28 lines × 2) lib/wasix/src/runtime/resolver/backend_source.rs
  • Code Duplication · Duplicated block (27 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (27 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (27 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (27 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (26 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs
  • Code Duplication · Duplicated block (25 lines × 2) lib/sys-utils/src/memory/fd_memory/memories.rs
  • Code Duplication · Duplicated block (23–25 lines × 2) lib/sys-utils/src/memory/fd_memory/memories.rs
  • Code Duplication · Duplicated block (24 lines × 2) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (23 lines × 4) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (23 lines × 4) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (21–23 lines × 2) lib/sys-utils/src/memory/fd_memory/memories.rs
  • Code Duplication · Duplicated block (23 lines × 2) lib/wasix/src/syscalls/wasix/epoll_create.rs
  • Code Duplication · Duplicated block (20–22 lines × 2) lib/compiler-cranelift/src/elf.rs
  • Code Duplication · Duplicated block (22 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (18–22 lines × 2) lib/wasix/src/net/socket.rs
  • Code Duplication · Duplicated block (22 lines × 2) lib/wasix/src/syscalls/wasi/fd_read.rs
  • Code Duplication · Duplicated block (21 lines × 2) lib/cli/src/commands/app/util.rs
  • Code Duplication · Duplicated block (21 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (21 lines × 2) lib/sys-utils/src/memory/fd_memory/memories.rs
  • Code Duplication · Duplicated block (21 lines × 2) lib/vm/src/libcalls.rs
  • Code Duplication · Duplicated block (20 lines × 3) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (20 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (20 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (18–19 lines × 3) lib/api/src/backend/sys/entities/function/mod.rs
  • Code Duplication · Duplicated block (17 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs
  • Code Duplication · Duplicated block (16–17 lines × 2) lib/compiler-singlepass/src/codegen.rs
  • Code Duplication · Duplicated block (17 lines × 2) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Duplicated block (10–17 lines × 2) lib/wasix/src/syscalls/wasix/proc_exec4.rs
  • Code Duplication · Duplicated block (15–16 lines × 2) lib/compiler-singlepass/src/codegen.rs
  • Code Duplication · Duplicated block (16 lines × 2) lib/compiler-singlepass/src/codegen.rs
  • Code Duplication · Duplicated block (16 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (16 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (13–16 lines × 2) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Duplicated block (12–15 lines × 5) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (15 lines × 4) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (15 lines × 3) lib/api/src/backend/js/entities/function/mod.rs
  • Code Duplication · Duplicated block (15 lines × 2) lib/api/src/backend/v8/entities/memory/mod.rs
  • Code Duplication · Duplicated block (15 lines × 2) lib/compiler-cranelift/src/translator/code_translator.rs
  • Code Duplication · Duplicated block (15 lines × 2) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (15 lines × 2) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (7–15 lines × 2) lib/compiler-singlepass/src/machine_x64.rs
  • Code Duplication · Duplicated block (15 lines × 2) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Duplicated block (12–14 lines × 8) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (14 lines × 5) lib/compiler-singlepass/src/codegen.rs
  • Code Duplication · Duplicated block (14 lines × 4) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (8–14 lines × 3) lib/compiler-cranelift/src/func_environ.rs
  • Code Duplication · Duplicated block (14 lines × 3) lib/compiler-cranelift/src/translator/code_translator.rs
  • Code Duplication · Duplicated block (13–14 lines × 3) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (10–14 lines × 2) lib/cli/src/commands/app/deploy.rs
  • Code Duplication · Duplicated block (14 lines × 2) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (13 lines × 12) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (12–13 lines × 4) lib/compiler-singlepass/src/codegen.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/compiler-singlepass/src/codegen.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/sys-utils/src/memory/fd_memory/memories.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/vm/src/vmcontext.rs
  • Code Duplication · Duplicated block (12–13 lines × 2) lib/wasix/src/syscalls/mod.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/wasix/src/syscalls/mod.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/wasix/src/syscalls/wasi/fd_write.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/wasix/src/syscalls/wasi/path_rename.rs
  • Code Duplication · Duplicated block (13 lines × 2) lib/wasix/src/syscalls/wasix/epoll_ctl.rs
  • Code Duplication · Duplicated block (12 lines × 6) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (11–12 lines × 6) lib/virtual-fs/src/mem_fs/file.rs
  • Code Duplication · Duplicated block (12 lines × 4) lib/api/src/backend/js/entities/function/mod.rs
  • Code Duplication · Duplicated block (11–12 lines × 4) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (10–12 lines × 3) lib/compiler-llvm/src/translator/code.rs
  • Code Duplication · Duplicated block (10–12 lines × 3) lib/compiler-singlepass/src/codegen.rs
Rebuild cost: about €270,000 · Estimate
Cost to rebuild€89,000 to €450,000, for 1,490 to 4,728 hours of work, about 1.9 person-years for 1 to 4 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×0.7 at a score of 46. 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: 275,576 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
Raises the score by about 8 points · Medium effort · Access Controls
2
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 6 points · Medium effort · Text alternatives
3
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Raises the score by about 4 points · Medium effort · Page structure

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 €270,000 to build again, about 1.9 person-years of work. Its weakest lens is Security and Compliance, at 35 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 28,525 lines over the last 90 days, which is about 115,685 lines a year. At that pace, the extra work comes to an estimated 14.9 to 89.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch virtual-fs virtual-fs virtual-mio virtual-mio virtual-fs->virtual-mio wasmer-package wasmer-package virtual-fs->wasmer-package virtual-net virtual-net virtual-net->virtual-mio wasmer wasmer wasmer-compiler wasmer-compiler wasmer->wasmer-compiler wasmer-compiler-cranelift wasmer-compiler-cranelift wasmer->wasmer-compiler-cranelift wasmer-compiler-llvm wasmer-compiler-llvm wasmer->wasmer-compiler-llvm wasmer-compiler-singlepass wasmer-compiler-singlepass wasmer->wasmer-compiler-singlepass wasmer-types wasmer-types wasmer->wasmer-types wasmer-vm wasmer-vm wasmer->wasmer-vm wasmer-backend-api wasmer-backend-api wasmer-config wasmer-config wasmer-backend-api->wasmer-config wasmer-backend-api->wasmer-package wasmer-c-api wasmer-c-api wasmer-c-api->wasmer wasmer-c-api->wasmer-compiler wasmer-c-api->wasmer-compiler-cranelift wasmer-c-api->wasmer-compiler-llvm wasmer-c-api->wasmer-compiler-singlepass wasmer-middlewares wasmer-middlewares wasmer-c-api->wasmer-middlewares wasmer-c-api->wasmer-types wasmer-wasix wasmer-wasix wasmer-c-api->wasmer-wasix wasmer-cli wasmer-cli wasmer-cli->virtual-fs wasmer-cli->virtual-mio wasmer-cli->virtual-net wasmer-cli->wasmer wasmer-cli->wasmer-backend-api wasmer-cli->wasmer-compiler wasmer-cli->wasmer-compiler-cranelift wasmer-cli->wasmer-compiler-llvm wasmer-cli->wasmer-compiler-singlepass wasmer-cli->wasmer-config wasmer-cli->wasmer-package wasmer-cli->wasmer-types wasmer-cli->wasmer-vm wasmer-cli->wasmer-wasix wasmer-compiler->wasmer-types wasmer-compiler->wasmer-vm wasmer-compiler-cranelift->wasmer-compiler wasmer-compiler-cranelift->wasmer-types wasmer-compiler-llvm->wasmer-compiler wasmer-compiler-llvm->wasmer-types wasmer-compiler-llvm->wasmer-vm wasmer-compiler-singlepass->wasmer-compiler wasmer-compiler-singlepass->wasmer-types wasmer-journal wasmer-journal wasmer-journal->virtual-fs wasmer-journal->virtual-net wasmer-journal->wasmer wasmer-journal->wasmer-config wasmer-wasix-types wasmer-wasix-types wasmer-journal->wasmer-wasix-types wasmer-middlewares->wasmer wasmer-middlewares->wasmer-types wasmer-middlewares->wasmer-vm wasmer-package->wasmer-config wasmer-package->wasmer-types wasmer-vm->wasmer-types wasmer-wasix->virtual-fs wasmer-wasix->virtual-mio wasmer-wasix->virtual-net wasmer-wasix->wasmer wasmer-wasix->wasmer-config wasmer-wasix->wasmer-journal wasmer-wasix->wasmer-package wasmer-wasix->wasmer-types wasmer-wasix->wasmer-wasix-types wasmer-wasix-types->wasmer wasmer-wasix-types->wasmer-types wasmer-workspace wasmer-workspace wasmer-workspace->wasmer wasmer-workspace->wasmer-compiler wasmer-workspace->wasmer-compiler-cranelift wasmer-workspace->wasmer-compiler-llvm wasmer-workspace->wasmer-compiler-singlepass wasmer-workspace->wasmer-middlewares wasmer-workspace->wasmer-types wasmer-workspace->wasmer-wasix __more__ +10 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.

808 modules, with 2332 dependencies between them. 19 loops run through 111 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 768 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 virtual_fs2 wasmer.backend.js.entities.store.obj3 wasmer.utils.mem.ptr4 wasmer_backend_api.client5 wasmer_cli.commands6 wasmer_cli.config.env7 wasmer_config.package.package_source8 wasmer_journal.entry9 wasmer_types.entity.primary_map10 wasmer_types.features11 wasmer_types.indexes12 wasmer_types.progress13 wasmer_types.target14 wasmer_types.units15 wasmer.backend.js.entities.engine16 wasmer.entities.exports17 wasmer_cli.commands.app.util18 wasmer_types.types19 wasmer_vm.store20 wasmer_wasix_types.wasi.wasix_manual21 wasmer.backend.js.entities.memory22 wasmer.entities.store.store_ref23 wasmer.entities.value24 wasmer_compiler_singlepass.machine25 wasmer_types.module26 wasmer_wasix_types.wasi.bindings27 wasmer.backend.js.entities.function.env28 wasmer.entities.external29 wasmer_vm.instance30 wasmer_wasix.fs31 wasmer_wasix.os.task.thread32 wasmer.backend.js.vm.external33 wasmer.entities.imports34 wasmer_compiler.engine.artifact35 wasmer.backend.js.entities.function36 wasmer.backend.js.entities.module37 wasmer.backend.js.entities.instance38 wasmer_wasix.runtime39 wasmer_wasix.state.env40 wasmer_wasix.state.linker.instance_group
1 virtual_fs
2 wasmer.backend.js.entities.store.obj
3 wasmer.utils.mem.ptr
4 wasmer_backend_api.client
5 wasmer_cli.commands
6 wasmer_cli.config.env
7 wasmer_config.package.package_source
8 wasmer_journal.entry
9 wasmer_types.entity.primary_map
10 wasmer_types.features
11 wasmer_types.indexes
12 wasmer_types.progress
13 wasmer_types.target
14 wasmer_types.units
15 wasmer.backend.js.entities.engine111
16 wasmer.entities.exports3
17 wasmer_cli.commands.app.util21
18 wasmer_types.types1
19 wasmer_vm.store1
20 wasmer_wasix_types.wasi.wasix_manual9
21 wasmer.backend.js.entities.memory211
22 wasmer.entities.store.store_ref32
23 wasmer.entities.value11
24 wasmer_compiler_singlepass.machine2212
25 wasmer_types.module2122
26 wasmer_wasix_types.wasi.bindings11
27 wasmer.backend.js.entities.function.env210
28 wasmer.entities.external11111
29 wasmer_vm.instance141153
30 wasmer_wasix.fs418
31 wasmer_wasix.os.task.thread1211
32 wasmer.backend.js.vm.external2
33 wasmer.entities.imports111
34 wasmer_compiler.engine.artifact322111121
35 wasmer.backend.js.entities.function31111
36 wasmer.backend.js.entities.module112121
37 wasmer.backend.js.entities.instance11
38 wasmer_wasix.runtime1467576
39 wasmer_wasix.state.env111112411
40 wasmer_wasix.state.linker.instance_group2111113
Uses a module listed above itPart of a loopThe module itself
1 virtual_fs2 wasmer.backend.js.entities.store.obj3 wasmer.utils.mem.ptr4 wasmer_backend_api.client5 wasmer_cli.commands6 wasmer_cli.config.env7 wasmer_config.package.package_source8 wasmer_journal.entry9 wasmer_types.entity.primary_map10 wasmer_types.features11 wasmer_types.indexes12 wasmer_types.progress13 wasmer_types.target14 wasmer_types.units15 wasmer.backend.js.entities.engine16 wasmer.entities.exports17 wasmer_cli.commands.app.util18 wasmer_types.types19 wasmer_vm.store20 wasmer_wasix_types.wasi.wasix_manual21 wasmer.backend.js.entities.memory22 wasmer.entities.store.store_ref23 wasmer.entities.value24 wasmer_compiler_singlepass.machine25 wasmer_types.module26 wasmer_wasix_types.wasi.bindings27 wasmer.backend.js.entities.function.env28 wasmer.entities.external29 wasmer_vm.instance30 wasmer_wasix.fs31 wasmer_wasix.os.task.thread32 wasmer.backend.js.vm.external33 wasmer.entities.imports34 wasmer_compiler.engine.artifact35 wasmer.backend.js.entities.function36 wasmer.backend.js.entities.module37 wasmer.backend.js.entities.instance38 wasmer_wasix.runtime39 wasmer_wasix.state.env40 wasmer_wasix.state.linker.instance_groupvirtual_fs1wasmer.backend.js.entities.store.obj2wasmer.utils.mem.ptr3wasmer_backend_api.client4wasmer_cli.commands5wasmer_cli.config.env6wasmer_config.package.package_source7wasmer_journal.entry8wasmer_types.entity.primary_map9wasmer_types.features10wasmer_types.indexes11wasmer_types.progress12wasmer_types.target13wasmer_types.units14wasmer.backend.js.entities.engine15wasmer.entities.exports16wasmer_cli.commands.app.util17wasmer_types.types18wasmer_vm.store19wasmer_wasix_types.wasi.wasix_manual20wasmer.backend.js.entities.memory21wasmer.entities.store.store_ref22wasmer.entities.value23wasmer_compiler_singlepass.machine24wasmer_types.module25wasmer_wasix_types.wasi.bindings26wasmer.backend.js.entities.function.env27wasmer.entities.external28wasmer_vm.instance29wasmer_wasix.fs30wasmer_wasix.os.task.thread31wasmer.backend.js.vm.external32wasmer.entities.imports33wasmer_compiler.engine.artifact34wasmer.backend.js.entities.function35wasmer.backend.js.entities.module36wasmer.backend.js.entities.instance37wasmer_wasix.runtime38wasmer_wasix.state.env39wasmer_wasix.state.linker.instance_group40111321119211321122122122112101111114115341812112111322111121311111121211114675761111124112111113+768 more modules (most-connected shown)

At a glance — Code Health · 61% · Adequate · gated by X4 ·

At a glance — Architecture · 87% · Strong ·

At a glance — Maturity · 64% · Adequate ·

At a glance — Readiness · 76% · Strong ·

At a glance — Security · 35% · Weak · gated by D29, D36, C2 ·

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

At a glance — Accessibility · 38% · Weak · gated by AC1, AC3 ·

At a glance — Performance · 94% · 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 — Injection149High / Critical
A03:2025 — Software Supply Chain Failures26Medium
A02:2025 — Security Misconfiguration9High / Critical

Roadmap

Top priorities: Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do; Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video; Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.

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

Do thisHelpsEffortDimension
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.+8.3 ptsMediumAccess Controls
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+5.8 ptsMediumText alternatives
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+3.6 ptsMediumPage structure
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.+3.2 ptsMediumWeb-Security Posture
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with generate-core-schemas.rs.+1.6 ptsLowADR Quality
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+2.7 ptsMediumForms & labels
Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED, REDACTED.+1.1 ptsLowStatic Analysis (SAST)
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED, REDACTED.+1.1 ptsLowStatic Analysis (SAST)

File quality

Per-file score 0–10 — a quality signature. Of 390 files carrying findings, judged against the Production bar: 3% slop · 62% mixed · 35% near-clean.

FileScoreBandWorst signal
REDACTED0.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.7SlopStatic Analysis (SAST): High: REDACTED
lib/compiler-llvm/src/translator/code.rs1.5SlopChange Coupling: Boundary-crossing change coupling: code.rs ↔ tunables.rs
REDACTED1.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
lib/compiler/src/translator/environ.rs4.7MixedChange Coupling: Boundary-crossing change coupling: environ.rs ↔ mod.rs
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedDependency Vulnerabilities: Medium advisory (unmaintained): REDACTED
lib/compiler-singlepass/src/machine_arm64.rs5.5MixedCyclomatic Complexity: MachineARM64::location_to_reg (cyclomatic 32)
lib/virtual-net/src/client.rs5.5MixedCyclomatic Complexity: RemoteNetworkingClientDriver::poll (cyclomatic 28)
lib/c-api-imports/src/lib.rs5.5MixedGod Classes: FileTooLong: src/lib.rs
lib/api/src/backend/js/entities/function/mod.rs5.5MixedGod Classes: FileTooLong: function/mod.rs
lib/api/src/backend/js/entities/module.rs5.5MixedCyclomatic Complexity: Module::annotate_table_functions (cyclomatic 17)

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

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

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

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

Could not be resolved — 12

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 57 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 57 dimensions across the health lenses
D1D2D3D4D5D6D12D13D14D15D16D17D19D20D23D26D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC6AX10AX3AX4AX8AX9C2ES1ES2M1M2M3M4P1P10P2P3P4P6PF1PF3S1X1X14X21X28X30X4

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, 2576 of 2615 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1d8cc-d2ea-7c04-990d-d8cbd5c30d46.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs) and this repository declares a Cargo test suite (repository root, 263 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated 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.
  • D23 Boundary Type-Coupling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind measured 0/40 valid on a seeded held-out sample of its rows on 98 C# repositories (docs/plans/deterministic-engine/adjudication/P5c-D23-units.md, "Version 1 ON MAIN"): the noise rows were dependencies on layer folders, shared cores and grouping folders read as contexts. By the pre-registered fallback (PREREGISTRATION v37) it publishes no row until version 4 passes its gate. The candidates are counted here, not reported as findings, and the score does not include them.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — 30 | ENV PATH="/root/.cargo/bin:${PATH}" 31 | >>> RUN rustup -v toolchain install 1.99 32 | # add docker the manual way 33 | COPY install_docker.sh / -------------------- ERROR: failed to solve: process "/bin/sh -c rustup -v toolchain install 1.99" did not complete successfully: exit code: 127; runtime evidence skipped.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 361 further occurrence(s) are not listed individually; the score already reflects all 401.
  • X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, 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: 2 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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 Complexity4.5 / 10Weak✓ 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 4.5 / 10 · rule-coverage 100% · ceiling Prevented

85 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was wasmer_compiler_cranelift::translator::code_translator::translate_operator at 403. A further 57 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 wasmer_parser_operator_t::from at 528 — they are counted neither in the figure above nor in this dimension's score. 20 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: lib/c-api/src/wasm_c_api/unstable/parser/operator.rs (wasmer_parser_operator_t::from at 528), lib/wasi-types/src/wasi/bindings.rs (SockProto::from_native at 265), lib/wasix/src/os/posix_err.rs (wasmer_wasix::os::posix_err::exit_code_to_message at 126), lib/types/src/libcalls.rs (LibCall::to_function_name at 89), lib/vm/src/libcalls.rs (wasmer_vm::libcalls::function_pointer at 89), and 15 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.

wasmer_wasix::syscalls::wasix::path_open2::path_open_internal_with_symlink_depth (cyclomatic 68) · ×10lib/wasix/src/syscalls/wasix/path_open2.rs:186
LLVMFunctionCodeGenerator::translate_integer_arithmetic_operator (cyclomatic 118) · ×7lib/compiler-llvm/src/translator/code.rs:3972
InodeSocket::bind_internal (cyclomatic 28) · ×6lib/wasix/src/net/socket.rs:309
wasmer_compiler_cranelift::translator::code_translator::translate_operator (cyclomatic 403) · ×4lib/compiler-cranelift/src/translator/code_translator.rs:159
FuncGen::feed_operator (cyclomatic 360) · ×2lib/compiler-singlepass/src/codegen.rs:1219

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

What to do

  1. Bring the 3 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with wasmer_compiler_cranelift::translator::code_translator::translate_operator (cyclomatic 403), FuncGen::feed_operator (cyclomatic 360), RemoteNetworkingServerDriver::process_socket (cyclomatic 125). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 4.5 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D2 · Cognitive Complexity5.2 / 10Adequate✓ 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 5.2 / 10 · rule-coverage 100% · ceiling Prevented

154 method(s) exceeded the cognitive complexity threshold of 15; the worst was FuncGen::feed_operator at 212.

wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal (cognitive 128) · ×22lib/wasix/src/syscalls/wasi/fd_write.rs:243
LLVMFunctionCodeGenerator::translate_basic_operator (cognitive 89) · ×6lib/compiler-llvm/src/translator/code.rs:3154
wasmer_compiler_cranelift::translator::code_translator::translate_operator (cognitive 87) · ×6lib/compiler-cranelift/src/translator/code_translator.rs:159
wasmer_compiler::object::module::emit_compilation (cognitive 39) · ×6lib/compiler/src/object/module.rs:154
InodeSocket::bind_internal (cognitive 53) · ×5lib/wasix/src/net/socket.rs:309

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cognitive Complexity — start with FuncGen::feed_operator (cognitive 212), JournalSyscallPlayer::play_event (cognitive 137), wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal (cognitive 128). — 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 4 together lifts Cognitive Complexity from 5.2 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes8.1 / 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.1 / 10 · rule-coverage 100% · ceiling Prevented

232 god class(es) detected.

MethodTooLong: FuncGen.feed_operator · ×74lib/compiler-singlepass/src/codegen.rs:1219
FileTooLong: translator/code.rs · ×64lib/compiler-llvm/src/translator/code.rs
FunctionTooLong: wasmer_compiler_cranelift::translator::code_translator::translate_operator · ×39lib/compiler-cranelift/src/translator/code_translator.rs:159
ClassTooLong: LLVMFunctionCodeGenerator · ×36lib/compiler-llvm/src/translator/code.rs:2454
TooManyMethods: TypedFunction · ×17lib/api/src/utils/native/typed_func.rs:23

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

What to do

  1. Resolve the 74 MethodTooLong finding(s) in God Classes — start with code.rs (14), mod.rs (5), machine_arm64.rs (4). — One of this dimension's main actionable groups (74 warning-level).
  2. Resolve the 64 FileTooLong finding(s) in God Classes — start with mod.rs (10), lib.rs (3), compiler.rs (2). — One of this dimension's main actionable groups (64 warning-level).
  3. Resolve the 39 FunctionTooLong finding(s) in God Classes — start with emitter_arm64.rs (3), emitter_riscv.rs (3), code_translator.rs (2). — One of this dimension's main actionable groups (39 warning-level).

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

D4 · Code Duplication4.8 / 10Weak✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

860 duplicated block group(s) detected. 12.9 % of the production lines (35,539 of 275,576) are in a reported copy. A further 393 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 5 of the 1253 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (5 lines × 2) · ×57lib/cli/src/commands/app/deploy.rs:1115
Duplicated block (10 lines × 2) · ×49lib/api/src/backend/js/entities/function/mod.rs:379
Duplicated block (7 lines × 2) · ×48lib/api/src/backend/js/entities/function/typed.rs:172
Duplicated block (9 lines × 2) · ×47lib/api/src/backend/sys/entities/function/mod.rs:74
Duplicated block (6 lines × 2) · ×38lib/api/src/backend/js/entities/module.rs:409

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

What to do

  1. Resolve the 57 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with code.rs (11), arc_box_file.rs (10), machine_arm64.rs (6). — One of this dimension's main actionable groups (57 warning-level).
  2. Resolve the 49 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with code.rs (9), machine_x64.rs (7), machine_arm64.rs (6). — One of this dimension's main actionable groups (49 warning-level).
  3. Resolve the 48 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with machine_arm64.rs (4), mod.rs (4), code.rs (3). — One of this dimension's main actionable groups (48 warning-level).

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

D5 · Coupling8.6 / 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.6 / 10 · rule-coverage 100% · ceiling Prevented

30 production modules (Cargo), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 4 module(s) off the main sequence, with abstractness counted on 24 of the 30 (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: wasmer-config · ×4
Unstable project wasmer-journal

What to do

  1. Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
  2. Resolve the 1 Unstable project wasmer-journal finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

D6 · Cohesion (LCOM4)9.2 / 10Stronggated by 29 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.2 / 10 · rule-coverage 100% · ceiling Verified

29 of 412 classes have LCOM4 above 3.

Low cohesion: AssemblerX64 (LCOM4 64) · ×29lib/compiler-singlepass/src/machine_x64.rs:39

What to do

  1. Resolve the 29 Low cohesion finding(s) in Cohesion (LCOM4) — start with mod.rs (7), module.rs (3), table.rs (3). — One of this dimension's main actionable groups (29 warning-level).

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

D12 · Dependency Hygiene9.3 9.3 / 10Exemplary✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 99% · ceiling Verified

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

Outdated: cc · ×14

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.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 781 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.9 / 10Strong✓ 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 8.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: lib/compiler-singlepass/src/codegen.rs (12×360=4320); lib/compiler-cranelift/src/translator/code_translator.rs (4×403=1612); lib/compiler-llvm/src/translator/code.rs (16×56=896) Repeated repair below the complexity floor: lib/wasix/src/bin_factory/mod.rs (7 of 10 changes were fixes); lib/compiler-singlepass/src/machine_x64.rs (5 of 7 changes were fixes); lib/compiler-cranelift/src/func_environ.rs (4 of 6 changes were fixes)

Hotspot: lib/compiler-singlepass/src/codegen.rs · ×18lib/compiler-singlepass/src/codegen.rs:1219
Repeated repair: lib/wasix/src/bin_factory/mod.rs · ×13lib/wasix/src/bin_factory/mod.rs:209

What to do

  1. Resolve the 18 Hotspot finding(s) in Churn × Complexity Hotspots — start with compiler.rs (3), codegen.rs, code_translator.rs. — One of this dimension's main actionable groups (18 warning-level).
  2. Resolve the 13 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (3), machine_x64.rs, func_environ.rs. — One of this dimension's main actionable groups (13 warning-level).

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

D16 · Bus Factor9.0 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

59 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is lib/compiler-singlepass/src/machine_x64.rs. Counted over 568 of the 970 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

What to do

  1. Resolve the 4 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (4 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.7 / 10Stronggated by 399 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.7 / 10 · rule-coverage 100% · ceiling Prevented

399 deducted task-comment markers across 275576 LoC (0.1/KLoC) → score 9.7. 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 · ×348tests/lib/wast/src/wast.rs:409
FixmeComment · ×39tests/integration/cli/tests/snapshot.rs:960
HackComment · ×12lib/wasix/src/state/linker/linker_state.rs:39

What to do

  1. Resolve the 348 TodoComment finding(s) in Explicit Debt — start with bindings.rs (55), mod.rs (51), bindings_manual.rs (15). — One of this dimension's main actionable groups (348 warning-level).
  2. Resolve the 39 FixmeComment finding(s) in Explicit Debt — start with mod.rs (4), compiler_builtins.rs (4), func_env.rs (3). — One of this dimension's main actionable groups (39 warning-level).
  3. Resolve the 12 HackComment finding(s) in Explicit Debt — start with mod.rs (2), linker_state.rs, load_package_tree.rs. — One of this dimension's main actionable groups (12 warning-level).

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. 54 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: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundlib/config/src/bin/generate-core-schemas.rs:1

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with generate-core-schemas.rs. — 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.

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

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

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

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

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

482 domain type(s) cross context boundaries across 3 contexts; they are measured and withheld (not published, not scored). Contexts: api, types, wasix.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D26 · Project Cohesion5.5 / 10Adequate✓ Tool-verified

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

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

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

6 of 26 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)0.0 / 10Critical✓ Tool-verified

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

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

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

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

149 finding(s): 0 critical, 137 high, 12 medium, 0 low. 91 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) — `REDACTED` (line 55, line 56, line 57, …), `REDACTED` (line 12), `lib/c-api/examples/early-exit.c`, `REDACTED` (line 11), `lib/c-api/examples/wasi.c` (line 105), … (+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. Separately, one or more rules could not re-parse an embedded snippet in 6 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D30 · Dependency Vulnerabilities9.2 / 10Stronggated by 4 serious findings✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security7.7 / 10Adequategated by 6 critical findings✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness7.6 / 10Adequategated by 5 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 7.6 / 10 · rule-coverage 100% · ceiling Documented

133 of 568 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is lib/journal/src/concrete/archived.rs. Counted over 568 of the 970 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×5lib/journal/src/concrete/archived.rs:1
Orphaned file · ×128lib/journal/src/concrete/log_file.rs:1
Further orphaned files (smaller)

What to do

  1. Resolve the 128 Orphaned file finding(s) in Knowledge Freshness — start with mod.rs (8), instance.rs (5), inner.rs (4). — One of this dimension's main actionable groups (128 recommendation-level).
  2. Resolve the 5 Orphaned knowledge finding(s) in Knowledge Freshness — start with archived.rs, play_event.rs, operator.rs. — One of this dimension's main actionable groups (5 issue-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.6 / 10Adequategated by 2 critical 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.6 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: filesystem_source.rs↔web_source.rs 82%; sock_send.rs↔sock_send_to.rs 77%; proc_fork.rs↔stack_checkpoint.rs 77%

Boundary-crossing change coupling: environ.rs ↔ mod.rs · ×2lib/compiler/src/translator/environ.rs:1
Change coupling: filesystem_source.rs ↔ web_source.rs · ×17lib/wasix/src/runtime/resolver/filesystem_source.rs:1
Change-coupling hub: proc_fork.rs → proc_exit.rs, stack_checkpoint.rs, thread_spawn.rs · ×3lib/wasix/src/syscalls/wasix/proc_fork.rs

What to do

  1. Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with environ.rs, code.rs. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 17 Change coupling finding(s) in Change Coupling — start with exec.rs (2), filesystem_source.rs, sock_send.rs. — One of this dimension's main actionable groups (17 warning-level).
  3. Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with proc_fork.rs, fd_write.rs, mod.rs. — One of this dimension's main actionable groups (3 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (docs/SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives1.0 / 10Critical✓ Tool-verified

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

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

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

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×2) — lib/cli/src/utils/package_wizard/templates/static-site/index.html:422, lib/cli/src/utils/package_wizard/templates/static-site/index.html:442

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels4.8 / 10Weak✓ Tool-verified

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

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

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

  • A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. — lib/cli/src/utils/package_wizard/templates/static-site/index.html:332

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure3.5 / 10Weak✓ Tool-verified

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

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

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

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — lib/cli/src/utils/package_wizard/templates/static-site/index.html:1
  • user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. — lib/cli/src/utils/package_wizard/templates/static-site/index.html:3

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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 isolation7.5 / 10Strong✓ 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.

  • `wasmer-workspace` (production) references the test project `test-generator`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.

What to do

  • Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
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.

C2 · Access Controls0.0 / 10Critical✓ Tool-verified

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

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

  • This repository serves requests — a server (.serve_connection) (lib/cli/src/commands/auth/login/mod.rs:131) — and no route guard, auth-gate middleware, global guard or imperative check that refuses a caller (401/403, an Unauthorized/Forbidden error) was found: its endpoints may be unprotected. — lib/cli/src/commands/auth/login/mod.rs:131

What to do

  • Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
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)9.3 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

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 repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy4.0 / 10Weak✓ Tool-verified

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

  • lib/c-api/README.md links to `./wasmer.hh`, but `lib/c-api/wasmer.hh` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — lib/c-api/README.md:202
  • lib/config/README.md links to `.github/workflows/release-please.yml`, but `lib/config/.github/workflows/release-please.yml` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — lib/config/README.md:17
  • lib/wasix/tests/wasm_tests/README.md links to `../wasm_tests.rs`, but `lib/wasix/tests/wasm_tests.rs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — lib/wasix/tests/wasm_tests/README.md:31

What to do

  • Reconcile the README with reality: lib/c-api/README.md links to `./wasmer.hh`, but `lib/c-api/wasmer.hh` does not exist; lib/config/README.md links to `.github/workflows/release-please.yml`, but `lib/config/.github/workflows/release-please.yml` does not exist; lib/wasix/tests/wasm_tests/README.md links to `../wasm_tests.rs`, but `lib/wasix/tests/wasm_tests.rs` does not exist.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

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

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

P2 · Observability6.6 / 10Adequate✓ 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 15/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `lib/config`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling6.0 / 10Adequate✓ Tool-verified

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

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

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

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

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

P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

PF1 · Benchmark discipline9.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

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

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

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

S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

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

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

  • This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `.serve_connection(` (lib/cli/src/commands/auth/login/mod.rs:131).
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `.serve_connection(` (lib/cli/src/commands/auth/login/mod.rs:131).

What to do

  • Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
  • Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
X1 · Async correctness8.0 / 10Strong✓ Tool-verified

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.

  • This `async` body is polled on an executor's worker thread, and `std::thread::sleep` blocks that thread: for the whole delay no other task scheduled on it makes progress — the Rust form of blocking on a task. Use `tokio::time::sleep(…).await` (or the runtime's own timer), which suspends only this task. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the executor with `tokio::task::spawn_blocking(…).await`. — lib/backend-api/src/query.rs:2356

What to do

  • Blocking `thread::sleep` inside an `async` body
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.

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.

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.

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

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

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

X4 · Structured logging4.0 / 10Weak✓ Tool-verified

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

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

  • `warn!` at line 44 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/utils/mod.rs:44
  • `debug!` at line 408 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:408
  • `trace!` at line 486 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:486
  • `warn!` at line 795 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:795
  • `warn!` at line 828 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:828
  • `warn!` at line 841 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:841
  • `trace!` at line 1126 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:1126
  • `warn!` at line 1230 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:1230
  • `trace!` at line 1256 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:1256
  • `trace!` at line 1269 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:1269
  • `warn!` at line 1375 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:1375
  • `warn!` at line 1496 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:1496
  • `trace!` at line 1515 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/mod.rs:1515
  • `debug!` at line 41 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/windows.rs:41
  • `warn!` at line 21 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/callback_signal.rs:21
  • `error!` at line 25 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. (×2) — lib/wasix/src/syscalls/wasix/chdir.rs:25, lib/wasix/src/syscalls/wasix/closure_allocate.rs:25
  • `trace!` at line 23 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_create.rs:23
  • `trace!` at line 37 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_create.rs:37
  • `trace!` at line 40 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_destroy.rs:40
  • `trace!` at line 48 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_destroy.rs:48
  • `trace!` at line 62 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_destroy.rs:62
  • `trace!` at line 49 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_switch.rs:49
  • `trace!` at line 59 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_switch.rs:59
  • `trace!` at line 68 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_switch.rs:68
  • `trace!` at line 72 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_switch.rs:72
  • `trace!` at line 74 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/context_switch.rs:74
  • `error!` at line 29 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/epoll_create.rs:29
  • `error!` at line 56 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/epoll_ctl.rs:56
  • `trace!` at line 119 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/epoll_wait.rs:119
  • `warn!` at line 132 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/epoll_wait.rs:132
  • `error!` at line 34 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. (×2) — lib/wasix/src/syscalls/wasix/fd_dup2.rs:34, lib/wasix/src/syscalls/wasix/fd_pipe.rs:34
  • `error!` at line 27 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/fd_fdflags_set.rs:27
  • `trace!` at line 164 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/futex_wait.rs:164
  • `trace!` at line 39 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/futex_wake.rs:39
  • `trace!` at line 42 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/futex_wake.rs:42
  • `trace!` at line 33 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/futex_wake_all.rs:33
  • `trace!` at line 36 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/futex_wake_all.rs:36
  • `error!` at line 100 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/wasix/src/syscalls/wasix/path_open2.rs:100

What to do

  • Interpolated log message defeats structured logging

WCAG coverage — what static analysis assessed

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

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health61%Adequate — gated by X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture87%StrongSolid.
Maturity64%AdequateAcceptable, with room to improve.
Readiness76%StrongSolid.
Security35%Weak — gated by D29, D36, C2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Accessibility38%Weak — gated by AC1, AC3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance94%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.

  • X10 Duplicated predicate — 9 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 58 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.

  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript 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; 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. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • 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
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — 30 | ENV PATH="/root/.cargo/bin:${PATH}" 31 | >>> RUN rustup -v toolchain install 1.99 32 | # add docker the manual way 33 | COPY install_docker.sh / -------------------- ERROR: failed to solve: process "/bin/sh -c rustup -v toolchain install 1.99" did not complete successfully: exit code: 127; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~26632 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 3 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .py, .rs source were not judged.
  • 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.
  • 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.
  • 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.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — Rust suite
  • DM1 Domain Modelling — applicable but not scored (4 signals for this style, 3 needed — the count is met but a required primary signal is absent): 67 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 84 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one; a Domain/Aggregates/ValueObjects layer; a Rust domain-layer crate (a .../domain/ clean-architecture layer); a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • 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 JavaScript/TypeScript, 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X12 Unreachable branch — X12 reached only 1% of this repository's production lines — rust (274,185 lines), c (1,548 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — 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 — 156 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 66 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×5
  • Orphaned knowledge lib/journal/src/concrete/archived.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 lib/wasix/src/syscalls/journal/play_event.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 lib/c-api/src/wasm_c_api/unstable/parser/operator.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 lib/journal/src/entry.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 lib/cli/src/commands/init.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.
AC1 · Text alternatives · <img> without a text alternative · ×2
  • <img> without a text alternative lib/cli/src/utils/package_wizard/templates/static-site/index.html:422 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative lib/cli/src/utils/package_wizard/templates/static-site/index.html:442 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: environ.rs ↔ mod.rs lib/compiler/src/translator/environ.rs:1 — `lib/compiler/src/translator/environ.rs` (context compiler) and `lib/vm/src/instance/mod.rs` (context vm) sit in DIFFERENT parts of the tree yet change together 56% of the time (9 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `fbeb9a63` fix(vm): share module passive data across instances instead of deep-c…; `75c34bc1` feat: use hash-based signature checks for indirect calls (#6293); `3641981e` feat: support Extended constant expressions WA feature (#6242) — run `git show` on any of them.
  • Boundary-crossing change coupling: code.rs ↔ tunables.rs lib/compiler-llvm/src/translator/code.rs:1 — `lib/compiler-llvm/src/translator/code.rs` (context compiler-llvm) and `lib/compiler/src/engine/tunables.rs` (context compiler) sit in DIFFERENT parts of the tree yet change together 50% of the time (7 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9303735a` fix(Table): add resource allocation tracking for local Tables (#16); `aa495eb7` feat(MemoryStyle::static): adjust API and require mmap of 8GiB (#13) …; `eb0fcf69` feat(LLVM,Cranelift,Singlepass): fully support multi-memory WA propos… — run `git show` on any of them.
AC2 · Forms & labels · Link with no accessible name · ×1
  • Link with no accessible name lib/cli/src/utils/package_wizard/templates/static-site/index.html:332 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang lib/cli/src/utils/package_wizard/templates/static-site/index.html:1 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure · Viewport restricts zoom · ×1
  • Viewport restricts zoom lib/cli/src/utils/package_wizard/templates/static-site/index.html:3 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
AX8 · Test isolation · Production project references a test project · ×1
  • Production project references a test project: wasmer-workspace → test-generator — `wasmer-workspace` (production) references the test project `test-generator`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 2242 finding(s)
D17 · Explicit Debt · TodoComment · ×348
  • TodoComment tests/lib/wast/src/wast.rs:409 — // // TODO: when memory64 merges into the proper spec then this should be — 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 tests/integration/cli/tests/publish.rs:27 — // <-- 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 tests/integration/cli/tests/publish.rs:89 — // <-- 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 tests/integration/cli/tests/snapshot.rs:73 — // TODO: show hash of code? — 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 tests/integration/cli/tests/snapshot.rs:229 — // TODO: figure out why snapshot exit code is 79 on macos — 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 tests/integration/cli/tests/snapshot.rs:488 — // TODO: figure out why this hangs on Windows and Mac OS — 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 tests/compilers/issues.rs:461 — // TODO: the tests fails on RISC-V as the `j` instruction can reach only +- 1MiB offset. — 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 tests/compilers/issues.rs:479 — // TODO: the tests fails on RISC-V as the `j` instruction can reach only +- 1MiB offset. — 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 tests/compilers/issues.rs:770 — // TODO: V8 appears to handle this differently — 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 tests/compilers/traps.rs:122 — // TODO: Reenable this (disabled as it was not working with llvm/singlepass) — 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 tests/compilers/traps.rs:362 — // TODO: Reenable this (disabled as it was not working with llvm/singlepass) — 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 tests/compilers/wast.rs:113 — // TODO: remove once added for Cranelift — 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 lib/wasix/tests/wasm_tests/wasi_wast/path_rename.rs:52 — // TODO: add temp directory support for native execution... — 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 lib/wasix/tests/wasm_tests/wasi_wast/path_rename.rs:131 — // TODO: add temp directory support for native execution... — 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 lib/wasix/src/lib.rs:63 — // TODO: should this be pub? — 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 lib/wasix/src/lib.rs:65 — // TODO: should this be pub? — 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 lib/wasix/src/lib.rs:816 — // TODO: split function into two variants, one for JS and one for sys. — 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 lib/wasix/src/utils/thread_parker.rs:51 — // TODO: review allow... — 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 lib/wasix/src/state/mod.rs:92 — // TODO: review allow... — 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 lib/wasix/src/state/mod.rs:99 — // TODO: review allow... — 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 lib/wasix/src/state/mod.rs:107 — // TODO: review allow... — 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 lib/wasix/src/state/handles/mod.rs:55 — // TODO: review allow... — 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 lib/wasix/src/net/socket.rs:1836 — // TODO: review allow... — 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 lib/wasix/src/syscalls/mod.rs:260 — // TODO: remove allow once inodes are refactored (see comments on [`WasiState`]) — 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 lib/wasix/src/syscalls/wasi/fd_seek.rs:93 — // TODO: remove allow once inodes are refactored (see comments on [`WasiState`]) — 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.
  • + 323 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×74
  • MethodTooLong: FuncGen.feed_operator lib/compiler-singlepass/src/codegen.rs:1219 — MethodTooLong — feed_operator runs 3932 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 3832 over it, 39.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LLVMFunctionCodeGenerator.translate_integer_arithmetic_operator lib/compiler-llvm/src/translator/code.rs:3972 — MethodTooLong — translate_integer_arithmetic_operator runs 1702 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 1602 over it, 17.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LLVMFunctionCodeGenerator.translate_floating_point_arithmetic_operator lib/compiler-llvm/src/translator/code.rs:6087 — MethodTooLong — translate_floating_point_arithmetic_operator runs 1075 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 975 over it, 10.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LLVMFunctionCodeGenerator.translate_conversion_operator lib/compiler-llvm/src/translator/code.rs:8516 — MethodTooLong — translate_conversion_operator runs 976 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 876 over it, 9.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Intrinsics.declare lib/compiler-llvm/src/translator/intrinsics.rs:305 — MethodTooLong — declare runs 853 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 753 over it, 8.53× 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: LLVMFunctionCodeGenerator.translate_memory_operator lib/compiler-llvm/src/translator/code.rs:9812 — MethodTooLong — translate_memory_operator runs 831 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 731 over it, 8.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: JournalSyscallPlayer.play_event lib/wasix/src/syscalls/journal/play_event.rs:7 — MethodTooLong — play_event runs 709 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 609 over it, 7.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LLVMFunctionCodeGenerator.translate_basic_operator lib/compiler-llvm/src/translator/code.rs:3154 — MethodTooLong — translate_basic_operator runs 625 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 525 over it, 6.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: LLVMFunctionCodeGenerator.translate_integer_comparison_operator lib/compiler-llvm/src/translator/code.rs:7391 — MethodTooLong — translate_integer_comparison_operator runs 624 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 524 over it, 6.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: LLVMFunctionCodeGenerator.translate_operator lib/compiler-llvm/src/translator/code.rs:12218 — MethodTooLong — translate_operator runs 556 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 456 over it, 5.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SockProto.fmt lib/wasi-types/src/wasi/bindings.rs:1668 — MethodTooLong — fmt runs 548 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 448 over it, 5.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: wasmer_parser_operator_t.from lib/c-api/src/wasm_c_api/unstable/parser/operator.rs:543 — MethodTooLong — from runs 532 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 432 over it, 5.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LLVMFunctionCodeGenerator.translate_atomic_memory_operator lib/compiler-llvm/src/translator/code.rs:10827 — MethodTooLong — translate_atomic_memory_operator runs 527 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 427 over it, 5.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: JournalEntry.try_from lib/journal/src/concrete/archived_from.rs:654 — MethodTooLong — try_from runs 488 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 388 over it, 4.88× 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: JournalEntry.serialize_archive lib/journal/src/concrete/archived.rs:412 — MethodTooLong — serialize_archive runs 477 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 377 over it, 4.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CraneliftCompiler.compile_module_internal lib/compiler-cranelift/src/compiler.rs:107 — MethodTooLong — compile_module_internal runs 471 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 371 over it, 4.71× 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: LLVMFunctionCodeGenerator.translate_eh_operator lib/compiler-llvm/src/translator/code.rs:11625 — MethodTooLong — translate_eh_operator runs 378 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 278 over it, 3.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RemoteNetworkingServerDriver.process_socket lib/virtual-net/src/server.rs:860 — MethodTooLong — process_socket runs 346 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 246 over it, 3.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: JournalEntry.into_owned lib/journal/src/entry.rs:399 — MethodTooLong — into_owned runs 334 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 234 over it, 3.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FuncTranslator.translate_to_module lib/compiler-llvm/src/translator/code.rs:186 — MethodTooLong — translate_to_module runs 329 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 229 over it, 3.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: CmdAppDeploy.run_async lib/cli/src/commands/app/deploy.rs:565 — MethodTooLong — run_async runs 324 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 224 over it, 3.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: LLVMCompiler.compile_module lib/compiler-llvm/src/compiler.rs:248 — MethodTooLong — compile_module runs 304 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 204 over it, 3.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.
  • MethodTooLong: SinglepassCompiler.compile_module_internal lib/compiler-singlepass/src/compiler.rs:67 — MethodTooLong — compile_module_internal runs 304 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 204 over it, 3.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.
  • MethodTooLong: LLVMFunctionCodeGenerator.translate_control_flow_operator lib/compiler-llvm/src/translator/code.rs:2723 — MethodTooLong — translate_control_flow_operator runs 297 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 197 over it, 2.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Artifact.from_parts_with_module_file lib/compiler/src/engine/artifact.rs:476 — MethodTooLong — from_parts_with_module_file runs 281 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 181 over it, 2.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.
  • + 49 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×64
  • FileTooLong: translator/code.rs lib/compiler-llvm/src/translator/code.rs — FileTooLong — 10214 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: LLVMFunctionCodeGenerator (3 blocks, 709-12830). The bar is 500 significant lines; this is 9714 over it, 20.43× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/machine_arm64.rs lib/compiler-singlepass/src/machine_arm64.rs — FileTooLong — 7029 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: MachineARM64 (3 blocks, 36-8494). The bar is 500 significant lines; this is 6529 over it, 14.06× 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/machine_x64.rs lib/compiler-singlepass/src/machine_x64.rs — FileTooLong — 6836 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: MachineX86_64 (3 blocks, 94-8432). The bar is 500 significant lines; this is 6336 over it, 13.67× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/machine_riscv.rs lib/compiler-singlepass/src/machine_riscv.rs — FileTooLong — 5316 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: MachineRiscv (3 blocks, 76-6616). The bar is 500 significant lines; this is 4816 over it, 10.63× 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/codegen.rs lib/compiler-singlepass/src/codegen.rs — FileTooLong — 4825 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: FuncGen (2 blocks, 93-6223). The bar is 500 significant lines; this is 4325 over it, 9.65× 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: wasi/bindings.rs lib/wasi-types/src/wasi/bindings.rs — FileTooLong — 3281 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 2781 over it, 6.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: translator/code_translator.rs lib/compiler-cranelift/src/translator/code_translator.rs — FileTooLong — 2810 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 2310 over it, 5.62× 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/emitter_arm64.rs lib/compiler-singlepass/src/emitter_arm64.rs — FileTooLong — 2519 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 68% of them inside a single declaration: Assembler (504-2805). The bar is 500 significant lines; this is 2019 over it, 5.04× 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/types.rs lib/backend-api/src/types.rs — FileTooLong — 2367 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 1867 over it, 4.73× 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/machine.rs lib/compiler-singlepass/src/machine.rs — FileTooLong — 2139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: Machine (105-2352). The bar is 500 significant lines; this is 1639 over it, 4.28× 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/query.rs lib/backend-api/src/query.rs — FileTooLong — 1913 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 108 free functions. The bar is 500 significant lines; this is 1413 over it, 3.83× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: fs/mod.rs lib/wasix/src/fs/mod.rs — FileTooLong — 1912 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: WasiFs (3 blocks, 569-2896). The bar is 500 significant lines; this is 1412 over it, 3.82× 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: translator/intrinsics.rs lib/compiler-llvm/src/translator/intrinsics.rs — FileTooLong — 1780 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 1280 over it, 3.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/func_environ.rs lib/compiler-cranelift/src/func_environ.rs — FileTooLong — 1691 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: FuncEnvironment (3 blocks, 89-2428). The bar is 500 significant lines; this is 1191 over it, 3.38× 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/emitter_x64.rs lib/compiler-singlepass/src/emitter_x64.rs — FileTooLong — 1622 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: AssemblerX64 (800-2279). The bar is 500 significant lines; this is 1122 over it, 3.24× 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/emitter_riscv.rs lib/compiler-singlepass/src/emitter_riscv.rs — FileTooLong — 1606 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: Assembler (352-1748). The bar is 500 significant lines; this is 1106 over it, 3.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/lib.rs lib/c-api-imports/src/lib.rs — FileTooLong — 1595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 128 free functions. The bar is 500 significant lines; this is 1095 over it, 3.19× 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: concrete/archived.rs lib/journal/src/concrete/archived.rs — FileTooLong — 1592 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 1092 over it, 3.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: engine/artifact.rs lib/compiler/src/engine/artifact.rs — FileTooLong — 1391 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 82% of them inside a single declaration: Artifact (6 blocks, 159-1947). The bar is 500 significant lines; this is 891 over it, 2.78× 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: net/socket.rs lib/wasix/src/net/socket.rs — FileTooLong — 1365 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 78% of them inside a single declaration: InodeSocket (2 blocks, 237-1695). The bar is 500 significant lines; this is 865 over it, 2.73× 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/server.rs lib/virtual-net/src/server.rs — FileTooLong — 1220 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 720 over it, 2.44× 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/client.rs lib/virtual-net/src/client.rs — FileTooLong — 1184 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 684 over it, 2.37× 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: parser/operator.rs lib/c-api/src/wasm_c_api/unstable/parser/operator.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 100% of them inside a single declaration: wasmer_parser_operator_t (2 blocks, 5-1080). 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: syscalls/mod.rs lib/wasix/src/syscalls/mod.rs — FileTooLong — 1047 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 47 free functions. The bar is 500 significant lines; this is 547 over it, 2.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: instance/mod.rs lib/vm/src/instance/mod.rs — FileTooLong — 1001 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 501 over it, 2.00× 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.
  • + 39 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×57
  • Duplicated block (5 lines × 2) lib/cli/src/commands/app/deploy.rs:1115 — lib/cli/src/commands/app/deploy.rs:1115-1119 | lib/cli/src/commands/run/wasi.rs:301-305 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/deploy.rs:1115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) lib/compiler-cranelift/src/translator/code_translator.rs:217 — lib/compiler-cranelift/src/translator/code_translator.rs:217-221 | lib/compiler-cranelift/src/translator/code_translator.rs:235-239 — both copies are in the same file, so extract the block into 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) lib/compiler-cranelift/src/translator/code_translator.rs:1692 — lib/compiler-cranelift/src/translator/code_translator.rs:1692-1696 | lib/compiler-cranelift/src/translator/code_translator.rs:1700-1704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) lib/compiler-cranelift/src/translator/code_translator.rs:2140 — lib/compiler-cranelift/src/translator/code_translator.rs:2140-2144 | lib/compiler-cranelift/src/translator/code_translator.rs:2149-2153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-cranelift/src/translator/code_translator.rs:2154` calls `ins`, `fneg` and `lib/compiler-cranelift/src/translator/code_translator.rs:2145` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/code.rs:2823 — lib/compiler-llvm/src/translator/code.rs:2823-2830 | lib/compiler-llvm/src/translator/code.rs:2852-2856 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:2823` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/code.rs:5050 — lib/compiler-llvm/src/translator/code.rs:5050-5054 | lib/compiler-llvm/src/translator/code.rs:10415-10419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-llvm/src/translator/code.rs:5055` calls `v128_into_i8x16` and `lib/compiler-llvm/src/translator/code.rs:10420` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/code.rs:7353 — lib/compiler-llvm/src/translator/code.rs:7353-7357 | lib/compiler-llvm/src/translator/code.rs:7369-7373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7353` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/code.rs:9964 — lib/compiler-llvm/src/translator/code.rs:9964-9968 | lib/compiler-llvm/src/translator/code.rs:9986-9990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9964` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/code.rs:9975 — lib/compiler-llvm/src/translator/code.rs:9975-9979 | lib/compiler-llvm/src/translator/code.rs:9997-10001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9975` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/code.rs:10020 — lib/compiler-llvm/src/translator/code.rs:10020-10024 | lib/compiler-llvm/src/translator/code.rs:10042-10046 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:10020` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/code.rs:10031 — lib/compiler-llvm/src/translator/code.rs:10031-10035 | lib/compiler-llvm/src/translator/code.rs:10053-10057 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:10031` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/code.rs:10064 — lib/compiler-llvm/src/translator/code.rs:10064-10068 | lib/compiler-llvm/src/translator/code.rs:10640-10644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:10064` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/intrinsics.rs:413 — lib/compiler-llvm/src/translator/intrinsics.rs:413-418 | lib/compiler-llvm/src/translator/intrinsics.rs:428-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/intrinsics.rs:413` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) lib/compiler-llvm/src/translator/intrinsics.rs:1608 — lib/compiler-llvm/src/translator/intrinsics.rs:1608-1612 | lib/compiler-llvm/src/translator/intrinsics.rs:1644-1648 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/codegen.rs:1742 — lib/compiler-singlepass/src/codegen.rs:1742-1746 | lib/compiler-singlepass/src/codegen.rs:1781-1786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:1742` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:895 — lib/compiler-singlepass/src/machine_arm64.rs:895-899 | lib/compiler-singlepass/src/machine_x64.rs:347-351 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:895` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:900 — lib/compiler-singlepass/src/machine_arm64.rs:900-904 | lib/compiler-singlepass/src/machine_arm64.rs:928-932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:900` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:923 — lib/compiler-singlepass/src/machine_arm64.rs:923-927 | lib/compiler-singlepass/src/machine_x64.rs:424-428 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:923` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:3037 — lib/compiler-singlepass/src/machine_riscv.rs:3037-3041 | lib/compiler-singlepass/src/machine_riscv.rs:4361-4365 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:3136 — lib/compiler-singlepass/src/machine_x64.rs:3136-3140 | lib/compiler-singlepass/src/machine_x64.rs:4919-4923 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler/src/engine/artifact.rs:562 — lib/compiler/src/engine/artifact.rs:562-566 | lib/compiler/src/engine/artifact.rs:582-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/artifact.rs:562` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/compiler/src/engine/link.rs:131 — lib/compiler/src/engine/link.rs:131-135 | lib/compiler/src/engine/link.rs:187-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) lib/virtual-fs/src/mem_fs/file.rs:1115 — lib/virtual-fs/src/mem_fs/file.rs:1115-1119 | lib/virtual-fs/src/mem_fs/file.rs:1127-1131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) lib/virtual-net/src/tcp_pair.rs:310 — lib/virtual-net/src/tcp_pair.rs:310-314 | lib/virtual-net/src/tcp_pair.rs:554-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/tcp_pair.rs:310` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) lib/wasix/src/net/mod.rs:76 — lib/wasix/src/net/mod.rs:76-80 | lib/wasix/src/net/mod.rs:331-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/mod.rs:76` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • + 32 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×49
  • Duplicated block (10 lines × 2) lib/api/src/backend/js/entities/function/mod.rs:379 — lib/api/src/backend/js/entities/function/mod.rs:379-388 | lib/api/src/backend/js/entities/function/mod.rs:411-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) lib/api/src/backend/v8/entities/function/mod.rs:169 — lib/api/src/backend/v8/entities/function/mod.rs:169-178 | lib/api/src/backend/v8/entities/function/mod.rs:245-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/function/mod.rs:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/cli/src/backend.rs:623 — lib/cli/src/backend.rs:623-632 | lib/cli/src/backend.rs:662-671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/backend.rs:623` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/cli/src/commands/app/util.rs:165 — lib/cli/src/commands/app/util.rs:165-174 | lib/cli/src/commands/app/util.rs:191-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) lib/cli/src/commands/init.rs:202 — lib/cli/src/commands/init.rs:202-212 | lib/cli/src/commands/init.rs:220-229 — both copies are in the same file, so extract the block into 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) lib/compiler-cranelift/src/elf.rs:263 — lib/compiler-cranelift/src/elf.rs:263-272 | lib/compiler-singlepass/src/elf.rs:49-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/elf.rs:263` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) lib/compiler-cranelift/src/func_environ.rs:743 — lib/compiler-cranelift/src/func_environ.rs:743-752 | lib/compiler-cranelift/src/func_environ.rs:873-882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:743` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-llvm/src/translator/code.rs:1487 — lib/compiler-llvm/src/translator/code.rs:1487-1496 | lib/compiler-llvm/src/translator/code.rs:1568-1577 — both copies are in the same file, so extract the block into 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) lib/compiler-llvm/src/translator/code.rs:6680 — lib/compiler-llvm/src/translator/code.rs:6680-6689 | lib/compiler-llvm/src/translator/code.rs:6850-6859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6680` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-llvm/src/translator/code.rs:6703 — lib/compiler-llvm/src/translator/code.rs:6703-6712 | lib/compiler-llvm/src/translator/code.rs:6873-6882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6703` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-llvm/src/translator/code.rs:7274 — lib/compiler-llvm/src/translator/code.rs:7274-7283 | lib/compiler-llvm/src/translator/code.rs:7294-7303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/codegen.rs:3193 — lib/compiler-singlepass/src/codegen.rs:3193-3202 | lib/compiler-singlepass/src/codegen.rs:3492-3501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:3193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:223 — lib/compiler-singlepass/src/machine_arm64.rs:223-232 | lib/compiler-singlepass/src/machine_arm64.rs:242-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2590 — lib/compiler-singlepass/src/machine_arm64.rs:2590-2599 | lib/compiler-singlepass/src/machine_riscv.rs:2993-3002 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2590` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2671 — lib/compiler-singlepass/src/machine_arm64.rs:2671-2680 | lib/compiler-singlepass/src/machine_arm64.rs:2709-2718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2671` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:4773 — lib/compiler-singlepass/src/machine_arm64.rs:4773-4782 | lib/compiler-singlepass/src/machine_riscv.rs:4316-4325 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4773` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:4854 — lib/compiler-singlepass/src/machine_arm64.rs:4854-4863 | lib/compiler-singlepass/src/machine_arm64.rs:4892-4901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4854` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:4877 — lib/compiler-singlepass/src/machine_arm64.rs:4877-4886 | lib/compiler-singlepass/src/machine_arm64.rs:5100-5109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4877` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:2818 — lib/compiler-singlepass/src/machine_x64.rs:2818-2827 | lib/compiler-singlepass/src/machine_x64.rs:2884-2893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_x64.rs:2896` calls `emit_label` and `lib/compiler-singlepass/src/machine_x64.rs:2829` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:3021 — lib/compiler-singlepass/src/machine_x64.rs:3021-3030 | lib/compiler-singlepass/src/machine_x64.rs:3076-3085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3021` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4601 — lib/compiler-singlepass/src/machine_x64.rs:4601-4610 | lib/compiler-singlepass/src/machine_x64.rs:4667-4676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_x64.rs:4679` calls `emit_label` and `lib/compiler-singlepass/src/machine_x64.rs:4612` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4804 — lib/compiler-singlepass/src/machine_x64.rs:4804-4813 | lib/compiler-singlepass/src/machine_x64.rs:4859-4868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4804` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4847 — lib/compiler-singlepass/src/machine_x64.rs:4847-4856 | lib/compiler-singlepass/src/machine_x64.rs:4901-4910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4847` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/compiler/src/engine/artifact.rs:192 — lib/compiler/src/engine/artifact.rs:192-201 | lib/compiler/src/engine/artifact.rs:1579-1588 — both copies are in the same file, so extract the block into 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) lib/compiler/src/engine/inner.rs:79 — lib/compiler/src/engine/inner.rs:79-88 | lib/compiler/src/engine/inner.rs:154-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/inner.rs:79` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×48
  • Duplicated block (7 lines × 2) lib/api/src/backend/js/entities/function/typed.rs:172 — lib/api/src/backend/js/entities/function/typed.rs:172-179 | lib/api/src/backend/sys/entities/function/typed.rs:311-317 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) lib/api/src/backend/v8/entities/module.rs:42 — lib/api/src/backend/v8/entities/module.rs:42-48 | lib/api/src/backend/v8/entities/module.rs:74-80 — both copies are in the same file, so extract the block into 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) lib/api/src/utils/polyfill.rs:802 — lib/api/src/utils/polyfill.rs:802-808 | lib/compiler/src/translator/sections.rs:420-426 — before extracting anything, compare `lib/api/src/utils/polyfill.rs` and `lib/compiler/src/translator/sections.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) lib/c-api/src/wasm_c_api/types/frame.rs:64 — lib/c-api/src/wasm_c_api/types/frame.rs:64-70 | lib/c-api/src/wasm_c_api/types/frame.rs:77-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/c-api/src/wasm_c_api/types/frame.rs:64` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/compiler-cranelift/src/compiler.rs:140 — lib/compiler-cranelift/src/compiler.rs:140-149 | lib/compiler-singlepass/src/compiler.rs:106-112 — before extracting anything, compare `lib/compiler-cranelift/src/compiler.rs` and `lib/compiler-singlepass/src/compiler.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) lib/compiler-cranelift/src/eh.rs:550 — lib/compiler-cranelift/src/eh.rs:550-556 | lib/compiler-cranelift/src/eh.rs:575-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/eh.rs:550` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/compiler-cranelift/src/elf.rs:101 — lib/compiler-cranelift/src/elf.rs:101-107 | lib/compiler/src/dwarf.rs:117-123 — before extracting anything, compare `lib/compiler-cranelift/src/elf.rs` and `lib/compiler/src/dwarf.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/elf.rs:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/compiler-cranelift/src/func_environ.rs:1164 — lib/compiler-cranelift/src/func_environ.rs:1164-1170 | lib/compiler-cranelift/src/func_environ.rs:1655-1661 — both copies are in the same file, so extract the block into 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) lib/compiler-cranelift/src/func_environ.rs:1184 — lib/compiler-cranelift/src/func_environ.rs:1184-1190 | lib/compiler-cranelift/src/func_environ.rs:1251-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:1184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/compiler-llvm/src/translator/code.rs:1797 — lib/compiler-llvm/src/translator/code.rs:1797-1803 | lib/compiler-llvm/src/translator/code.rs:6034-6040 — both copies are in the same file, so extract the block into 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) lib/compiler-llvm/src/translator/code.rs:4453 — lib/compiler-llvm/src/translator/code.rs:4453-4459 | lib/compiler-llvm/src/translator/code.rs:4463-4469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4453` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/compiler-llvm/src/translator/code.rs:8776 — lib/compiler-llvm/src/translator/code.rs:8776-8782 | lib/compiler-llvm/src/translator/code.rs:9610-9616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8776` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) lib/compiler-singlepass/src/codegen.rs:2693 — lib/compiler-singlepass/src/codegen.rs:2693-2700 | lib/compiler-singlepass/src/codegen.rs:2703-2709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:2693` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/compiler-singlepass/src/elf.rs:45 — lib/compiler-singlepass/src/elf.rs:45-51 | lib/compiler/src/elf.rs:343-349 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/elf.rs:45` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:774 — lib/compiler-singlepass/src/machine_arm64.rs:774-780 | lib/compiler-singlepass/src/machine_arm64.rs:804-810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:774` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1003 — lib/compiler-singlepass/src/machine_arm64.rs:1003-1009 | lib/compiler-singlepass/src/machine_riscv.rs:2471-2477 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:1003` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2886 — lib/compiler-singlepass/src/machine_arm64.rs:2886-2892 | lib/compiler-singlepass/src/machine_arm64.rs:5069-5075 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_riscv.rs:6064 — lib/compiler-singlepass/src/machine_riscv.rs:6064-6070 | lib/compiler-singlepass/src/machine_x64.rs:7175-7181 — before extracting anything, compare `lib/compiler-singlepass/src/machine_riscv.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:6064` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:7380 — lib/compiler-singlepass/src/machine_x64.rs:7380-7386 | lib/compiler-singlepass/src/machine_x64.rs:7509-7515 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:7800 — lib/compiler-singlepass/src/machine_x64.rs:7800-7806 | lib/compiler-singlepass/src/machine_x64.rs:7929-7935 — both copies are in the same file, so extract the block into 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) lib/virtual-fs/src/mount_fs.rs:293 — lib/virtual-fs/src/mount_fs.rs:293-299 | lib/virtual-fs/src/mount_fs.rs:328-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mount_fs.rs:293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/virtual-fs/src/pipe.rs:78 — lib/virtual-fs/src/pipe.rs:78-84 | lib/virtual-fs/src/pipe.rs:277-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/pipe.rs:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/virtual-net/src/rx_tx.rs:549 — lib/virtual-net/src/rx_tx.rs:549-555 | lib/virtual-net/src/rx_tx.rs:582-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:549` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/wasi-types/src/wasi/bindings.rs:1159 — lib/wasi-types/src/wasi/bindings.rs:1159-1165 | lib/wasi-types/src/wasi/bindings.rs:1185-1191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasi-types/src/wasi/bindings.rs:1159` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/wasix/src/fs/mod.rs:919 — lib/wasix/src/fs/mod.rs:919-925 | lib/wasix/src/fs/mod.rs:990-996 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/fs/mod.rs:919` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 23 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×47
  • Duplicated block (9 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs:74 — lib/api/src/backend/sys/entities/function/mod.rs:74-82 | lib/api/src/backend/sys/entities/function/mod.rs:178-186 — both copies are in the same file, so extract the block into 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) lib/api/src/entities/function/env/inner.rs:339 — lib/api/src/entities/function/env/inner.rs:339-347 | lib/api/src/entities/function/env/inner.rs:395-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) lib/api/src/utils/polyfill.rs:531 — lib/api/src/utils/polyfill.rs:531-539 | lib/compiler/src/translator/sections.rs:38-46 — before extracting anything, compare `lib/api/src/utils/polyfill.rs` and `lib/compiler/src/translator/sections.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 84 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) lib/cli/src/commands/app/secrets/create.rs:74 — lib/cli/src/commands/app/secrets/create.rs:74-82 | lib/cli/src/commands/app/secrets/update.rs:79-87 — before extracting anything, compare `lib/cli/src/commands/app/secrets/create.rs` and `lib/cli/src/commands/app/secrets/update.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/secrets/create.rs:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/cli/src/commands/app/secrets/export.rs:50 — lib/cli/src/commands/app/secrets/export.rs:50-58 | lib/cli/src/commands/app/secrets/reveal.rs:70-78 — 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) lib/cli/src/commands/app/secrets/utils/render.rs:28 — lib/cli/src/commands/app/secrets/utils/render.rs:28-36 | lib/cli/src/commands/app/secrets/utils/render.rs:69-77 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/secrets/utils/render.rs:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-cranelift/src/func_environ.rs:592 — lib/compiler-cranelift/src/func_environ.rs:592-600 | lib/compiler-cranelift/src/func_environ.rs:629-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:592` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-cranelift/src/func_environ.rs:1192 — lib/compiler-cranelift/src/func_environ.rs:1192-1200 | lib/compiler-cranelift/src/func_environ.rs:1259-1267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:1192` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-cranelift/src/func_environ.rs:1268` calls `current_block`, `expect`, `insert_block_after` and `lib/compiler-cranelift/src/func_environ.rs:1201` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) lib/compiler-cranelift/src/func_environ.rs:1926 — lib/compiler-cranelift/src/func_environ.rs:1926-1934 | lib/compiler-cranelift/src/func_environ.rs:1979-1987 — both copies are in the same file, so extract the block into 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) lib/compiler-cranelift/src/translator/code_translator.rs:188 — lib/compiler-cranelift/src/translator/code_translator.rs:188-196 | lib/compiler-cranelift/src/translator/code_translator.rs:201-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/translator/code_translator.rs:188` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-cranelift/src/translator/code_translator.rs:3058 — lib/compiler-cranelift/src/translator/code_translator.rs:3058-3066 | lib/compiler-cranelift/src/translator/code_translator.rs:3143-3151 — both copies are in the same file, so extract the block into 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) lib/compiler-llvm/src/translator/code.rs:4030 — lib/compiler-llvm/src/translator/code.rs:4030-4038 | lib/compiler-llvm/src/translator/code.rs:4090-4098 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4030` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-llvm/src/translator/code.rs:11479 — lib/compiler-llvm/src/translator/code.rs:11479-11487 | lib/compiler-llvm/src/translator/code.rs:11569-11577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:11479` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-singlepass/src/codegen.rs:1893 — lib/compiler-singlepass/src/codegen.rs:1893-1901 | lib/compiler-singlepass/src/codegen.rs:2044-2052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:1893` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:437 — lib/compiler-singlepass/src/machine_arm64.rs:437-445 | lib/compiler-singlepass/src/machine_riscv.rs:286-294 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:437` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1004 — lib/compiler-singlepass/src/machine_arm64.rs:1004-1012 | lib/compiler-singlepass/src/machine_arm64.rs:2162-2170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:1004` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1032 — lib/compiler-singlepass/src/machine_arm64.rs:1032-1040 | lib/compiler-singlepass/src/machine_riscv.rs:976-984 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:1032` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1224 — lib/compiler-singlepass/src/machine_arm64.rs:1224-1232 | lib/compiler-singlepass/src/machine_arm64.rs:1254-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 (9 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2413 — lib/compiler-singlepass/src/machine_arm64.rs:2413-2421 | lib/compiler-singlepass/src/machine_riscv.rs:2791-2799 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) lib/compiler-singlepass/src/machine_arm64.rs:4424 — lib/compiler-singlepass/src/machine_arm64.rs:4424-4432 | lib/compiler-singlepass/src/machine_arm64.rs:4607-4615 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_arm64.rs:4482 — lib/compiler-singlepass/src/machine_arm64.rs:4482-4490 | lib/compiler-singlepass/src/machine_arm64.rs:4670-4678 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_arm64.rs:6982 — lib/compiler-singlepass/src/machine_arm64.rs:6982-6990 | lib/compiler-singlepass/src/machine_arm64.rs:7218-7226 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_arm64.rs:7040 — lib/compiler-singlepass/src/machine_arm64.rs:7040-7048 | lib/compiler-singlepass/src/machine_arm64.rs:7281-7289 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_arm64.rs:7098 — lib/compiler-singlepass/src/machine_arm64.rs:7098-7106 | lib/compiler-singlepass/src/machine_arm64.rs:7344-7352 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_arm64.rs:7662 — lib/compiler-singlepass/src/machine_arm64.rs:7662-7670 | lib/compiler-singlepass/src/machine_arm64.rs:7740-7748 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7662` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 22 more in this group — see findings.md.
D17 · Explicit Debt · FixmeComment · ×39
  • FixmeComment tests/integration/cli/tests/snapshot.rs:960 — // FIXME: re-enable - hangs on windows and macos — 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 tests/compilers/metering.rs:167 — // FIXME: Since now a metering error is signaled with an `unreachable`, it is impossible to verify — 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 lib/wasix/src/lib.rs:1 — // FIXME: merge with ./lib.rs_upstream — 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 lib/wasix/src/syscalls/wasix/closure_prepare.rs:219 — // FIXME: Look into replacing this with the wasm start function — 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 lib/wasix/src/syscalls/wasix/fd_pipe.rs:61 — // FIXME: since a hash of the inode name is used to calculate the inode number, this may — 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 lib/wasix/src/syscalls/wasix/sock_pair.rs:9 — // FIXME — 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 lib/wasix/src/syscalls/wasix/sock_pair.rs:57 — // FIXME: currently, socket properties are ignored outright, since they — 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 lib/wasix/src/syscalls/wasi/fd_seek.rs:132 — // FIXME: implement this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment lib/wasix/src/syscalls/journal/restore_snapshot.rs:33 — // FIXME: if the stdout/stderr FDs were closed as a result of replaying the journal, — 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 lib/wasix/src/state/builder.rs:1143 — // FIXME: use a proper custom error type — 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 lib/wasix/src/state/env.rs:508 — // FIXME: use custom error type — 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 lib/wasix/src/state/env.rs:532 — // FIXME: should we be storing envs as raw byte arrays? — 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 lib/wasix/src/state/func_env.rs:85 — // FIXME: shouldn't this happen _before_ instantiating, so the startup code in the instance — 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 lib/wasix/src/state/func_env.rs:123 — // FIXME: this probably doesn't work with WASIX modules, since they import their memories? — 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 lib/wasix/src/state/func_env.rs:160 — // FIXME: Move this code to somewhere that makes sense (in WasiEnv?) — 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 lib/wasix/src/state/linker/mod.rs:705 — // FIXME: this needs to become a parameter if we ever decouple the linker from WASIX — 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 lib/wasix/src/state/linker/mod.rs:1114 — // FIXME: If we fail at an intermediate step, we should reset the linker's state, a la: — 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 lib/wasix/src/runtime/resolver/backend_source.rs:224 — // FIXME: implementing caching! — 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 lib/wasix/src/runtime/resolver/inputs.rs:131 — // FIXME: is this still needed? — 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 lib/wasix/src/runtime/resolver/resolve.rs:791 — // FIXME: This code is all super naive and will break the moment there — 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 lib/wasix/src/runtime/resolver/web_source.rs:157 — // FIXME: This will all block the main thread — 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 lib/wasix/src/runtime/package_loader/builtin_loader.rs:535 — // FIXME: This implementation will block the async runtime and should use — 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 lib/wasix/src/os/task/control_plane.rs:132 — // FIXME: De-register terminated processes! — 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 lib/wasix/src/os/task/process.rs:864 — // FIXME: this is wrong, threads might still be running! — 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 lib/vm/src/trap/traphandlers.rs:711 — // FIXME: this is what the previous C++ did to make sure that TLS — 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.
  • + 14 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×39
  • FunctionTooLong: wasmer_compiler_cranelift::translator::code_translator::translate_operator lib/compiler-cranelift/src/translator/code_translator.rs:159 — FunctionTooLong — wasmer_compiler_cranelift::translator::code_translator::translate_operator runs 1836 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 1736 over it, 18.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.
  • FunctionTooLong: wasmer_compiler_llvm::object_file::load_object_file lib/compiler-llvm/src/object_file.rs:131 — FunctionTooLong — wasmer_compiler_llvm::object_file::load_object_file runs 506 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 406 over it, 5.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: wasmer_wasix::syscalls::wasix::path_open2::path_open_internal_with_symlink_depth lib/wasix/src/syscalls/wasix/path_open2.rs:186 — FunctionTooLong — wasmer_wasix::syscalls::wasix::path_open2::path_open_internal_with_symlink_depth runs 395 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 295 over it, 3.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: virtual_fs::overlay_fs::open_copy_on_write lib/virtual-fs/src/overlay_fs.rs:741 — FunctionTooLong — virtual_fs::overlay_fs::open_copy_on_write runs 374 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 274 over it, 3.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: wasmer_compiler::engine::link::apply_relocation lib/compiler/src/engine/link.rs:21 — FunctionTooLong — wasmer_compiler::engine::link::apply_relocation runs 350 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 250 over it, 3.50× 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: wasmer_compiler::object::module::emit_compilation lib/compiler/src/object/module.rs:154 — FunctionTooLong — wasmer_compiler::object::module::emit_compilation runs 297 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 197 over it, 2.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal lib/wasix/src/syscalls/wasi/fd_write.rs:243 — FunctionTooLong — wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal runs 294 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 194 over it, 2.94× 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: wasmer_wasix::syscalls::wasi::fd_read::fd_read_internal lib/wasix/src/syscalls/wasi/fd_read.rs:135 — FunctionTooLong — wasmer_wasix::syscalls::wasi::fd_read::fd_read_internal runs 237 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 137 over it, 2.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: wasmer_compiler_cranelift::translator::code_translator::type_of lib/compiler-cranelift/src/translator/code_translator.rs:3477 — FunctionTooLong — wasmer_compiler_cranelift::translator::code_translator::type_of runs 215 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wasmer_compiler_cranelift::elf::emit_local_function lib/compiler-cranelift/src/elf.rs:238 — FunctionTooLong — wasmer_compiler_cranelift::elf::emit_local_function runs 212 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 112 over it, 2.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: wasmer_wasix::syscalls::wasi::path_rename::path_rename_internal lib/wasix/src/syscalls/wasi/path_rename.rs:56 — FunctionTooLong — wasmer_wasix::syscalls::wasi::path_rename::path_rename_internal runs 198 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 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wasmer_package_sdk::package::publish::publish_package_directory lib/package-sdk/src/package/publish.rs:131 — FunctionTooLong — wasmer_package_sdk::package::publish::publish_package_directory runs 176 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 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wasmer_wasix::syscalls::wasi::poll_oneoff::poll_oneoff_internal lib/wasix/src/syscalls/wasi/poll_oneoff.rs:232 — FunctionTooLong — wasmer_wasix::syscalls::wasi::poll_oneoff::poll_oneoff_internal runs 161 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 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wasmer_wasix::syscalls::wasix::proc_exec4::proc_exec4_impl lib/wasix/src/syscalls/wasix/proc_exec4.rs:78 — FunctionTooLong — wasmer_wasix::syscalls::wasix::proc_exec4::proc_exec4_impl runs 153 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 53 over it, 1.53× 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: wasmer_wasix::syscalls::wasix::sock_send_file::sock_send_file_internal lib/wasix/src/syscalls/wasix/sock_send_file.rs:52 — FunctionTooLong — wasmer_wasix::syscalls::wasix::sock_send_file::sock_send_file_internal runs 149 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 49 over it, 1.49× 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: wasmer_wasix::syscalls::wasix::proc_fork::proc_fork lib/wasix/src/syscalls/wasix/proc_fork.rs:23 — FunctionTooLong — wasmer_wasix::syscalls::wasix::proc_fork::proc_fork runs 148 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 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wasmer_compiler_singlepass::emitter_arm64::gen_import_call_trampoline_arm64 lib/compiler-singlepass/src/emitter_arm64.rs:3108 — FunctionTooLong — wasmer_compiler_singlepass::emitter_arm64::gen_import_call_trampoline_arm64 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.
  • FunctionTooLong: wasmer_wasix::wasix_exports_32 lib/wasix/src/lib.rs:518 — FunctionTooLong — wasmer_wasix::wasix_exports_32 runs 145 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wasmer_wasix::wasix_exports_64 lib/wasix/src/lib.rs:667 — FunctionTooLong — wasmer_wasix::wasix_exports_64 runs 145 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wasmer_package_sdk::app::deploy_remote_build::deploy_app_remote lib/package-sdk/src/app/deploy_remote_build.rs:101 — FunctionTooLong — wasmer_package_sdk::app::deploy_remote_build::deploy_app_remote runs 144 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 44 over it, 1.44× 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: wasmer_wasix::syscalls::wasix::closure_prepare::build_closure_wasm_bytes lib/wasix/src/syscalls/wasix/closure_prepare.rs:130 — FunctionTooLong — wasmer_wasix::syscalls::wasix::closure_prepare::build_closure_wasm_bytes runs 144 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 44 over it, 1.44× 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: wasmer_vm::libcalls::function_pointer lib/vm/src/libcalls.rs:897 — FunctionTooLong — wasmer_vm::libcalls::function_pointer 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: wasmer_cli::commands::init::construct_manifest lib/cli/src/commands/init.rs:362 — FunctionTooLong — wasmer_cli::commands::init::construct_manifest runs 136 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 36 over it, 1.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.
  • FunctionTooLong: wasmer_package::convert::webc_to_package::webc_to_package_dir lib/package/src/convert/webc_to_package.rs:11 — FunctionTooLong — wasmer_package::convert::webc_to_package::webc_to_package_dir runs 136 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 36 over it, 1.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.
  • FunctionTooLong: wasmer_wasix::os::posix_err::exit_code_to_message lib/wasix/src/os/posix_err.rs:133 — FunctionTooLong — wasmer_wasix::os::posix_err::exit_code_to_message 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.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×38
  • Duplicated block (6 lines × 2) lib/api/src/backend/js/entities/module.rs:409 — lib/api/src/backend/js/entities/module.rs:409-414 | lib/api/src/backend/js/entities/module.rs:421-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs:66 — lib/api/src/backend/sys/entities/function/mod.rs:66-71 | lib/api/src/backend/sys/entities/function/mod.rs:161-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/mod.rs:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/api/src/entities/function/inner.rs:265 — lib/api/src/entities/function/inner.rs:265-270 | lib/api/src/entities/function/inner.rs:321-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/entities/function/inner.rs:265` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/cli/src/commands/app/deploy.rs:356 — lib/cli/src/commands/app/deploy.rs:356-361 | lib/cli/src/commands/app/deploy.rs:1025-1030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/deploy.rs:356` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/compiler-cranelift/src/func_environ.rs:309 — lib/compiler-cranelift/src/func_environ.rs:309-314 | lib/compiler-cranelift/src/func_environ.rs:1563-1568 — both copies are in the same file, so extract the block into 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) lib/compiler-cranelift/src/func_environ.rs:2114 — lib/compiler-cranelift/src/func_environ.rs:2114-2119 | lib/compiler-cranelift/src/func_environ.rs:2251-2256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn translate_exn_reraise_unmatched( &mut` in one and `crate) fn translate_table_size( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) lib/compiler-llvm/src/translator/code.rs:3332 — lib/compiler-llvm/src/translator/code.rs:3332-3337 | lib/compiler-llvm/src/translator/code.rs:3393-3398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:3332` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/compiler-llvm/src/translator/code.rs:6027 — lib/compiler-llvm/src/translator/code.rs:6027-6032 | lib/compiler-llvm/src/translator/code.rs:6074-6079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6027` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:6072` calls `const_zero`, `const_int` and `lib/compiler-llvm/src/translator/code.rs:6026` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) lib/compiler-llvm/src/translator/code.rs:11853 — lib/compiler-llvm/src/translator/code.rs:11853-11858 | lib/compiler-llvm/src/translator/code.rs:11920-11925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:11853` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:893 — lib/compiler-singlepass/src/machine_arm64.rs:893-898 | lib/compiler-singlepass/src/machine_arm64.rs:921-926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:893` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1985 — lib/compiler-singlepass/src/machine_arm64.rs:1985-1990 | lib/compiler-singlepass/src/machine_riscv.rs:2407-2412 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:1985` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2916 — lib/compiler-singlepass/src/machine_arm64.rs:2916-2921 | lib/compiler-singlepass/src/machine_arm64.rs:5099-5104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2916` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:4536 — lib/compiler-singlepass/src/machine_arm64.rs:4536-4541 | lib/compiler-singlepass/src/machine_arm64.rs:7399-7404 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_arm64.rs:4697 — lib/compiler-singlepass/src/machine_arm64.rs:4697-4702 | lib/compiler-singlepass/src/machine_riscv.rs:4235-4240 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4697` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:8110 — lib/compiler-singlepass/src/machine_arm64.rs:8110-8115 | lib/compiler-singlepass/src/machine_x64.rs:7615-7620 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:8110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_arm64.rs:8116` calls `GPR` and `lib/compiler-singlepass/src/machine_x64.rs:7621` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:1380 — lib/compiler-singlepass/src/machine_riscv.rs:1380-1385 | lib/compiler-singlepass/src/machine_x64.rs:478-483 — before extracting anything, compare `lib/compiler-singlepass/src/machine_riscv.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:1412 — lib/compiler-singlepass/src/machine_riscv.rs:1412-1417 | lib/compiler-singlepass/src/machine_riscv.rs:1583-1588 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:674 — lib/compiler-singlepass/src/machine_x64.rs:674-679 | lib/compiler-singlepass/src/machine_x64.rs:820-825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) lib/compiler/src/engine/artifact.rs:568 — lib/compiler/src/engine/artifact.rs:568-573 | lib/compiler/src/engine/artifact.rs:588-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/artifact.rs:568` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/package/src/package/package.rs:321 — lib/package/src/package/package.rs:321-326 | lib/package/src/package/package.rs:330-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/package/src/package/package.rs:321` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/package/src/package/volume/fs.rs:436 — lib/package/src/package/volume/fs.rs:436-441 | lib/package/src/package/volume/fs.rs:444-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) lib/virtual-net/src/host.rs:418 — lib/virtual-net/src/host.rs:418-423 | lib/virtual-net/src/host.rs:434-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) lib/wasix/src/http/web_http_client.rs:167 — lib/wasix/src/http/web_http_client.rs:167-173 | lib/wasix/src/http/web_http_client.rs:194-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/http/web_http_client.rs:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/wasix/src/net/mod.rs:140 — lib/wasix/src/net/mod.rs:140-145 | lib/wasix/src/net/mod.rs:303-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/mod.rs:140` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/wasix/src/syscalls/wasi/path_readlink.rs:30 — lib/wasix/src/syscalls/wasi/path_readlink.rs:30-35 | lib/wasix/src/syscalls/wasi/path_remove_directory.rs:14-20 — 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.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×37
  • Duplicated block (8 lines × 2) lib/api/src/backend/js/entities/function/mod.rs:251 — lib/api/src/backend/js/entities/function/mod.rs:251-258 | lib/api/src/backend/sys/entities/function/mod.rs:361-369 — before extracting anything, compare `lib/api/src/backend/js/entities/function/mod.rs` and `lib/api/src/backend/sys/entities/function/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/js/entities/function/mod.rs:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) lib/c-api-imports/src/lib.rs:1092 — lib/c-api-imports/src/lib.rs:1092-1099 | lib/c-api-imports/src/lib.rs:1116-1123 — both copies are in the same file, so extract the block into 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) lib/c-api-imports/src/lib.rs:1315 — lib/c-api-imports/src/lib.rs:1315-1322 | lib/c-api-imports/src/lib.rs:1348-1355 — both copies are in the same file, so extract the block into 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) lib/cli/src/utils/prompts.rs:8 — lib/cli/src/utils/prompts.rs:8-19 | lib/cli/src/utils/prompts.rs:32-39 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/utils/prompts.rs:8` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/compiler-cranelift/src/func_environ.rs:1411 — lib/compiler-cranelift/src/func_environ.rs:1411-1418 | lib/compiler-cranelift/src/func_environ.rs:2097-2104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:1411` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn translate_unreachable( &mut` in one and `crate) fn translate_exn_reraise_unmatched( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) lib/compiler-llvm/src/translator/code.rs:4465 — lib/compiler-llvm/src/translator/code.rs:4465-4472 | lib/compiler-llvm/src/translator/code.rs:4517-4524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4465` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) lib/compiler-llvm/src/translator/code.rs:9736 — lib/compiler-llvm/src/translator/code.rs:9736-9743 | lib/compiler-llvm/src/translator/code.rs:9764-9771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/compiler-llvm/src/translator/code.rs:9750 — lib/compiler-llvm/src/translator/code.rs:9750-9757 | lib/compiler-llvm/src/translator/code.rs:9778-9785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9750` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/emitter_arm64.rs:2988 — lib/compiler-singlepass/src/emitter_arm64.rs:2988-2995 | lib/compiler-singlepass/src/machine_x64.rs:8160-8167 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/emitter_arm64.rs:2988` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1089 — lib/compiler-singlepass/src/machine_arm64.rs:1089-1096 | lib/compiler-singlepass/src/machine_x64.rs:587-594 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:1089` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1587 — lib/compiler-singlepass/src/machine_arm64.rs:1587-1594 | lib/compiler-singlepass/src/machine_arm64.rs:1604-1611 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_arm64.rs:1654 — lib/compiler-singlepass/src/machine_arm64.rs:1654-1661 | lib/compiler-singlepass/src/machine_riscv.rs:2194-2201 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:2192` calls `GPR` and `lib/compiler-singlepass/src/machine_arm64.rs:1653` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:7663 — lib/compiler-singlepass/src/machine_arm64.rs:7663-7670 | lib/compiler-singlepass/src/machine_arm64.rs:7702-7709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7663` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:7741 — lib/compiler-singlepass/src/machine_arm64.rs:7741-7748 | lib/compiler-singlepass/src/machine_arm64.rs:7780-7787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7741` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:1189 — lib/compiler-singlepass/src/machine_x64.rs:1189-1196 | lib/compiler-singlepass/src/machine_x64.rs:1602-1609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:3151 — lib/compiler-singlepass/src/machine_x64.rs:3151-3158 | lib/compiler-singlepass/src/machine_x64.rs:4934-4941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3151` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:6891 — lib/compiler-singlepass/src/machine_x64.rs:6891-6898 | lib/compiler-singlepass/src/machine_x64.rs:6991-6998 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:6891` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:6954 — lib/compiler-singlepass/src/machine_x64.rs:6954-6961 | lib/compiler-singlepass/src/machine_x64.rs:7054-7061 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:6954` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) lib/compiler/src/engine/artifact.rs:271 — lib/compiler/src/engine/artifact.rs:271-278 | lib/compiler/src/engine/artifact.rs:864-871 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/artifact.rs:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) lib/compiler/src/engine/artifact.rs:654 — lib/compiler/src/engine/artifact.rs:654-661 | lib/compiler/src/engine/artifact.rs:999-1006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/artifact.rs:654` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/types/src/features.rs:364 — lib/types/src/features.rs:364-371 | lib/types/src/features.rs:386-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) lib/virtual-fs/src/mem_fs/file.rs:1051 — lib/virtual-fs/src/mem_fs/file.rs:1051-1058 | lib/virtual-fs/src/mem_fs/file.rs:1292-1299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/file.rs:1051` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) lib/virtual-fs/src/overlay_fs.rs:1129 — lib/virtual-fs/src/overlay_fs.rs:1129-1136 | lib/virtual-fs/src/overlay_fs.rs:1141-1148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/overlay_fs.rs:1129` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) lib/vm/src/libcalls.rs:378 — lib/vm/src/libcalls.rs:378-385 | lib/vm/src/libcalls.rs:439-446 — both copies are in the same file, so extract the block into 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) lib/wasix/src/fs/mod.rs:943 — lib/wasix/src/fs/mod.rs:943-950 | lib/wasix/src/fs/mod.rs:1010-1017 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • + 12 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×36
  • ClassTooLong: LLVMFunctionCodeGenerator lib/compiler-llvm/src/translator/code.rs:2454 — ClassTooLong — 9680 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, 3 blocks, lines 709-12830. The bar is 400 significant lines; this is 9280 over it, 24.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: MachineARM64 lib/compiler-singlepass/src/machine_arm64.rs:36 — ClassTooLong — 6974 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 42 methods, 3 blocks, lines 36-8494. The bar is 400 significant lines; this is 6574 over it, 17.44× 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: MachineX86_64 lib/compiler-singlepass/src/machine_x64.rs:94 — ClassTooLong — 6772 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 50 methods, 3 blocks, lines 94-8432. The bar is 400 significant lines; this is 6372 over it, 16.93× 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: MachineRiscv lib/compiler-singlepass/src/machine_riscv.rs:76 — ClassTooLong — 5247 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 36 methods, 3 blocks, lines 76-6616. The bar is 400 significant lines; this is 4847 over it, 13.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FuncGen lib/compiler-singlepass/src/codegen.rs:93 — ClassTooLong — 4696 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 93-6223. The bar is 400 significant lines; this is 4296 over it, 11.74× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Machine lib/compiler-singlepass/src/machine.rs:105 — ClassTooLong — 1939 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 276 methods. The bar is 400 significant lines; this is 1539 over it, 4.85× 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: FuncEnvironment lib/compiler-cranelift/src/func_environ.rs:89 — ClassTooLong — 1637 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 99 methods, 3 blocks, lines 89-2428. The bar is 400 significant lines; this is 1237 over it, 4.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WasiFs lib/wasix/src/fs/mod.rs:569 — ClassTooLong — 1502 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 69 methods, 3 blocks, lines 569-2896. The bar is 400 significant lines; this is 1102 over it, 3.76× 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: Artifact lib/compiler/src/engine/artifact.rs:159 — ClassTooLong — 1143 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 31 methods, 6 blocks, lines 159-1947. The bar is 400 significant lines; this is 743 over it, 2.86× 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: SockProto lib/wasi-types/src/wasi/bindings.rs:1401 — ClassTooLong — 1092 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 4 blocks, lines 1401-3757. The bar is 400 significant lines; this is 692 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: wasmer_parser_operator_t lib/c-api/src/wasm_c_api/unstable/parser/operator.rs:5 — 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), 0 methods, 2 blocks, lines 5-1080. 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: InodeSocket lib/wasix/src/net/socket.rs:237 — ClassTooLong — 1058 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 2 blocks, lines 237-1695. The bar is 400 significant lines; this is 658 over it, 2.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: Intrinsics lib/compiler-llvm/src/translator/intrinsics.rs:71 — ClassTooLong — 1034 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 2 blocks, lines 71-1391. The bar is 400 significant lines; this is 634 over it, 2.59× 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: WasiEnv lib/wasix/src/state/env.rs:185 — ClassTooLong — 720 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 61 methods, 5 blocks, lines 185-1411. The bar is 400 significant lines; this is 320 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.
  • ClassTooLong: FileHandle lib/virtual-fs/src/mem_fs/file.rs:29 — ClassTooLong — 720 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 9 blocks, lines 29-1785. The bar is 400 significant lines; this is 320 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.
  • ClassTooLong: RemoteNetworkingServerDriver lib/virtual-net/src/server.rs:316 — ClassTooLong — 713 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, 2 blocks, lines 325-1324. The bar is 400 significant lines; this is 313 over it, 1.78× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Linker lib/wasix/src/state/linker/mod.rs:316 — ClassTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 3 blocks, lines 316-1337. The bar is 400 significant lines; this is 277 over it, 1.69× 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: CmdAppDeploy lib/cli/src/commands/app/deploy.rs:41 — ClassTooLong — 674 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 3 blocks, lines 41-1031. The bar is 400 significant lines; this is 274 over it, 1.69× 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: JournalEntry lib/journal/src/entry.rs:83 — ClassTooLong — 669 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 2 blocks, lines 83-861. The bar is 400 significant lines; this is 269 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.
  • ClassTooLong: CtxType lib/compiler-llvm/src/translator/intrinsics.rs:1430 — ClassTooLong — 617 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 1430-2232. The bar is 400 significant lines; this is 217 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WasiEnvBuilder lib/wasix/src/state/builder.rs:51 — ClassTooLong — 576 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 84 methods, 3 blocks, lines 51-1174. The bar is 400 significant lines; this is 176 over it, 1.44× 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: CmdAppCreate lib/cli/src/commands/app/create.rs:80 — ClassTooLong — 567 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 3 blocks, lines 80-947. The bar is 400 significant lines; this is 167 over it, 1.42× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Instance lib/vm/src/instance/mod.rs:55 — ClassTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 73 methods, 3 blocks, lines 55-1055. The bar is 400 significant lines; this is 155 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RemoteSocket lib/virtual-net/src/client.rs:905 — ClassTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 12 blocks, lines 905-1693. The bar is 400 significant lines; this is 134 over it, 1.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CraneliftCompiler lib/compiler-cranelift/src/compiler.rs:90 — ClassTooLong — 527 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 3 blocks, lines 90-794. The bar is 400 significant lines; this is 127 over it, 1.32× 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.
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×31
  • Duplicated block (11 lines × 2) lib/api/src/entities/store/local_rwlock.rs:197 — lib/api/src/entities/store/local_rwlock.rs:197-207 | lib/api/src/entities/store/local_rwlock.rs:247-257 — both copies are in the same file, so extract the block into 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) lib/cli/src/backend.rs:607 — lib/cli/src/backend.rs:607-617 | lib/cli/src/backend.rs:646-656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/backend.rs:607` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/cli/src/backend.rs:644` calls `enable_verifier` and `lib/cli/src/backend.rs:606` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) lib/compiler-cranelift/src/elf.rs:289 — lib/compiler-cranelift/src/elf.rs:289-299 | lib/compiler-singlepass/src/elf.rs:67-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/elf.rs:289` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) lib/compiler-llvm/src/translator/code.rs:1226 — lib/compiler-llvm/src/translator/code.rs:1226-1236 | lib/compiler-llvm/src/translator/code.rs:1327-1337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:1226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:203 — lib/compiler-singlepass/src/machine_arm64.rs:203-213 | lib/compiler-singlepass/src/machine_riscv.rs:147-157 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2088 — lib/compiler-singlepass/src/machine_arm64.rs:2088-2098 | lib/compiler-singlepass/src/machine_arm64.rs:2112-2122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2088` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2632 — lib/compiler-singlepass/src/machine_arm64.rs:2632-2642 | lib/compiler-singlepass/src/machine_riscv.rs:3040-3050 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2632` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:4815 — lib/compiler-singlepass/src/machine_arm64.rs:4815-4825 | lib/compiler-singlepass/src/machine_riscv.rs:4364-4374 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4815` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:7559 — lib/compiler-singlepass/src/machine_arm64.rs:7559-7569 | lib/compiler-singlepass/src/machine_arm64.rs:7586-7596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7559` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:7613 — lib/compiler-singlepass/src/machine_arm64.rs:7613-7623 | lib/compiler-singlepass/src/machine_arm64.rs:7640-7650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7613` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:7679 — lib/compiler-singlepass/src/machine_arm64.rs:7679-7689 | lib/compiler-singlepass/src/machine_arm64.rs:7757-7767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7679` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:7718 — lib/compiler-singlepass/src/machine_arm64.rs:7718-7728 | lib/compiler-singlepass/src/machine_arm64.rs:7796-7806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7718` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:1114 — lib/compiler-singlepass/src/machine_x64.rs:1114-1124 | lib/compiler-singlepass/src/machine_x64.rs:1527-1537 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:1200 — lib/compiler-singlepass/src/machine_x64.rs:1200-1210 | lib/compiler-singlepass/src/machine_x64.rs:1613-1623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1200` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler/src/engine/artifact.rs:670 — lib/compiler/src/engine/artifact.rs:670-680 | lib/compiler/src/engine/artifact.rs:697-707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/artifact.rs:670` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/wasix/src/bin_factory/exec.rs:268 — lib/wasix/src/bin_factory/exec.rs:268-278 | lib/wasix/src/bin_factory/exec.rs:281-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/bin_factory/exec.rs:268` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs:17 — lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs:17-27 | lib/wasix/src/syscalls/journal/maybe_snapshot_once.rs:17-27 — before extracting anything, compare `lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs` and `lib/wasix/src/syscalls/journal/maybe_snapshot_once.rs` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/wasix/src/syscalls/wasix/closure_prepare.rs:345 — lib/wasix/src/syscalls/wasix/closure_prepare.rs:345-355 | lib/wasix/src/syscalls/wasix/closure_prepare.rs:359-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/closure_prepare.rs:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/wasix/src/syscalls/wasix/proc_exec4.rs:247 — lib/wasix/src/syscalls/wasix/proc_exec4.rs:247-257 | lib/wasix/src/syscalls/wasix/proc_exit2.rs:58-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/proc_exec4.rs:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/wasix/src/syscalls/wasix/sock_send.rs:101 — lib/wasix/src/syscalls/wasix/sock_send.rs:101-111 | lib/wasix/src/syscalls/wasix/sock_send_to.rs:111-121 — before extracting anything, compare `lib/wasix/src/syscalls/wasix/sock_send.rs` and `lib/wasix/src/syscalls/wasix/sock_send_to.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/sock_send.rs:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/compiler-llvm/src/translator/code.rs:6350 — lib/compiler-llvm/src/translator/code.rs:6350-6360 | lib/compiler-llvm/src/translator/code.rs:6383-6393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-llvm/src/translator/code.rs:6457 — lib/compiler-llvm/src/translator/code.rs:6457-6467 | lib/compiler-llvm/src/translator/code.rs:6490-6500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6457` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/compiler-llvm/src/translator/code.rs:1096 — lib/compiler-llvm/src/translator/code.rs:1096-1106 | lib/compiler-llvm/src/translator/code.rs:4949-4959 — both copies are in the same file, so extract the block into 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) lib/compiler-cranelift/src/dwarf.rs:44 — lib/compiler-cranelift/src/dwarf.rs:44-54 | lib/compiler-singlepass/src/dwarf.rs:32-42 — before extracting anything, compare `lib/compiler-cranelift/src/dwarf.rs` and `lib/compiler-singlepass/src/dwarf.rs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:2323 — lib/compiler-singlepass/src/machine_riscv.rs:2323-2333 | lib/compiler-singlepass/src/machine_x64.rs:2329-2339 — before extracting anything, compare `lib/compiler-singlepass/src/machine_riscv.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:2323` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×29
  • Duplicated block (13 lines × 2) lib/api/src/backend/js/entities/function/mod.rs:279 — lib/api/src/backend/js/entities/function/mod.rs:279-291 | lib/api/src/backend/sys/entities/function/mod.rs:389-401 — before extracting anything, compare `lib/api/src/backend/js/entities/function/mod.rs` and `lib/api/src/backend/sys/entities/function/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/js/entities/function/mod.rs:279` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/api/src/backend/js/entities/function/mod.rs:277` calls `clone` and `lib/api/src/backend/sys/entities/function/mod.rs:388` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) lib/api/src/backend/js/entities/memory/buffer.rs:15 — lib/api/src/backend/js/entities/memory/buffer.rs:15-27 | lib/api/src/backend/js/entities/memory/buffer.rs:44-56 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `buf` to `&mut [u8]` in one and `&'b mut [MaybeUninit<u8>]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs:265 — lib/api/src/backend/sys/entities/function/mod.rs:265-277 | lib/api/src/backend/sys/entities/function/mod.rs:419-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/mod.rs:265` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) lib/api/src/backend/v8/entities/function/mod.rs:120 — lib/api/src/backend/v8/entities/function/mod.rs:120-132 | lib/api/src/backend/v8/entities/function/mod.rs:270-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/function/mod.rs:120` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) lib/api/src/backend/v8/entities/function/mod.rs:180 — lib/api/src/backend/v8/entities/function/mod.rs:180-192 | lib/api/src/backend/v8/entities/function/mod.rs:256-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/function/mod.rs:180` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) lib/backend-api/src/query.rs:1811 — lib/backend-api/src/query.rs:1811-1823 | lib/backend-api/src/query.rs:1926-1938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/backend-api/src/query.rs:1811` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:920 — lib/compiler-llvm/src/translator/code.rs:920-932 | lib/compiler-llvm/src/translator/code.rs:933-945 — both copies are in the same file, so extract the block into 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) lib/compiler-llvm/src/translator/code.rs:6395 — lib/compiler-llvm/src/translator/code.rs:6395-6407 | lib/compiler-llvm/src/translator/code.rs:6502-6514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6395` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:8833 — lib/compiler-llvm/src/translator/code.rs:8833-8845 | lib/compiler-llvm/src/translator/code.rs:8907-8919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8833` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:8982 — lib/compiler-llvm/src/translator/code.rs:8982-8994 | lib/compiler-llvm/src/translator/code.rs:9048-9060 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8982` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:9227 — lib/compiler-llvm/src/translator/code.rs:9227-9239 | lib/compiler-llvm/src/translator/code.rs:9663-9675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9227` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:9275 — lib/compiler-llvm/src/translator/code.rs:9275-9287 | lib/compiler-llvm/src/translator/code.rs:9289-9301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:9331 — lib/compiler-llvm/src/translator/code.rs:9331-9343 | lib/compiler-llvm/src/translator/code.rs:9345-9357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:9387 — lib/compiler-llvm/src/translator/code.rs:9387-9399 | lib/compiler-llvm/src/translator/code.rs:9401-9413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:9443 — lib/compiler-llvm/src/translator/code.rs:9443-9455 | lib/compiler-llvm/src/translator/code.rs:9457-9469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) lib/compiler-llvm/src/translator/code.rs:10435 — lib/compiler-llvm/src/translator/code.rs:10435-10447 | lib/compiler-llvm/src/translator/code.rs:10500-10512 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/codegen.rs:1100 — lib/compiler-singlepass/src/codegen.rs:1100-1112 | lib/compiler-singlepass/src/codegen.rs:1131-1143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:1100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-singlepass/src/codegen.rs:5549 — lib/compiler-singlepass/src/codegen.rs:5549-5561 | lib/compiler-singlepass/src/codegen.rs:5674-5686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:5549` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-singlepass/src/emitter_arm64.rs:2849 — lib/compiler-singlepass/src/emitter_arm64.rs:2849-2861 | lib/compiler-singlepass/src/emitter_riscv.rs:1792-1804 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/emitter_arm64.rs:2849` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:150 — lib/compiler-singlepass/src/machine_arm64.rs:150-162 | lib/compiler-singlepass/src/machine_arm64.rs:190-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:150` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:310 — lib/compiler-singlepass/src/machine_arm64.rs:310-322 | lib/compiler-singlepass/src/machine_arm64.rs:348-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:6910 — lib/compiler-singlepass/src/machine_x64.rs:6910-6922 | lib/compiler-singlepass/src/machine_x64.rs:7010-7022 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:6910` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/compiler/src/engine/artifact.rs:282 — lib/compiler/src/engine/artifact.rs:282-294 | lib/compiler/src/engine/artifact.rs:337-349 — both copies are in the same file, so extract the block into 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) lib/vm/src/vmcontext.rs:426 — lib/vm/src/vmcontext.rs:426-438 | lib/vm/src/vmcontext.rs:465-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) lib/wasix/src/syscalls/mod.rs:730 — lib/wasix/src/syscalls/mod.rs:730-742 | lib/wasix/src/syscalls/mod.rs:765-777 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/mod.rs:730` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/wasix/src/syscalls/mod.rs:729` calls `tasks`, `clone` and `lib/wasix/src/syscalls/mod.rs:764` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • + 4 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×29
  • Low cohesion: AssemblerX64 (LCOM4 64) lib/compiler-singlepass/src/machine_x64.rs:39 — AssemblerX64's methods fall into 64 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 64 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: PluggableRuntime (LCOM4 10) lib/wasix/src/runtime/mod.rs:688 — PluggableRuntime's methods fall into 10 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 10 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: StoreObjects (LCOM4 8) lib/api/src/backend/js/entities/store/obj.rs:51 — StoreObjects'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: Cranelift (LCOM4 7) lib/compiler-cranelift/src/config.rs:113 — Cranelift'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: LLVM (LCOM4 7) lib/compiler-llvm/src/config.rs:113 — LLVM'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: MachineX86_64 (LCOM4 7) lib/compiler-singlepass/src/machine_x64.rs:94 — MachineX86_64'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: Function (LCOM4 6) lib/api/src/backend/js/entities/function/mod.rs:66 — Function'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: Memory (LCOM4 6) lib/api/src/backend/v8/entities/memory/mod.rs:21 — Memory'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: Module (LCOM4 5) lib/api/src/backend/js/entities/module.rs:45 — Module'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: Function (LCOM4 5) lib/api/src/backend/sys/entities/function/mod.rs:42 — Function'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: Module (LCOM4 5) lib/api/src/backend/sys/entities/module.rs:25 — Module'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: Table (LCOM4 5) lib/api/src/backend/v8/entities/table.rs:18 — Table'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: WasmCapiRuntimeHooks (LCOM4 5) lib/c-api-imports/src/lib.rs:271 — WasmCapiRuntimeHooks'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: MachineARM64 (LCOM4 5) lib/compiler-singlepass/src/machine_arm64.rs:36 — MachineARM64'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: MachineRiscv (LCOM4 5) lib/compiler-singlepass/src/machine_riscv.rs:76 — MachineRiscv'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: FunctionEnv (LCOM4 4) lib/api/src/backend/js/entities/function/env.rs:19 — FunctionEnv's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Global (LCOM4 4) lib/api/src/backend/js/entities/global.rs:13 — Global's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Memory (LCOM4 4) lib/api/src/backend/js/entities/memory/mod.rs:25 — Memory's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Table (LCOM4 4) lib/api/src/backend/js/entities/table.rs:10 — Table's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FunctionEnv (LCOM4 4) lib/api/src/backend/sys/entities/function/env.rs:16 — FunctionEnv's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Memory (LCOM4 4) lib/api/src/backend/sys/entities/memory/mod.rs:32 — Memory's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Table (LCOM4 4) lib/api/src/backend/sys/entities/table.rs:15 — Table's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FunctionEnv (LCOM4 4) lib/api/src/backend/v8/entities/function/env.rs:13 — FunctionEnv's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Function (LCOM4 4) lib/api/src/backend/v8/entities/function/mod.rs:38 — Function's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Module (LCOM4 4) lib/api/src/backend/v8/entities/module.rs:159 — Module's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×26
  • Duplicated block (12 lines × 2) lib/api/src/backend/sys/entities/memory/mod.rs:217 — lib/api/src/backend/sys/entities/memory/mod.rs:217-228 | lib/api/src/backend/sys/entities/memory/mod.rs:240-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `buf` to `&mut [u8]` in one and `&'b mut [MaybeUninit<u8>]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) lib/api/src/utils/mem/mod.rs:343 — lib/api/src/utils/mem/mod.rs:343-354 | lib/api/src/utils/mem/mod.rs:361-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/utils/mem/mod.rs:343` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/cli/src/commands/app/deploy.rs:894 — lib/cli/src/commands/app/deploy.rs:894-905 | lib/cli/src/commands/app/deploy.rs:907-918 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/deploy.rs:894` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/cli/src/commands/app/secrets/create.rs:60 — lib/cli/src/commands/app/secrets/create.rs:60-71 | lib/cli/src/commands/app/secrets/delete.rs:62-73 — before extracting anything, compare `lib/cli/src/commands/app/secrets/create.rs` and `lib/cli/src/commands/app/secrets/delete.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/secrets/create.rs:60` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/cli/src/commands/app/secrets/reveal.rs:51 — lib/cli/src/commands/app/secrets/reveal.rs:51-62 | lib/cli/src/commands/app/secrets/update.rs:65-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/secrets/reveal.rs:51` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/cli/src/utils/unpack.rs:89 — lib/cli/src/utils/unpack.rs:89-100 | lib/cli/src/utils/unpack.rs:114-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/utils/unpack.rs:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/compiler-cranelift/src/translator/code_translator/bounds_checks.rs:137 — lib/compiler-cranelift/src/translator/code_translator/bounds_checks.rs:137-148 | lib/compiler-cranelift/src/translator/code_translator/bounds_checks.rs:190-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/translator/code_translator/bounds_checks.rs:190` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:953 — lib/compiler-singlepass/src/machine_arm64.rs:953-964 | lib/compiler-singlepass/src/machine_riscv.rs:911-922 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:953` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2273 — lib/compiler-singlepass/src/machine_arm64.rs:2273-2284 | lib/compiler-singlepass/src/machine_riscv.rs:2636-2647 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2273` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:2349 — lib/compiler-singlepass/src/machine_riscv.rs:2349-2360 | lib/compiler-singlepass/src/machine_riscv.rs:2473-2484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:2349` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:1084 — lib/compiler-singlepass/src/machine_x64.rs:1084-1095 | lib/compiler-singlepass/src/machine_x64.rs:1497-1508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1084` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4444 — lib/compiler-singlepass/src/machine_x64.rs:4444-4455 | lib/compiler-singlepass/src/machine_x64.rs:4504-4515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4444` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/virtual-fs/src/mount_fs.rs:709 — lib/virtual-fs/src/mount_fs.rs:709-720 | lib/virtual-fs/src/mount_fs.rs:734-745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mount_fs.rs:709` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/virtual-net/src/client.rs:115 — lib/virtual-net/src/client.rs:115-126 | lib/virtual-net/src/server.rs:88-99 — before extracting anything, compare `lib/virtual-net/src/client.rs` and `lib/virtual-net/src/server.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `rx` to `mpsc::Receiver<MessageResponse>` in one and `mpsc::Receiver<MessageRequest>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) lib/virtual-net/src/host.rs:404 — lib/virtual-net/src/host.rs:404-415 | lib/virtual-net/src/host.rs:859-870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) lib/virtual-net/src/ruleset.rs:454 — lib/virtual-net/src/ruleset.rs:454-465 | lib/virtual-net/src/ruleset.rs:485-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/ruleset.rs:454` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/virtual-net/src/rx_tx.rs:402 — lib/virtual-net/src/rx_tx.rs:402-413 | lib/virtual-net/src/rx_tx.rs:464-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:402` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) lib/wasix/src/fs/fd_list.rs:255 — lib/wasix/src/fs/fd_list.rs:255-266 | lib/wasix/src/fs/fd_list.rs:278-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/fs/fd_list.rs:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/wasix/src/net/socket.rs:744 — lib/wasix/src/net/socket.rs:744-755 | lib/wasix/src/net/socket.rs:776-787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:744` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/wasix/src/net/socket.rs:775` calls `pin` and `lib/wasix/src/net/socket.rs:743` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) lib/wasix/src/os/task/process.rs:694 — lib/wasix/src/os/task/process.rs:694-705 | lib/wasix/src/os/task/process.rs:734-745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/os/task/process.rs:694` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/wasix/src/os/task/process.rs:708 — lib/wasix/src/os/task/process.rs:708-719 | lib/wasix/src/os/task/process.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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/os/task/process.rs:708` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/wasix/src/runtime/package_loader/builtin_loader.rs:714 — lib/wasix/src/runtime/package_loader/builtin_loader.rs:714-725 | lib/wasix/src/runtime/package_loader/builtin_loader.rs:750-761 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) lib/wasix/src/syscalls/mod.rs:683 — lib/wasix/src/syscalls/mod.rs:683-694 | lib/wasix/src/syscalls/mod.rs:759-770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/mod.rs:683` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) lib/wasix/src/syscalls/wasix/sock_open.rs:31 — lib/wasix/src/syscalls/wasix/sock_open.rs:31-42 | lib/wasix/src/syscalls/wasix/sock_pair.rs:44-55 — 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) lib/wasix/src/syscalls/wasix/sock_send_file.rs:165 — lib/wasix/src/syscalls/wasix/sock_send_file.rs:165-176 | lib/wasix/src/syscalls/wasix/sock_send_file.rs:178-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • + 1 more in this group — see findings.md.
D2 · Cognitive Complexity · wasmer_wasix · ×22
  • wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal (cognitive 128) lib/wasix/src/syscalls/wasi/fd_write.rs:243 — wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal has cognitive complexity 128 (threshold 15). Drivers by points: if/else 26 (65 pts), match/switch 12 (34 pts), loops 8 (25 pts), boolean chains 4 (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_wasix::syscalls::wasix::path_open2::path_open_internal_with_symlink_depth (cognitive 127) lib/wasix/src/syscalls/wasix/path_open2.rs:186 — wasmer_wasix::syscalls::wasix::path_open2::path_open_internal_with_symlink_depth has cognitive complexity 127 (threshold 15). Drivers by points: if/else 41 (89 pts), match/switch 12 (27 pts), boolean chains 11 (nesting depth added 63). Of this number, 125 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_wasix::syscalls::wasi::fd_read::fd_read_internal (cognitive 76) lib/wasix/src/syscalls/wasi/fd_read.rs:135 — wasmer_wasix::syscalls::wasi::fd_read::fd_read_internal has cognitive complexity 76 (threshold 15). Drivers by points: if/else 20 (38 pts), match/switch 11 (28 pts), loops 4 (8 pts), boolean chains 2 (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.
  • wasmer_wasix::syscalls::wasi::poll_oneoff::poll_oneoff_internal (cognitive 53) lib/wasix/src/syscalls/wasi/poll_oneoff.rs:232 — wasmer_wasix::syscalls::wasi::poll_oneoff::poll_oneoff_internal has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (42 pts), match/switch 4 (5 pts), boolean chains 3, loops 3 (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.
  • wasmer_wasix::syscalls::wasix::proc_exec4::proc_exec4_impl (cognitive 44) lib/wasix/src/syscalls/wasix/proc_exec4.rs:78 — wasmer_wasix::syscalls::wasix::proc_exec4::proc_exec4_impl has cognitive complexity 44 (threshold 15). Drivers by points: match/switch 10 (22 pts), if/else 12 (19 pts), boolean chains 3 (nesting depth added 19). 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.
  • wasmer_wasix::syscalls::wasix::epoll_ctl::epoll_ctl_internal (cognitive 38) lib/wasix/src/syscalls/wasix/epoll_ctl.rs:64 — wasmer_wasix::syscalls::wasix::epoll_ctl::epoll_ctl_internal has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (19 pts), match/switch 7 (19 pts) (nesting depth added 26). 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.
  • wasmer_wasix::syscalls::wasi::path_rename::path_rename_internal (cognitive 36) lib/wasix/src/syscalls/wasi/path_rename.rs:56 — wasmer_wasix::syscalls::wasi::path_rename::path_rename_internal has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 5 (6 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.
  • wasmer_wasix::bin_factory::exec::call_module (cognitive 29) lib/wasix/src/bin_factory/exec.rs:250 — wasmer_wasix::bin_factory::exec::call_module has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_wasix::runners::wasi_common::prepare_filesystem (cognitive 23) lib/wasix/src/runners/wasi_common.rs:226 — wasmer_wasix::runners::wasi_common::prepare_filesystem has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 3 (6 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_wasix::syscalls::wasix::epoll_wait::epoll_wait (cognitive 22) lib/wasix/src/syscalls/wasix/epoll_wait.rs:17 — wasmer_wasix::syscalls::wasix::epoll_wait::epoll_wait has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 3 (4 pts), loops 2 (3 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.
  • wasmer_wasix::syscalls::journal::restore_snapshot::restore_snapshot (cognitive 21) lib/wasix/src/syscalls/journal/restore_snapshot.rs:9 — wasmer_wasix::syscalls::journal::restore_snapshot::restore_snapshot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 6 (8 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.
  • wasmer_wasix::syscalls::wasix::proc_spawn::proc_spawn_internal (cognitive 21) lib/wasix/src/syscalls/wasix/proc_spawn.rs:100 — wasmer_wasix::syscalls::wasix::proc_spawn::proc_spawn_internal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 7 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_wasix::syscalls::wasix::proc_join::proc_join_internal (cognitive 19) lib/wasix/src/syscalls/wasix/proc_join.rs:35 — wasmer_wasix::syscalls::wasix::proc_join::proc_join_internal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 6 (8 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.
  • wasmer_wasix::syscalls::wasix::proc_spawn3::proc_spawn3_impl (cognitive 19) lib/wasix/src/syscalls/wasix/proc_spawn3.rs:89 — wasmer_wasix::syscalls::wasix::proc_spawn3::proc_spawn3_impl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 4 (5 pts), boolean chains 3, 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.
  • wasmer_wasix::syscalls::wasi::path_link::path_link_internal (cognitive 18) lib/wasix/src/syscalls/wasi/path_link.rs:73 — wasmer_wasix::syscalls::wasi::path_link::path_link_internal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 5 (9 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.
  • wasmer_wasix::runtime::resolver::resolve::resolve_package (cognitive 17) lib/wasix/src/runtime/resolver/resolve.rs:790 — wasmer_wasix::runtime::resolver::resolve::resolve_package has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 2 (6 pts), if/else 3 (5 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_wasix::bin_factory::exec::resume_vfork (cognitive 16) lib/wasix/src/bin_factory/exec.rs:410 — wasmer_wasix::bin_factory::exec::resume_vfork has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 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.
  • wasmer_wasix::runtime::resolver::resolve::discover_dependencies_once (cognitive 16) lib/wasix/src/runtime/resolver/resolve.rs:177 — wasmer_wasix::runtime::resolver::resolve::discover_dependencies_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_wasix::state::linker::locator::locate_module (cognitive 16) lib/wasix/src/state/linker/locator.rs:17 — wasmer_wasix::state::linker::locator::locate_module has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 3 (6 pts), loops 1 (2 pts) (nesting depth added 6). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_wasix::syscalls::wasi::fd_filestat_set_times::fd_filestat_set_times_internal (cognitive 16) lib/wasix/src/syscalls/wasi/fd_filestat_set_times.rs:43 — wasmer_wasix::syscalls::wasi::fd_filestat_set_times::fd_filestat_set_times_internal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (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.
  • wasmer_wasix::syscalls::wasi::path_unlink_file::path_unlink_file_internal (cognitive 16) lib/wasix/src/syscalls/wasi/path_unlink_file.rs:46 — wasmer_wasix::syscalls::wasi::path_unlink_file::path_unlink_file_internal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (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.
  • wasmer_wasix::syscalls::wasix::proc_fork::proc_fork (cognitive 16) lib/wasix/src/syscalls/wasix/proc_fork.rs:23 — wasmer_wasix::syscalls::wasix::proc_fork::proc_fork has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 5 (6 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×22
  • Duplicated block (14 lines × 2) lib/api/src/backend/mod.rs:46 — lib/api/src/backend/mod.rs:46-59 | lib/api/src/backend/mod.rs:73-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) lib/api/src/utils/polyfill.rs:845 — lib/api/src/utils/polyfill.rs:845-858 | lib/compiler/src/translator/sections.rs:592-605 — before extracting anything, compare `lib/api/src/utils/polyfill.rs` and `lib/compiler/src/translator/sections.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) lib/backend-api/src/query.rs:1768 — lib/backend-api/src/query.rs:1768-1781 | lib/backend-api/src/query.rs:1804-1817 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/backend-api/src/query.rs:1768` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/compiler-cranelift/src/elf.rs:124 — lib/compiler-cranelift/src/elf.rs:124-137 | lib/compiler/src/dwarf.rs:140-153 — before extracting anything, compare `lib/compiler-cranelift/src/elf.rs` and `lib/compiler/src/dwarf.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/elf.rs:124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/compiler-llvm/src/translator/code.rs:4043 — lib/compiler-llvm/src/translator/code.rs:4043-4056 | lib/compiler-llvm/src/translator/code.rs:4099-4112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4043` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/compiler-llvm/src/translator/code.rs:7309 — lib/compiler-llvm/src/translator/code.rs:7309-7322 | lib/compiler-llvm/src/translator/code.rs:7328-7341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/compiler-llvm/src/translator/code.rs:8560 — lib/compiler-llvm/src/translator/code.rs:8560-8573 | lib/compiler-llvm/src/translator/code.rs:8588-8601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8560` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1115 — lib/compiler-singlepass/src/machine_arm64.rs:1115-1128 | lib/compiler-singlepass/src/machine_arm64.rs:1133-1146 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_arm64.rs:2066 — lib/compiler-singlepass/src/machine_arm64.rs:2066-2079 | lib/compiler-singlepass/src/machine_riscv.rs:2448-2461 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) lib/compiler-singlepass/src/machine_riscv.rs:1125 — lib/compiler-singlepass/src/machine_riscv.rs:1125-1138 | lib/compiler-singlepass/src/machine_riscv.rs:1242-1255 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:1069 — lib/compiler-singlepass/src/machine_x64.rs:1069-1082 | lib/compiler-singlepass/src/machine_x64.rs:1482-1495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1069` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:1408 — lib/compiler-singlepass/src/machine_x64.rs:1408-1421 | lib/compiler-singlepass/src/machine_x64.rs:1795-1808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1408` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:2786 — lib/compiler-singlepass/src/machine_x64.rs:2786-2799 | lib/compiler-singlepass/src/machine_x64.rs:2842-2855 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:4569 — lib/compiler-singlepass/src/machine_x64.rs:4569-4582 | lib/compiler-singlepass/src/machine_x64.rs:4625-4638 — both copies are in the same file, so extract the block into 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) lib/compiler/src/engine/artifact.rs:528 — lib/compiler/src/engine/artifact.rs:528-541 | lib/compiler/src/engine/artifact.rs:544-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/artifact.rs:528` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/wasix/src/net/socket.rs:1343 — lib/wasix/src/net/socket.rs:1343-1356 | lib/wasix/src/net/socket.rs:1427-1440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1343` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/wasix/src/syscalls/journal/restore_snapshot.rs:39 — lib/wasix/src/syscalls/journal/restore_snapshot.rs:39-52 | lib/wasix/src/syscalls/journal/restore_snapshot.rs:56-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/journal/restore_snapshot.rs:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/wasix/src/syscalls/wasi/fd_write.rs:50 — lib/wasix/src/syscalls/wasi/fd_write.rs:50-63 | lib/wasix/src/syscalls/wasi/fd_write.rs:104-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasi/fd_write.rs:50` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/wasix/src/syscalls/wasix/sock_send.rs:70 — lib/wasix/src/syscalls/wasix/sock_send.rs:70-83 | lib/wasix/src/syscalls/wasix/sock_send_to.rs:67-80 — before extracting anything, compare `lib/wasix/src/syscalls/wasix/sock_send.rs` and `lib/wasix/src/syscalls/wasix/sock_send_to.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/sock_send.rs:70` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/wasix/src/syscalls/wasix/path_open2.rs:91 — lib/wasix/src/syscalls/wasix/path_open2.rs:91-105 | lib/wasix/src/syscalls/wasix/sock_accept.rs:87-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/path_open2.rs:91` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/wasix/src/net/socket.rs:529 — lib/wasix/src/net/socket.rs:529-542 | lib/wasix/src/net/socket.rs:551-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:529` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) lib/virtual-fs/src/mem_fs/file.rs:393 — lib/virtual-fs/src/mem_fs/file.rs:393-406 | lib/virtual-fs/src/mem_fs/file.rs:457-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/file.rs:393` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D15 · Churn × Complexity Hotspots · Hotspot · ×18
  • Hotspot: lib/compiler-singlepass/src/codegen.rs lib/compiler-singlepass/src/codegen.rs:1219 — lib/compiler-singlepass/src/codegen.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 360 in FuncGen::feed_operator at line 1219. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-singlepass/src/codegen.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: lib/compiler-cranelift/src/translator/code_translator.rs lib/compiler-cranelift/src/translator/code_translator.rs:159 — lib/compiler-cranelift/src/translator/code_translator.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 403 in wasmer_compiler_cranelift::translator::code_translator::translate_operator at line 159. 2 of those changes were fix/bug commits, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-cranelift/src/translator/code_translator.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: lib/compiler-llvm/src/translator/code.rs lib/compiler-llvm/src/translator/code.rs:3154 — lib/compiler-llvm/src/translator/code.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in LLVMFunctionCodeGenerator::translate_basic_operator at line 3154. 6 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-llvm/src/translator/code.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: lib/compiler/src/engine/mapped_binary.rs lib/compiler/src/engine/mapped_binary.rs:348 — lib/compiler/src/engine/mapped_binary.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in MemoryMappedBinary::try_from_source at line 348. 3 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler/src/engine/mapped_binary.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: lib/compiler/src/engine/artifact.rs lib/compiler/src/engine/artifact.rs:476 — lib/compiler/src/engine/artifact.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Artifact::from_parts_with_module_file at line 476. 2 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler/src/engine/artifact.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: lib/compiler-singlepass/src/compiler.rs lib/compiler-singlepass/src/compiler.rs:67 — lib/compiler-singlepass/src/compiler.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in SinglepassCompiler::compile_module_internal at line 67. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-singlepass/src/compiler.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: lib/cli/src/commands/app/deploy.rs lib/cli/src/commands/app/deploy.rs:565 — lib/cli/src/commands/app/deploy.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in CmdAppDeploy::run_async at line 565. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/cli/src/commands/app/deploy.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: lib/cli/src/backend.rs lib/cli/src/backend.rs:594 — lib/cli/src/backend.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in BackendType::get_engine at line 594. 1 of those changes was a fix/bug commit, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/cli/src/backend.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: lib/wasix/src/syscalls/wasi/fd_write.rs lib/wasix/src/syscalls/wasi/fd_write.rs:243 — lib/wasix/src/syscalls/wasi/fd_write.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal at line 243. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/wasix/src/syscalls/wasi/fd_write.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: lib/compiler-cranelift/src/elf.rs lib/compiler-cranelift/src/elf.rs:238 — lib/compiler-cranelift/src/elf.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in wasmer_compiler_cranelift::elf::emit_local_function at line 238. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-cranelift/src/elf.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: lib/compiler-llvm/src/compiler.rs lib/compiler-llvm/src/compiler.rs:248 — lib/compiler-llvm/src/compiler.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in LLVMCompiler::compile_module at line 248. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-llvm/src/compiler.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: scripts/make-release.py scripts/make-release.py:78 — scripts/make-release.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in make-release.make_release at line 78. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- scripts/make-release.py`: 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: lib/compiler-cranelift/src/compiler.rs lib/compiler-cranelift/src/compiler.rs:107 — lib/compiler-cranelift/src/compiler.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in CraneliftCompiler::compile_module_internal at line 107. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-cranelift/src/compiler.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: lib/wasix/src/syscalls/wasix/proc_spawn3.rs lib/wasix/src/syscalls/wasix/proc_spawn3.rs:89 — lib/wasix/src/syscalls/wasix/proc_spawn3.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in wasmer_wasix::syscalls::wasix::proc_spawn3::proc_spawn3_impl at line 89. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/wasix/src/syscalls/wasix/proc_spawn3.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: lib/wasix/src/syscalls/wasi/path_rename.rs lib/wasix/src/syscalls/wasi/path_rename.rs:56 — lib/wasix/src/syscalls/wasi/path_rename.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in wasmer_wasix::syscalls::wasi::path_rename::path_rename_internal at line 56. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/wasix/src/syscalls/wasi/path_rename.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: lib/wasix/src/syscalls/wasix/proc_exec4.rs lib/wasix/src/syscalls/wasix/proc_exec4.rs:78 — lib/wasix/src/syscalls/wasix/proc_exec4.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in wasmer_wasix::syscalls::wasix::proc_exec4::proc_exec4_impl at line 78. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/wasix/src/syscalls/wasix/proc_exec4.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: lib/wasix/src/state/builder.rs lib/wasix/src/state/builder.rs:884 — lib/wasix/src/state/builder.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in WasiEnvBuilder::build_init at line 884. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/wasix/src/state/builder.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: lib/compiler-singlepass/src/emitter_arm64.rs lib/compiler-singlepass/src/emitter_arm64.rs:3108 — lib/compiler-singlepass/src/emitter_arm64.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in wasmer_compiler_singlepass::emitter_arm64::gen_import_call_trampoline_arm64 at line 3108. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-singlepass/src/emitter_arm64.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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×18
  • Edited copy of a member (15 corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:1536 — lib/compiler-singlepass/src/emitter_x64.rs:1536-1550 | lib/compiler-singlepass/src/emitter_x64.rs:1552-1566 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:2128 — lib/compiler-singlepass/src/emitter_x64.rs:2128-2142 | lib/compiler-singlepass/src/emitter_x64.rs:2150-2164 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/virtual-net/src/host.rs:417 — lib/virtual-net/src/host.rs:417-431 | lib/virtual-net/src/host.rs:433-447 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/wasix/src/syscalls/wasix/sock_set_opt_flag.rs:19 — lib/wasix/src/syscalls/wasix/sock_set_opt_flag.rs:19-39 | lib/wasix/src/syscalls/wasix/sock_set_opt_size.rs:19-33 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/wasix/src/net/socket.rs:1702 — lib/wasix/src/net/socket.rs:1702-1716 | lib/wasix/src/net/socket.rs:1723-1737 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/api/src/utils/mem/mod.rs:340 — lib/api/src/utils/mem/mod.rs:340-354 | lib/api/src/utils/mem/mod.rs:358-372 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2457 — lib/compiler-singlepass/src/machine_arm64.rs:2457-2471 | lib/compiler-singlepass/src/machine_riscv.rs:2910-2924 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/c-api-imports/src/lib.rs:2006 — lib/c-api-imports/src/lib.rs:2006-2024 | lib/c-api-imports/src/lib.rs:2044-2058 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/virtual-net/src/client.rs:1530 — lib/virtual-net/src/client.rs:1530-1545 | lib/virtual-net/src/client.rs:1547-1561 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/api/src/utils/polyfill.rs:695 — lib/api/src/utils/polyfill.rs:695-709 | lib/compiler/src/translator/sections.rs:220-237 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:2127 — lib/compiler-singlepass/src/machine_riscv.rs:2127-2141 | lib/compiler-singlepass/src/machine_riscv.rs:2143-2157 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/api/src/backend/js/utils/convert.rs:309 — lib/api/src/backend/js/utils/convert.rs:309-323 | lib/api/src/backend/js/utils/convert.rs:336-350 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/api/src/utils/polyfill.rs:191 — lib/api/src/utils/polyfill.rs:191-205 | lib/compiler/src/translator/environ.rs:197-211 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/api/src/utils/polyfill.rs:212 — lib/api/src/utils/polyfill.rs:212-226 | lib/compiler/src/translator/environ.rs:218-234 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/api/src/utils/polyfill.rs:233 — lib/api/src/utils/polyfill.rs:233-247 | lib/compiler/src/translator/environ.rs:241-255 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/virtual-net/src/client.rs:114 — lib/virtual-net/src/client.rs:114-129 | lib/virtual-net/src/server.rs:87-101 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/api/src/backend/js/utils/convert.rs:364 — lib/api/src/backend/js/utils/convert.rs:364-378 | lib/api/src/backend/js/utils/convert.rs:392-406 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/virtual-fs/src/mem_fs/filesystem.rs:1000 — lib/virtual-fs/src/mem_fs/filesystem.rs:1000-1014 | lib/virtual-fs/src/mem_fs/filesystem.rs:1024-1038 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D3 · God Classes · TooManyMethods · ×17
  • TooManyMethods: TypedFunction lib/api/src/utils/native/typed_func.rs:23 — TooManyMethods — 173 methods, declared across 4 files: function/typed.rs (64), function/typed.rs (64), function/typed.rs (43), native/typed_func.rs (2). The bar is 30 methods; this is 143 over it, 5.77× 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: JournalEffector lib/wasix/src/journal/effector/mod.rs:104 — TooManyMethods — 117 methods, declared across 59 files: effector/memory_and_snapshot.rs (2), effector/process_exit.rs (2), syscalls/chdir.rs (2), syscalls/clock_time.rs (2), +55 more file(s). The bar is 30 methods; this is 87 over it, 3.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FuncEnvironment lib/compiler-cranelift/src/func_environ.rs:89 — TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.30× 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: WasiEnvBuilder lib/wasix/src/state/builder.rs:51 — TooManyMethods — 84 methods. The bar is 30 methods; this is 54 over it, 2.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: VMOffsets lib/types/src/vmoffsets.rs:204 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.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: Instance lib/vm/src/instance/mod.rs:55 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.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: WasiFs lib/wasix/src/fs/mod.rs:569 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× 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: WasiEnv lib/wasix/src/state/env.rs:185 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.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: LLVMFunctionCodeGenerator lib/compiler-llvm/src/translator/code.rs:2454 — 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: MachineX86_64 lib/compiler-singlepass/src/machine_x64.rs:94 — 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: MachineARM64 lib/compiler-singlepass/src/machine_arm64.rs:36 — 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: ModuleEnvironment lib/compiler/src/translator/environ.rs:62 — 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: InodeSocket lib/wasix/src/net/socket.rs:237 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× 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: MachineRiscv lib/compiler-singlepass/src/machine_riscv.rs:76 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WasiRunner lib/wasix/src/runners/wasi.rs:26 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WasiThread lib/wasix/src/os/task/thread.rs:98 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Artifact lib/compiler/src/engine/artifact.rs:159 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D35 · Change Coupling · Change coupling · ×17
  • Change coupling: filesystem_source.rs ↔ web_source.rs lib/wasix/src/runtime/resolver/filesystem_source.rs:1 — `lib/wasix/src/runtime/resolver/filesystem_source.rs` and `lib/wasix/src/runtime/resolver/web_source.rs` change together 82% of the time (9 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `c454c2a7` fix warnings; `8d74bf12` add utils for Container creation; `d3ada875` move container, volume and migration back to webc — run `git show` on any of them.
  • Change coupling: sock_send.rs ↔ sock_send_to.rs lib/wasix/src/syscalls/wasix/sock_send.rs:1 — `lib/wasix/src/syscalls/wasix/sock_send.rs` and `lib/wasix/src/syscalls/wasix/sock_send_to.rs` change together 77% of the time (10 of the 13 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 10 shared commits counted here, the most recent 3 are `03165a20` Connected udp peer state (#6738); `68604f18` More linting fixes; `61c68250` Split the port and socket syscalls so they can be invokes seperately — run `git show` on any of them.
  • Change coupling: exec.rs ↔ proc_exit.rs lib/wasix/src/bin_factory/exec.rs:1 — `lib/wasix/src/bin_factory/exec.rs` and `lib/wasix/src/syscalls/wasi/proc_exit.rs` change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 11 shared commits counted here, the most recent 3 are `2293567a` feat!(api): replace the OnCalledAction store hook with per-call CallW…; `d8efe0b8` feat!(api): replace the OnCalledAction store hook with per-call CallW…; `b92cd508` Adjust WasiVFork — run `git show` on any of them.
  • Change coupling: client.rs ↔ server.rs lib/virtual-net/src/client.rs:1 — `lib/virtual-net/src/client.rs` and `lib/virtual-net/src/server.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `e4244c1f` Various fixes to get wasmer-js compiling; `f5bee5d4` Upgrade hyper to 1.0 across the repo; `ba9e62b4` - Added more methods to the interest handler for expanded functionali… — run `git show` on any of them.
  • Change coupling: context_destroy.rs ↔ context_switch.rs lib/wasix/src/syscalls/wasix/context_destroy.rs:1 — `lib/wasix/src/syscalls/wasix/context_destroy.rs` and `lib/wasix/src/syscalls/wasix/context_switch.rs` change together 62% of the time (10 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 10 shared commits counted here, the most recent 3 are `22452b2c` Rename the functions of context_switching; `f0f31269` Add support for engines not supporting async execution; `bbd2f544` Rename context switching context to context-switching environment — run `git show` on any of them.
  • Change coupling: context_create.rs ↔ context_destroy.rs lib/wasix/src/syscalls/wasix/context_create.rs:1 — `lib/wasix/src/syscalls/wasix/context_create.rs` and `lib/wasix/src/syscalls/wasix/context_destroy.rs` change together 62% of the time (10 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 10 shared commits counted here, the most recent 3 are `f0f31269` Add support for engines not supporting async execution; `bbd2f544` Rename context switching context to context-switching environment; `1a810630` Organize imports in context switching functions — run `git show` on any of them.
  • Change coupling: sock_recv.rs ↔ sock_send.rs lib/wasix/src/syscalls/wasix/sock_recv.rs:1 — `lib/wasix/src/syscalls/wasix/sock_recv.rs` and `lib/wasix/src/syscalls/wasix/sock_send.rs` change together 60% of the time (12 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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 12 shared commits counted here, the most recent 3 are `db310f1e` fix(wasix): make sock_send/sock_recv handle PipeTx/PipeRx like pipe-b…; `de25a3ec` Fix calling sock_send with an FD from a socket pair; `387a89c3` Fix calling sock_send with an FD from a socket pair — run `git show` on any of them.
  • Change coupling: inspect.rs ↔ validate.rs lib/cli/src/commands/inspect.rs:1 — `lib/cli/src/commands/inspect.rs` and `lib/cli/src/commands/validate.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 6 shared commits counted here, the most recent 3 are `c8ddde53` remove unncessary hash options for validate and inspect; `22c1935f` fix jsc build; `010625ae` add hash algorithm option to the engine — run `git show` on any of them.
  • Change coupling: task_join_handle.rs ↔ env.rs lib/wasix/src/os/task/task_join_handle.rs:1 — `lib/wasix/src/os/task/task_join_handle.rs` and `lib/wasix/src/state/env.rs` change together 58% of the time (7 of the 12 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 7 shared commits counted here, the most recent 3 are `68fedb87` Fixed an issue where ctrl-c was not triggering during deep threading …; `9e3f3c03` Now reusing DCGI instances but not the memory associated with them; `a41bf19d` Refactored the exit codes so they can be strongly typed and arbitary (at that commit the files were still `lib/wasi/src/os/task/task_join_handle.rs` and `lib/wasi/src/state/env.rs`) — run `git show` on any of them.
  • Change coupling: exec.rs ↔ mod.rs lib/wasix/src/bin_factory/exec.rs:1 — `lib/wasix/src/bin_factory/exec.rs` and `lib/wasix/src/os/command/mod.rs` change together 56% of the time (9 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 — 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 9 shared commits counted here, the most recent 3 are `83a75a02` Refactor how `InlineWaker::block_on` works, while also refactoring `I…; `752f9ad2` Rename WasiRuntime to Runtime (at that commit the files were still `lib/wasi/src/bin_factory/exec.rs` and `lib/wasi/src/os/command/mod.rs`); `a41bf19d` Refactored the exit codes so they can be strongly typed and arbitary (at that commit the files were still `lib/wasi/src/bin_factory/exec.rs` and `lib/wasi/src/os/command/mod.rs`) — run `git show` on any of them.
  • Change coupling: futex_wait.rs ↔ thread_sleep.rs lib/wasix/src/syscalls/wasix/futex_wait.rs:1 — `lib/wasix/src/syscalls/wasix/futex_wait.rs` and `lib/wasix/src/syscalls/wasix/thread_sleep.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 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 6 shared commits counted here, the most recent 3 are `3713f1c6` Implemented an exponential CPU backoff that kicks in when a run token…; `45d98097` DProxy now correctly snapshots threads to the journal; `24368b50` More wiring of the snapshot options and the intercepts — run `git show` on any of them.
  • Change coupling: epoll_ctl.rs ↔ epoll_wait.rs lib/wasix/src/syscalls/wasix/epoll_ctl.rs:1 — `lib/wasix/src/syscalls/wasix/epoll_ctl.rs` and `lib/wasix/src/syscalls/wasix/epoll_wait.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 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 6 shared commits counted here, the most recent 3 are `06082328` fix(wasix): Refactor EPOLL implementation; `94f2b9c0` Rework how pipes and event FDs interact with the epoll system; `31bf65dd` Fixed an issue where the notifications were not renewed on epoll enab… — run `git show` on any of them.
  • Change coupling: poll_oneoff.rs ↔ thread_sleep.rs lib/wasix/src/syscalls/wasi/poll_oneoff.rs:1 — `lib/wasix/src/syscalls/wasi/poll_oneoff.rs` and `lib/wasix/src/syscalls/wasix/thread_sleep.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 `3713f1c6` Implemented an exponential CPU backoff that kicks in when a run token…; `45d98097` DProxy now correctly snapshots threads to the journal; `24368b50` More wiring of the snapshot options and the intercepts — run `git show` on any of them.
  • Change coupling: stack_checkpoint.rs ↔ thread_spawn.rs lib/wasix/src/syscalls/wasix/stack_checkpoint.rs:1 — `lib/wasix/src/syscalls/wasix/stack_checkpoint.rs` and `lib/wasix/src/syscalls/wasix/thread_spawn.rs` change together 54% of the time (7 of the 13 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 7 shared commits counted here, the most recent 3 are `13203fde` Renamed InstanceSnapshot to StoreSnapshot which better reflects its p…; `31c4a61f` Refactored the snapshot feature toggle; `e2fd1daa` Removed the default stack size as its unreliable (at that commit the files were still `lib/wasi/src/syscalls/wasix/stack_checkpoint.rs` and `lib/wasi/src/syscalls/wasix/thread_spawn.rs`) — run `git show` on any of them.
  • Change coupling: push.rs ↔ tag.rs lib/cli/src/commands/package/push.rs:1 — `lib/cli/src/commands/package/push.rs` and `lib/cli/src/commands/package/tag.rs` change together 50% of the time (9 of the 18 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 `e8c35d76` fix(cli): Actively wait for packages only after tag; `ba4b735e` fix(cli): More fixes on final user-facing messages; `6944f370` feat(cli): Better final messages for `push`, `tag` and `publish` — run `git show` on any of them.
  • Change coupling: binary_package.rs ↔ outputs.rs lib/wasix/src/bin_factory/binary_package.rs:1 — `lib/wasix/src/bin_factory/binary_package.rs` and `lib/wasix/src/runtime/resolver/outputs.rs` change together 50% of the time (7 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 — 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 7 shared commits counted here, the most recent 3 are `d3f235f0` Partially resolve compilation errors after merge; `f4b1f202` catch up to latest webc changes; `c06e2cb4` wasmer can now run unnamed packages — run `git show` on any of them.
  • Change coupling: create.rs ↔ mod.rs lib/cli/src/commands/app/create.rs:1 — `lib/cli/src/commands/app/create.rs` and `lib/cli/src/utils/package_wizard/mod.rs` change together 50% of the time (6 of the 12 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 `fc6471e4` feat(cli): Use registry templates to create new apps; `1a3a6521` Improved prompting; `cf4f322e` [skip ci] Fix CLI tests, resolve review comments — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×17
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/api/src/backend/js/entities/memory/view.rs:254 — lib/api/src/backend/js/entities/memory/view.rs:254-267 | lib/api/src/backend/sys/entities/memory/view.rs:177-190 | lib/api/src/backend/v8/entities/memory/view.rs:172-185 | lib/api/src/entities/memory/view/inner.rs:207-220 — 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) lib/api/src/backend/sys/entities/memory/mod.rs:288 — lib/api/src/backend/sys/entities/memory/mod.rs:288-318 | lib/api/src/backend/sys/entities/memory/mod.rs:320-349 | lib/api/src/backend/v8/entities/memory/mod.rs:342-376 | lib/api/src/backend/v8/entities/memory/mod.rs:379-413 — 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) lib/api/src/entities/function/inner.rs:224 — lib/api/src/entities/function/inner.rs:224-237 | lib/api/src/entities/function/inner.rs:259-276 | lib/api/src/entities/function/inner.rs:289-302 | lib/api/src/entities/function/inner.rs:316-333 — 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) lib/backend-api/src/query.rs:1430 — lib/backend-api/src/query.rs:1430-1457 | lib/backend-api/src/query.rs:2189-2216 | lib/backend-api/src/query.rs:2222-2249 | lib/backend-api/src/query.rs:2627-2654 — 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) lib/cli/src/commands/app/secrets/create.rs:58 — lib/cli/src/commands/app/secrets/create.rs:58-71 | lib/cli/src/commands/app/secrets/delete.rs:60-73 | lib/cli/src/commands/app/secrets/reveal.rs:49-62 | lib/cli/src/commands/app/secrets/update.rs:63-76 — 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) lib/compiler-cranelift/src/func_environ.rs:2185 — lib/compiler-cranelift/src/func_environ.rs:2185-2200 | lib/compiler-cranelift/src/func_environ.rs:2212-2228 | lib/compiler-cranelift/src/func_environ.rs:2268-2294 | lib/compiler-cranelift/src/func_environ.rs:2304-2321 — 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) lib/compiler-llvm/src/translator/intrinsics.rs:1485 — lib/compiler-llvm/src/translator/intrinsics.rs:1485-1579 | lib/compiler-llvm/src/translator/intrinsics.rs:1589-1650 | lib/compiler-llvm/src/translator/intrinsics.rs:1778-1851 | lib/compiler-llvm/src/translator/trampoline.rs:447-590 — 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) lib/compiler-singlepass/src/emitter_x64.rs:1946 — lib/compiler-singlepass/src/emitter_x64.rs:1946-1955 | lib/compiler-singlepass/src/emitter_x64.rs:1976-1985 | lib/compiler-singlepass/src/emitter_x64.rs:2006-2015 | lib/compiler-singlepass/src/emitter_x64.rs:2036-2045 — 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) lib/compiler-singlepass/src/emitter_x64.rs:1961 — lib/compiler-singlepass/src/emitter_x64.rs:1961-1970 | lib/compiler-singlepass/src/emitter_x64.rs:1991-2000 | lib/compiler-singlepass/src/emitter_x64.rs:2021-2030 | lib/compiler-singlepass/src/emitter_x64.rs:2051-2060 — 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) lib/compiler-singlepass/src/machine_arm64.rs:2065 — lib/compiler-singlepass/src/machine_arm64.rs:2065-2146 | lib/compiler-singlepass/src/machine_riscv.rs:1108-1177 | lib/compiler-singlepass/src/machine_riscv.rs:1220-1279 | lib/compiler-singlepass/src/machine_riscv.rs:2447-2513 — 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) lib/compiler-singlepass/src/machine_arm64.rs:7658 — lib/compiler-singlepass/src/machine_arm64.rs:7658-7689 | lib/compiler-singlepass/src/machine_arm64.rs:7697-7728 | lib/compiler-singlepass/src/machine_arm64.rs:7736-7767 | lib/compiler-singlepass/src/machine_arm64.rs:7775-7806 — 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) lib/compiler-singlepass/src/machine_arm64.rs:7886 — lib/compiler-singlepass/src/machine_arm64.rs:7886-7898 | lib/compiler-singlepass/src/machine_arm64.rs:7924-7936 | lib/compiler-singlepass/src/machine_arm64.rs:8171-8183 | lib/compiler-singlepass/src/machine_arm64.rs:8209-8221 — 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) lib/compiler-singlepass/src/machine_arm64.rs:7905 — lib/compiler-singlepass/src/machine_arm64.rs:7905-7917 | lib/compiler-singlepass/src/machine_arm64.rs:7943-7955 | lib/compiler-singlepass/src/machine_arm64.rs:8190-8202 | lib/compiler-singlepass/src/machine_arm64.rs:8228-8240 — 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) lib/compiler-singlepass/src/machine_x64.rs:6889 — lib/compiler-singlepass/src/machine_x64.rs:6889-6945 | lib/compiler-singlepass/src/machine_x64.rs:6952-6982 | lib/compiler-singlepass/src/machine_x64.rs:6989-7045 | lib/compiler-singlepass/src/machine_x64.rs:7052-7082 — 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) lib/virtual-fs/src/cow_file.rs:151 — lib/virtual-fs/src/cow_file.rs:151-158 | lib/virtual-fs/src/cow_file.rs:164-171 | lib/virtual-fs/src/cow_file.rs:274-281 | lib/virtual-fs/src/overlay_fs.rs:749-1302 — 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) lib/wasix/src/net/socket.rs:1252 — lib/wasix/src/net/socket.rs:1252-1263 | lib/wasix/src/net/socket.rs:1265-1276 | lib/wasix/src/net/socket.rs:1278-1289 | lib/wasix/src/net/socket.rs:1291-1302 — 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) lib/wasix/src/syscalls/wasi/path_filestat_set_times.rs:31 — lib/wasix/src/syscalls/wasi/path_filestat_set_times.rs:31-69 | lib/wasix/src/syscalls/wasi/path_rename.rs:30-54 | lib/wasix/src/syscalls/wasi/path_symlink.rs:25-54 | lib/wasix/src/syscalls/wasi/path_unlink_file.rs:19-44 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×16
  • Edited copy of a member (10 corresponding lines) lib/api/src/entities/function/env/inner.rs:124 — lib/api/src/entities/function/env/inner.rs:124-133 | lib/api/src/entities/function/env/inner.rs:136-145 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/api/src/backend/js/entities/function/mod.rs:617 — lib/api/src/backend/js/entities/function/mod.rs:617-630 | lib/api/src/backend/sys/entities/function/mod.rs:801-810 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/c-api-imports/src/lib.rs:578 — lib/c-api-imports/src/lib.rs:578-590 | lib/c-api-imports/src/lib.rs:595-604 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/compiler-cranelift/src/translator/func_state.rs:614 — lib/compiler-cranelift/src/translator/func_state.rs:614-623 | lib/compiler-cranelift/src/translator/func_state.rs:634-647 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:1122 — lib/compiler-singlepass/src/emitter_x64.rs:1122-1132 | lib/compiler-singlepass/src/emitter_x64.rs:1133-1142 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/api/src/entities/function/env/inner.rs:244 — lib/api/src/entities/function/env/inner.rs:244-253 | lib/api/src/entities/function/env/inner.rs:257-266 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/virtual-net/src/client.rs:1596 — lib/virtual-net/src/client.rs:1596-1605 | lib/virtual-net/src/client.rs:1611-1620 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/wasix/src/os/epoll/mod.rs:236 — lib/wasix/src/os/epoll/mod.rs:236-245 | lib/wasix/src/os/epoll/mod.rs:251-262 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/wasix/src/state/builder.rs:565 — lib/wasix/src/state/builder.rs:565-574 | lib/wasix/src/state/builder.rs:666-679 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/journal/src/concrete/buffered.rs:43 — lib/journal/src/concrete/buffered.rs:43-52 | lib/journal/src/concrete/transaction.rs:60-69 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/api/src/entities/function/env/inner.rs:408 — lib/api/src/entities/function/env/inner.rs:408-417 | lib/api/src/entities/function/env/inner.rs:419-428 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:371 — lib/compiler-singlepass/src/machine_x64.rs:371-380 | lib/compiler-singlepass/src/machine_x64.rs:448-457 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/api/src/utils/mem/mod.rs:277 — lib/api/src/utils/mem/mod.rs:277-288 | lib/api/src/utils/mem/mod.rs:319-328 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/virtual-net/src/tcp_pair.rs:78 — lib/virtual-net/src/tcp_pair.rs:78-87 | lib/virtual-net/src/tcp_pair.rs:89-98 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:2264 — lib/compiler-singlepass/src/machine_riscv.rs:2264-2276 | lib/compiler-singlepass/src/machine_x64.rs:2273-2282 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1386 — lib/compiler-singlepass/src/machine_arm64.rs:1386-1395 | lib/compiler-singlepass/src/machine_x64.rs:1995-2004 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×15
  • Edited copy of a member (13 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2361 — lib/compiler-singlepass/src/machine_arm64.rs:2361-2377 | lib/compiler-singlepass/src/machine_riscv.rs:2719-2731 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:7962 — lib/compiler-singlepass/src/machine_arm64.rs:7962-7974 | lib/compiler-singlepass/src/machine_arm64.rs:7981-7993 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:8247 — lib/compiler-singlepass/src/machine_arm64.rs:8247-8259 | lib/compiler-singlepass/src/machine_arm64.rs:8266-8278 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:452 — lib/compiler-singlepass/src/machine_arm64.rs:452-464 | lib/compiler-singlepass/src/machine_arm64.rs:495-508 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/wasix/src/syscalls/wasix/sock_bind.rs:58 — lib/wasix/src/syscalls/wasix/sock_bind.rs:58-71 | lib/wasix/src/syscalls/wasix/sock_listen.rs:46-58 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/api/src/backend/sys/entities/instance.rs:33 — lib/api/src/backend/sys/entities/instance.rs:33-45 | lib/api/src/backend/sys/entities/instance.rs:52-64 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1488 — lib/compiler-singlepass/src/machine_arm64.rs:1488-1504 | lib/compiler-singlepass/src/machine_riscv.rs:2036-2048 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/virtual-net/src/host.rs:576 — lib/virtual-net/src/host.rs:576-588 | lib/virtual-net/src/host.rs:964-976 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/api/src/backend/sys/entities/function/mod.rs:603 — lib/api/src/backend/sys/entities/function/mod.rs:603-615 | lib/api/src/backend/sys/entities/function/mod.rs:635-647 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/vm/src/instance/mod.rs:278 — lib/vm/src/instance/mod.rs:278-290 | lib/vm/src/instance/mod.rs:293-305 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/api/src/backend/js/entities/memory/view.rs:142 — lib/api/src/backend/js/entities/memory/view.rs:142-154 | lib/api/src/backend/js/entities/memory/view.rs:231-244 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/c-api-imports/src/lib.rs:1484 — lib/c-api-imports/src/lib.rs:1484-1498 | lib/c-api-imports/src/lib.rs:2064-2076 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/api/src/backend/sys/entities/function/env.rs:272 — lib/api/src/backend/sys/entities/function/env.rs:272-284 | lib/api/src/backend/sys/entities/function/env.rs:288-300 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/backend-api/src/query.rs:1475 — lib/backend-api/src/query.rs:1475-1490 | lib/backend-api/src/query.rs:2607-2619 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/wasix/src/os/task/process.rs:209 — lib/wasix/src/os/task/process.rs:209-221 | lib/wasix/src/syscalls/journal/do_checkpoint_from_outside.rs:8-24 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×15
  • Duplicated block (16 lines × 2) lib/api/src/backend/js/entities/memory/view.rs:118 — lib/api/src/backend/js/entities/memory/view.rs:118-133 | lib/api/src/backend/js/entities/memory/view.rs:171-186 — both copies are in the same file, so extract the block into 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) lib/api/src/utils/mem/access.rs:243 — lib/api/src/utils/mem/access.rs:243-258 | lib/api/src/utils/mem/access.rs:293-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/utils/mem/access.rs:243` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/cli/src/commands/app/create.rs:61 — lib/cli/src/commands/app/create.rs:61-76 | lib/cli/src/commands/app/create.rs:164-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/create.rs:61` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/compiler-llvm/src/translator/code.rs:8715 — lib/compiler-llvm/src/translator/code.rs:8715-8730 | lib/compiler-llvm/src/translator/code.rs:8739-8754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8715` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) lib/compiler-llvm/src/translator/code.rs:11314 — lib/compiler-llvm/src/translator/code.rs:11314-11329 | lib/compiler-llvm/src/translator/code.rs:11342-11357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:11314` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/compiler-singlepass/src/codegen.rs:2364 — lib/compiler-singlepass/src/codegen.rs:2364-2379 | lib/compiler-singlepass/src/codegen.rs:2427-2442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/codegen.rs:2425` calls `pop_value_released` and `lib/compiler-singlepass/src/codegen.rs:2362` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) lib/compiler-singlepass/src/codegen.rs:5568 — lib/compiler-singlepass/src/codegen.rs:5568-5583 | lib/compiler-singlepass/src/codegen.rs:5612-5627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:5568` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:4361 — lib/compiler-singlepass/src/machine_arm64.rs:4361-4376 | lib/compiler-singlepass/src/machine_arm64.rs:7151-7166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:727 — lib/compiler-singlepass/src/machine_x64.rs:727-742 | lib/compiler-singlepass/src/machine_x64.rs:872-887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:727` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:1128 — lib/compiler-singlepass/src/machine_x64.rs:1128-1143 | lib/compiler-singlepass/src/machine_x64.rs:1541-1556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1128` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4372 — lib/compiler-singlepass/src/machine_x64.rs:4372-4387 | lib/compiler-singlepass/src/machine_x64.rs:6715-6730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/compiler/src/engine/artifact.rs:618 — lib/compiler/src/engine/artifact.rs:618-633 | lib/compiler/src/engine/artifact.rs:635-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/artifact.rs:618` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/vm/src/table.rs:343 — lib/vm/src/table.rs:343-358 | lib/vm/src/table.rs:392-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/vm/src/table.rs:343` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) lib/wasix/src/net/socket.rs:1483 — lib/wasix/src/net/socket.rs:1483-1498 | lib/wasix/src/net/socket.rs:1576-1591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1483` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) lib/config/src/package/mod.rs:383 — lib/config/src/package/mod.rs:383-398 | lib/package/src/package/manifest.rs:691-706 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `val` to `&toml::Value` in one and `&toml::value::Value` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×15
  • Duplicated block (9 lines × 3) lib/api/src/backend/sys/entities/function/mod.rs:523 — lib/api/src/backend/sys/entities/function/mod.rs:523-531 | lib/api/src/backend/sys/entities/function/typed.rs:67-75 | lib/api/src/backend/sys/entities/function/typed.rs:200-208 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `store` to `&impl AsStoreRef` in one and `&mut impl AsStoreMut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) lib/compiler-llvm/src/translator/code.rs:5726 — lib/compiler-llvm/src/translator/code.rs:5726-5734 | lib/compiler-llvm/src/translator/code.rs:5786-5794 | lib/compiler-llvm/src/translator/code.rs:5846-5854 — 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) lib/compiler-llvm/src/translator/code.rs:5741 — lib/compiler-llvm/src/translator/code.rs:5741-5749 | lib/compiler-llvm/src/translator/code.rs:5801-5809 | lib/compiler-llvm/src/translator/code.rs:5861-5869 — 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) lib/compiler-llvm/src/translator/code.rs:5756 — lib/compiler-llvm/src/translator/code.rs:5756-5764 | lib/compiler-llvm/src/translator/code.rs:5816-5824 | lib/compiler-llvm/src/translator/code.rs:5876-5884 — 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) lib/compiler-llvm/src/translator/code.rs:5771 — lib/compiler-llvm/src/translator/code.rs:5771-5779 | lib/compiler-llvm/src/translator/code.rs:5831-5839 | lib/compiler-llvm/src/translator/code.rs:5891-5899 — 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) lib/compiler-singlepass/src/machine_riscv.rs:1380 — lib/compiler-singlepass/src/machine_riscv.rs:1380-1388 | lib/compiler-singlepass/src/machine_riscv.rs:1432-1440 | lib/compiler-singlepass/src/machine_riscv.rs:1489-1497 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:1391` calls `move_location`, `Imm32`, `GPR` and `lib/compiler-singlepass/src/machine_riscv.rs:1443` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:7410 — lib/compiler-singlepass/src/machine_x64.rs:7410-7418 | lib/compiler-singlepass/src/machine_x64.rs:7830-7838 | lib/compiler-singlepass/src/machine_x64.rs:7954-7962 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:7410` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) lib/virtual-net/src/client.rs:782 — lib/virtual-net/src/client.rs:782-790 | lib/virtual-net/src/client.rs:813-821 | lib/virtual-net/src/client.rs:863-871 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/client.rs:782` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 3) lib/wasix/src/syscalls/mod.rs:680 — lib/wasix/src/syscalls/mod.rs:680-688 | lib/wasix/src/syscalls/mod.rs:719-727 | lib/wasix/src/syscalls/mod.rs:756-764 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/wasix/src/syscalls/mod.rs:729` calls `tasks`, `clone` and `lib/wasix/src/syscalls/mod.rs:689` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) lib/api/src/backend/js/entities/function/env.rs:146 — lib/api/src/backend/js/entities/function/env.rs:146-154 | lib/api/src/backend/sys/entities/function/env.rs:160-168 | lib/api/src/backend/v8/entities/function/env.rs:140-148 — before extracting anything, compare `lib/api/src/backend/js/entities/function/env.rs` and `lib/api/src/backend/sys/entities/function/env.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/api/src/backend/js/entities/function/env.rs:157` calls `as_store_async` and `lib/api/src/backend/v8/entities/function/env.rs:149` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) lib/api/src/backend/js/entities/store/handle.rs:128 — lib/api/src/backend/js/entities/store/handle.rs:128-136 | lib/api/src/backend/v8/entities/store/obj.rs:258-266 | lib/vm/src/store.rs:271-279 — before extracting anything, compare `lib/api/src/backend/js/entities/store/handle.rs` and `lib/api/src/backend/v8/entities/store/obj.rs` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) lib/api/src/backend/js/entities/function/env.rs:29 — lib/api/src/backend/js/entities/function/env.rs:29-37 | lib/api/src/backend/sys/entities/function/env.rs:23-31 | lib/api/src/backend/v8/entities/function/env.rs:23-31 — before extracting anything, compare `lib/api/src/backend/js/entities/function/env.rs` and `lib/api/src/backend/sys/entities/function/env.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) lib/wasix/src/syscalls/wasix/sock_send.rs:68 — lib/wasix/src/syscalls/wasix/sock_send.rs:68-76 | lib/wasix/src/syscalls/wasix/sock_send_file.rs:36-44 | lib/wasix/src/syscalls/wasix/sock_send_to.rs:64-73 — before extracting anything, compare `lib/wasix/src/syscalls/wasix/sock_send.rs` and `lib/wasix/src/syscalls/wasix/sock_send_to.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/sock_send.rs:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) lib/wasix/src/lib.rs:425 — lib/wasix/src/lib.rs:425-433 | lib/wasix/src/lib.rs:481-489 | lib/wasix/src/lib.rs:546-554 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/wasix/src/lib.rs:422` calls `new_typed_with_env` and `lib/wasix/src/lib.rs:480` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) fuzz/fuzz_targets/cranelift.rs:16 — fuzz/fuzz_targets/cranelift.rs:16-24 | fuzz/fuzz_targets/llvm.rs:16-24 | fuzz/fuzz_targets/misc.rs:10-18 — 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×13
  • Repeated repair: lib/wasix/src/bin_factory/mod.rs lib/wasix/src/bin_factory/mod.rs:209 — lib/wasix/src/bin_factory/mod.rs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is BinFactory::get_executable at line 209), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(wasix): report a shebang chain that never ends as ELOOP”; “fix(wasix): leave the caller's argv alone when a script spawn fails”; “fix(wasix): find an executable that no preopen covers”; “fix(wasix): report an unusable shebang as ENOEXEC instead of compiling it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/wasix/src/bin_factory/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.
  • Repeated repair: lib/compiler-singlepass/src/machine_x64.rs lib/compiler-singlepass/src/machine_x64.rs:129 — lib/compiler-singlepass/src/machine_x64.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is MachineX86_64::emit_relaxed_binop at line 129), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(Singlepass): fix emission of SSE instructions (#7184)”; “fix(Singlepass): use correct value_size for some memory ops (#7079)”; “fix(Singlepass): correctly narrow returned value for atomics (#7066)”; “fix(VMOffsets): handle gracefully u32 -> i32 casting (#6904)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-singlepass/src/machine_x64.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: lib/compiler-cranelift/src/func_environ.rs lib/compiler-cranelift/src/func_environ.rs:1174 — lib/compiler-cranelift/src/func_environ.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is FuncEnvironment::call_with_handlers at line 1174), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cranelift): use RawValue slots for exception payloads (#7156)”; “fix(Cranelift): use i32 for exception references”; “fix(Table): add resource allocation tracking for local Tables (#16)”; “fix(VMOffsets): handle gracefully u32 -> i32 casting (#6904)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-cranelift/src/func_environ.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: lib/wasix/src/http/web_http_client.rs lib/wasix/src/http/web_http_client.rs:138 — lib/wasix/src/http/web_http_client.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is wasmer_wasix::http::web_http_client::fetch at line 138), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(wasix): lower the body presize cap to 64 MiB”; “fix(wasix): limit how much Content-Length reserves up front”; “fix(wasix): read web HTTP bodies into one presized buffer”; “fix(wasix): normalize decoded Fetch response headers (#7043)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/wasix/src/http/web_http_client.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: lib/vm/src/instance/mod.rs lib/vm/src/instance/mod.rs:1483 — lib/vm/src/instance/mod.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is wasmer_vm::instance::eval_init_expr at line 1483), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(Table): sync correctly embedded VMContext table (#41) (#7133)”; “fix(LLVM): correctly pass m0 param for direct and indirect calls (#7131)”; “fix(Table): handle type mismatch for set/elem/grow/copy/new operations (#7130)”; “fix(Table): add resource allocation tracking for local Tables (#16)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/vm/src/instance/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.
  • Repeated repair: lib/vm/src/table.rs lib/vm/src/table.rs:281 — lib/vm/src/table.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is VMTable::set_with_construction at line 281), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(Table): sync correctly embedded VMContext table (#41) (#7133)”; “fix(Table): handle type mismatch for set/elem/grow/copy/new operations (#7130)”; “fix(Table): add resource allocation tracking for local Tables (#16)”; “fix(Table): handle table.grow boundary limit”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/vm/src/table.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: lib/wasix/src/syscalls/wasi/path_unlink_file.rs lib/wasix/src/syscalls/wasi/path_unlink_file.rs:46 — lib/wasix/src/syscalls/wasi/path_unlink_file.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is wasmer_wasix::syscalls::wasi::path_unlink_file::path_unlink_file_internal at line 46), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(wasix): unify directory unlink validation after rights checks”; “fix(wasix): reject directories in path_unlink_file before touching the directory cache”; “fix(wasix): preserve directory state on rejected file unlink”; “fix(wasix): enforce preopen rights on the resolved path (#7119)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/wasix/src/syscalls/wasi/path_unlink_file.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: lib/api/src/backend/sys/entities/function/mod.rs lib/api/src/backend/sys/entities/function/mod.rs:836 — lib/api/src/backend/sys/entities/function/mod.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is DynamicFunction::func_wrapper at line 836), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(api): make call_wrapped re-entry and store access sound”; “fix(LLVM): correctly pass m0 param for direct and indirect calls (#7131)”; “fix(api): give each call its own store context entry”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/api/src/backend/sys/entities/function/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.
  • Repeated repair: lib/compiler-singlepass/src/emitter_x64.rs lib/compiler-singlepass/src/emitter_x64.rs:1009 — lib/compiler-singlepass/src/emitter_x64.rs changed 3 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 13 (its worst body is AssemblerX64::emit_lea at line 1009), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(Singlepass): fix emission of SSE instructions (#7184)”; “chore(Singlepass): remove explicit register listing (was bug in dynasm) (#7124)”; “fix(Singlepass): correctly narrow returned value for atomics (#7066)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/compiler-singlepass/src/emitter_x64.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: lib/types/src/vmoffsets.rs lib/types/src/vmoffsets.rs:255 — lib/types/src/vmoffsets.rs changed 3 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 4 (its worst body is VMOffsets::try_new at line 255), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(LLVM): correctly pass m0 param for direct and indirect calls (#7131)”; “fix(Table): add resource allocation tracking for local Tables (#16)”; “fix(VMOffsets): handle gracefully u32 -> i32 casting (#6904)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/types/src/vmoffsets.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: lib/virtual-fs/src/mem_fs/filesystem.rs lib/virtual-fs/src/mem_fs/filesystem.rs:63 — lib/virtual-fs/src/mem_fs/filesystem.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is FileSystem::mount_directory_entries at line 63), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(virtual-fs): resolve and mutate under one lock in mem_fs rename, remove and open”; “fix(virtual-fs): keep an open mem_fs file readable after a rename replaces it”; “fix(virtual-fs): allow renaming a symlink in mem_fs (#7033)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/virtual-fs/src/mem_fs/filesystem.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: lib/virtual-fs/src/host_fs.rs lib/virtual-fs/src/host_fs.rs:39 — lib/virtual-fs/src/host_fs.rs changed 3 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 7 (its worst body is virtual_fs::host_fs::normalize_path at line 39), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(virtual-fs): preserve cross-device rename errors”; “fix(virtual-fs): use atomic host rename across directories”; “fix poll_read_ready underflow when the file cursor is past EOF”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/virtual-fs/src/host_fs.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: lib/virtual-fs/src/mem_fs/file.rs lib/virtual-fs/src/mem_fs/file.rs:891 — lib/virtual-fs/src/mem_fs/file.rs changed 3 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 11 (its worst body is FileHandle::poll_read at line 891), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(virtual-fs): reject overflowing in-memory file seeks”; “fix(virtual-fs): preserve wide cursors in read readiness”; “fix poll_read_ready underflow when the file cursor is past EOF”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 10:02:46 -08:00' --until='2026-11-13 10:02:46 -08:00' --full-history --no-merges -- lib/virtual-fs/src/mem_fs/file.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.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×13
  • Edited copy of a member (12 corresponding lines) lib/virtual-fs/src/mem_fs/mod.rs:153 — lib/virtual-fs/src/mem_fs/mod.rs:153-164 | lib/virtual-fs/src/mem_fs/mod.rs:179-190 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/api/src/entities/external/extref/inner.rs:107 — lib/api/src/entities/external/extref/inner.rs:107-118 | lib/api/src/entities/store/obj.rs:25-40 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/api/src/utils/mem/ptr.rs:106 — lib/api/src/utils/mem/ptr.rs:106-117 | lib/api/src/utils/mem/ptr.rs:124-135 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/wasi-types/src/wasi/bindings.rs:1154 — lib/wasi-types/src/wasi/bindings.rs:1154-1165 | lib/wasi-types/src/wasi/bindings.rs:1180-1191 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/compiler-cranelift/src/func_environ.rs:1426 — lib/compiler-cranelift/src/func_environ.rs:1426-1437 | lib/compiler-cranelift/src/func_environ.rs:2159-2175 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/compiler-cranelift/src/func_environ.rs:1446 — lib/compiler-cranelift/src/func_environ.rs:1446-1460 | lib/compiler-cranelift/src/func_environ.rs:1513-1524 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1625 — lib/compiler-singlepass/src/machine_arm64.rs:1625-1637 | lib/compiler-singlepass/src/machine_riscv.rs:2172-2183 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/wasix/src/state/linker/mod.rs:1012 — lib/wasix/src/state/linker/mod.rs:1012-1032 | lib/wasix/src/state/linker/mod.rs:1325-1336 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/compiler-singlepass/src/output_reporter.rs:39 — lib/compiler-singlepass/src/output_reporter.rs:39-55 | lib/compiler-singlepass/src/output_reporter.rs:57-68 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/backend-api/src/client.rs:225 — lib/backend-api/src/client.rs:225-236 | lib/backend-api/src/client.rs:247-262 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/vm/src/libcalls.rs:326 — lib/vm/src/libcalls.rs:326-337 | lib/vm/src/libcalls.rs:349-360 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/compiler-cranelift/src/dwarf.rs:22 — lib/compiler-cranelift/src/dwarf.rs:22-34 | lib/compiler-singlepass/src/dwarf.rs:19-30 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:98 — lib/compiler-singlepass/src/machine_riscv.rs:98-110 | lib/compiler-singlepass/src/machine_x64.rs:117-128 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×13
  • Duplicated block (20 lines × 2) lib/api/src/backend/sys/entities/function/typed.rs:53 — lib/api/src/backend/sys/entities/function/typed.rs:53-72 | lib/api/src/backend/sys/entities/function/typed.rs:186-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/typed.rs:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/compiler-cranelift/src/dwarf.rs:77 — lib/compiler-cranelift/src/dwarf.rs:77-96 | lib/compiler-singlepass/src/dwarf.rs:65-84 — before extracting anything, compare `lib/compiler-cranelift/src/dwarf.rs` and `lib/compiler-singlepass/src/dwarf.rs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/dwarf.rs:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/compiler-llvm/src/translator/code.rs:3574 — lib/compiler-llvm/src/translator/code.rs:3574-3593 | lib/compiler-llvm/src/translator/code.rs:3604-3623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:3574` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:1224 — lib/compiler-singlepass/src/machine_x64.rs:1224-1243 | lib/compiler-singlepass/src/machine_x64.rs:1637-1656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:1316 — lib/compiler-singlepass/src/machine_x64.rs:1316-1335 | lib/compiler-singlepass/src/machine_x64.rs:1716-1735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1316` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4270 — lib/compiler-singlepass/src/machine_x64.rs:4270-4289 | lib/compiler-singlepass/src/machine_x64.rs:6394-6413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4270` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4315 — lib/compiler-singlepass/src/machine_x64.rs:4315-4334 | lib/compiler-singlepass/src/machine_x64.rs:6439-6458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4315` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4426 — lib/compiler-singlepass/src/machine_x64.rs:4426-4445 | lib/compiler-singlepass/src/machine_x64.rs:6595-6614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4426` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4486 — lib/compiler-singlepass/src/machine_x64.rs:4486-4505 | lib/compiler-singlepass/src/machine_x64.rs:6655-6674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4486` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/virtual-net/src/host.rs:912 — lib/virtual-net/src/host.rs:912-931 | lib/virtual-net/src/host.rs:1225-1244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/host.rs:912` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) lib/virtual-net/src/rx_tx.rs:379 — lib/virtual-net/src/rx_tx.rs:379-398 | lib/virtual-net/src/rx_tx.rs:441-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:379` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) lib/wasix/src/net/socket.rs:1314 — lib/wasix/src/net/socket.rs:1314-1333 | lib/wasix/src/net/socket.rs:1402-1421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1314` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) lib/virtual-net/src/server.rs:1580 — lib/virtual-net/src/server.rs:1580-1599 | lib/virtual-net/src/server.rs:1601-1620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×13
  • Duplicated block (17 lines × 2) lib/api/src/backend/sys/entities/function/typed.rs:90 — lib/api/src/backend/sys/entities/function/typed.rs:90-106 | lib/api/src/backend/sys/entities/function/typed.rs:216-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/typed.rs:90` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/api/src/backend/sys/entities/memory/mod.rs:261 — lib/api/src/backend/sys/entities/memory/mod.rs:261-277 | lib/api/src/backend/v8/entities/memory/mod.rs:315-331 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) lib/compiler-llvm/src/translator/code.rs:10362 — lib/compiler-llvm/src/translator/code.rs:10362-10378 | lib/compiler-llvm/src/translator/code.rs:10390-10406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:10362` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/compiler-singlepass/src/emitter_riscv.rs:1916 — lib/compiler-singlepass/src/emitter_riscv.rs:1916-1932 | lib/compiler-singlepass/src/emitter_riscv.rs:2074-2090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/emitter_riscv.rs:1916` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/compiler-singlepass/src/emitter_riscv.rs:2003 — lib/compiler-singlepass/src/emitter_riscv.rs:2003-2019 | lib/compiler-singlepass/src/emitter_riscv.rs:2138-2154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/emitter_riscv.rs:2003` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/compiler/src/compiler.rs:536 — lib/compiler/src/compiler.rs:536-552 | lib/compiler/src/compiler.rs:581-597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/compiler.rs:536` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/virtual-fs/src/mem_fs/file.rs:973 — lib/virtual-fs/src/mem_fs/file.rs:973-989 | lib/virtual-fs/src/mem_fs/file.rs:1161-1177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/file.rs:973` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/virtual-net/src/client.rs:320 — lib/virtual-net/src/client.rs:320-336 | lib/virtual-net/src/server.rs:379-395 — before extracting anything, compare `lib/virtual-net/src/client.rs` and `lib/virtual-net/src/server.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/client.rs:320` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) lib/wasix/src/syscalls/wasix/sock_send.rs:137 — lib/wasix/src/syscalls/wasix/sock_send.rs:137-153 | lib/wasix/src/syscalls/wasix/sock_send_to.rs:149-165 — before extracting anything, compare `lib/wasix/src/syscalls/wasix/sock_send.rs` and `lib/wasix/src/syscalls/wasix/sock_send_to.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/sock_send.rs:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/virtual-net/src/client.rs:1328 — lib/virtual-net/src/client.rs:1328-1344 | lib/virtual-net/src/client.rs:1572-1588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) lib/wasix/src/syscalls/wasix/proc_exec3.rs:34 — lib/wasix/src/syscalls/wasix/proc_exec3.rs:34-50 | lib/wasix/src/syscalls/wasix/proc_exec4.rs:29-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 (17 lines × 2) lib/compiler/src/abi.rs:112 — lib/compiler/src/abi.rs:112-128 | lib/compiler/src/abi.rs:159-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/abi.rs:112` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) lib/api/src/backend/v8/entities/module.rs:55 — lib/api/src/backend/v8/entities/module.rs:55-71 | lib/api/src/backend/v8/entities/module.rs:84-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/module.rs:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/api/src/backend/v8/entities/module.rs:55` calls `to_string` and `lib/api/src/backend/v8/entities/module.rs:83` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×13
  • Duplicated block (7 lines × 4) lib/backend-api/src/query.rs:1441 — lib/backend-api/src/query.rs:1441-1447 | lib/backend-api/src/query.rs:2200-2206 | lib/backend-api/src/query.rs:2233-2239 | lib/backend-api/src/query.rs:2638-2644 — 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) lib/compiler-llvm/src/translator/code.rs:3986 — lib/compiler-llvm/src/translator/code.rs:3986-3992 | lib/compiler-llvm/src/translator/code.rs:3997-4003 | lib/compiler-llvm/src/translator/code.rs:4061-4067 | lib/compiler-llvm/src/translator/code.rs:4117-4123 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:3986` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/compiler-llvm/src/translator/code.rs:4208 — lib/compiler-llvm/src/translator/code.rs:4208-4214 | lib/compiler-llvm/src/translator/code.rs:4219-4225 | lib/compiler-llvm/src/translator/code.rs:4230-4236 | lib/compiler-llvm/src/translator/code.rs:4241-4247 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4208` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/compiler-llvm/src/translator/code.rs:5305 — lib/compiler-llvm/src/translator/code.rs:5305-5311 | lib/compiler-llvm/src/translator/code.rs:5326-5332 | lib/compiler-llvm/src/translator/code.rs:5344-5350 | lib/compiler-llvm/src/translator/code.rs:5366-5372 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:5305` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/compiler-llvm/src/translator/code.rs:5407 — lib/compiler-llvm/src/translator/code.rs:5407-5413 | lib/compiler-llvm/src/translator/code.rs:5428-5434 | lib/compiler-llvm/src/translator/code.rs:5446-5452 | lib/compiler-llvm/src/translator/code.rs:5468-5474 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:5407` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/compiler-llvm/src/translator/code.rs:10126 — lib/compiler-llvm/src/translator/code.rs:10126-10132 | lib/compiler-llvm/src/translator/code.rs:10136-10142 | lib/compiler-llvm/src/translator/code.rs:10146-10152 | lib/compiler-llvm/src/translator/code.rs:10156-10162 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:10126` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:7208 — lib/compiler-singlepass/src/machine_arm64.rs:7208-7214 | lib/compiler-singlepass/src/machine_arm64.rs:7271-7277 | lib/compiler-singlepass/src/machine_arm64.rs:7334-7340 | lib/compiler-singlepass/src/machine_arm64.rs:7397-7403 — 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) lib/compiler-singlepass/src/machine_x64.rs:3033 — lib/compiler-singlepass/src/machine_x64.rs:3033-3039 | lib/compiler-singlepass/src/machine_x64.rs:3088-3094 | lib/compiler-singlepass/src/machine_x64.rs:4816-4822 | lib/compiler-singlepass/src/machine_x64.rs:4871-4877 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3033` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/compiler-singlepass/src/machine_x64.rs:3047 — lib/compiler-singlepass/src/machine_x64.rs:3047-3053 | lib/compiler-singlepass/src/machine_x64.rs:3102-3108 | lib/compiler-singlepass/src/machine_x64.rs:4830-4836 | lib/compiler-singlepass/src/machine_x64.rs:4885-4891 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3047` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/compiler-singlepass/src/machine_x64.rs:6890 — lib/compiler-singlepass/src/machine_x64.rs:6890-6896 | lib/compiler-singlepass/src/machine_x64.rs:6953-6959 | lib/compiler-singlepass/src/machine_x64.rs:6990-6996 | lib/compiler-singlepass/src/machine_x64.rs:7053-7059 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:6890` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/wasix/src/net/socket.rs:1257 — lib/wasix/src/net/socket.rs:1257-1263 | lib/wasix/src/net/socket.rs:1270-1276 | lib/wasix/src/net/socket.rs:1283-1289 | lib/wasix/src/net/socket.rs:1296-1302 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1257` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) lib/wasix/src/net/socket.rs:1356 — lib/wasix/src/net/socket.rs:1356-1362 | lib/wasix/src/net/socket.rs:1440-1446 | lib/wasix/src/net/socket.rs:1532-1538 | lib/wasix/src/net/socket.rs:1623-1629 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/wasix/src/net/socket.rs:1363` calls `drop` and `lib/wasix/src/net/socket.rs:1630` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) lib/wasix/src/state/linker/instance_group/imports.rs:435 — lib/wasix/src/state/linker/instance_group/imports.rs:435-442 | lib/wasix/src/state/linker/instance_group/imports.rs:452-459 | lib/wasix/src/state/linker/instance_group/imports.rs:469-475 | lib/wasix/src/state/linker/instance_group/imports.rs:482-488 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/state/linker/instance_group/imports.rs:435` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×13
  • Duplicated block (7 lines × 3) lib/compiler-llvm/src/translator/code.rs:4332 — lib/compiler-llvm/src/translator/code.rs:4332-4338 | lib/compiler-llvm/src/translator/code.rs:4343-4349 | lib/compiler-llvm/src/translator/code.rs:4354-4360 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4332` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/compiler-llvm/src/translator/code.rs:4657 — lib/compiler-llvm/src/translator/code.rs:4657-4663 | lib/compiler-llvm/src/translator/code.rs:4760-4766 | lib/compiler-llvm/src/translator/code.rs:4914-4920 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4657` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/compiler-llvm/src/translator/code.rs:9853 — lib/compiler-llvm/src/translator/code.rs:9853-9859 | lib/compiler-llvm/src/translator/code.rs:10307-10313 | lib/compiler-llvm/src/translator/code.rs:10320-10326 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9853` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/compiler-llvm/src/translator/code.rs:9867 — lib/compiler-llvm/src/translator/code.rs:9867-9873 | lib/compiler-llvm/src/translator/code.rs:9881-9887 | lib/compiler-llvm/src/translator/code.rs:9895-9901 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9867` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:381 — lib/compiler-singlepass/src/machine_arm64.rs:381-387 | lib/compiler-singlepass/src/machine_arm64.rs:523-529 | lib/compiler-singlepass/src/machine_arm64.rs:561-567 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:381` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:4534 — lib/compiler-singlepass/src/machine_arm64.rs:4534-4540 | lib/compiler-singlepass/src/machine_arm64.rs:4597-4603 | lib/compiler-singlepass/src/machine_arm64.rs:4660-4666 — 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) lib/wasix/src/syscalls/wasix/port_addr_remove.rs:15 — lib/wasix/src/syscalls/wasix/port_addr_remove.rs:15-21 | lib/wasix/src/syscalls/wasix/port_gateway_set.rs:15-21 | lib/wasix/src/syscalls/wasix/port_route_remove.rs:11-17 — 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) lib/compiler-llvm/src/translator/code.rs:11303 — lib/compiler-llvm/src/translator/code.rs:11303-11309 | lib/compiler-llvm/src/translator/code.rs:11331-11337 | lib/compiler-llvm/src/translator/code.rs:11358-11364 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:11358` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:11331` calls `from_u32`, `memarg_memory_index` and `lib/compiler-llvm/src/translator/code.rs:11358` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:1550 — lib/compiler-singlepass/src/machine_arm64.rs:1550-1556 | lib/compiler-singlepass/src/machine_riscv.rs:2091-2097 | lib/compiler-singlepass/src/machine_x64.rs:2144-2150 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) lib/api/src/backend/js/entities/function/env.rs:43 — lib/api/src/backend/js/entities/function/env.rs:43-49 | lib/api/src/backend/sys/entities/function/env.rs:52-58 | lib/api/src/backend/v8/entities/function/env.rs:37-43 — before extracting anything, compare `lib/api/src/backend/js/entities/function/env.rs` and `lib/api/src/backend/sys/entities/function/env.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) lib/api/src/backend/js/entities/function/env.rs:62 — lib/api/src/backend/js/entities/function/env.rs:62-68 | lib/api/src/backend/sys/entities/function/env.rs:61-67 | lib/api/src/backend/v8/entities/function/env.rs:56-62 — before extracting anything, compare `lib/api/src/backend/js/entities/function/env.rs` and `lib/api/src/backend/sys/entities/function/env.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) lib/wasix/src/syscalls/wasix/sock_join_multicast_v4.rs:48 — lib/wasix/src/syscalls/wasix/sock_join_multicast_v4.rs:48-54 | lib/wasix/src/syscalls/wasix/sock_join_multicast_v6.rs:47-53 | lib/wasix/src/syscalls/wasix/sock_leave_multicast_v4.rs:48-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/sock_join_multicast_v4.rs:48` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) lib/wasix/src/syscalls/wasix/fd_pipe.rs:34 — lib/wasix/src/syscalls/wasix/fd_pipe.rs:34-40 | lib/wasix/src/syscalls/wasix/sock_open.rs:49-55 | lib/wasix/src/syscalls/wasix/sock_pair.rs:64-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/fd_pipe.rs:34` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/wasix/src/syscalls/wasix/fd_pipe.rs:42` calls `current`, `record` and `lib/wasix/src/syscalls/wasix/sock_pair.rs:71` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D17 · Explicit Debt · HackComment · ×12
  • HackComment lib/wasix/src/state/linker/linker_state.rs:39 — // hack from back then. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/wasix/src/state/linker/mod.rs:498 — // HACK: The main module doesn't have to exist in the virtual FS at all; e.g. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/wasix/src/runtime/package_loader/load_package_tree.rs:265 — /// HACK: Some older packages like `sharrattj/bash` and `sharrattj/coreutils` — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/wasix/src/runners/wasi_common.rs:353 — /// HACK: We need this so users can mount host directories at relative paths. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/wasix/src/http/web_http_client.rs:55 — /// # Hack — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/wasix/src/bin_factory/binary_package.rs:242 — // HACK: webc has no way to return its deserialized manifest to us, so we need to do it again here — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/virtual-fs/src/overlay_fs.rs:1334 — // HACK: We shouldn't really be ignoring FsError::BaseNotDirectory, but — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/virtual-fs/src/webc_volume_fs.rs:424 — // HACK: WebC v2 doesn't have timestamps, and WebC v3 files sometimes — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/derive/tests/compiletest.rs:31 — // hack to make this work on OSX: we probably don't need it though — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/compiler-llvm/src/config.rs:284 — // Hack: we're using is_pic to determine whether this is a native — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/cli/src/commands/package/common/mod.rs:25 — // HACK: We want to invalidate the cache used for GraphQL queries so — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment lib/api/src/entities/exports.rs:151 — /// Hack to get this working with nativefunc too — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×12
  • Edited copy of a member (18 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2582 — lib/compiler-singlepass/src/machine_arm64.rs:2582-2599 | lib/compiler-singlepass/src/machine_arm64.rs:4765-4782 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/api/src/backend/js/entities/function/typed.rs:43 — lib/api/src/backend/js/entities/function/typed.rs:43-133 | lib/api/src/backend/sys/entities/function/typed.rs:150-270 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/api/src/backend/js/entities/function/typed.rs:43 — lib/api/src/backend/js/entities/function/typed.rs:43-60 | lib/api/src/backend/sys/entities/function/typed.rs:150-169 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1160 — lib/compiler-singlepass/src/machine_arm64.rs:1160-1177 | lib/compiler-singlepass/src/machine_arm64.rs:1203-1220 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/cli/src/commands/app/database/list.rs:26 — lib/cli/src/commands/app/database/list.rs:26-50 | lib/cli/src/commands/cron.rs:68-85 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:2206 — lib/compiler-singlepass/src/machine_riscv.rs:2206-2225 | lib/compiler-singlepass/src/machine_x64.rs:2244-2261 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/api/src/backend/sys/entities/memory/mod.rs:216 — lib/api/src/backend/sys/entities/memory/mod.rs:216-233 | lib/api/src/backend/v8/entities/memory/mod.rs:264-284 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/wasix/src/fs/mod.rs:381 — lib/wasix/src/fs/mod.rs:381-398 | lib/wasix/src/fs/mod.rs:404-421 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/cli/src/utils/prompts.rs:7 — lib/cli/src/utils/prompts.rs:7-24 | lib/cli/src/utils/prompts.rs:31-49 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/wasix/src/fs/fd_list.rs:254 — lib/wasix/src/fs/fd_list.rs:254-271 | lib/wasix/src/fs/fd_list.rs:277-294 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/types/src/types.rs:169 — lib/types/src/types.rs:169-188 | lib/types/src/types.rs:194-211 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/virtual-net/src/client.rs:593 — lib/virtual-net/src/client.rs:593-610 | lib/virtual-net/src/client.rs:884-901 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×12
  • Duplicated block (10 lines × 3) lib/cli/src/backend.rs:451 — lib/cli/src/backend.rs:451-460 | lib/cli/src/backend.rs:481-490 | lib/cli/src/backend.rs:524-533 — 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) lib/cli/src/commands/app/deploy.rs:805 — lib/cli/src/commands/app/deploy.rs:805-814 | lib/cli/src/commands/app/deploy.rs:943-952 | lib/cli/src/commands/app/deploy.rs:956-965 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/deploy.rs:805` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) lib/compiler-llvm/src/translator/code.rs:8622 — lib/compiler-llvm/src/translator/code.rs:8622-8631 | lib/compiler-llvm/src/translator/code.rs:8650-8659 | lib/compiler-llvm/src/translator/code.rs:10553-10562 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8622` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) lib/compiler-llvm/src/translator/code.rs:8722 — lib/compiler-llvm/src/translator/code.rs:8722-8731 | lib/compiler-llvm/src/translator/code.rs:8746-8755 | lib/compiler-llvm/src/translator/code.rs:10591-10600 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8722` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:486 — lib/compiler-singlepass/src/machine_x64.rs:486-495 | lib/compiler-singlepass/src/machine_x64.rs:522-531 | lib/compiler-singlepass/src/machine_x64.rs:550-559 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:486` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) lib/wasix/src/net/socket.rs:1352 — lib/wasix/src/net/socket.rs:1352-1361 | lib/wasix/src/net/socket.rs:1436-1445 | lib/wasix/src/net/socket.rs:1528-1537 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1352` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 3) lib/compiler-llvm/src/translator/code.rs:5232 — lib/compiler-llvm/src/translator/code.rs:5232-5241 | lib/compiler-llvm/src/translator/code.rs:5334-5343 | lib/compiler-llvm/src/translator/code.rs:5436-5445 — 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) lib/compiler-singlepass/src/machine_x64.rs:2350 — lib/compiler-singlepass/src/machine_x64.rs:2350-2359 | lib/compiler-singlepass/src/machine_x64.rs:2361-2370 | lib/compiler-singlepass/src/machine_x64.rs:2372-2381 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 3) lib/api/src/backend/js/entities/store/obj.rs:77 — lib/api/src/backend/js/entities/store/obj.rs:77-86 | lib/api/src/backend/v8/entities/store/obj.rs:98-107 | lib/vm/src/store.rs:108-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 3) lib/api/src/backend/sys/entities/global.rs:80 — lib/api/src/backend/sys/entities/global.rs:80-89 | lib/api/src/backend/sys/entities/memory/mod.rs:95-104 | lib/api/src/backend/sys/entities/table.rs:178-187 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `vm_extern` to `VMExternGlobal` in one and `VMExternMemory` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:1809 — lib/compiler-singlepass/src/machine_arm64.rs:1809-1818 | lib/compiler-singlepass/src/machine_riscv.rs:2309-2318 | lib/compiler-singlepass/src/machine_x64.rs:2318-2327 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:1809` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) lib/cli/src/commands/app/secrets/create.rs:152 — lib/cli/src/commands/app/secrets/create.rs:152-161 | lib/cli/src/commands/app/secrets/import.rs:142-151 | lib/cli/src/commands/app/secrets/update.rs:146-155 — before extracting anything, compare `lib/cli/src/commands/app/secrets/create.rs` and `lib/cli/src/commands/app/secrets/update.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/secrets/create.rs:152` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×12
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5724 — lib/compiler-llvm/src/translator/code.rs:5724-5729 | lib/compiler-llvm/src/translator/code.rs:7563-7570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7563` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5739 — lib/compiler-llvm/src/translator/code.rs:5739-5744 | lib/compiler-llvm/src/translator/code.rs:7650-7657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7650` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5754 — lib/compiler-llvm/src/translator/code.rs:5754-5759 | lib/compiler-llvm/src/translator/code.rs:7884-7891 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7884` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5769 — lib/compiler-llvm/src/translator/code.rs:5769-5774 | lib/compiler-llvm/src/translator/code.rs:7974-7981 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7974` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5784 — lib/compiler-llvm/src/translator/code.rs:5784-5789 | lib/compiler-llvm/src/translator/code.rs:7581-7588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7581` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5799 — lib/compiler-llvm/src/translator/code.rs:5799-5804 | lib/compiler-llvm/src/translator/code.rs:7668-7675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7668` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5814 — lib/compiler-llvm/src/translator/code.rs:5814-5819 | lib/compiler-llvm/src/translator/code.rs:7902-7909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7902` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5829 — lib/compiler-llvm/src/translator/code.rs:5829-5834 | lib/compiler-llvm/src/translator/code.rs:7992-7999 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7992` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5844 — lib/compiler-llvm/src/translator/code.rs:5844-5849 | lib/compiler-llvm/src/translator/code.rs:7599-7606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7599` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5859 — lib/compiler-llvm/src/translator/code.rs:5859-5864 | lib/compiler-llvm/src/translator/code.rs:7686-7693 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7686` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5874 — lib/compiler-llvm/src/translator/code.rs:5874-5879 | lib/compiler-llvm/src/translator/code.rs:7920-7927 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7920` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–8 lines × 2) lib/compiler-llvm/src/translator/code.rs:5889 — lib/compiler-llvm/src/translator/code.rs:5889-5894 | lib/compiler-llvm/src/translator/code.rs:8010-8017 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8010` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×11
  • Duplicated block (15 lines × 2) lib/api/src/backend/v8/entities/memory/mod.rs:265 — lib/api/src/backend/v8/entities/memory/mod.rs:265-279 | lib/api/src/backend/v8/entities/memory/mod.rs:291-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `buf` to `&mut [u8]` in one and `&'b mut [MaybeUninit<u8>]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (15 lines × 2) lib/compiler-llvm/src/translator/code.rs:6137 — lib/compiler-llvm/src/translator/code.rs:6137-6151 | lib/compiler-llvm/src/translator/code.rs:6406-6420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/compiler-llvm/src/translator/code.rs:6163 — lib/compiler-llvm/src/translator/code.rs:6163-6177 | lib/compiler-llvm/src/translator/code.rs:6513-6527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/compiler-llvm/src/translator/code.rs:8616 — lib/compiler-llvm/src/translator/code.rs:8616-8630 | lib/compiler-llvm/src/translator/code.rs:8644-8658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8616` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) lib/compiler-llvm/src/translator/code.rs:9116 — lib/compiler-llvm/src/translator/code.rs:9116-9130 | lib/compiler-llvm/src/translator/code.rs:9174-9188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/compiler-llvm/src/translator/code.rs:11904 — lib/compiler-llvm/src/translator/code.rs:11904-11918 | lib/compiler-llvm/src/translator/code.rs:11973-11987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:11904` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:11971` calls `push`, `as_basic_value` and `lib/compiler-llvm/src/translator/code.rs:11902` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:966 — lib/compiler-singlepass/src/machine_arm64.rs:966-980 | lib/compiler-singlepass/src/machine_riscv.rs:923-937 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:966` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2923 — lib/compiler-singlepass/src/machine_arm64.rs:2923-2937 | lib/compiler-singlepass/src/machine_arm64.rs:5106-5120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2923` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:4233 — lib/compiler-singlepass/src/machine_x64.rs:4233-4247 | lib/compiler-singlepass/src/machine_x64.rs:6484-6498 — both copies are in the same file, so extract the block into 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) lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs:30 — lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs:30-44 | lib/wasix/src/syscalls/journal/maybe_snapshot_once.rs:30-44 — before extracting anything, compare `lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs` and `lib/wasix/src/syscalls/journal/maybe_snapshot_once.rs` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs:30` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) lib/wasix/src/syscalls/wasix/proc_exec3.rs:67 — lib/wasix/src/syscalls/wasix/proc_exec3.rs:67-81 | lib/wasix/src/syscalls/wasix/proc_exec4.rs:62-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/proc_exec3.rs:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · wasmer_wasix · ×10
  • wasmer_wasix::syscalls::wasix::path_open2::path_open_internal_with_symlink_depth (cyclomatic 68) lib/wasix/src/syscalls/wasix/path_open2.rs:186 — wasmer_wasix::syscalls::wasix::path_open2::path_open_internal_with_symlink_depth has cyclomatic complexity 68 (threshold 15). Of this number, 66 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal (cyclomatic 59) lib/wasix/src/syscalls/wasi/fd_write.rs:243 — wasmer_wasix::syscalls::wasi::fd_write::fd_write_internal has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wasmer_wasix::syscalls::wasi::fd_read::fd_read_internal (cyclomatic 40) lib/wasix/src/syscalls/wasi/fd_read.rs:135 — wasmer_wasix::syscalls::wasi::fd_read::fd_read_internal has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wasmer_wasix::syscalls::wasi::poll_oneoff::poll_oneoff_internal (cyclomatic 31) lib/wasix/src/syscalls/wasi/poll_oneoff.rs:232 — wasmer_wasix::syscalls::wasi::poll_oneoff::poll_oneoff_internal has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • wasmer_wasix::syscalls::wasi::path_rename::path_rename_internal (cyclomatic 30) lib/wasix/src/syscalls/wasi/path_rename.rs:56 — wasmer_wasix::syscalls::wasi::path_rename::path_rename_internal 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.
  • wasmer_wasix::syscalls::wasix::proc_exec4::proc_exec4_impl (cyclomatic 28) lib/wasix/src/syscalls/wasix/proc_exec4.rs:78 — wasmer_wasix::syscalls::wasix::proc_exec4::proc_exec4_impl has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • wasmer_wasix::bin_factory::exec::call_module (cyclomatic 20) lib/wasix/src/bin_factory/exec.rs:250 — wasmer_wasix::bin_factory::exec::call_module 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.
  • wasmer_wasix::syscalls::wasix::proc_spawn::proc_spawn_internal (cyclomatic 18) lib/wasix/src/syscalls/wasix/proc_spawn.rs:100 — wasmer_wasix::syscalls::wasix::proc_spawn::proc_spawn_internal 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.
  • wasmer_wasix::syscalls::wasi::path_link::path_link_internal (cyclomatic 16) lib/wasix/src/syscalls/wasi/path_link.rs:73 — wasmer_wasix::syscalls::wasi::path_link::path_link_internal 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.
  • wasmer_wasix::syscalls::wasix::proc_spawn3::proc_spawn3_impl (cyclomatic 16) lib/wasix/src/syscalls/wasix/proc_spawn3.rs:89 — wasmer_wasix::syscalls::wasix::proc_spawn3::proc_spawn3_impl 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.
D29 · Static Analysis (SAST) · REDACTED · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×10
  • Edited copy of a member (14 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2862 — lib/compiler-singlepass/src/machine_arm64.rs:2862-2875 | lib/compiler-singlepass/src/machine_arm64.rs:5045-5058 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:297 — lib/compiler-singlepass/src/machine_x64.rs:297-310 | lib/compiler-singlepass/src/machine_x64.rs:318-331 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1651 — lib/compiler-singlepass/src/machine_arm64.rs:1651-1664 | lib/compiler-singlepass/src/machine_riscv.rs:2189-2204 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/wasix/src/utils/owned_mutex_guard.rs:139 — lib/wasix/src/utils/owned_mutex_guard.rs:139-152 | lib/wasix/src/utils/owned_mutex_guard.rs:217-230 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/api/src/entities/store/context.rs:485 — lib/api/src/entities/store/context.rs:485-498 | lib/api/src/entities/store/context.rs:503-516 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/virtual-net/src/ruleset.rs:676 — lib/virtual-net/src/ruleset.rs:676-689 | lib/virtual-net/src/ruleset.rs:692-705 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/cli/src/commands/app/secrets/create.rs:73 — lib/cli/src/commands/app/secrets/create.rs:73-86 | lib/cli/src/commands/app/secrets/update.rs:78-91 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/vm/src/libcalls/eh/dwarf/mod.rs:36 — lib/vm/src/libcalls/eh/dwarf/mod.rs:36-49 | lib/vm/src/libcalls/eh/dwarf/mod.rs:51-68 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/wasix/src/state/linker/wasm_utils.rs:67 — lib/wasix/src/state/linker/wasm_utils.rs:67-85 | lib/wasix/src/state/linker/wasm_utils.rs:87-100 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) lib/c-api/src/wasm_c_api/types/global.rs:55 — lib/c-api/src/wasm_c_api/types/global.rs:55-68 | lib/c-api/src/wasm_c_api/types/table.rs:62-80 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×10
  • Duplicated block (27 lines × 2) lib/api/src/backend/v8/entities/memory/mod.rs:350 — lib/api/src/backend/v8/entities/memory/mod.rs:350-376 | lib/api/src/backend/v8/entities/memory/mod.rs:387-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/memory/mod.rs:350` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) lib/compiler-llvm/src/translator/code.rs:811 — lib/compiler-llvm/src/translator/code.rs:811-837 | lib/compiler-llvm/src/translator/code.rs:949-975 — both copies are in the same file, so extract the block into 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) lib/compiler-llvm/src/translator/code.rs:1132 — lib/compiler-llvm/src/translator/code.rs:1132-1158 | lib/compiler-llvm/src/translator/code.rs:1182-1208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:1132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:778 — lib/compiler-singlepass/src/machine_x64.rs:778-804 | lib/compiler-singlepass/src/machine_x64.rs:920-946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:778` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:3718 — lib/compiler-singlepass/src/machine_x64.rs:3718-3744 | lib/compiler-singlepass/src/machine_x64.rs:3851-3877 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:3765 — lib/compiler-singlepass/src/machine_x64.rs:3765-3791 | lib/compiler-singlepass/src/machine_x64.rs:3898-3924 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:5660 — lib/compiler-singlepass/src/machine_x64.rs:5660-5686 | lib/compiler-singlepass/src/machine_x64.rs:5840-5866 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:5707 — lib/compiler-singlepass/src/machine_x64.rs:5707-5733 | lib/compiler-singlepass/src/machine_x64.rs:5887-5913 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:5754 — lib/compiler-singlepass/src/machine_x64.rs:5754-5780 | lib/compiler-singlepass/src/machine_x64.rs:5934-5960 — both copies are in the same file, so extract the block into 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) lib/virtual-fs/src/mem_fs/filesystem.rs:230 — lib/virtual-fs/src/mem_fs/filesystem.rs:230-256 | lib/virtual-fs/src/mem_fs/filesystem.rs:435-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/filesystem.rs:230` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×10
  • Duplicated block (6 lines × 3) lib/api/src/backend/v8/entities/function/mod.rs:320 — lib/api/src/backend/v8/entities/function/mod.rs:320-325 | lib/api/src/backend/v8/entities/function/mod.rs:328-333 | lib/api/src/backend/v8/entities/tag.rs:64-69 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/function/mod.rs:320` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:2067 — lib/compiler-singlepass/src/machine_arm64.rs:2067-2073 | lib/compiler-singlepass/src/machine_riscv.rs:1235-1240 | lib/compiler-singlepass/src/machine_riscv.rs:2449-2455 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2067` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:4359 — lib/compiler-singlepass/src/machine_arm64.rs:4359-4364 | lib/compiler-singlepass/src/machine_arm64.rs:4417-4422 | lib/compiler-singlepass/src/machine_arm64.rs:4475-4480 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:2531 — lib/compiler-singlepass/src/machine_x64.rs:2531-2536 | lib/compiler-singlepass/src/machine_x64.rs:7824-7829 | lib/compiler-singlepass/src/machine_x64.rs:7948-7953 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:2531` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 3) lib/api/src/backend/js/entities/store/handle.rs:39 — lib/api/src/backend/js/entities/store/handle.rs:39-44 | lib/api/src/backend/v8/entities/store/obj.rs:169-174 | lib/vm/src/store.rs:169-174 — before extracting anything, compare `lib/api/src/backend/js/entities/store/handle.rs` and `lib/api/src/backend/v8/entities/store/obj.rs` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `f` to `&mut std::fmt::Formatter<'_>` in one and `&mut fmt::Formatter<'_>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 3) lib/compiler-singlepass/src/arm64_decl.rs:145 — lib/compiler-singlepass/src/arm64_decl.rs:145-150 | lib/compiler-singlepass/src/riscv_decl.rs:99-104 | lib/compiler-singlepass/src/x64_decl.rs:70-75 — 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 (6 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:1372 — lib/compiler-singlepass/src/machine_arm64.rs:1372-1377 | lib/compiler-singlepass/src/machine_riscv.rs:1948-1953 | lib/compiler-singlepass/src/machine_x64.rs:1981-1986 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) lib/compiler-singlepass/src/machine_arm64.rs:1531 — lib/compiler-singlepass/src/machine_arm64.rs:1531-1536 | lib/compiler-singlepass/src/machine_riscv.rs:2072-2077 | lib/compiler-singlepass/src/machine_x64.rs:2125-2130 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) lib/compiler-singlepass/src/machine_riscv.rs:1786 — lib/compiler-singlepass/src/machine_riscv.rs:1786-1791 | lib/compiler-singlepass/src/machine_x64.rs:1168-1173 | lib/compiler-singlepass/src/machine_x64.rs:1581-1586 — before extracting anything, compare `lib/compiler-singlepass/src/machine_riscv.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) lib/virtual-fs/src/mem_fs/filesystem.rs:861 — lib/virtual-fs/src/mem_fs/filesystem.rs:861-866 | lib/virtual-fs/src/mem_fs/filesystem.rs:908-913 | lib/virtual-fs/src/mem_fs/filesystem.rs:949-954 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/filesystem.rs:861` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/virtual-fs/src/mem_fs/filesystem.rs:957` calls `Directory` and `lib/virtual-fs/src/mem_fs/filesystem.rs:916` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×9
  • Edited copy of a member (23 corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:1459 — lib/compiler-singlepass/src/emitter_x64.rs:1459-1481 | lib/compiler-singlepass/src/emitter_x64.rs:1488-1510 — 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) lib/wasix/src/os/task/process.rs:803 — lib/wasix/src/os/task/process.rs:803-825 | lib/wasix/src/os/task/process.rs:828-858 — 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) lib/compiler/src/engine/inner.rs:69 — lib/compiler/src/engine/inner.rs:69-91 | lib/compiler/src/engine/inner.rs:143-166 — 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) lib/compiler-singlepass/src/codegen.rs:1090 — lib/compiler-singlepass/src/codegen.rs:1090-1112 | lib/compiler-singlepass/src/codegen.rs:1120-1143 — 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) lib/cli/src/commands/package/tag.rs:96 — lib/cli/src/commands/package/tag.rs:96-118 | lib/cli/src/commands/package/tag.rs:125-149 — 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) lib/wasix/src/syscalls/mod.rs:718 — lib/wasix/src/syscalls/mod.rs:718-742 | lib/wasix/src/syscalls/mod.rs:755-777 — 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) lib/wasix/src/runtime/package_loader/builtin_loader.rs:342 — lib/wasix/src/runtime/package_loader/builtin_loader.rs:342-374 | lib/wasix/src/runtime/resolver/backend_source.rs:196-218 — 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) lib/compiler-singlepass/src/machine_x64.rs:721 — lib/compiler-singlepass/src/machine_x64.rs:721-746 | lib/compiler-singlepass/src/machine_x64.rs:866-888 — 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) lib/api/src/utils/polyfill.rs:715 — lib/api/src/utils/polyfill.rs:715-737 | lib/compiler/src/translator/sections.rs:243-265 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×9
  • Edited copy of a member (11 corresponding lines) lib/virtual-fs/src/mount_fs.rs:133 — lib/virtual-fs/src/mount_fs.rs:133-146 | lib/virtual-fs/src/mount_fs.rs:444-454 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/wasix/src/runtime/mod.rs:1193 — lib/wasix/src/runtime/mod.rs:1193-1206 | lib/wasix/src/runtime/mod.rs:1213-1223 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/c-api/src/wasm_c_api/types/frame.rs:60 — lib/c-api/src/wasm_c_api/types/frame.rs:60-70 | lib/c-api/src/wasm_c_api/types/frame.rs:73-85 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/c-api-imports/src/lib.rs:792 — lib/c-api-imports/src/lib.rs:792-802 | lib/c-api-imports/src/lib.rs:873-883 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/journal/src/concrete/auto_consistent.rs:41 — lib/journal/src/concrete/auto_consistent.rs:41-51 | lib/journal/src/concrete/transaction.rs:37-50 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/compiler-singlepass/src/codegen.rs:1194 — lib/compiler-singlepass/src/codegen.rs:1194-1205 | lib/compiler-singlepass/src/codegen.rs:1207-1217 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/api/src/utils/polyfill.rs:542 — lib/api/src/utils/polyfill.rs:542-552 | lib/compiler/src/translator/sections.rs:49-60 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/api/src/backend/js/entities/engine.rs:18 — lib/api/src/backend/js/entities/engine.rs:18-28 | lib/api/src/backend/v8/entities/engine.rs:62-72 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) lib/compiler/src/translator/sections.rs:199 — lib/compiler/src/translator/sections.rs:199-214 | lib/api/src/utils/polyfill.rs:679-689 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×9
  • Edited copy of a member (7 corresponding lines) lib/virtual-net/src/host.rs:507 — lib/virtual-net/src/host.rs:507-515 | lib/virtual-net/src/host.rs:517-523 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/virtual-net/src/tcp_pair.rs:308 — lib/virtual-net/src/tcp_pair.rs:308-314 | lib/virtual-net/src/tcp_pair.rs:552-558 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/virtual-fs/src/ops.rs:98 — lib/virtual-fs/src/ops.rs:98-104 | lib/virtual-fs/src/ops.rs:110-118 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/api/src/backend/js/entities/module.rs:408 — lib/api/src/backend/js/entities/module.rs:408-414 | lib/api/src/backend/js/entities/module.rs:420-426 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/virtual-io/src/interest.rs:156 — lib/virtual-io/src/interest.rs:156-162 | lib/wasix/src/os/task/thread.rs:415-422 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/compiler-cranelift/src/translator/func_state.rs:582 — lib/compiler-cranelift/src/translator/func_state.rs:582-588 | lib/compiler-cranelift/src/translator/func_state.rs:597-603 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/c-api-imports/src/lib.rs:1722 — lib/c-api-imports/src/lib.rs:1722-1728 | lib/c-api-imports/src/lib.rs:1744-1750 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/c-api-imports/src/lib.rs:1188 — lib/c-api-imports/src/lib.rs:1188-1194 | lib/c-api-imports/src/lib.rs:2124-2130 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/backend-api/src/error.rs:25 — lib/backend-api/src/error.rs:25-33 | lib/wasix/src/runtime/resolver/resolve.rs:88-94 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×9
  • Duplicated block (11 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:305 — lib/compiler-singlepass/src/machine_arm64.rs:305-315 | lib/compiler-singlepass/src/machine_arm64.rs:324-334 | lib/compiler-singlepass/src/machine_arm64.rs:343-353 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:305` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:8435 — lib/compiler-singlepass/src/machine_arm64.rs:8435-8445 | lib/compiler-singlepass/src/machine_riscv.rs:6569-6579 | lib/compiler-singlepass/src/machine_x64.rs:8376-8386 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:8435` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/compiler-singlepass/src/machine_riscv.rs:1418 — lib/compiler-singlepass/src/machine_riscv.rs:1418-1428 | lib/compiler-singlepass/src/machine_riscv.rs:1475-1485 | lib/compiler-singlepass/src/machine_riscv.rs:1546-1556 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:1418` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/compiler/src/object/module.rs:248 — lib/compiler/src/object/module.rs:248-258 | lib/compiler/src/object/module.rs:272-282 | lib/compiler/src/object/module.rs:292-302 — 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) lib/compiler/src/object/module.rs:730 — lib/compiler/src/object/module.rs:730-740 | lib/compiler/src/object/module.rs:754-764 | lib/compiler/src/object/module.rs:779-789 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/object/module.rs:730` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) lib/vm/src/vmcontext.rs:396 — lib/vm/src/vmcontext.rs:396-406 | lib/vm/src/vmcontext.rs:425-435 | lib/vm/src/vmcontext.rs:464-474 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) lib/api/src/backend/js/entities/function/mod.rs:316 — lib/api/src/backend/js/entities/function/mod.rs:316-326 | lib/api/src/backend/js/entities/function/mod.rs:332-342 | lib/api/src/backend/js/entities/function/mod.rs:348-358 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:1566 — lib/compiler-singlepass/src/machine_arm64.rs:1566-1576 | lib/compiler-singlepass/src/machine_riscv.rs:2107-2117 | lib/compiler-singlepass/src/machine_x64.rs:2160-2170 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) lib/compiler-llvm/src/translator/code.rs:1200 — lib/compiler-llvm/src/translator/code.rs:1200-1210 | lib/compiler-llvm/src/translator/code.rs:1841-1851 | lib/compiler-llvm/src/translator/code.rs:2059-2069 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:1200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×8
  • Edited copy of a member (20 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:7152 — lib/compiler-singlepass/src/machine_x64.rs:7152-7171 | lib/compiler-singlepass/src/machine_x64.rs:7593-7612 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/cli/src/commands/app/secrets/utils/render.rs:27 — lib/cli/src/commands/app/secrets/utils/render.rs:27-46 | lib/cli/src/commands/app/secrets/utils/render.rs:68-90 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/api/src/backend/js/entities/memory/view.rs:117 — lib/api/src/backend/js/entities/memory/view.rs:117-136 | lib/api/src/backend/js/entities/memory/view.rs:170-197 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/compiler-cranelift/src/eh.rs:548 — lib/compiler-cranelift/src/eh.rs:548-567 | lib/compiler-cranelift/src/eh.rs:572-592 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/virtual-net/src/client.rs:559 — lib/virtual-net/src/client.rs:559-578 | lib/virtual-net/src/client.rs:952-973 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/api/src/backend/sys/entities/memory/mod.rs:239 — lib/api/src/backend/sys/entities/memory/mod.rs:239-258 | lib/api/src/backend/v8/entities/memory/mod.rs:290-312 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/wasix/src/syscalls/unix/mod.rs:15 — lib/wasix/src/syscalls/unix/mod.rs:15-34 | lib/wasix/src/syscalls/unix/mod.rs:39-61 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) lib/compiler-llvm/src/translator/code.rs:1486 — lib/compiler-llvm/src/translator/code.rs:1486-1505 | lib/compiler-llvm/src/translator/code.rs:1567-1587 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×8
  • Edited copy of a member (19 corresponding lines) lib/compiler/src/elf.rs:336 — lib/compiler/src/elf.rs:336-354 | lib/compiler/src/elf.rs:361-379 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/cli/src/commands/app/secrets/create.rs:217 — lib/cli/src/commands/app/secrets/create.rs:217-235 | lib/cli/src/commands/app/secrets/update.rs:211-230 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/c-api/src/wasm_c_api/wasi/mod.rs:253 — lib/c-api/src/wasm_c_api/wasi/mod.rs:253-273 | lib/c-api/src/wasm_c_api/wasi/mod.rs:280-298 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/c-api-imports/src/lib.rs:1440 — lib/c-api-imports/src/lib.rs:1440-1458 | lib/c-api-imports/src/lib.rs:1460-1478 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/wasix/src/syscalls/wasix/sock_addr_local.rs:20 — lib/wasix/src/syscalls/wasix/sock_addr_local.rs:20-38 | lib/wasix/src/syscalls/wasix/sock_addr_peer.rs:20-38 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/api/src/backend/v8/entities/memory/mod.rs:80 — lib/api/src/backend/v8/entities/memory/mod.rs:80-98 | lib/api/src/backend/v8/entities/table.rs:61-82 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/compiler/src/engine/mapped_binary.rs:747 — lib/compiler/src/engine/mapped_binary.rs:747-765 | lib/compiler/src/engine/mapped_binary.rs:775-793 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) lib/compiler-llvm/src/translator/code.rs:157 — lib/compiler-llvm/src/translator/code.rs:157-183 | lib/compiler-llvm/src/translator/trampoline.rs:57-75 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×8
  • Duplicated block (18 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs:279 — lib/api/src/backend/sys/entities/function/mod.rs:279-296 | lib/api/src/backend/sys/entities/function/mod.rs:433-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/mod.rs:279` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/compiler-cranelift/src/compiler.rs:451 — lib/compiler-cranelift/src/compiler.rs:451-468 | lib/compiler-cranelift/src/compiler.rs:488-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/compiler.rs:451` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) lib/compiler-cranelift/src/func_environ.rs:2004 — lib/compiler-cranelift/src/func_environ.rs:2004-2021 | lib/compiler-cranelift/src/func_environ.rs:2029-2046 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:2004` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/compiler-llvm/src/translator/code.rs:11860 — lib/compiler-llvm/src/translator/code.rs:11860-11877 | lib/compiler-llvm/src/translator/code.rs:11927-11944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:11860` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/compiler-singlepass/src/codegen.rs:1335 — lib/compiler-singlepass/src/codegen.rs:1335-1352 | lib/compiler-singlepass/src/codegen.rs:1357-1374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:1335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2336 — lib/compiler-singlepass/src/machine_arm64.rs:2336-2353 | lib/compiler-singlepass/src/machine_riscv.rs:2690-2707 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:2709` calls `emit_debug_breakpoint`, `emit_brk` and `lib/compiler-singlepass/src/machine_arm64.rs:2355` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) lib/wasix/src/os/task/process.rs:300 — lib/wasix/src/os/task/process.rs:300-317 | lib/wasix/src/os/task/process.rs:380-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/os/task/process.rs:300` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) lib/wasix/src/syscalls/wasi/path_open.rs:95 — lib/wasix/src/syscalls/wasi/path_open.rs:95-112 | lib/wasix/src/syscalls/wasix/path_open2.rs:98-115 — before extracting anything, compare `lib/wasix/src/syscalls/wasi/path_open.rs` and `lib/wasix/src/syscalls/wasix/path_open2.rs` as WHOLE FILES: 95% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasi/path_open.rs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/wasix/src/syscalls/wasi/path_open.rs:94` calls `empty` and `lib/wasix/src/syscalls/wasix/path_open2.rs:97` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×8
  • Duplicated block (13 lines × 3) lib/compiler-llvm/src/translator/code.rs:6099 — lib/compiler-llvm/src/translator/code.rs:6099-6111 | lib/compiler-llvm/src/translator/code.rs:6193-6205 | lib/compiler-llvm/src/translator/code.rs:6287-6299 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6099` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/compiler-llvm/src/translator/code.rs:6120 — lib/compiler-llvm/src/translator/code.rs:6120-6132 | lib/compiler-llvm/src/translator/code.rs:6214-6226 | lib/compiler-llvm/src/translator/code.rs:6308-6320 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/virtual-net/src/server.rs:883 — lib/virtual-net/src/server.rs:883-895 | lib/virtual-net/src/server.rs:913-925 | lib/virtual-net/src/server.rs:940-952 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/server.rs:883` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/compiler-llvm/src/translator/code.rs:5190 — lib/compiler-llvm/src/translator/code.rs:5190-5202 | lib/compiler-llvm/src/translator/code.rs:5292-5304 | lib/compiler-llvm/src/translator/code.rs:5394-5406 — 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) lib/compiler-llvm/src/translator/code.rs:5211 — lib/compiler-llvm/src/translator/code.rs:5211-5223 | lib/compiler-llvm/src/translator/code.rs:5313-5325 | lib/compiler-llvm/src/translator/code.rs:5415-5427 — 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) lib/compiler-singlepass/src/machine_arm64.rs:1883 — lib/compiler-singlepass/src/machine_arm64.rs:1883-1895 | lib/compiler-singlepass/src/machine_arm64.rs:1898-1910 | lib/compiler-singlepass/src/machine_arm64.rs:1913-1925 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:1883` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/compiler-llvm/src/translator/code.rs:2042 — lib/compiler-llvm/src/translator/code.rs:2042-2054 | lib/compiler-llvm/src/translator/code.rs:3731-3744 | lib/compiler-llvm/src/translator/code.rs:3891-3905 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:2042` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:811 — lib/compiler-singlepass/src/machine_arm64.rs:811-823 | lib/compiler-singlepass/src/machine_arm64.rs:839-851 | lib/compiler-singlepass/src/machine_arm64.rs:868-880 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:811` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×8
  • Duplicated block (8 lines × 3) lib/compiler-cranelift/src/compiler.rs:159 — lib/compiler-cranelift/src/compiler.rs:159-166 | lib/compiler-llvm/src/compiler.rs:269-277 | lib/compiler-singlepass/src/compiler.rs:115-122 — before extracting anything, compare `lib/compiler-cranelift/src/compiler.rs` and `lib/compiler-singlepass/src/compiler.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) lib/compiler-cranelift/src/config.rs:45 — lib/compiler-cranelift/src/config.rs:45-52 | lib/compiler-llvm/src/config.rs:50-57 | lib/compiler-singlepass/src/config.rs:44-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 3) lib/compiler-singlepass/src/codegen.rs:5875 — lib/compiler-singlepass/src/codegen.rs:5875-5882 | lib/compiler-singlepass/src/codegen.rs:5925-5932 | lib/compiler-singlepass/src/codegen.rs:5974-5981 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:5875` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/codegen.rs:5874` calls `pop`, `unwrap` and `lib/compiler-singlepass/src/codegen.rs:5973` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:1059 — lib/compiler-singlepass/src/machine_x64.rs:1059-1066 | lib/compiler-singlepass/src/machine_x64.rs:1214-1221 | lib/compiler-singlepass/src/machine_x64.rs:1398-1405 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1059` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) lib/wasix/src/net/socket.rs:1440 — lib/wasix/src/net/socket.rs:1440-1447 | lib/wasix/src/net/socket.rs:1532-1539 | lib/wasix/src/net/socket.rs:1623-1630 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1440` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/wasix/src/net/socket.rs:1448` calls `drop` and `lib/wasix/src/net/socket.rs:1631` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:2187 — lib/compiler-singlepass/src/machine_arm64.rs:2187-2194 | lib/compiler-singlepass/src/machine_riscv.rs:2531-2538 | lib/compiler-singlepass/src/machine_x64.rs:2466-2473 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) lib/types/src/entity/boxed_slice.rs:33 — lib/types/src/entity/boxed_slice.rs:33-40 | lib/types/src/entity/primary_map.rs:51-58 | lib/types/src/entity/secondary_map.rs:47-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 all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) lib/compiler-singlepass/src/machine_riscv.rs:1392 — lib/compiler-singlepass/src/machine_riscv.rs:1392-1399 | lib/compiler-singlepass/src/machine_riscv.rs:1443-1450 | lib/compiler-singlepass/src/machine_riscv.rs:1500-1507 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:1391` calls `move_location`, `Imm32`, `GPR` and `lib/compiler-singlepass/src/machine_riscv.rs:1441` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×8
  • Duplicated block (7 lines × 6) lib/compiler-llvm/src/translator/code.rs:5234 — lib/compiler-llvm/src/translator/code.rs:5234-5240 | lib/compiler-llvm/src/translator/code.rs:5252-5258 | lib/compiler-llvm/src/translator/code.rs:5336-5342 | lib/compiler-llvm/src/translator/code.rs:5354-5360 | lib/compiler-llvm/src/translator/code.rs:5438-5444 | lib/compiler-llvm/src/translator/code.rs:5456-5462 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-llvm/src/translator/code.rs:5241` calls `splat_vector`, `as_basic_value_enum`, `build_left_shift` and `lib/compiler-llvm/src/translator/code.rs:5259` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 6) lib/compiler-singlepass/src/machine_arm64.rs:3445 — lib/compiler-singlepass/src/machine_arm64.rs:3445-3451 | lib/compiler-singlepass/src/machine_arm64.rs:3628-3634 | lib/compiler-singlepass/src/machine_arm64.rs:3811-3817 | lib/compiler-singlepass/src/machine_arm64.rs:3994-4000 | lib/compiler-singlepass/src/machine_arm64.rs:4177-4183 | lib/compiler-singlepass/src/machine_arm64.rs:4359-4365 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 6) lib/compiler-singlepass/src/machine_arm64.rs:3506 — lib/compiler-singlepass/src/machine_arm64.rs:3506-3512 | lib/compiler-singlepass/src/machine_arm64.rs:3689-3695 | lib/compiler-singlepass/src/machine_arm64.rs:3872-3878 | lib/compiler-singlepass/src/machine_arm64.rs:4055-4061 | lib/compiler-singlepass/src/machine_arm64.rs:4238-4244 | lib/compiler-singlepass/src/machine_arm64.rs:4417-4423 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 6) lib/compiler-singlepass/src/machine_arm64.rs:3567 — lib/compiler-singlepass/src/machine_arm64.rs:3567-3573 | lib/compiler-singlepass/src/machine_arm64.rs:3750-3756 | lib/compiler-singlepass/src/machine_arm64.rs:3933-3939 | lib/compiler-singlepass/src/machine_arm64.rs:4116-4122 | lib/compiler-singlepass/src/machine_arm64.rs:4299-4305 | lib/compiler-singlepass/src/machine_arm64.rs:4475-4481 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 6) lib/compiler-singlepass/src/machine_arm64.rs:5756 — lib/compiler-singlepass/src/machine_arm64.rs:5756-5762 | lib/compiler-singlepass/src/machine_arm64.rs:6000-6006 | lib/compiler-singlepass/src/machine_arm64.rs:6244-6250 | lib/compiler-singlepass/src/machine_arm64.rs:6488-6494 | lib/compiler-singlepass/src/machine_arm64.rs:6732-6738 | lib/compiler-singlepass/src/machine_arm64.rs:6975-6981 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 6) lib/compiler-singlepass/src/machine_arm64.rs:5817 — lib/compiler-singlepass/src/machine_arm64.rs:5817-5823 | lib/compiler-singlepass/src/machine_arm64.rs:6061-6067 | lib/compiler-singlepass/src/machine_arm64.rs:6305-6311 | lib/compiler-singlepass/src/machine_arm64.rs:6549-6555 | lib/compiler-singlepass/src/machine_arm64.rs:6793-6799 | lib/compiler-singlepass/src/machine_arm64.rs:7033-7039 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 6) lib/compiler-singlepass/src/machine_arm64.rs:5878 — lib/compiler-singlepass/src/machine_arm64.rs:5878-5884 | lib/compiler-singlepass/src/machine_arm64.rs:6122-6128 | lib/compiler-singlepass/src/machine_arm64.rs:6366-6372 | lib/compiler-singlepass/src/machine_arm64.rs:6610-6616 | lib/compiler-singlepass/src/machine_arm64.rs:6854-6860 | lib/compiler-singlepass/src/machine_arm64.rs:7091-7097 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 6) lib/compiler-singlepass/src/machine_arm64.rs:5939 — lib/compiler-singlepass/src/machine_arm64.rs:5939-5945 | lib/compiler-singlepass/src/machine_arm64.rs:6183-6189 | lib/compiler-singlepass/src/machine_arm64.rs:6427-6433 | lib/compiler-singlepass/src/machine_arm64.rs:6671-6677 | lib/compiler-singlepass/src/machine_arm64.rs:6915-6921 | lib/compiler-singlepass/src/machine_arm64.rs:7149-7155 — 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.
D1 · Cyclomatic Complexity · LLVMFunctionCodeGenerator · ×7
  • LLVMFunctionCodeGenerator::translate_integer_arithmetic_operator (cyclomatic 118) lib/compiler-llvm/src/translator/code.rs:3972 — LLVMFunctionCodeGenerator::translate_integer_arithmetic_operator has cyclomatic complexity 118 (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.
  • LLVMFunctionCodeGenerator::translate_memory_operator (cyclomatic 86) lib/compiler-llvm/src/translator/code.rs:9812 — LLVMFunctionCodeGenerator::translate_memory_operator has cyclomatic complexity 86 (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.
  • LLVMFunctionCodeGenerator::translate_conversion_operator (cyclomatic 67) lib/compiler-llvm/src/translator/code.rs:8516 — LLVMFunctionCodeGenerator::translate_conversion_operator has cyclomatic complexity 67 (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: LLVMFunctionCodeGenerator::translate_floating_point_arithmetic_operator (cyclomatic 70) 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.
  • LLVMFunctionCodeGenerator::translate_basic_operator (cyclomatic 56) lib/compiler-llvm/src/translator/code.rs:3154 — LLVMFunctionCodeGenerator::translate_basic_operator has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent 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: LLVMFunctionCodeGenerator::translate_floating_point_arithmetic_operator (cyclomatic 70) 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.
  • LLVMFunctionCodeGenerator::translate_control_flow_operator (cyclomatic 33) lib/compiler-llvm/src/translator/code.rs:2723 — LLVMFunctionCodeGenerator::translate_control_flow_operator has cyclomatic complexity 33 (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. This is NOT this file's highest cyclomatic complexity: LLVMFunctionCodeGenerator::translate_floating_point_arithmetic_operator (cyclomatic 70) 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.
  • LLVMFunctionCodeGenerator::translate_eh_operator (cyclomatic 23) lib/compiler-llvm/src/translator/code.rs:11625 — LLVMFunctionCodeGenerator::translate_eh_operator 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. This is NOT this file's highest cyclomatic complexity: LLVMFunctionCodeGenerator::translate_floating_point_arithmetic_operator (cyclomatic 70) 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.
  • LLVMFunctionCodeGenerator::translate_operator (cyclomatic 20) lib/compiler-llvm/src/translator/code.rs:12218 — LLVMFunctionCodeGenerator::translate_operator 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. This is NOT this file's highest cyclomatic complexity: LLVMFunctionCodeGenerator::translate_floating_point_arithmetic_operator (cyclomatic 70) 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.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×7
  • Edited copy of a member (26 corresponding lines) lib/config/src/package/mod.rs:400 — lib/config/src/package/mod.rs:400-425 | lib/config/src/package/mod.rs:427-453 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/wasix/src/syscalls/wasi/args_sizes_get.rs:16 — lib/wasix/src/syscalls/wasi/args_sizes_get.rs:16-41 | lib/wasix/src/syscalls/wasi/environ_sizes_get.rs:16-49 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/vm/src/vmcontext.rs:422 — lib/vm/src/vmcontext.rs:422-447 | lib/vm/src/vmcontext.rs:461-486 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/api/src/entities/engine/mod.rs:85 — lib/api/src/entities/engine/mod.rs:85-111 | lib/api/src/entities/engine/mod.rs:119-144 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/wasix/src/syscalls/wasi/fd_seek.rs:23 — lib/wasix/src/syscalls/wasi/fd_seek.rs:23-48 | lib/wasix/src/syscalls/wasix/fd_pipe.rs:25-50 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/api/src/utils/mem/access.rs:238 — lib/api/src/utils/mem/access.rs:238-268 | lib/api/src/utils/mem/access.rs:291-316 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) lib/cli/src/backend.rs:346 — lib/cli/src/backend.rs:346-371 | lib/cli/src/backend.rs:384-418 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×7
  • Edited copy of a member (25 corresponding lines) lib/api/src/entities/instance.rs:58 — lib/api/src/entities/instance.rs:58-82 | lib/api/src/entities/instance.rs:99-126 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/wasix/src/runtime/resolver/filesystem_source.rs:14 — lib/wasix/src/runtime/resolver/filesystem_source.rs:14-38 | lib/wasix/src/runtime/resolver/web_source.rs:226-252 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/cli/src/commands/app/util.rs:155 — lib/cli/src/commands/app/util.rs:155-181 | lib/cli/src/commands/app/util.rs:183-207 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1726 — lib/compiler-singlepass/src/machine_arm64.rs:1726-1750 | lib/compiler-singlepass/src/machine_arm64.rs:1759-1791 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/cli/src/commands/package/push.rs:67 — lib/cli/src/commands/package/push.rs:67-92 | lib/cli/src/commands/package/tag.rs:361-385 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/package/src/package/manifest.rs:133 — lib/package/src/package/manifest.rs:133-158 | lib/package/src/package/manifest.rs:164-188 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) lib/wasix/src/runtime/resolver/web_source.rs:174 — lib/wasix/src/runtime/resolver/web_source.rs:174-198 | lib/wasix/src/runtime/resolver/web_source.rs:200-224 — 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 (27 corresponding lines) · ×7
  • Edited copy of a member (27 corresponding lines) lib/virtual-net/src/host.rs:901 — lib/virtual-net/src/host.rs:901-931 | lib/virtual-net/src/host.rs:1218-1244 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/wasix/src/os/task/process.rs:693 — lib/wasix/src/os/task/process.rs:693-719 | lib/wasix/src/os/task/process.rs:733-759 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/cli/src/commands/package/publish.rs:134 — lib/cli/src/commands/package/publish.rs:134-160 | lib/cli/src/commands/package/tag.rs:636-669 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/c-api-imports/src/lib.rs:1314 — lib/c-api-imports/src/lib.rs:1314-1340 | lib/c-api-imports/src/lib.rs:1347-1373 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/virtual-fs/src/pipe.rs:75 — lib/virtual-fs/src/pipe.rs:75-101 | lib/virtual-fs/src/pipe.rs:271-297 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/api/src/entities/store/context.rs:520 — lib/api/src/entities/store/context.rs:520-549 | lib/api/src/entities/store/context.rs:553-579 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/api/src/utils/polyfill.rs:158 — lib/api/src/utils/polyfill.rs:158-184 | lib/compiler/src/translator/environ.rs:164-190 — 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 (9 corresponding lines) · ×7
  • Edited copy of a member (9 corresponding lines) lib/c-api-imports/src/lib.rs:2172 — lib/c-api-imports/src/lib.rs:2172-2180 | lib/c-api/src/wasm_c_api/types/reference.rs:94-102 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/api/src/backend/sys/entities/engine.rs:179 — lib/api/src/backend/sys/entities/engine.rs:179-187 | lib/api/src/backend/sys/entities/engine.rs:192-200 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/cli/src/types.rs:534 — lib/cli/src/types.rs:534-547 | lib/cli/src/types.rs:570-578 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/cli/src/types.rs:263 — lib/cli/src/types.rs:263-275 | lib/cli/src/types.rs:310-318 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/cli/src/types.rs:228 — lib/cli/src/types.rs:228-236 | lib/cli/src/types.rs:389-397 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/api/src/entities/engine/inner.rs:54 — lib/api/src/entities/engine/inner.rs:54-64 | lib/api/src/entities/engine/inner.rs:78-86 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/api/src/entities/memory/inner.rs:239 — lib/api/src/entities/memory/inner.rs:239-248 | lib/api/src/entities/memory/mod.rs:208-216 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×7
  • Edited copy of a member (4 corresponding lines) lib/config/src/package/package_hash.rs:72 — lib/config/src/package/package_hash.rs:72-76 | lib/config/src/package/package_source.rs:142-145 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/compiler/src/serialize.rs:139 — lib/compiler/src/serialize.rs:139-142 | lib/compiler/src/types/symbols.rs:144-147 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/compiler/src/serialize.rs:147 — lib/compiler/src/serialize.rs:147-150 | lib/compiler/src/types/symbols.rs:152-155 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/config/src/package/named_package_ident.rs:310 — lib/config/src/package/named_package_ident.rs:310-313 | lib/config/src/package/package_ident.rs:91-94 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/api/src/backend/js/entities/module.rs:431 — lib/api/src/backend/js/entities/module.rs:431-434 | lib/api/src/backend/v8/entities/module.rs:281-284 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/journal/src/concrete/aligned_cow_str.rs:110 — lib/journal/src/concrete/aligned_cow_str.rs:110-113 | lib/journal/src/concrete/aligned_cow_vec.rs:212-215 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/api/src/backend/js/entities/module.rs:439 — lib/api/src/backend/js/entities/module.rs:439-442 | lib/api/src/backend/v8/entities/module.rs:273-276 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×7
  • Duplicated block (21 lines × 2) lib/api/src/backend/sys/entities/memory/mod.rs:298 — lib/api/src/backend/sys/entities/memory/mod.rs:298-318 | lib/api/src/backend/sys/entities/memory/mod.rs:329-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/memory/mod.rs:298` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/cli/src/commands/app/util.rs:308 — lib/cli/src/commands/app/util.rs:308-328 | lib/cli/src/commands/package/common/mod.rs:210-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/util.rs:308` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/compiler-cranelift/src/elf.rs:139 — lib/compiler-cranelift/src/elf.rs:139-159 | lib/compiler/src/dwarf.rs:155-175 — before extracting anything, compare `lib/compiler-cranelift/src/elf.rs` and `lib/compiler/src/dwarf.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/elf.rs:139` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) lib/compiler-llvm/src/translator/code.rs:2555 — lib/compiler-llvm/src/translator/code.rs:2555-2575 | lib/compiler-llvm/src/translator/code.rs:2581-2601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:2555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/compiler-singlepass/src/codegen.rs:1259 — lib/compiler-singlepass/src/codegen.rs:1259-1279 | lib/compiler-singlepass/src/codegen.rs:1289-1309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/codegen.rs:1255` calls `type_to_wp_type`, `acquire_location`, `push` and `lib/compiler-singlepass/src/codegen.rs:1288` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (21 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:3680 — lib/compiler-singlepass/src/machine_x64.rs:3680-3700 | lib/compiler-singlepass/src/machine_x64.rs:3813-3833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3680` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:7814 — lib/compiler-singlepass/src/machine_x64.rs:7814-7834 | lib/compiler-singlepass/src/machine_x64.rs:7938-7958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:7814` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×7
  • Duplicated block (12–13 lines × 2) lib/c-api/src/wasm_c_api/engine/config/sys.rs:157 — lib/c-api/src/wasm_c_api/engine/config/sys.rs:157-168 | lib/c-api/src/wasm_c_api/engine/config/sys.rs:173-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/c-api/src/wasm_c_api/engine/config/sys.rs:157` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) lib/compiler-cranelift/src/trampoline/dynamic_function.rs:33 — lib/compiler-cranelift/src/trampoline/dynamic_function.rs:33-44 | lib/compiler-cranelift/src/trampoline/function_call.rs:36-48 — 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) lib/compiler-singlepass/src/machine_riscv.rs:1073 — lib/compiler-singlepass/src/machine_riscv.rs:1073-1085 | lib/compiler-singlepass/src/machine_riscv.rs:1191-1202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:1073` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:488 — lib/compiler-singlepass/src/machine_x64.rs:488-500 | lib/compiler-singlepass/src/machine_x64.rs:552-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:488` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12–13 lines × 2) lib/wasix/src/runners/wasi.rs:425 — lib/wasix/src/runners/wasi.rs:425-436 | lib/wasix/src/runners/wasi.rs:536-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/runners/wasi.rs:425` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) lib/wasix/src/syscalls/mod.rs:633 — lib/wasix/src/syscalls/mod.rs:633-644 | lib/wasix/src/syscalls/mod.rs:727-739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/mod.rs:633` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) lib/wasix/src/syscalls/wasi/fd_dup.rs:26 — lib/wasix/src/syscalls/wasi/fd_dup.rs:26-37 | lib/wasix/src/syscalls/wasix/fd_dup2.rs:33-45 — before extracting anything, compare `lib/wasix/src/syscalls/wasi/fd_dup.rs` and `lib/wasix/src/syscalls/wasix/fd_dup2.rs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasi/fd_dup.rs:26` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×7
  • Duplicated block (10 lines × 4) lib/compiler-llvm/src/translator/code.rs:4614 — lib/compiler-llvm/src/translator/code.rs:4614-4623 | lib/compiler-llvm/src/translator/code.rs:4625-4634 | lib/compiler-llvm/src/translator/code.rs:4636-4645 | lib/compiler-llvm/src/translator/code.rs:4890-4899 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4614` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) lib/compiler-llvm/src/translator/code.rs:6668 — lib/compiler-llvm/src/translator/code.rs:6668-6677 | lib/compiler-llvm/src/translator/code.rs:6691-6700 | lib/compiler-llvm/src/translator/code.rs:6838-6847 | lib/compiler-llvm/src/translator/code.rs:6861-6870 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6668` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:2656 — lib/compiler-singlepass/src/machine_arm64.rs:2656-2665 | lib/compiler-singlepass/src/machine_arm64.rs:2694-2703 | lib/compiler-singlepass/src/machine_arm64.rs:2917-2926 | lib/compiler-singlepass/src/machine_arm64.rs:4839-4848 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2656` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:4367 — lib/compiler-singlepass/src/machine_arm64.rs:4367-4376 | lib/compiler-singlepass/src/machine_arm64.rs:4425-4434 | lib/compiler-singlepass/src/machine_arm64.rs:4483-4492 | lib/compiler-singlepass/src/machine_arm64.rs:7157-7166 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4367` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 4) lib/virtual-fs/src/mem_fs/file.rs:907 — lib/virtual-fs/src/mem_fs/file.rs:907-916 | lib/virtual-fs/src/mem_fs/file.rs:997-1006 | lib/virtual-fs/src/mem_fs/file.rs:1105-1114 | lib/virtual-fs/src/mem_fs/file.rs:1187-1196 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/file.rs:907` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) lib/compiler-llvm/src/translator/code.rs:5667 — lib/compiler-llvm/src/translator/code.rs:5667-5676 | lib/compiler-llvm/src/translator/code.rs:5682-5691 | lib/compiler-llvm/src/translator/code.rs:5697-5706 | lib/compiler-llvm/src/translator/code.rs:5712-5721 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:5667` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) lib/compiler-cranelift/src/translator/code_translator.rs:3242 — lib/compiler-cranelift/src/translator/code_translator.rs:3242-3251 | lib/compiler-cranelift/src/translator/code_translator.rs:3291-3300 | lib/compiler-cranelift/src/translator/code_translator.rs:3340-3349 | lib/compiler-cranelift/src/translator/code_translator.rs:3382-3391 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/translator/code_translator.rs:3242` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-cranelift/src/translator/code_translator.rs:3236` calls `pop1`, `value_type` and `lib/compiler-cranelift/src/translator/code_translator.rs:3336` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D1 · Cyclomatic Complexity · InodeSocket · ×6
  • InodeSocket::bind_internal (cyclomatic 28) lib/wasix/src/net/socket.rs:309 — InodeSocket::bind_internal has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • InodeSocket::connect (cyclomatic 21) lib/wasix/src/net/socket.rs:692 — InodeSocket::connect 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. This is NOT this file's highest cyclomatic complexity: WasiSocketOption::try_from (cyclomatic 28) 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.
  • InodeSocket::set_opt_flag (cyclomatic 19) lib/wasix/src/net/socket.rs:922 — InodeSocket::set_opt_flag has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: WasiSocketOption::try_from (cyclomatic 28) 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.
  • InodeSocket::get_opt_flag (cyclomatic 17) lib/wasix/src/net/socket.rs:974 — InodeSocket::get_opt_flag 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. This is NOT this file's highest cyclomatic complexity: WasiSocketOption::try_from (cyclomatic 28) 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.
  • InodeSocket::send (cyclomatic 16) lib/wasix/src/net/socket.rs:1304 — InodeSocket::send 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: WasiSocketOption::try_from (cyclomatic 28) 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.
  • InodeSocket::recv (cyclomatic 16) lib/wasix/src/net/socket.rs:1475 — InodeSocket::recv 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: WasiSocketOption::try_from (cyclomatic 28) 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 · LLVMFunctionCodeGenerator · ×6
  • LLVMFunctionCodeGenerator::translate_basic_operator (cognitive 89) lib/compiler-llvm/src/translator/code.rs:3154 — LLVMFunctionCodeGenerator::translate_basic_operator has cognitive complexity 89 (threshold 15). Drivers by points: if/else 38 (66 pts), loops 4 (13 pts), match/switch 4 (7 pts), boolean chains 3 (nesting depth added 40). 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.
  • LLVMFunctionCodeGenerator::translate_eh_operator (cognitive 56) lib/compiler-llvm/src/translator/code.rs:11625 — LLVMFunctionCodeGenerator::translate_eh_operator has cognitive complexity 56 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 7 (23 pts), match/switch 4 (9 pts) (nesting depth added 35). 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.
  • LLVMFunctionCodeGenerator::translate_control_flow_operator (cognitive 51) lib/compiler-llvm/src/translator/code.rs:2723 — LLVMFunctionCodeGenerator::translate_control_flow_operator has cognitive complexity 51 (threshold 15). Drivers by points: loops 14 (32 pts), if/else 9 (16 pts), match/switch 2 (3 pts) (nesting depth added 26). 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.
  • LLVMFunctionCodeGenerator::translate_memory_operator (cognitive 22) lib/compiler-llvm/src/translator/code.rs:9812 — LLVMFunctionCodeGenerator::translate_memory_operator has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • LLVMFunctionCodeGenerator::translate_integer_arithmetic_operator (cognitive 21) lib/compiler-llvm/src/translator/code.rs:3972 — LLVMFunctionCodeGenerator::translate_integer_arithmetic_operator has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 9 (17 pts), if/else 3 (4 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • LLVMFunctionCodeGenerator::resolve_memory_ptr (cognitive 20) lib/compiler-llvm/src/translator/code.rs:1871 — LLVMFunctionCodeGenerator::resolve_memory_ptr has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wasmer_compiler_cranelift · ×6
  • wasmer_compiler_cranelift::translator::code_translator::translate_operator (cognitive 87) lib/compiler-cranelift/src/translator/code_translator.rs:159 — wasmer_compiler_cranelift::translator::code_translator::translate_operator has cognitive complexity 87 (threshold 15). Drivers by points: if/else 21 (41 pts), match/switch 14 (31 pts), loops 6 (15 pts) (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.
  • wasmer_compiler_cranelift::elf::emit_local_function (cognitive 47) lib/compiler-cranelift/src/elf.rs:238 — wasmer_compiler_cranelift::elf::emit_local_function has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (28 pts), loops 6 (13 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_compiler_cranelift::eh::build_function_lsda (cognitive 27) lib/compiler-cranelift/src/eh.rs:43 — wasmer_compiler_cranelift::eh::build_function_lsda has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (7 pts), loops 5 (6 pts) (nesting depth added 9). 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.
  • wasmer_compiler_cranelift::eh::compact_unwind_encoding_aarch64 (cognitive 19) lib/compiler-cranelift/src/eh.rs:419 — wasmer_compiler_cranelift::eh::compact_unwind_encoding_aarch64 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (6 pts), loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_compiler_cranelift::eh::encode_action_table (cognitive 17) lib/compiler-cranelift/src/eh.rs:600 — wasmer_compiler_cranelift::eh::encode_action_table has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_compiler_cranelift::translator::code_translator::translate_unreachable_operator (cognitive 16) lib/compiler-cranelift/src/translator/code_translator.rs:2656 — wasmer_compiler_cranelift::translator::code_translator::translate_unreachable_operator has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 2 (5 pts), boolean chains 2 (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 · wasmer_compiler · ×6
  • wasmer_compiler::object::module::emit_compilation (cognitive 39) lib/compiler/src/object/module.rs:154 — wasmer_compiler::object::module::emit_compilation has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 5 (13 pts), loops 8 (9 pts), boolean chains 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.
  • wasmer_compiler::engine::link::apply_relocation (cognitive 27) lib/compiler/src/engine/link.rs:21 — wasmer_compiler::engine::link::apply_relocation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_compiler::engine::resolver::resolve_imports (cognitive 21) lib/compiler/src/engine/resolver.rs:79 — wasmer_compiler::engine::resolver::resolve_imports has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 2 (8 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • wasmer_compiler::engine::resolver::resolve_tags (cognitive 21) lib/compiler/src/engine/resolver.rs:221 — wasmer_compiler::engine::resolver::resolve_tags has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (5 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_compiler::translator::sections::parse_name_section (cognitive 18) lib/compiler/src/translator/sections.rs:558 — wasmer_compiler::translator::sections::parse_name_section has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_compiler::compiler::translate_function_buckets (cognitive 17) lib/compiler/src/compiler.rs:355 — wasmer_compiler::compiler::translate_function_buckets has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 2 (7 pts), match/switch 1 (2 pts) (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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (5 members, 50+ identical tokens) lib/backend-api/src/query.rs:266 — lib/backend-api/src/query.rs:266-303 | lib/backend-api/src/query.rs:644-679 | lib/backend-api/src/query.rs:698-735 | lib/backend-api/src/query.rs:1513-1554 | lib/backend-api/src/query.rs:1579-1619 — 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) lib/backend-api/src/query.rs:855 — lib/backend-api/src/query.rs:855-903 | lib/backend-api/src/query.rs:913-964 | lib/backend-api/src/query.rs:986-1035 | lib/backend-api/src/query.rs:1045-1096 | lib/backend-api/src/query.rs:1118-1167 — 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) lib/compiler-singlepass/src/machine_x64.rs:2509 — lib/compiler-singlepass/src/machine_x64.rs:2509-2560 | lib/compiler-singlepass/src/machine_x64.rs:7309-7431 | lib/compiler-singlepass/src/machine_x64.rs:7438-7555 | lib/compiler-singlepass/src/machine_x64.rs:7729-7851 | lib/compiler-singlepass/src/machine_x64.rs:7858-7975 — 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) lib/virtual-fs/src/mem_fs/filesystem.rs:186 — lib/virtual-fs/src/mem_fs/filesystem.rs:186-256 | lib/virtual-fs/src/mem_fs/filesystem.rs:258-314 | lib/virtual-fs/src/mem_fs/filesystem.rs:386-461 | lib/virtual-fs/src/mem_fs/filesystem.rs:467-516 | lib/virtual-fs/src/mem_fs/filesystem.rs:620-662 — 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) lib/virtual-net/src/client.rs:711 — lib/virtual-net/src/client.rs:711-726 | lib/virtual-net/src/client.rs:771-796 | lib/virtual-net/src/client.rs:803-827 | lib/virtual-net/src/client.rs:829-848 | lib/virtual-net/src/client.rs:854-877 — 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) lib/wasix/src/net/socket.rs:613 — lib/wasix/src/net/socket.rs:613-673 | lib/wasix/src/net/socket.rs:1310-1388 | lib/wasix/src/net/socket.rs:1397-1473 | lib/wasix/src/net/socket.rs:1482-1566 | lib/wasix/src/net/socket.rs:1575-1655 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×6
  • Edited copy of a member (31 corresponding lines) lib/virtual-fs/src/mem_fs/file.rs:324 — lib/virtual-fs/src/mem_fs/file.rs:324-354 | lib/virtual-fs/src/mem_fs/file.rs:356-387 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) lib/wasix/src/syscalls/wasi/fd_write.rs:32 — lib/wasix/src/syscalls/wasi/fd_write.rs:32-63 | lib/wasix/src/syscalls/wasi/fd_write.rs:87-117 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:6086 — lib/compiler-singlepass/src/machine_riscv.rs:6086-6116 | lib/compiler-singlepass/src/machine_riscv.rs:6322-6352 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) lib/api/src/utils/polyfill.rs:781 — lib/api/src/utils/polyfill.rs:781-815 | lib/compiler/src/translator/sections.rs:403-433 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) lib/backend-api/src/query.rs:1797 — lib/backend-api/src/query.rs:1797-1827 | lib/backend-api/src/query.rs:1910-1942 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) lib/compiler/src/translator/sections.rs:489 — lib/compiler/src/translator/sections.rs:489-519 | lib/compiler/src/translator/sections.rs:525-555 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×6
  • Edited copy of a member (8 corresponding lines) lib/c-api-imports/src/lib.rs:1752 — lib/c-api-imports/src/lib.rs:1752-1760 | lib/c-api-imports/src/lib.rs:2115-2122 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/compiler-cranelift/src/abi.rs:117 — lib/compiler-cranelift/src/abi.rs:117-125 | lib/compiler-cranelift/src/abi.rs:127-134 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:1096 — lib/compiler-singlepass/src/emitter_x64.rs:1096-1103 | lib/compiler-singlepass/src/emitter_x64.rs:2253-2260 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/compiler-llvm/src/config.rs:88 — lib/compiler-llvm/src/config.rs:88-95 | lib/compiler-llvm/src/config.rs:102-109 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/c-api/src/wasm_c_api/module.rs:31 — lib/c-api/src/wasm_c_api/module.rs:31-39 | lib/c-api/src/wasm_c_api/unstable/module.rs:174-181 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) fuzz/fuzz_targets/equivalence.rs:41 — fuzz/fuzz_targets/equivalence.rs:41-49 | fuzz/fuzz_targets/equivalence.rs:52-59 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×6
  • Edited copy of a member (6 corresponding lines) lib/virtual-net/src/rx_tx.rs:28 — lib/virtual-net/src/rx_tx.rs:28-33 | lib/wasix/src/os/task/thread.rs:407-412 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2296 — lib/compiler-singlepass/src/machine_arm64.rs:2296-2301 | lib/compiler-singlepass/src/machine_riscv.rs:2655-2660 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:1991 — lib/compiler-singlepass/src/machine_riscv.rs:1991-1996 | lib/compiler-singlepass/src/machine_x64.rs:2046-2051 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) lib/vm/src/instance/mod.rs:1082 — lib/vm/src/instance/mod.rs:1082-1091 | lib/vm/src/instance/ref.rs:42-47 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1379 — lib/compiler-singlepass/src/machine_arm64.rs:1379-1384 | lib/compiler-singlepass/src/machine_x64.rs:1988-1993 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) lib/c-api-imports/src/lib.rs:2226 — lib/c-api-imports/src/lib.rs:2226-2231 | lib/c-api/src/wasm_c_api/types/reference.rs:149-156 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×6
  • Duplicated block (22 lines × 2) lib/compiler-llvm/src/translator/code.rs:11881 — lib/compiler-llvm/src/translator/code.rs:11881-11902 | lib/compiler-llvm/src/translator/code.rs:11948-11969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:11881` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-llvm/src/translator/code.rs:11971` calls `push`, `as_basic_value` and `lib/compiler-llvm/src/translator/code.rs:11904` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (22 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:1849 — lib/compiler-singlepass/src/machine_arm64.rs:1849-1870 | lib/compiler-singlepass/src/machine_arm64.rs:1932-1953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:1849` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) lib/compiler-singlepass/src/machine_arm64.rs:2038 — lib/compiler-singlepass/src/machine_arm64.rs:2038-2059 | lib/compiler-singlepass/src/machine_riscv.rs:2420-2441 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2038` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:5621 — lib/compiler-singlepass/src/machine_x64.rs:5621-5642 | lib/compiler-singlepass/src/machine_x64.rs:5801-5822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:5621` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) lib/api/src/backend/sys/entities/memory/view.rs:205 — lib/api/src/backend/sys/entities/memory/view.rs:205-226 | lib/api/src/backend/v8/entities/memory/view.rs:200-221 — before extracting anything, compare `lib/api/src/backend/sys/entities/memory/view.rs` and `lib/api/src/backend/v8/entities/memory/view.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) scripts/make-release.py:174 — scripts/make-release.py:174-195 | scripts/make-release.py:444-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×6
  • Duplicated block (14 lines × 3) lib/backend-api/src/query.rs:873 — lib/backend-api/src/query.rs:873-886 | lib/backend-api/src/query.rs:931-944 | lib/backend-api/src/query.rs:1063-1076 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/backend-api/src/query.rs:873` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) lib/compiler-cranelift/src/translator/code_translator.rs:3254 — lib/compiler-cranelift/src/translator/code_translator.rs:3254-3267 | lib/compiler-cranelift/src/translator/code_translator.rs:3307-3320 | lib/compiler-cranelift/src/translator/code_translator.rs:3393-3406 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-cranelift/src/translator/code_translator.rs:3253` calls `bytes` and `lib/compiler-cranelift/src/translator/code_translator.rs:3391` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 3) lib/virtual-fs/src/mem_fs/file.rs:917 — lib/virtual-fs/src/mem_fs/file.rs:917-930 | lib/virtual-fs/src/mem_fs/file.rs:932-945 | lib/virtual-fs/src/mem_fs/file.rs:947-960 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 3) lib/wasix/src/syscalls/wasi/fd_read.rs:246 — lib/wasix/src/syscalls/wasi/fd_read.rs:246-259 | lib/wasix/src/syscalls/wasi/fd_read.rs:302-315 | lib/wasix/src/syscalls/wasi/fd_read.rs:356-369 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasi/fd_read.rs:246` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) lib/compiler-llvm/src/translator/code.rs:5250 — lib/compiler-llvm/src/translator/code.rs:5250-5263 | lib/compiler-llvm/src/translator/code.rs:5352-5365 | lib/compiler-llvm/src/translator/code.rs:5454-5467 — 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) lib/compiler-cranelift/src/translator/code_translator.rs:3237 — lib/compiler-cranelift/src/translator/code_translator.rs:3237-3250 | lib/compiler-cranelift/src/translator/code_translator.rs:3286-3299 | lib/compiler-cranelift/src/translator/code_translator.rs:3377-3390 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-cranelift/src/translator/code_translator.rs:3253` calls `bytes` and `lib/compiler-cranelift/src/translator/code_translator.rs:3393` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×6
  • Duplicated block (12 lines × 3) lib/compiler-singlepass/src/emitter_arm64.rs:3288 — lib/compiler-singlepass/src/emitter_arm64.rs:3288-3299 | lib/compiler-singlepass/src/emitter_riscv.rs:2179-2190 | lib/compiler-singlepass/src/machine_x64.rs:8361-8372 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/emitter_arm64.rs:3288` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:2655 — lib/compiler-singlepass/src/machine_arm64.rs:2655-2666 | lib/compiler-singlepass/src/machine_arm64.rs:2693-2704 | lib/compiler-singlepass/src/machine_arm64.rs:4838-4849 — 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) lib/compiler-singlepass/src/machine_x64.rs:6613 — lib/compiler-singlepass/src/machine_x64.rs:6613-6624 | lib/compiler-singlepass/src/machine_x64.rs:6673-6684 | lib/compiler-singlepass/src/machine_x64.rs:6733-6744 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:6613` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) lib/virtual-fs/src/overlay_fs.rs:286 — lib/virtual-fs/src/overlay_fs.rs:286-297 | lib/virtual-fs/src/overlay_fs.rs:533-544 | lib/virtual-fs/src/overlay_fs.rs:562-573 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/overlay_fs.rs:286` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) lib/wasix/src/syscalls/wasi/fd_read.rs:219 — lib/wasix/src/syscalls/wasi/fd_read.rs:219-230 | lib/wasix/src/syscalls/wasi/fd_read.rs:334-346 | lib/wasix/src/syscalls/wasi/fd_read.rs:388-400 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasi/fd_read.rs:219` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 3) lib/wasix/src/syscalls/wasi/fd_write.rs:421 — lib/wasix/src/syscalls/wasi/fd_write.rs:421-432 | lib/wasix/src/syscalls/wasi/fd_write.rs:480-491 | lib/wasix/src/syscalls/wasi/fd_write.rs:598-609 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasi/fd_write.rs:421` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×6
  • Duplicated block (9 lines × 4) lib/cli/src/commands/app/secrets/create.rs:59 — lib/cli/src/commands/app/secrets/create.rs:59-67 | lib/cli/src/commands/app/secrets/delete.rs:61-69 | lib/cli/src/commands/app/secrets/reveal.rs:50-58 | lib/cli/src/commands/app/secrets/update.rs:64-72 — before extracting anything, compare `lib/cli/src/commands/app/secrets/create.rs` and `lib/cli/src/commands/app/secrets/delete.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/secrets/create.rs:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) lib/compiler-singlepass/src/emitter_x64.rs:1947 — lib/compiler-singlepass/src/emitter_x64.rs:1947-1955 | lib/compiler-singlepass/src/emitter_x64.rs:1977-1985 | lib/compiler-singlepass/src/emitter_x64.rs:2007-2015 | lib/compiler-singlepass/src/emitter_x64.rs:2037-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 4) lib/compiler-singlepass/src/emitter_x64.rs:1962 — lib/compiler-singlepass/src/emitter_x64.rs:1962-1970 | lib/compiler-singlepass/src/emitter_x64.rs:1992-2000 | lib/compiler-singlepass/src/emitter_x64.rs:2022-2030 | lib/compiler-singlepass/src/emitter_x64.rs:2052-2060 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:4366 — lib/compiler-singlepass/src/machine_arm64.rs:4366-4374 | lib/compiler-singlepass/src/machine_arm64.rs:4544-4552 | lib/compiler-singlepass/src/machine_arm64.rs:7156-7164 | lib/compiler-singlepass/src/machine_arm64.rs:7407-7415 — 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) lib/compiler-singlepass/src/machine_arm64.rs:7890 — lib/compiler-singlepass/src/machine_arm64.rs:7890-7898 | lib/compiler-singlepass/src/machine_arm64.rs:7928-7936 | lib/compiler-singlepass/src/machine_arm64.rs:8175-8183 | lib/compiler-singlepass/src/machine_arm64.rs:8213-8221 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7890` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:7909 — lib/compiler-singlepass/src/machine_arm64.rs:7909-7917 | lib/compiler-singlepass/src/machine_arm64.rs:7947-7955 | lib/compiler-singlepass/src/machine_arm64.rs:8194-8202 | lib/compiler-singlepass/src/machine_arm64.rs:8232-8240 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7909` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D2 · Cognitive Complexity · InodeSocket · ×5
  • InodeSocket::bind_internal (cognitive 53) lib/wasix/src/net/socket.rs:309 — InodeSocket::bind_internal has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (30 pts), match/switch 11 (23 pts) (nesting depth added 33). 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.
  • InodeSocket::connect (cognitive 28) lib/wasix/src/net/socket.rs:692 — InodeSocket::connect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 6 (13 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.
  • InodeSocket::send (cognitive 17) lib/wasix/src/net/socket.rs:1304 — InodeSocket::send has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 5 (7 pts), loops 1 (nesting depth added 7). 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.
  • InodeSocket::recv (cognitive 16) lib/wasix/src/net/socket.rs:1475 — InodeSocket::recv has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 3, loops 1 (nesting depth added 7). 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.
  • InodeSocket::recv_from (cognitive 16) lib/wasix/src/net/socket.rs:1568 — InodeSocket::recv_from has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 3, loops 1 (nesting depth added 7). 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 · wasmer_compiler_singlepass · ×5
  • wasmer_compiler_singlepass::emitter_arm64::gen_import_call_trampoline_arm64 (cognitive 47) lib/compiler-singlepass/src/emitter_arm64.rs:3108 — wasmer_compiler_singlepass::emitter_arm64::gen_import_call_trampoline_arm64 has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 4 (11 pts), loops 2 (6 pts), boolean chains 4 (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.
  • wasmer_compiler_singlepass::emitter_arm64::gen_std_dynamic_import_trampoline_arm64 (cognitive 29) lib/compiler-singlepass/src/emitter_arm64.rs:2949 — wasmer_compiler_singlepass::emitter_arm64::gen_std_dynamic_import_trampoline_arm64 has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 5 (17 pts), if/else 8 (10 pts), loops 1 (2 pts) (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.
  • wasmer_compiler_singlepass::emitter_riscv::gen_import_call_trampoline_riscv (cognitive 27) lib/compiler-singlepass/src/emitter_riscv.rs:2036 — wasmer_compiler_singlepass::emitter_riscv::gen_import_call_trampoline_riscv has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_compiler_singlepass::emitter_riscv::gen_std_trampoline_riscv (cognitive 23) lib/compiler-singlepass/src/emitter_riscv.rs:1750 — wasmer_compiler_singlepass::emitter_riscv::gen_std_trampoline_riscv has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_compiler_singlepass::emitter_arm64::gen_std_trampoline_arm64 (cognitive 21) lib/compiler-singlepass/src/emitter_arm64.rs:2807 — wasmer_compiler_singlepass::emitter_arm64::gen_std_trampoline_arm64 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 4 (8 pts), 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.
D2 · Cognitive Complexity · wasmer_cli · ×5
  • wasmer_cli::commands::app::deploy::wait_app (cognitive 40) lib/cli/src/commands/app/deploy.rs:1171 — wasmer_cli::commands::app::deploy::wait_app has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (33 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_cli::commands::app::secrets::utils::get_app_id (cognitive 32) lib/cli/src/commands/app/secrets/utils/mod.rs:93 — wasmer_cli::commands::app::secrets::utils::get_app_id has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (32 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.
  • wasmer_cli::utils::prompts::prompt_for_package (cognitive 26) lib/cli/src/utils/prompts.rs:113 — wasmer_cli::utils::prompts::prompt_for_package has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (3 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.
  • wasmer_cli::commands::init::construct_manifest (cognitive 24) lib/cli/src/commands/init.rs:362 — wasmer_cli::commands::init::construct_manifest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 3 (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.
  • wasmer_cli::utils::yaml::merge_into_mapping (cognitive 20) lib/cli/src/utils/yaml.rs:81 — wasmer_cli::utils::yaml::merge_into_mapping has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×5
  • Edited copy of a member (21 corresponding lines) lib/virtual-fs/src/mem_fs/file.rs:1833 — lib/virtual-fs/src/mem_fs/file.rs:1833-1867 | lib/virtual-fs/src/mem_fs/file.rs:1940-1964 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:849 — lib/compiler-singlepass/src/machine_riscv.rs:849-869 | lib/compiler-singlepass/src/machine_riscv.rs:1745-1765 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) lib/c-api-imports/src/lib.rs:804 — lib/c-api-imports/src/lib.rs:804-824 | lib/c-api-imports/src/lib.rs:848-871 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) lib/wasix/src/syscalls/mod.rs:206 — lib/wasix/src/syscalls/mod.rs:206-232 | lib/wasix/src/syscalls/mod.rs:238-258 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) lib/cli/src/commands/app/create.rs:56 — lib/cli/src/commands/app/create.rs:56-76 | lib/cli/src/commands/app/create.rs:159-179 — 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 (34 corresponding lines) · ×5
  • Edited copy of a member (34 corresponding lines) lib/types/src/module.rs:427 — lib/types/src/module.rs:427-460 | lib/types/src/module.rs:463-498 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) lib/wasix/src/net/mod.rs:131 — lib/wasix/src/net/mod.rs:131-164 | lib/wasix/src/net/mod.rs:198-231 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:3011 — lib/compiler-singlepass/src/machine_arm64.rs:3011-3044 | lib/compiler-singlepass/src/machine_arm64.rs:5195-5229 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) lib/vm/src/table.rs:332 — lib/vm/src/table.rs:332-368 | lib/vm/src/table.rs:384-417 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:5175 — lib/compiler-singlepass/src/machine_x64.rs:5175-5208 | lib/compiler-singlepass/src/machine_x64.rs:5342-5375 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×5
  • Edited copy of a member (22 corresponding lines) lib/api/src/backend/js/entities/function/mod.rs:378 — lib/api/src/backend/js/entities/function/mod.rs:378-399 | lib/api/src/backend/js/entities/function/mod.rs:410-432 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) lib/virtual-net/src/tcp_pair.rs:110 — lib/virtual-net/src/tcp_pair.rs:110-131 | lib/virtual-net/src/tcp_pair.rs:133-155 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) lib/c-api-imports/src/lib.rs:1091 — lib/c-api-imports/src/lib.rs:1091-1113 | lib/c-api-imports/src/lib.rs:1115-1136 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) lib/api/src/backend/v8/entities/table.rs:123 — lib/api/src/backend/v8/entities/table.rs:123-146 | lib/api/src/backend/v8/entities/table.rs:159-180 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) lib/wasix/src/state/handles/thread_local.rs:77 — lib/wasix/src/state/handles/thread_local.rs:77-98 | lib/wasix/src/state/handles/thread_local.rs:99-120 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×5
  • Edited copy of a member (17 corresponding lines) lib/api/src/entities/module/inner.rs:131 — lib/api/src/entities/module/inner.rs:131-151 | lib/api/src/entities/module/inner.rs:207-223 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1506 — lib/compiler-singlepass/src/machine_arm64.rs:1506-1525 | lib/compiler-singlepass/src/machine_riscv.rs:2050-2066 — 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) lib/compiler-singlepass/src/codegen.rs:350 — lib/compiler-singlepass/src/codegen.rs:350-366 | lib/compiler-singlepass/src/codegen.rs:371-390 — 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) lib/cli/src/utils/prompts.rs:57 — lib/cli/src/utils/prompts.rs:57-73 | lib/cli/src/utils/prompts.rs:90-106 — 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) lib/api/src/utils/polyfill.rs:135 — lib/api/src/utils/polyfill.rs:135-151 | lib/compiler/src/translator/environ.rs:141-157 — 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 (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:1292 — lib/compiler-singlepass/src/machine_x64.rs:1292-1310 | lib/compiler-singlepass/src/machine_x64.rs:1364-1382 — both copies are in the same file, so extract the block into 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) lib/compiler-singlepass/src/machine_x64.rs:7394 — lib/compiler-singlepass/src/machine_x64.rs:7394-7412 | lib/compiler-singlepass/src/machine_x64.rs:7518-7536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:7394` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) lib/virtual-net/src/server.rs:1560 — lib/virtual-net/src/server.rs:1560-1578 | lib/virtual-net/src/server.rs:1622-1640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) lib/wasix/src/net/socket.rs:1544 — lib/wasix/src/net/socket.rs:1544-1562 | lib/wasix/src/net/socket.rs:1633-1651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1544` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/wasix/src/net/socket.rs:1540` calls `drop` and `lib/wasix/src/net/socket.rs:1630` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 2) lib/wasix/src/syscalls/wasix/sock_send.rs:115 — lib/wasix/src/syscalls/wasix/sock_send.rs:115-133 | lib/wasix/src/syscalls/wasix/sock_send_to.rs:126-144 — before extracting anything, compare `lib/wasix/src/syscalls/wasix/sock_send.rs` and `lib/wasix/src/syscalls/wasix/sock_send_to.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/sock_send.rs:115` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×5
  • Duplicated block (14–15 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:3733 — lib/compiler-singlepass/src/machine_x64.rs:3733-3747 | lib/compiler-singlepass/src/machine_x64.rs:3866-3880 | lib/compiler-singlepass/src/machine_x64.rs:4283-4296 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3733` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:3780 — lib/compiler-singlepass/src/machine_x64.rs:3780-3794 | lib/compiler-singlepass/src/machine_x64.rs:3913-3927 | lib/compiler-singlepass/src/machine_x64.rs:4328-4341 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3780` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:5675 — lib/compiler-singlepass/src/machine_x64.rs:5675-5689 | lib/compiler-singlepass/src/machine_x64.rs:5855-5869 | lib/compiler-singlepass/src/machine_x64.rs:6407-6420 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:5675` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:5722 — lib/compiler-singlepass/src/machine_x64.rs:5722-5736 | lib/compiler-singlepass/src/machine_x64.rs:5902-5916 | lib/compiler-singlepass/src/machine_x64.rs:6452-6465 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:5722` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:5769 — lib/compiler-singlepass/src/machine_x64.rs:5769-5783 | lib/compiler-singlepass/src/machine_x64.rs:5949-5963 | lib/compiler-singlepass/src/machine_x64.rs:6497-6510 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:5769` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×5
  • Duplicated block (10–11 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs:537 — lib/api/src/backend/sys/entities/function/mod.rs:537-547 | lib/api/src/backend/sys/entities/function/typed.rs:81-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/mod.rs:537` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `store` to `&impl AsStoreRef` in one and `&mut impl AsStoreMut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10–11 lines × 2) lib/compiler-cranelift/src/compiler.rs:157 — lib/compiler-cranelift/src/compiler.rs:157-166 | lib/compiler-llvm/src/compiler.rs:267-277 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10–11 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:2211 — lib/compiler-singlepass/src/machine_riscv.rs:2211-2221 | lib/compiler-singlepass/src/machine_x64.rs:2249-2258 — before extracting anything, compare `lib/compiler-singlepass/src/machine_riscv.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:2211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) lib/compiler/src/engine/artifact.rs:1839 — lib/compiler/src/engine/artifact.rs:1839-1848 | lib/compiler/src/engine/artifact.rs:1887-1897 — both copies are in the same file, so extract the block into 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) lib/api/src/backend/js/entities/function/mod.rs:193 — lib/api/src/backend/js/entities/function/mod.rs:193-202 | lib/api/src/backend/sys/entities/function/mod.rs:305-315 — before extracting anything, compare `lib/api/src/backend/js/entities/function/mod.rs` and `lib/api/src/backend/sys/entities/function/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/js/entities/function/mod.rs:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×5
  • Duplicated block (5 lines × 3) lib/compiler-cranelift/src/translator/code_translator.rs:2009 — lib/compiler-cranelift/src/translator/code_translator.rs:2009-2013 | lib/compiler-cranelift/src/translator/code_translator.rs:2018-2022 | lib/compiler-cranelift/src/translator/code_translator.rs:2027-2031 — 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) lib/compiler-singlepass/src/elf.rs:39 — lib/compiler-singlepass/src/elf.rs:39-43 | lib/compiler/src/elf.rs:337-341 | lib/compiler/src/elf.rs:362-366 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/elf.rs:39` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) lib/virtual-fs/src/overlay_fs.rs:1132 — lib/virtual-fs/src/overlay_fs.rs:1132-1136 | lib/virtual-fs/src/overlay_fs.rs:1144-1148 | lib/virtual-fs/src/overlay_fs.rs:1279-1283 — 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) lib/compiler-singlepass/src/machine_arm64.rs:1538 — lib/compiler-singlepass/src/machine_arm64.rs:1538-1542 | lib/compiler-singlepass/src/machine_riscv.rs:2079-2083 | lib/compiler-singlepass/src/machine_x64.rs:2132-2136 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) lib/compiler/src/serialize.rs:49 — lib/compiler/src/serialize.rs:49-53 | lib/compiler/src/serialize.rs:85-89 | lib/compiler/src/types/symbols.rs:96-100 — 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.
D1 · Cyclomatic Complexity · wasmer_compiler_cranelift · ×4
  • wasmer_compiler_cranelift::translator::code_translator::translate_operator (cyclomatic 403) lib/compiler-cranelift/src/translator/code_translator.rs:159 — wasmer_compiler_cranelift::translator::code_translator::translate_operator has cyclomatic complexity 403 (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.
  • wasmer_compiler_cranelift::elf::emit_local_function (cyclomatic 25) lib/compiler-cranelift/src/elf.rs:238 — wasmer_compiler_cranelift::elf::emit_local_function 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.
  • wasmer_compiler_cranelift::eh::compact_unwind_encoding_aarch64 (cyclomatic 19) lib/compiler-cranelift/src/eh.rs:419 — wasmer_compiler_cranelift::eh::compact_unwind_encoding_aarch64 has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • wasmer_compiler_cranelift::eh::build_function_lsda (cyclomatic 17) lib/compiler-cranelift/src/eh.rs:43 — wasmer_compiler_cranelift::eh::build_function_lsda 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.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×4
  • Edited copy of a member (30 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:1066 — lib/compiler-singlepass/src/machine_riscv.rs:1066-1100 | lib/compiler-singlepass/src/machine_riscv.rs:1184-1213 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) lib/wasix/src/syscalls/wasix/sock_open.rs:30 — lib/wasix/src/syscalls/wasix/sock_open.rs:30-59 | lib/wasix/src/syscalls/wasix/sock_pair.rs:43-75 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) lib/virtual-fs/src/mount_fs.rs:607 — lib/virtual-fs/src/mount_fs.rs:607-636 | lib/virtual-fs/src/mount_fs.rs:659-701 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) lib/virtual-net/src/ruleset.rs:451 — lib/virtual-net/src/ruleset.rs:451-480 | lib/virtual-net/src/ruleset.rs:482-519 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×4
  • Edited copy of a member (29 corresponding lines) lib/wasix/src/syscalls/wasix/sock_bind.rs:17 — lib/wasix/src/syscalls/wasix/sock_bind.rs:17-52 | lib/wasix/src/syscalls/wasix/sock_connect.rs:21-49 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) lib/types/src/module.rs:241 — lib/types/src/module.rs:241-269 | lib/types/src/module.rs:273-302 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs:16 — lib/wasix/src/syscalls/journal/maybe_snapshot_many.rs:16-44 | lib/wasix/src/syscalls/journal/maybe_snapshot_once.rs:16-44 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) lib/api/src/backend/v8/entities/module.rs:41 — lib/api/src/backend/v8/entities/module.rs:41-71 | lib/api/src/backend/v8/entities/module.rs:73-101 — 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 (24 corresponding lines) · ×4
  • Edited copy of a member (24 corresponding lines) lib/virtual-fs/src/mount_fs.rs:703 — lib/virtual-fs/src/mount_fs.rs:703-726 | lib/virtual-fs/src/mount_fs.rs:728-751 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) lib/package/src/package/manifest.rs:901 — lib/package/src/package/manifest.rs:901-929 | lib/package/src/package/manifest.rs:958-981 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) lib/virtual-fs/src/overlay_fs.rs:422 — lib/virtual-fs/src/overlay_fs.rs:422-452 | lib/virtual-fs/src/overlay_fs.rs:583-606 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) lib/compiler-llvm/src/translator/code.rs:1295 — lib/compiler-llvm/src/translator/code.rs:1295-1318 | lib/compiler-llvm/src/translator/code.rs:1326-1349 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 14+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:7820 — lib/compiler-singlepass/src/machine_arm64.rs:7820-7836 | lib/compiler-singlepass/src/machine_arm64.rs:8109-8123 | lib/compiler-singlepass/src/machine_x64.rs:7614-7627 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) lib/compiler-cranelift/src/func_environ.rs:412 — lib/compiler-cranelift/src/func_environ.rs:412-425 | lib/compiler-cranelift/src/func_environ.rs:741-755 | lib/compiler-cranelift/src/func_environ.rs:871-885 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:4696 — lib/compiler-singlepass/src/machine_arm64.rs:4696-4709 | lib/compiler-singlepass/src/machine_riscv.rs:4234-4247 | lib/compiler-singlepass/src/machine_x64.rs:4520-4533 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:7838 — lib/compiler-singlepass/src/machine_arm64.rs:7838-7859 | lib/compiler-singlepass/src/machine_arm64.rs:8125-8144 | lib/compiler-singlepass/src/machine_x64.rs:7629-7642 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×4
  • Duplicated block (18 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:6985 — lib/compiler-singlepass/src/machine_arm64.rs:6985-7002 | lib/compiler-singlepass/src/machine_arm64.rs:7043-7060 | lib/compiler-singlepass/src/machine_arm64.rs:7101-7118 | lib/compiler-singlepass/src/machine_arm64.rs:7159-7176 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:6985` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:7222 — lib/compiler-singlepass/src/machine_arm64.rs:7222-7239 | lib/compiler-singlepass/src/machine_arm64.rs:7285-7302 | lib/compiler-singlepass/src/machine_arm64.rs:7348-7365 | lib/compiler-singlepass/src/machine_arm64.rs:7411-7428 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:7222` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 4) lib/compiler-singlepass/src/machine_x64.rs:3679 — lib/compiler-singlepass/src/machine_x64.rs:3679-3696 | lib/compiler-singlepass/src/machine_x64.rs:3812-3829 | lib/compiler-singlepass/src/machine_x64.rs:5754-5771 | lib/compiler-singlepass/src/machine_x64.rs:5934-5951 — 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) lib/virtual-net/src/client.rs:147 — lib/virtual-net/src/client.rs:147-164 | lib/virtual-net/src/client.rs:168-185 | lib/virtual-net/src/server.rs:117-134 | lib/virtual-net/src/server.rs:138-155 — before extracting anything, compare `lib/virtual-net/src/client.rs` and `lib/virtual-net/src/server.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `tx` to `mpsc::Sender<MessageRequest>` in one and `mpsc::Sender<MessageResponse>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/virtual-net/src/client.rs:188` calls `default` and `lib/virtual-net/src/server.rs:159` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×4
  • Duplicated block (16–17 lines × 2) lib/compiler-cranelift/src/func_environ.rs:1803 — lib/compiler-cranelift/src/func_environ.rs:1803-1819 | lib/compiler-cranelift/src/func_environ.rs:1883-1898 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:1803` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) lib/compiler-singlepass/src/codegen.rs:3639 — lib/compiler-singlepass/src/codegen.rs:3639-3655 | lib/compiler-singlepass/src/codegen.rs:3673-3688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:3639` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) lib/wasix/src/net/socket.rs:1441 — lib/wasix/src/net/socket.rs:1441-1456 | lib/wasix/src/net/socket.rs:1533-1549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1441` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) lib/wasix/src/state/linker/mod.rs:535 — lib/wasix/src/state/linker/mod.rs:535-550 | lib/wasix/src/state/linker/mod.rs:779-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/state/linker/mod.rs:535` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×4
  • Duplicated block (15–16 lines × 2) lib/compiler-singlepass/src/codegen.rs:5522 — lib/compiler-singlepass/src/codegen.rs:5522-5537 | lib/compiler-singlepass/src/codegen.rs:5654-5668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:5522` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:3675 — lib/compiler-singlepass/src/machine_x64.rs:3675-3689 | lib/compiler-singlepass/src/machine_x64.rs:4229-4244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3675` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–16 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:5617 — lib/compiler-singlepass/src/machine_x64.rs:5617-5631 | lib/compiler-singlepass/src/machine_x64.rs:6353-6368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:5617` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–16 lines × 2) lib/types/src/vmoffsets.rs:297 — lib/types/src/vmoffsets.rs:297-311 | lib/types/src/vmoffsets.rs:334-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/types/src/vmoffsets.rs:334` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×4
  • Duplicated block (12 lines × 4) lib/api/src/backend/js/entities/function/mod.rs:225 — lib/api/src/backend/js/entities/function/mod.rs:225-236 | lib/api/src/backend/js/entities/function/mod.rs:282-293 | lib/api/src/backend/sys/entities/function/mod.rs:335-346 | lib/api/src/backend/sys/entities/function/mod.rs:392-403 — before extracting anything, compare `lib/api/src/backend/js/entities/function/mod.rs` and `lib/api/src/backend/sys/entities/function/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/js/entities/function/mod.rs:225` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 4) lib/api/src/backend/v8/entities/function/mod.rs:96 — lib/api/src/backend/v8/entities/function/mod.rs:96-107 | lib/api/src/backend/v8/entities/function/mod.rs:111-122 | lib/api/src/backend/v8/entities/function/mod.rs:171-182 | lib/api/src/backend/v8/entities/function/mod.rs:185-196 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/function/mod.rs:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 4) lib/compiler-singlepass/src/machine_riscv.rs:484 — lib/compiler-singlepass/src/machine_riscv.rs:484-495 | lib/compiler-singlepass/src/machine_riscv.rs:506-517 | lib/compiler-singlepass/src/machine_riscv.rs:544-555 | lib/compiler-singlepass/src/machine_riscv.rs:753-764 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:751` calls `emit_label` and `lib/compiler-singlepass/src/machine_riscv.rs:481` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 4) lib/compiler-singlepass/src/machine_x64.rs:7418 — lib/compiler-singlepass/src/machine_x64.rs:7418-7429 | lib/compiler-singlepass/src/machine_x64.rs:7542-7553 | lib/compiler-singlepass/src/machine_x64.rs:7838-7849 | lib/compiler-singlepass/src/machine_x64.rs:7962-7973 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:7418` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×4
  • Duplicated block (8 lines × 6) lib/compiler-llvm/src/translator/code.rs:5192 — lib/compiler-llvm/src/translator/code.rs:5192-5199 | lib/compiler-llvm/src/translator/code.rs:5213-5220 | lib/compiler-llvm/src/translator/code.rs:5294-5301 | lib/compiler-llvm/src/translator/code.rs:5315-5322 | lib/compiler-llvm/src/translator/code.rs:5396-5403 | lib/compiler-llvm/src/translator/code.rs:5417-5424 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:5192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 6) lib/compiler-llvm/src/translator/code.rs:8839 — lib/compiler-llvm/src/translator/code.rs:8839-8846 | lib/compiler-llvm/src/translator/code.rs:8913-8920 | lib/compiler-llvm/src/translator/code.rs:8988-8995 | lib/compiler-llvm/src/translator/code.rs:9054-9061 | lib/compiler-llvm/src/translator/code.rs:9227-9234 | lib/compiler-llvm/src/translator/code.rs:9663-9670 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8839` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 6) lib/compiler-singlepass/src/machine_arm64.rs:1229 — lib/compiler-singlepass/src/machine_arm64.rs:1229-1236 | lib/compiler-singlepass/src/machine_riscv.rs:358-365 | lib/compiler-singlepass/src/machine_riscv.rs:418-425 | lib/compiler-singlepass/src/machine_riscv.rs:593-600 | lib/compiler-singlepass/src/machine_riscv.rs:632-639 | lib/compiler-singlepass/src/machine_riscv.rs:795-802 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) lib/compiler-singlepass/src/machine_riscv.rs:2986 — lib/compiler-singlepass/src/machine_riscv.rs:2986-2993 | lib/compiler-singlepass/src/machine_riscv.rs:3064-3071 | lib/compiler-singlepass/src/machine_riscv.rs:3094-3101 | lib/compiler-singlepass/src/machine_riscv.rs:4309-4316 | lib/compiler-singlepass/src/machine_riscv.rs:4388-4395 | lib/compiler-singlepass/src/machine_riscv.rs:4418-4425 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×4
  • Duplicated block (7–8 lines × 2) lib/compiler-llvm/src/translator/intrinsics.rs:1596 — lib/compiler-llvm/src/translator/intrinsics.rs:1596-1603 | lib/compiler-llvm/src/translator/intrinsics.rs:1636-1642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/intrinsics.rs:1596` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) lib/compiler-llvm/src/translator/intrinsics.rs:1594 — lib/compiler-llvm/src/translator/intrinsics.rs:1594-1601 | lib/compiler-llvm/src/translator/intrinsics.rs:1605-1611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/intrinsics.rs:1594` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:1117 — lib/compiler-singlepass/src/machine_riscv.rs:1117-1123 | lib/compiler-singlepass/src/machine_riscv.rs:1233-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) lib/wasix/src/syscalls/wasix/closure_allocate.rs:13 — lib/wasix/src/syscalls/wasix/closure_allocate.rs:13-19 | lib/wasix/src/syscalls/wasix/closure_free.rs:11-18 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×4
  • Duplicated block (5 lines × 4) lib/api/src/backend/sys/entities/memory/mod.rs:289 — lib/api/src/backend/sys/entities/memory/mod.rs:289-294 | lib/api/src/backend/sys/entities/memory/mod.rs:321-326 | lib/api/src/backend/v8/entities/memory/mod.rs:343-347 | lib/api/src/backend/v8/entities/memory/mod.rs:380-384 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/memory/mod.rs:289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) lib/api/src/entities/function/inner.rs:229 — lib/api/src/entities/function/inner.rs:229-233 | lib/api/src/entities/function/inner.rs:265-270 | lib/api/src/entities/function/inner.rs:294-298 | lib/api/src/entities/function/inner.rs:322-327 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/entities/function/inner.rs:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) lib/virtual-net/src/client.rs:785 — lib/virtual-net/src/client.rs:785-790 | lib/virtual-net/src/client.rs:816-821 | lib/virtual-net/src/client.rs:838-842 | lib/virtual-net/src/client.rs:866-871 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/client.rs:785` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) lib/wasix/src/syscalls/wasi/path_filestat_set_times.rs:32 — lib/wasix/src/syscalls/wasi/path_filestat_set_times.rs:32-37 | lib/wasix/src/syscalls/wasi/path_rename.rs:31-35 | lib/wasix/src/syscalls/wasi/path_symlink.rs:26-30 | lib/wasix/src/syscalls/wasi/path_unlink_file.rs:20-25 — 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.
D5 · Coupling · Off the main sequence · ×4
  • Off the main sequence: wasmer-config — wasmer-config: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: wasmer-types — wasmer-types: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
  • Off the main sequence: virtual-mio — virtual-mio: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: wasmer-vm — wasmer-vm: abstractness 0.05, instability 0.17, distance 0.79 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
D2 · Cognitive Complexity · FuncGen · ×3
  • FuncGen::feed_operator (cognitive 212) lib/compiler-singlepass/src/codegen.rs:1219 — FuncGen::feed_operator has cognitive complexity 212 (threshold 15). Drivers by points: if/else 99 (173 pts), loops 8 (20 pts), boolean chains 16, match/switch 2 (3 pts) (nesting depth added 87). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FuncGen::emit_call_native (cognitive 20) lib/compiler-singlepass/src/codegen.rs:730 — FuncGen::emit_call_native has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 5, match/switch 3 (5 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.
  • FuncGen::finalize (cognitive 17) lib/compiler-singlepass/src/codegen.rs:6037 — FuncGen::finalize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), match/switch 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 · wasmer_vm · ×3
  • wasmer_vm::libcalls::eh::dwarf::eh::find_eh_action (cognitive 80) lib/vm/src/libcalls/eh/dwarf/eh.rs:72 — wasmer_vm::libcalls::eh::dwarf::eh::find_eh_action has cognitive complexity 80 (threshold 15). Drivers by points: if/else 20 (66 pts), loops 2 (7 pts), match/switch 1 (7 pts) (nesting depth added 57). 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.
  • wasmer_vm::trap::traphandlers::process_illegal_op (cognitive 27) lib/vm/src/trap/traphandlers.rs:185 — wasmer_vm::trap::traphandlers::process_illegal_op has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasmer_vm::instance::initialize_tables (cognitive 16) lib/vm/src/instance/mod.rs:1561 — wasmer_vm::instance::initialize_tables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MachineARM64 · ×3
  • MachineARM64::location_to_reg (cognitive 67) lib/compiler-singlepass/src/machine_arm64.rs:132 — MachineARM64::location_to_reg has cognitive complexity 67 (threshold 15). Drivers by points: if/else 30 (60 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 32). 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.
  • MachineARM64::move_location (cognitive 40) lib/compiler-singlepass/src/machine_arm64.rs:1835 — MachineARM64::move_location has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 9 (16 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • MachineARM64::location_to_neon (cognitive 23) lib/compiler-singlepass/src/machine_arm64.rs:284 — MachineARM64::location_to_neon has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WasiEnv · ×3
  • WasiEnv::process_signals_internal (cognitive 37) lib/wasix/src/state/env.rs:825 — WasiEnv::process_signals_internal has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (8 pts), match/switch 1 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WasiEnv::instantiate (cognitive 20) lib/wasix/src/state/env.rs:510 — WasiEnv::instantiate has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 7 (9 pts), boolean chains 1 (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.
  • WasiEnv::on_exit (cognitive 18) lib/wasix/src/state/env.rs:1333 — WasiEnv::on_exit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CmdAppCreate · ×3
  • CmdAppCreate::run_async (cognitive 30) lib/cli/src/commands/app/create.rs:854 — CmdAppCreate::run_async has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 2 (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.
  • CmdAppCreate::create_from_template (cognitive 28) lib/cli/src/commands/app/create.rs:645 — CmdAppCreate::create_from_template has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CmdAppCreate::get_template_url (cognitive 20) lib/cli/src/commands/app/create.rs:521 — CmdAppCreate::get_template_url has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×3
  • Change-coupling hub: proc_fork.rs → proc_exit.rs, stack_checkpoint.rs, thread_spawn.rs lib/wasix/src/syscalls/wasix/proc_fork.rs — `lib/wasix/src/syscalls/wasix/proc_fork.rs` changes together with 3 other files — `lib/wasix/src/syscalls/wasi/proc_exit.rs`, `lib/wasix/src/syscalls/wasix/stack_checkpoint.rs`, `lib/wasix/src/syscalls/wasix/thread_spawn.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.
  • Change-coupling hub: fd_write.rs → fd_read.rs, fd_seek.rs, sock_send_file.rs lib/wasix/src/syscalls/wasi/fd_write.rs — `lib/wasix/src/syscalls/wasi/fd_write.rs` changes together with 3 other files — `lib/wasix/src/syscalls/wasi/fd_read.rs`, `lib/wasix/src/syscalls/wasi/fd_seek.rs`, `lib/wasix/src/syscalls/wasix/sock_send_file.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.
  • Change-coupling hub: mod.rs → compile.rs, inspect.rs, validate.rs lib/cli/src/commands/run/mod.rs — `lib/cli/src/commands/run/mod.rs` changes together with 3 other files — `lib/cli/src/commands/compile.rs`, `lib/cli/src/commands/inspect.rs`, `lib/cli/src/commands/validate.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
  • REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (6 members, 50+ identical tokens) lib/compiler-llvm/src/translator/intrinsics.rs:1924 — lib/compiler-llvm/src/translator/intrinsics.rs:1924-1998 | lib/compiler-llvm/src/translator/intrinsics.rs:2004-2043 | lib/compiler-llvm/src/translator/intrinsics.rs:2049-2089 | lib/compiler-llvm/src/translator/intrinsics.rs:2095-2135 | lib/compiler-llvm/src/translator/intrinsics.rs:2141-2181 | lib/compiler-llvm/src/translator/intrinsics.rs:2187-2227 — 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) lib/virtual-fs/src/mem_fs/file.rs:389 — lib/virtual-fs/src/mem_fs/file.rs:389-451 | lib/virtual-fs/src/mem_fs/file.rs:453-498 | lib/virtual-fs/src/mem_fs/file.rs:1050-1085 | lib/virtual-fs/src/mem_fs/file.rs:1185-1252 | lib/virtual-fs/src/mem_fs/file.rs:1254-1289 | lib/virtual-fs/src/mem_fs/file.rs:1291-1326 — 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) lib/virtual-fs/src/mem_fs/file.rs:389 — lib/virtual-fs/src/mem_fs/file.rs:389-451 | lib/virtual-fs/src/mem_fs/file.rs:453-498 | lib/virtual-fs/src/mem_fs/file.rs:895-991 | lib/virtual-fs/src/mem_fs/file.rs:995-1048 | lib/virtual-fs/src/mem_fs/file.rs:1093-1179 | lib/virtual-fs/src/mem_fs/file.rs:1185-1252 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×3
  • Edited copy of a member (43 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:3129 — lib/compiler-singlepass/src/machine_x64.rs:3129-3171 | lib/compiler-singlepass/src/machine_x64.rs:4912-4954 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) lib/backend-api/src/subscription.rs:25 — lib/backend-api/src/subscription.rs:25-67 | lib/backend-api/src/subscription.rs:79-121 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:762 — lib/compiler-singlepass/src/machine_x64.rs:762-804 | lib/compiler-singlepass/src/machine_x64.rs:904-946 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×3
  • Edited copy of a member (33 corresponding lines) lib/virtual-fs/src/mem_fs/filesystem.rs:907 — lib/virtual-fs/src/mem_fs/filesystem.rs:907-939 | lib/virtual-fs/src/mem_fs/filesystem.rs:948-981 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:2869 — lib/compiler-singlepass/src/machine_x64.rs:2869-2901 | lib/compiler-singlepass/src/machine_x64.rs:4652-4684 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:6568 — lib/compiler-singlepass/src/machine_riscv.rs:6568-6606 | lib/compiler-singlepass/src/machine_x64.rs:8375-8407 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 21+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 21+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:889 — lib/compiler-singlepass/src/machine_arm64.rs:889-909 | lib/compiler-singlepass/src/machine_arm64.rs:917-937 | lib/compiler-singlepass/src/machine_x64.rs:339-363 | lib/compiler-singlepass/src/machine_x64.rs:416-440 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 21+ corresponding lines) lib/wasix/src/syscalls/wasix/port_addr_add.rs:16 — lib/wasix/src/syscalls/wasix/port_addr_add.rs:16-36 | lib/wasix/src/syscalls/wasix/port_addr_remove.rs:14-34 | lib/wasix/src/syscalls/wasix/port_gateway_set.rs:14-34 | lib/wasix/src/syscalls/wasix/port_route_remove.rs:10-30 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 21+ corresponding lines) lib/wasix/src/syscalls/wasi/fd_dup.rs:17 — lib/wasix/src/syscalls/wasi/fd_dup.rs:17-37 | lib/wasix/src/syscalls/wasix/epoll_create.rs:20-41 | lib/wasix/src/syscalls/wasix/fd_dup2.rs:19-45 | lib/wasix/src/syscalls/wasix/sock_send_file.rs:26-49 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 12+ corresponding lines) lib/api/src/entities/function/env/inner.rs:293 — lib/api/src/entities/function/env/inner.rs:293-304 | lib/api/src/entities/function/env/inner.rs:322-333 | lib/api/src/entities/function/env/inner.rs:365-376 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) lib/virtual-net/src/client.rs:212 — lib/virtual-net/src/client.rs:212-223 | lib/virtual-net/src/client.rs:241-252 | lib/virtual-net/src/server.rs:179-190 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) lib/virtual-fs/src/mem_fs/file.rs:119 — lib/virtual-fs/src/mem_fs/file.rs:119-130 | lib/virtual-fs/src/mem_fs/file.rs:132-143 | lib/virtual-fs/src/mem_fs/file.rs:145-158 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (5 members, 10+ corresponding lines) lib/api/src/entities/external/extref/inner.rs:49 — lib/api/src/entities/external/extref/inner.rs:49-58 | lib/api/src/entities/function/env/inner.rs:25-34 | lib/api/src/entities/function/env/inner.rs:269-278 | lib/api/src/entities/function/env/inner.rs:281-290 | lib/api/src/entities/function/env/inner.rs:380-389 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 10+ corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:1788 — lib/compiler-singlepass/src/emitter_x64.rs:1788-1797 | lib/compiler-singlepass/src/emitter_x64.rs:1818-1827 | lib/compiler-singlepass/src/emitter_x64.rs:1848-1857 | lib/compiler-singlepass/src/emitter_x64.rs:2066-2075 | lib/compiler-singlepass/src/emitter_x64.rs:2096-2105 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 10+ corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:1803 — lib/compiler-singlepass/src/emitter_x64.rs:1803-1812 | lib/compiler-singlepass/src/emitter_x64.rs:1833-1842 | lib/compiler-singlepass/src/emitter_x64.rs:1863-1872 | lib/compiler-singlepass/src/emitter_x64.rs:2081-2090 | lib/compiler-singlepass/src/emitter_x64.rs:2111-2120 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 10+ corresponding lines) lib/virtual-net/src/client.rs:1268 — lib/virtual-net/src/client.rs:1268-1277 | lib/virtual-net/src/client.rs:1498-1508 | lib/virtual-net/src/client.rs:1518-1528 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) lib/api/src/entities/function/env/inner.rs:310 — lib/api/src/entities/function/env/inner.rs:310-319 | lib/api/src/entities/function/env/inner.rs:353-362 | lib/api/src/entities/function/inner.rs:478-487 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1397 — lib/compiler-singlepass/src/machine_arm64.rs:1397-1406 | lib/compiler-singlepass/src/machine_riscv.rs:1922-1932 | lib/compiler-singlepass/src/machine_x64.rs:2006-2015 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×3
  • Duplicated block (30 lines × 2) lib/api/src/backend/sys/entities/function/typed.rs:108 — lib/api/src/backend/sys/entities/function/typed.rs:108-137 | lib/api/src/backend/sys/entities/function/typed.rs:235-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/typed.rs:108` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/api/src/backend/sys/entities/function/typed.rs:234` calls `drop` and `lib/api/src/backend/sys/entities/function/typed.rs:106` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (30 lines × 2) lib/compiler-cranelift/src/trampoline/dynamic_function.rs:137 — lib/compiler-cranelift/src/trampoline/dynamic_function.rs:137-166 | lib/compiler-cranelift/src/trampoline/function_call.rs:127-156 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/trampoline/dynamic_function.rs:137` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (30 lines × 2) lib/virtual-net/src/rx_tx.rs:559 — lib/virtual-net/src/rx_tx.rs:559-588 | lib/virtual-net/src/rx_tx.rs:592-621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:559` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×3
  • Duplicated block (26 lines × 2) lib/backend-api/src/query.rs:1529 — lib/backend-api/src/query.rs:1529-1554 | lib/backend-api/src/query.rs:1594-1619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/backend-api/src/query.rs:1529` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) lib/types/src/module.rs:244 — lib/types/src/module.rs:244-269 | lib/types/src/module.rs:277-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/types/src/module.rs:244` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `it` to `ModuleInfo` in one and `ArchivableModuleInfo` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/types/src/module.rs:276` calls `default` and `lib/types/src/module.rs:243` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (26 lines × 2) lib/compiler/src/engine/artifact.rs:377 — lib/compiler/src/engine/artifact.rs:377-402 | lib/compiler/src/engine/artifact.rs:428-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler/src/engine/artifact.rs:377` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×3
  • Duplicated block (24 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:231 — lib/compiler-singlepass/src/machine_x64.rs:231-254 | lib/compiler-singlepass/src/machine_x64.rs:259-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 (24 lines × 2) lib/virtual-net/src/host.rs:347 — lib/virtual-net/src/host.rs:347-370 | lib/virtual-net/src/host.rs:813-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) lib/virtual-fs/src/mem_fs/filesystem.rs:916 — lib/virtual-fs/src/mem_fs/filesystem.rs:916-939 | lib/virtual-fs/src/mem_fs/filesystem.rs:958-981 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/filesystem.rs:916` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/virtual-fs/src/mem_fs/filesystem.rs:957` calls `Directory` and `lib/virtual-fs/src/mem_fs/filesystem.rs:915` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×3
  • Duplicated block (14–16 lines × 2) lib/cli/src/commands/package/common/mod.rs:178 — lib/cli/src/commands/package/common/mod.rs:178-191 | lib/package/src/convert/webc_to_package.rs:29-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/package/common/mod.rs:178` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–16 lines × 2) lib/compiler-llvm/src/compiler.rs:537 — lib/compiler-llvm/src/compiler.rs:537-552 | lib/compiler-llvm/src/translator/trampoline.rs:403-416 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/compiler.rs:537` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–16 lines × 2) lib/compiler-llvm/src/translator/code.rs:1238 — lib/compiler-llvm/src/translator/code.rs:1238-1251 | lib/compiler-llvm/src/translator/code.rs:1297-1312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:1238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×3
  • Duplicated block (11–12 lines × 2) lib/cli/src/commands/app/deploy.rs:942 — lib/cli/src/commands/app/deploy.rs:942-953 | lib/cli/src/commands/app/deploy.rs:955-965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/deploy.rs:942` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) lib/compiler-cranelift/src/translator/code_translator.rs:519 — lib/compiler-cranelift/src/translator/code_translator.rs:519-529 | lib/compiler-cranelift/src/translator/code_translator.rs:3460-3471 — both copies are in the same file, so extract the block into 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) lib/virtual-fs/src/overlay_fs.rs:1184 — lib/virtual-fs/src/overlay_fs.rs:1184-1195 | lib/virtual-fs/src/overlay_fs.rs:1201-1211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/overlay_fs.rs:1184` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×3
  • Duplicated block (11 lines × 4) lib/compiler-llvm/src/translator/code.rs:6720 — lib/compiler-llvm/src/translator/code.rs:6720-6730 | lib/compiler-llvm/src/translator/code.rs:6782-6792 | lib/compiler-llvm/src/translator/code.rs:6890-6900 | lib/compiler-llvm/src/translator/code.rs:6953-6963 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6720` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 4) lib/compiler-llvm/src/translator/code.rs:8837 — lib/compiler-llvm/src/translator/code.rs:8837-8847 | lib/compiler-llvm/src/translator/code.rs:8911-8921 | lib/compiler-llvm/src/translator/code.rs:8986-8996 | lib/compiler-llvm/src/translator/code.rs:9052-9062 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8837` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 4) lib/wasix/src/syscalls/wasi/fd_read.rs:190 — lib/wasix/src/syscalls/wasi/fd_read.rs:190-200 | lib/wasix/src/syscalls/wasi/fd_read.rs:254-264 | lib/wasix/src/syscalls/wasi/fd_read.rs:310-320 | lib/wasix/src/syscalls/wasi/fd_read.rs:364-374 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasi/fd_read.rs:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×3
  • Duplicated block (10–11 lines × 3) lib/cli/src/commands/app/secrets/create.rs:218 — lib/cli/src/commands/app/secrets/create.rs:218-227 | lib/cli/src/commands/app/secrets/delete.rs:140-149 | lib/cli/src/commands/app/secrets/update.rs:212-222 — before extracting anything, compare `lib/cli/src/commands/app/secrets/create.rs` and `lib/cli/src/commands/app/secrets/delete.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/secrets/create.rs:218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:2539 — lib/compiler-singlepass/src/machine_x64.rs:2539-2548 | lib/compiler-singlepass/src/machine_x64.rs:7399-7409 | lib/compiler-singlepass/src/machine_x64.rs:7523-7533 — 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–11 lines × 3) lib/virtual-fs/src/mem_fs/mod.rs:155 — lib/virtual-fs/src/mem_fs/mod.rs:155-164 | lib/virtual-fs/src/mem_fs/mod.rs:180-190 | lib/virtual-fs/src/mem_fs/mod.rs:204-214 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/mod.rs:155` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×3
  • Duplicated block (9–10 lines × 4) lib/compiler-llvm/src/translator/code.rs:6764 — lib/compiler-llvm/src/translator/code.rs:6764-6772 | lib/compiler-llvm/src/translator/code.rs:6826-6834 | lib/compiler-llvm/src/translator/code.rs:6934-6943 | lib/compiler-llvm/src/translator/code.rs:6997-7005 — 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–10 lines × 4) lib/cli/src/commands/app/deploy.rs:899 — lib/cli/src/commands/app/deploy.rs:899-909 | lib/cli/src/commands/app/deploy.rs:912-921 | lib/cli/src/commands/app/deploy.rs:923-932 | lib/cli/src/commands/app/deploy.rs:933-941 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/deploy.rs:899` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 4) lib/compiler-llvm/src/object_file.rs:788 — lib/compiler-llvm/src/object_file.rs:788-797 | lib/compiler-llvm/src/object_file.rs:802-811 | lib/compiler-llvm/src/object_file.rs:816-825 | lib/compiler-llvm/src/object_file.rs:827-835 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/object_file.rs:788` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/object_file.rs:788` calls `Ok` and `lib/compiler-llvm/src/object_file.rs:827` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×3
  • Duplicated block (9–10 lines × 2) lib/compiler-llvm/src/translator/code.rs:9614 — lib/compiler-llvm/src/translator/code.rs:9614-9622 | lib/compiler-llvm/src/translator/code.rs:9638-9647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:9638` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 2) lib/wasix/src/net/socket.rs:734 — lib/wasix/src/net/socket.rs:734-743 | lib/wasix/src/net/socket.rs:766-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:734` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/wasix/src/net/socket.rs:775` calls `pin` and `lib/wasix/src/net/socket.rs:744` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–10 lines × 2) lib/wasix/src/state/func_env.rs:392 — lib/wasix/src/state/func_env.rs:392-400 | lib/wasix/src/state/func_env.rs:406-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/state/func_env.rs:392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×3
  • Duplicated block (9 lines × 7) lib/compiler-llvm/src/translator/code.rs:6150 — lib/compiler-llvm/src/translator/code.rs:6150-6158 | lib/compiler-llvm/src/translator/code.rs:6244-6252 | lib/compiler-llvm/src/translator/code.rs:6338-6346 | lib/compiler-llvm/src/translator/code.rs:6725-6733 | lib/compiler-llvm/src/translator/code.rs:6750-6758 | lib/compiler-llvm/src/translator/code.rs:6895-6903 | lib/compiler-llvm/src/translator/code.rs:6920-6928 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6150` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:6747` calls `finalize_minmax_result`, `as_basic_value_enum`, `into_vector_value` and `lib/compiler-llvm/src/translator/code.rs:6149` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 7) lib/compiler-llvm/src/translator/code.rs:6176 — lib/compiler-llvm/src/translator/code.rs:6176-6184 | lib/compiler-llvm/src/translator/code.rs:6270-6278 | lib/compiler-llvm/src/translator/code.rs:6445-6453 | lib/compiler-llvm/src/translator/code.rs:6787-6795 | lib/compiler-llvm/src/translator/code.rs:6812-6820 | lib/compiler-llvm/src/translator/code.rs:6958-6966 | lib/compiler-llvm/src/translator/code.rs:6983-6991 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6176` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:6809` calls `finalize_minmax_result`, `as_basic_value_enum`, `into_vector_value` and `lib/compiler-llvm/src/translator/code.rs:6175` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 7) lib/compiler-singlepass/src/machine_arm64.rs:4368 — lib/compiler-singlepass/src/machine_arm64.rs:4368-4376 | lib/compiler-singlepass/src/machine_arm64.rs:4426-4434 | lib/compiler-singlepass/src/machine_arm64.rs:4484-4492 | lib/compiler-singlepass/src/machine_arm64.rs:6984-6992 | lib/compiler-singlepass/src/machine_arm64.rs:7042-7050 | lib/compiler-singlepass/src/machine_arm64.rs:7100-7108 | lib/compiler-singlepass/src/machine_arm64.rs:7158-7166 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4368` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) lib/compiler-cranelift/src/func_environ.rs:2188 — lib/compiler-cranelift/src/func_environ.rs:2188-2195 | lib/compiler-cranelift/src/func_environ.rs:2216-2223 | lib/compiler-cranelift/src/func_environ.rs:2275-2287 | lib/compiler-cranelift/src/func_environ.rs:2309-2316 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:2188` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) lib/compiler-llvm/src/translator/code.rs:4025 — lib/compiler-llvm/src/translator/code.rs:4025-4032 | lib/compiler-llvm/src/translator/code.rs:4041-4048 | lib/compiler-llvm/src/translator/code.rs:4085-4092 | lib/compiler-llvm/src/translator/code.rs:4097-4104 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4025` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 4) lib/compiler-llvm/src/translator/code.rs:6679 — lib/compiler-llvm/src/translator/code.rs:6679-6686 | lib/compiler-llvm/src/translator/code.rs:6702-6709 | lib/compiler-llvm/src/translator/code.rs:6849-6856 | lib/compiler-llvm/src/translator/code.rs:6872-6879 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6679` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×3
  • Duplicated block (7 lines × 8) lib/compiler-singlepass/src/machine_riscv.rs:2986 — lib/compiler-singlepass/src/machine_riscv.rs:2986-2992 | lib/compiler-singlepass/src/machine_riscv.rs:3017-3023 | lib/compiler-singlepass/src/machine_riscv.rs:3064-3070 | lib/compiler-singlepass/src/machine_riscv.rs:3094-3100 | lib/compiler-singlepass/src/machine_riscv.rs:4309-4315 | lib/compiler-singlepass/src/machine_riscv.rs:4340-4346 | lib/compiler-singlepass/src/machine_riscv.rs:4388-4394 | lib/compiler-singlepass/src/machine_riscv.rs:4418-4424 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 8) lib/compiler-singlepass/src/machine_x64.rs:975 — lib/compiler-singlepass/src/machine_x64.rs:975-981 | lib/compiler-singlepass/src/machine_x64.rs:1170-1176 | lib/compiler-singlepass/src/machine_x64.rs:1583-1589 | lib/compiler-singlepass/src/machine_x64.rs:2512-2518 | lib/compiler-singlepass/src/machine_x64.rs:7367-7373 | lib/compiler-singlepass/src/machine_x64.rs:7496-7502 | lib/compiler-singlepass/src/machine_x64.rs:7787-7793 | lib/compiler-singlepass/src/machine_x64.rs:7916-7922 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:975` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_x64.rs:2520` calls `emit_relaxed_mov`, `SIMD` and `lib/compiler-singlepass/src/machine_x64.rs:982` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 8) lib/compiler-singlepass/src/machine_x64.rs:1145 — lib/compiler-singlepass/src/machine_x64.rs:1145-1151 | lib/compiler-singlepass/src/machine_x64.rs:1259-1265 | lib/compiler-singlepass/src/machine_x64.rs:1351-1357 | lib/compiler-singlepass/src/machine_x64.rs:1437-1443 | lib/compiler-singlepass/src/machine_x64.rs:1558-1564 | lib/compiler-singlepass/src/machine_x64.rs:1672-1678 | lib/compiler-singlepass/src/machine_x64.rs:1751-1757 | lib/compiler-singlepass/src/machine_x64.rs:1824-1830 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×3
  • Duplicated block (6 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:2655 — lib/compiler-singlepass/src/machine_arm64.rs:2655-2660 | lib/compiler-singlepass/src/machine_arm64.rs:2693-2698 | lib/compiler-singlepass/src/machine_arm64.rs:4838-4843 | lib/compiler-singlepass/src/machine_arm64.rs:4876-4881 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:2655` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:6975 — lib/compiler-singlepass/src/machine_arm64.rs:6975-6980 | lib/compiler-singlepass/src/machine_arm64.rs:7033-7038 | lib/compiler-singlepass/src/machine_arm64.rs:7091-7096 | lib/compiler-singlepass/src/machine_arm64.rs:7149-7154 — 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) lib/api/src/backend/js/entities/function/mod.rs:194 — lib/api/src/backend/js/entities/function/mod.rs:194-199 | lib/api/src/backend/js/entities/function/mod.rs:250-255 | lib/api/src/backend/sys/entities/function/mod.rs:306-311 | lib/api/src/backend/sys/entities/function/mod.rs:360-365 — before extracting anything, compare `lib/api/src/backend/js/entities/function/mod.rs` and `lib/api/src/backend/sys/entities/function/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/js/entities/function/mod.rs:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · FuncGen · ×2
  • FuncGen::feed_operator (cyclomatic 360) lib/compiler-singlepass/src/codegen.rs:1219 — FuncGen::feed_operator has cyclomatic complexity 360 (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.
  • FuncGen::emit_call_native (cyclomatic 19) lib/compiler-singlepass/src/codegen.rs:730 — FuncGen::emit_call_native 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 · RemoteNetworkingServerDriver · ×2
  • RemoteNetworkingServerDriver::process_socket (cyclomatic 125) lib/virtual-net/src/server.rs:860 — RemoteNetworkingServerDriver::process_socket has cyclomatic complexity 125 (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.
  • RemoteNetworkingServerDriver::process_interface (cyclomatic 26) lib/virtual-net/src/server.rs:657 — RemoteNetworkingServerDriver::process_interface has cyclomatic complexity 26 (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 · wasmer_compiler · ×2
  • wasmer_compiler::engine::link::apply_relocation (cyclomatic 57) lib/compiler/src/engine/link.rs:21 — wasmer_compiler::engine::link::apply_relocation has cyclomatic complexity 57 (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.
  • wasmer_compiler::object::module::emit_compilation (cyclomatic 44) lib/compiler/src/object/module.rs:154 — wasmer_compiler::object::module::emit_compilation has cyclomatic complexity 44 (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 · WasiFs · ×2
  • WasiFs::get_inode_at_path_inner (cyclomatic 44) lib/wasix/src/fs/mod.rs:1250 — WasiFs::get_inode_at_path_inner has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • WasiFs::create_preopens (cyclomatic 18) lib/wasix/src/fs/mod.rs:2499 — WasiFs::create_preopens has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: wasmer_wasix::fs::fs_error_into_wasi_err (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 · MachineARM64 · ×2
  • MachineARM64::location_to_reg (cyclomatic 32) lib/compiler-singlepass/src/machine_arm64.rs:132 — MachineARM64::location_to_reg has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • MachineARM64::move_location (cyclomatic 32) lib/compiler-singlepass/src/machine_arm64.rs:1835 — MachineARM64::move_location 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.
D1 · Cyclomatic Complexity · RemoteAdapterSocket · ×2
  • RemoteAdapterSocket::drain_reads_and_accepts (cyclomatic 26) lib/virtual-net/src/server.rs:1506 — RemoteAdapterSocket::drain_reads_and_accepts 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.
  • RemoteAdapterSocket::send (cyclomatic 16) lib/virtual-net/src/server.rs:1340 — RemoteAdapterSocket::send 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 · wasmer_vm · ×2
  • wasmer_vm::trap::traphandlers::process_illegal_op (cyclomatic 26) lib/vm/src/trap/traphandlers.rs:185 — wasmer_vm::trap::traphandlers::process_illegal_op 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.
  • wasmer_vm::libcalls::eh::dwarf::eh::find_eh_action (cyclomatic 22) lib/vm/src/libcalls/eh/dwarf/eh.rs:72 — wasmer_vm::libcalls::eh::dwarf::eh::find_eh_action 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.
D1 · Cyclomatic Complexity · RemoteTx · ×2
  • RemoteTx::poll_send (cyclomatic 23) lib/virtual-net/src/rx_tx.rs:160 — RemoteTx::poll_send has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • RemoteTx::send_with_driver (cyclomatic 17) lib/virtual-net/src/rx_tx.rs:327 — RemoteTx::send_with_driver 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 · LLVMAbi · ×2
  • LLVMAbi::func_type_to_llvm (cyclomatic 19) lib/compiler-llvm/src/abi.rs:204 — LLVMAbi::func_type_to_llvm has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • LLVMAbi::rets_from_call (cyclomatic 18) lib/compiler-llvm/src/abi.rs:363 — LLVMAbi::rets_from_call 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.
D2 · Cognitive Complexity · RemoteNetworkingServerDriver · ×2
  • RemoteNetworkingServerDriver::process_socket (cognitive 93) lib/virtual-net/src/server.rs:860 — RemoteNetworkingServerDriver::process_socket has cognitive complexity 93 (threshold 15). Drivers by points: match/switch 62 (93 pts) (nesting depth added 31). 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.
  • RemoteNetworkingServerDriver::poll (cognitive 17) lib/virtual-net/src/server.rs:328 — RemoteNetworkingServerDriver::poll has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (7 pts), if/else 3 (6 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasiFs · ×2
  • WasiFs::get_inode_at_path_inner (cognitive 87) lib/wasix/src/fs/mod.rs:1250 — WasiFs::get_inode_at_path_inner has cognitive complexity 87 (threshold 15). Drivers by points: if/else 31 (70 pts), match/switch 4 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WasiFs::create_preopens (cognitive 32) lib/wasix/src/fs/mod.rs:2499 — WasiFs::create_preopens has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 2, loops 2 (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 · RemoteAdapterSocket · ×2
  • RemoteAdapterSocket::drain_reads_and_accepts (cognitive 50) lib/virtual-net/src/server.rs:1506 — RemoteAdapterSocket::drain_reads_and_accepts has cognitive complexity 50 (threshold 15). Drivers by points: if/else 9 (29 pts), match/switch 6 (18 pts), loops 2 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RemoteAdapterSocket::send (cognitive 41) lib/virtual-net/src/server.rs:1340 — RemoteAdapterSocket::send has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), match/switch 3 (7 pts) (nesting depth added 24). 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 · FuncTrampoline · ×2
  • FuncTrampoline::dynamic_trampoline (cognitive 33) lib/compiler-llvm/src/translator/trampoline.rs:306 — FuncTrampoline::dynamic_trampoline has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (13 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FuncTrampoline::trampoline (cognitive 17) lib/compiler-llvm/src/translator/trampoline.rs:155 — FuncTrampoline::trampoline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileSystem · ×2
  • FileSystem::open (cognitive 32) lib/virtual-fs/src/mem_fs/file_opener.rs:338 — FileSystem::open has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 7, match/switch 5 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FileSystem::union (cognitive 17) lib/virtual-fs/src/mem_fs/filesystem.rs:121 — FileSystem::union has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 2 (6 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InstanceGroupState · ×2
  • InstanceGroupState::define_common_import (cognitive 29) lib/wasix/src/state/linker/instance_group/imports.rs:396 — InstanceGroupState::define_common_import has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 1 (2 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.
  • InstanceGroupState::generate_stub_function (cognitive 22) lib/wasix/src/state/linker/instance_group/imports.rs:520 — InstanceGroupState::generate_stub_function has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 3 (5 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RemoteTx · ×2
  • RemoteTx::poll_send (cognitive 26) lib/virtual-net/src/rx_tx.rs:160 — RemoteTx::poll_send has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 10 (14 pts), if/else 6 (12 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • RemoteTx::send_with_driver (cognitive 22) lib/virtual-net/src/rx_tx.rs:327 — RemoteTx::send_with_driver has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 7 (10 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LLVMAbi · ×2
  • LLVMAbi::rets_from_call (cognitive 23) lib/compiler-llvm/src/abi.rs:363 — LLVMAbi::rets_from_call has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 4 (6 pts), loops 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.
  • LLVMAbi::func_type_to_llvm (cognitive 18) lib/compiler-llvm/src/abi.rs:204 — LLVMAbi::func_type_to_llvm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (6 pts), match/switch 4 (5 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 · CmdAppSecretsCreate · ×2
  • CmdAppSecretsCreate::create (cognitive 18) lib/cli/src/commands/app/secrets/create.rs:145 — CmdAppSecretsCreate::create has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (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.
  • CmdAppSecretsCreate::filter_secrets (cognitive 16) lib/cli/src/commands/app/secrets/create.rs:90 — CmdAppSecretsCreate::filter_secrets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Wasi · ×2
  • Wasi::build_mapped_directories (cognitive 18) lib/cli/src/commands/run/wasi.rs:505 — Wasi::build_mapped_directories has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Wasi::prepare (cognitive 16) lib/cli/src/commands/run/wasi.rs:343 — Wasi::prepare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 5 (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 · wasmer_package_sdk · ×2
  • wasmer_package_sdk::app::deploy_remote_build::deploy_app_remote (cognitive 17) lib/package-sdk/src/app/deploy_remote_build.rs:101 — wasmer_package_sdk::app::deploy_remote_build::deploy_app_remote has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 1 (4 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.
  • wasmer_package_sdk::app::deploy::wait_app (cognitive 16) lib/package-sdk/src/app/deploy.rs:132 — wasmer_package_sdk::app::deploy::wait_app has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (2 pts), 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.
D3 · God Classes · TooManyFields · ×2
  • TooManyFields: Intrinsics lib/compiler-llvm/src/translator/intrinsics.rs:71 — TooManyFields — 179 stored fields beside 1 method. The bar is 30 stored fields; this is 149 over it, 5.97× 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: FuncEnvironment lib/compiler-cranelift/src/func_environ.rs:89 — TooManyFields — 38 stored fields beside 99 methods. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Near-duplicate member family (4 members, 25 shared lines) · ×2
  • Near-duplicate member family (4 members, 25 shared lines) lib/compiler-llvm/src/translator/code.rs:1513 — lib/compiler-llvm/src/translator/code.rs:1513-1558 | lib/compiler-llvm/src/translator/code.rs:1596-1634 | lib/compiler-llvm/src/translator/code.rs:1644-1697 | lib/compiler-llvm/src/translator/code.rs:1707-1769 — These 4 members are variants of one another: a block of 25 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.
  • Near-duplicate member family (4 members, 25 shared lines) lib/compiler-singlepass/src/machine_arm64.rs:4341 — lib/compiler-singlepass/src/machine_arm64.rs:4341-4386 | lib/compiler-singlepass/src/machine_arm64.rs:4516-4565 | lib/compiler-singlepass/src/machine_arm64.rs:7131-7176 | lib/compiler-singlepass/src/machine_arm64.rs:7379-7428 — These 4 members are variants of one another: a block of 25 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 · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (7 members, 50+ identical tokens) lib/compiler-cranelift/src/func_environ.rs:1387 — lib/compiler-cranelift/src/func_environ.rs:1387-1399 | lib/compiler-cranelift/src/func_environ.rs:1406-1418 | lib/compiler-cranelift/src/func_environ.rs:2095-2104 | lib/compiler-cranelift/src/func_environ.rs:2111-2146 | lib/compiler-cranelift/src/func_environ.rs:2248-2258 | lib/compiler-cranelift/src/func_environ.rs:2349-2364 | lib/compiler-cranelift/src/func_environ.rs:2373-2382 — 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) lib/compiler-singlepass/src/machine_x64.rs:4355 — lib/compiler-singlepass/src/machine_x64.rs:4355-4395 | lib/compiler-singlepass/src/machine_x64.rs:4409-4455 | lib/compiler-singlepass/src/machine_x64.rs:4469-4515 | lib/compiler-singlepass/src/machine_x64.rs:6524-6564 | lib/compiler-singlepass/src/machine_x64.rs:6578-6624 | lib/compiler-singlepass/src/machine_x64.rs:6638-6684 | lib/compiler-singlepass/src/machine_x64.rs:6698-6744 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×2
  • Edited copy of a member (57 corresponding lines) lib/compiler-cranelift/src/func_environ.rs:1182 — lib/compiler-cranelift/src/func_environ.rs:1182-1238 | lib/compiler-cranelift/src/func_environ.rs:1250-1310 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (57 corresponding lines) lib/wasix/src/runtime/resolver/backend_source.rs:76 — lib/wasix/src/runtime/resolver/backend_source.rs:76-132 | lib/wasix/src/runtime/resolver/backend_source.rs:138-194 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×2
  • Edited copy of a member (38 corresponding lines) lib/compiler/src/abi.rs:91 — lib/compiler/src/abi.rs:91-128 | lib/compiler/src/abi.rs:138-175 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) lib/wasix/src/syscalls/wasi/fd_allocate.rs:41 — lib/wasix/src/syscalls/wasi/fd_allocate.rs:41-88 | lib/wasix/src/syscalls/wasi/fd_filestat_set_size.rs:37-74 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×2
  • Edited copy of a member (55 corresponding lines) lib/wasix/src/syscalls/wasix/proc_spawn2.rs:41 — lib/wasix/src/syscalls/wasix/proc_spawn2.rs:41-96 | lib/wasix/src/syscalls/wasix/proc_spawn3.rs:33-87 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (55 corresponding lines) lib/wasix/src/runtime/package_loader/load_package_tree.rs:418 — lib/wasix/src/runtime/package_loader/load_package_tree.rs:418-472 | lib/wasix/src/runtime/package_loader/load_package_tree.rs:501-563 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×2
  • Edited copy of a member (44 corresponding lines) lib/wasix/src/net/socket.rs:922 — lib/wasix/src/net/socket.rs:922-972 | lib/wasix/src/net/socket.rs:974-1017 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) lib/compiler-llvm/src/translator/code.rs:1175 — lib/compiler-llvm/src/translator/code.rs:1175-1218 | lib/compiler-llvm/src/translator/code.rs:2023-2077 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×2
  • Edited copy of a member (47 corresponding lines) lib/cli/src/commands/app/secrets/create.rs:150 — lib/cli/src/commands/app/secrets/create.rs:150-196 | lib/cli/src/commands/app/secrets/update.rs:144-190 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) lib/compiler-cranelift/src/elf.rs:123 — lib/compiler-cranelift/src/elf.rs:123-169 | lib/compiler/src/dwarf.rs:139-185 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) lib/compiler-cranelift/src/translator/code_translator.rs:3235 — lib/compiler-cranelift/src/translator/code_translator.rs:3235-3275 | lib/compiler-cranelift/src/translator/code_translator.rs:3283-3327 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) lib/cli/src/commands/app/util.rs:307 — lib/cli/src/commands/app/util.rs:307-352 | lib/cli/src/commands/package/common/mod.rs:209-249 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) lib/api/src/backend/sys/entities/function/mod.rs:259 — lib/api/src/backend/sys/entities/function/mod.rs:259-296 | lib/api/src/backend/sys/entities/function/mod.rs:414-450 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) lib/wasix/src/syscalls/wasi/fd_event.rs:38 — lib/wasix/src/syscalls/wasi/fd_event.rs:38-74 | lib/wasix/src/syscalls/wasix/epoll_create.rs:46-85 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×2
  • Edited copy of a member (28 corresponding lines) lib/virtual-fs/src/pipe.rs:103 — lib/virtual-fs/src/pipe.rs:103-131 | lib/virtual-fs/src/pipe.rs:455-482 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) lib/backend-api/src/query.rs:1762 — lib/backend-api/src/query.rs:1762-1789 | lib/backend-api/src/query.rs:1874-1901 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 27+ corresponding lines) · ×2
  • Edited copies of one member (7 members, 27+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:5655 — lib/compiler-singlepass/src/machine_x64.rs:5655-5689 | lib/compiler-singlepass/src/machine_x64.rs:5702-5736 | lib/compiler-singlepass/src/machine_x64.rs:5749-5783 | lib/compiler-singlepass/src/machine_x64.rs:5796-5822 | lib/compiler-singlepass/src/machine_x64.rs:5835-5869 | lib/compiler-singlepass/src/machine_x64.rs:5882-5916 | lib/compiler-singlepass/src/machine_x64.rs:5929-5963 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
  • Edited copies of one member (7 members, 27+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:3713 — lib/compiler-singlepass/src/machine_x64.rs:3713-3747 | lib/compiler-singlepass/src/machine_x64.rs:3760-3794 | lib/compiler-singlepass/src/machine_x64.rs:3807-3833 | lib/compiler-singlepass/src/machine_x64.rs:3846-3880 | lib/compiler-singlepass/src/machine_x64.rs:3893-3927 | lib/compiler-singlepass/src/machine_x64.rs:4264-4296 | lib/compiler-singlepass/src/machine_x64.rs:4309-4341 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 22+ corresponding lines) lib/vm/src/instance/allocator.rs:175 — lib/vm/src/instance/allocator.rs:175-198 | lib/vm/src/instance/allocator.rs:211-233 | lib/vm/src/instance/allocator.rs:246-267 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) lib/cli/src/types.rs:82 — lib/cli/src/types.rs:82-103 | lib/cli/src/types.rs:364-385 | lib/cli/src/types.rs:439-460 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 22+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 22+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2412 — lib/compiler-singlepass/src/machine_arm64.rs:2412-2434 | lib/compiler-singlepass/src/machine_riscv.rs:2790-2819 | lib/compiler-singlepass/src/machine_riscv.rs:6062-6084 | lib/compiler-singlepass/src/machine_riscv.rs:6298-6320 | lib/compiler-singlepass/src/machine_x64.rs:7173-7194 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 22+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:3293 — lib/compiler-singlepass/src/machine_x64.rs:3293-3314 | lib/compiler-singlepass/src/machine_x64.rs:3359-3380 | lib/compiler-singlepass/src/machine_x64.rs:5076-5097 | lib/compiler-singlepass/src/machine_x64.rs:5142-5163 | lib/compiler-singlepass/src/machine_x64.rs:5220-5241 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) lib/api/src/entities/table/inner.rs:36 — lib/api/src/entities/table/inner.rs:36-51 | lib/api/src/entities/table/inner.rs:126-157 | lib/api/src/entities/table/inner.rs:160-175 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) lib/api/src/backend/js/entities/function/typed.rs:171 — lib/api/src/backend/js/entities/function/typed.rs:171-188 | lib/api/src/backend/sys/entities/function/mod.rs:771-792 | lib/api/src/backend/sys/entities/function/typed.rs:310-325 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 19+ corresponding lines) lib/backend-api/src/query.rs:2408 — lib/backend-api/src/query.rs:2408-2426 | lib/backend-api/src/query.rs:2446-2473 | lib/backend-api/src/query.rs:2493-2520 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) fuzz/fuzz_targets/cranelift.rs:15 — fuzz/fuzz_targets/cranelift.rs:15-33 | fuzz/fuzz_targets/llvm.rs:15-33 | fuzz/fuzz_targets/misc.rs:9-27 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) lib/virtual-net/src/client.rs:1289 — lib/virtual-net/src/client.rs:1289-1306 | lib/virtual-net/src/client.rs:1308-1325 | lib/virtual-net/src/client.rs:1363-1382 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) lib/api/src/backend/js/entities/memory/buffer.rs:14 — lib/api/src/backend/js/entities/memory/buffer.rs:14-31 | lib/api/src/backend/js/entities/memory/buffer.rs:43-62 | lib/api/src/backend/js/entities/memory/buffer.rs:64-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 17+ corresponding lines) lib/wasix/src/syscalls/wasi/clock_time_set.rs:16 — lib/wasix/src/syscalls/wasi/clock_time_set.rs:16-32 | lib/wasix/src/syscalls/wasi/fd_fdstat_set_flags.rs:16-33 | lib/wasix/src/syscalls/wasi/fd_renumber.rs:17-34 | lib/wasix/src/syscalls/wasix/fd_fdflags_set.rs:16-35 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 17+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:8000 — lib/compiler-singlepass/src/machine_arm64.rs:8000-8016 | lib/compiler-singlepass/src/machine_arm64.rs:8023-8039 | lib/compiler-singlepass/src/machine_arm64.rs:8285-8301 | lib/compiler-singlepass/src/machine_arm64.rs:8308-8324 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×2
  • Edited copy of a member (16 corresponding lines) lib/virtual-fs/src/mem_fs/filesystem.rs:586 — lib/virtual-fs/src/mem_fs/filesystem.rs:586-601 | lib/virtual-fs/src/mem_fs/filesystem.rs:603-618 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:1586 — lib/compiler-singlepass/src/machine_arm64.rs:1586-1601 | lib/compiler-singlepass/src/machine_arm64.rs:1603-1618 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) lib/virtual-fs/src/overlay_fs.rs:362 — lib/virtual-fs/src/overlay_fs.rs:362-388 | lib/virtual-fs/src/overlay_fs.rs:390-404 | lib/virtual-fs/src/overlay_fs.rs:406-420 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) lib/compiler-cranelift/src/elf.rs:100 — lib/compiler-cranelift/src/elf.rs:100-116 | lib/compiler/src/dwarf.rs:116-132 | lib/compiler/src/dwarf.rs:254-268 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) lib/wasix/src/syscalls/wasi/fd_fdstat_set_flags.rs:39 — lib/wasix/src/syscalls/wasi/fd_fdstat_set_flags.rs:39-51 | lib/wasix/src/syscalls/wasi/fd_fdstat_set_rights.rs:47-64 | lib/wasix/src/syscalls/wasix/fd_fdflags_set.rs:41-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) lib/virtual-net/src/server.rs:1683 — lib/virtual-net/src/server.rs:1683-1693 | lib/virtual-net/src/server.rs:1695-1705 | lib/virtual-net/src/server.rs:1707-1717 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 15+ corresponding lines) lib/wasix/src/syscalls/wasix/port_addr_clear.rs:7 — lib/wasix/src/syscalls/wasix/port_addr_clear.rs:7-21 | lib/wasix/src/syscalls/wasix/port_dhcp_acquire.rs:7-21 | lib/wasix/src/syscalls/wasix/port_route_clear.rs:7-21 | lib/wasix/src/syscalls/wasix/port_unbridge.rs:7-21 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) lib/compiler-cranelift/src/func_environ.rs:459 — lib/compiler-cranelift/src/func_environ.rs:459-473 | lib/compiler-cranelift/src/func_environ.rs:496-510 | lib/compiler-cranelift/src/func_environ.rs:536-550 | lib/compiler-cranelift/src/func_environ.rs:611-625 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 9+ corresponding lines) lib/compiler-cranelift/src/func_environ.rs:2077 — lib/compiler-cranelift/src/func_environ.rs:2077-2087 | lib/compiler-cranelift/src/func_environ.rs:2234-2242 | lib/compiler-cranelift/src/func_environ.rs:2327-2339 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) lib/compiler-cranelift/src/config.rs:44 — lib/compiler-cranelift/src/config.rs:44-52 | lib/compiler-llvm/src/config.rs:49-57 | lib/compiler-singlepass/src/config.rs:43-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 20+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:4036 — lib/compiler-singlepass/src/machine_x64.rs:4036-4055 | lib/compiler-singlepass/src/machine_x64.rs:4068-4087 | lib/compiler-singlepass/src/machine_x64.rs:4100-4119 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:4132 — lib/compiler-singlepass/src/machine_x64.rs:4132-4151 | lib/compiler-singlepass/src/machine_x64.rs:4164-4183 | lib/compiler-singlepass/src/machine_x64.rs:4196-4215 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×2
  • Edited copy of a member (5 corresponding lines) lib/compiler-cranelift/src/config.rs:84 — lib/compiler-cranelift/src/config.rs:84-88 | lib/compiler-singlepass/src/config.rs:75-79 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) lib/virtual-fs/src/random_file.rs:42 — lib/virtual-fs/src/random_file.rs:42-46 | lib/virtual-fs/src/zero_file.rs:45-49 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×2
  • Duplicated block (36 lines × 2) lib/virtual-net/src/rx_tx.rs:204 — lib/virtual-net/src/rx_tx.rs:204-239 | lib/virtual-net/src/rx_tx.rs:265-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:204` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (36 lines × 2) lib/wasix/src/syscalls/wasi/path_open.rs:41 — lib/wasix/src/syscalls/wasi/path_open.rs:41-76 | lib/wasix/src/syscalls/wasix/path_open2.rs:44-79 — before extracting anything, compare `lib/wasix/src/syscalls/wasi/path_open.rs` and `lib/wasix/src/syscalls/wasix/path_open2.rs` as WHOLE FILES: 95% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasi/path_open.rs:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) lib/cli/src/commands/app/create.rs:406 — lib/cli/src/commands/app/create.rs:406-436 | lib/cli/src/commands/app/create.rs:488-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/create.rs:406` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (31 lines × 2) lib/compiler-llvm/src/translator/code.rs:4691 — lib/compiler-llvm/src/translator/code.rs:4691-4721 | lib/compiler-llvm/src/translator/code.rs:4810-4840 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4691` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:4808` calls `v128_into_i32x4` and `lib/compiler-llvm/src/translator/code.rs:4689` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25 lines × 4) · ×2
  • Duplicated block (25 lines × 4) lib/compiler-llvm/src/translator/code.rs:8800 — lib/compiler-llvm/src/translator/code.rs:8800-8824 | lib/compiler-llvm/src/translator/code.rs:8874-8898 | lib/compiler-llvm/src/translator/code.rs:8949-8973 | lib/compiler-llvm/src/translator/code.rs:9015-9039 — 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 (25 lines × 4) lib/compiler-llvm/src/translator/code.rs:1514 — lib/compiler-llvm/src/translator/code.rs:1514-1538 | lib/compiler-llvm/src/translator/code.rs:1597-1621 | lib/compiler-llvm/src/translator/code.rs:1645-1669 | lib/compiler-llvm/src/translator/code.rs:1708-1732 — 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 (23 lines × 4) · ×2
  • Duplicated block (23 lines × 4) lib/compiler-singlepass/src/machine_x64.rs:3718 — lib/compiler-singlepass/src/machine_x64.rs:3718-3740 | lib/compiler-singlepass/src/machine_x64.rs:3851-3873 | lib/compiler-singlepass/src/machine_x64.rs:5660-5682 | lib/compiler-singlepass/src/machine_x64.rs:5840-5862 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3718` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 4) lib/compiler-singlepass/src/machine_x64.rs:3765 — lib/compiler-singlepass/src/machine_x64.rs:3765-3787 | lib/compiler-singlepass/src/machine_x64.rs:3898-3920 | lib/compiler-singlepass/src/machine_x64.rs:5707-5729 | lib/compiler-singlepass/src/machine_x64.rs:5887-5909 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3765` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) lib/wasix/src/syscalls/wasix/epoll_create.rs:60 — lib/wasix/src/syscalls/wasix/epoll_create.rs:60-82 | lib/wasix/src/syscalls/wasix/sock_open.rs:103-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/wasix/src/syscalls/wasix/sock_open.rs:126` calls `current`, `record` and `lib/wasix/src/syscalls/wasix/epoll_create.rs:84` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (23 lines × 2) lib/wasix/src/syscalls/wasix/fd_pipe.rs:88 — lib/wasix/src/syscalls/wasix/fd_pipe.rs:88-110 | lib/wasix/src/syscalls/wasix/fd_pipe.rs:112-134 — both copies are in the same file, so extract the 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 × 3) · ×2
  • Duplicated block (20 lines × 3) lib/compiler-llvm/src/translator/code.rs:4476 — lib/compiler-llvm/src/translator/code.rs:4476-4495 | lib/compiler-llvm/src/translator/code.rs:4528-4547 | lib/compiler-llvm/src/translator/code.rs:4574-4593 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4476` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 3) lib/compiler-singlepass/src/compiler.rs:206 — lib/compiler-singlepass/src/compiler.rs:206-225 | lib/compiler-singlepass/src/compiler.rs:228-247 | lib/compiler-singlepass/src/compiler.rs:253-272 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/compiler.rs:206` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×2
  • Duplicated block (18 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:4369 — lib/compiler-singlepass/src/machine_arm64.rs:4369-4386 | lib/compiler-singlepass/src/machine_arm64.rs:4427-4444 | lib/compiler-singlepass/src/machine_arm64.rs:4485-4502 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4369` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:4548 — lib/compiler-singlepass/src/machine_arm64.rs:4548-4565 | lib/compiler-singlepass/src/machine_arm64.rs:4611-4628 | lib/compiler-singlepass/src/machine_arm64.rs:4674-4691 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4548` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:3057 — lib/compiler-singlepass/src/machine_x64.rs:3057-3073 | lib/compiler-singlepass/src/machine_x64.rs:3110-3127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:3057` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) lib/virtual-fs/src/mem_fs/file.rs:1812 — lib/virtual-fs/src/mem_fs/file.rs:1812-1829 | lib/virtual-fs/src/mem_fs/file.rs:1920-1936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×2
  • Duplicated block (17 lines × 3) lib/virtual-net/src/rx_tx.rs:185 — lib/virtual-net/src/rx_tx.rs:185-201 | lib/virtual-net/src/rx_tx.rs:246-262 | lib/virtual-net/src/rx_tx.rs:307-323 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) lib/virtual-net/src/rx_tx.rs:360 — lib/virtual-net/src/rx_tx.rs:360-376 | lib/virtual-net/src/rx_tx.rs:422-438 | lib/virtual-net/src/rx_tx.rs:484-500 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:360` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) lib/c-api-imports/src/lib.rs:1441 — lib/c-api-imports/src/lib.rs:1441-1454 | lib/c-api-imports/src/lib.rs:1461-1475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/c-api-imports/src/lib.rs:1441` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:360 — lib/compiler-singlepass/src/machine_riscv.rs:360-373 | lib/compiler-singlepass/src/machine_riscv.rs:634-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:360` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×2
  • Duplicated block (13 lines × 5) lib/backend-api/src/query.rs:281 — lib/backend-api/src/query.rs:281-293 | lib/backend-api/src/query.rs:657-669 | lib/backend-api/src/query.rs:713-725 | lib/backend-api/src/query.rs:1529-1541 | lib/backend-api/src/query.rs:1594-1606 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/backend-api/src/query.rs:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 5) lib/backend-api/src/query.rs:875 — lib/backend-api/src/query.rs:875-887 | lib/backend-api/src/query.rs:933-945 | lib/backend-api/src/query.rs:1004-1016 | lib/backend-api/src/query.rs:1065-1077 | lib/backend-api/src/query.rs:1136-1148 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/backend-api/src/query.rs:875` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×2
  • Duplicated block (12–13 lines × 4) lib/compiler-singlepass/src/codegen.rs:3637 — lib/compiler-singlepass/src/codegen.rs:3637-3648 | lib/compiler-singlepass/src/codegen.rs:3671-3682 | lib/compiler-singlepass/src/codegen.rs:3718-3730 | lib/compiler-singlepass/src/codegen.rs:3743-3754 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 4) lib/virtual-net/src/rx_tx.rs:117 — lib/virtual-net/src/rx_tx.rs:117-128 | lib/virtual-net/src/rx_tx.rs:138-149 | lib/virtual-net/src/rx_tx.rs:380-392 | lib/virtual-net/src/rx_tx.rs:442-454 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:380` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×2
  • Duplicated block (11–12 lines × 4) lib/compiler-llvm/src/translator/code.rs:4885 — lib/compiler-llvm/src/translator/code.rs:4885-4896 | lib/compiler-llvm/src/translator/code.rs:4901-4912 | lib/compiler-llvm/src/translator/code.rs:8667-8677 | lib/compiler-llvm/src/translator/code.rs:8691-8701 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4885` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 4) lib/compiler-singlepass/src/machine_arm64.rs:147 — lib/compiler-singlepass/src/machine_arm64.rs:147-158 | lib/compiler-singlepass/src/machine_arm64.rs:167-178 | lib/compiler-singlepass/src/machine_arm64.rs:187-198 | lib/compiler-singlepass/src/machine_riscv.rs:186-196 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 13) · ×2
  • Duplicated block (10 lines × 13) lib/compiler-llvm/src/translator/code.rs:7428 — lib/compiler-llvm/src/translator/code.rs:7428-7437 | lib/compiler-llvm/src/translator/code.rs:7503-7512 | lib/compiler-llvm/src/translator/code.rs:7586-7596 | lib/compiler-llvm/src/translator/code.rs:7673-7683 | lib/compiler-llvm/src/translator/code.rs:7745-7755 | lib/compiler-llvm/src/translator/code.rs:7835-7845 | lib/compiler-llvm/src/translator/code.rs:7907-7917 | lib/compiler-llvm/src/translator/code.rs:7997-8007 | lib/compiler-llvm/src/translator/code.rs:8066-8076 | lib/compiler-llvm/src/translator/code.rs:8156-8166 | lib/compiler-llvm/src/translator/code.rs:8566-8575 | lib/compiler-llvm/src/translator/code.rs:8594-8603 | lib/compiler-llvm/src/translator/code.rs:10535-10544 — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7428` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 13) lib/compiler-llvm/src/translator/code.rs:7458 — lib/compiler-llvm/src/translator/code.rs:7458-7467 | lib/compiler-llvm/src/translator/code.rs:7533-7542 | lib/compiler-llvm/src/translator/code.rs:7622-7632 | lib/compiler-llvm/src/translator/code.rs:7781-7791 | lib/compiler-llvm/src/translator/code.rs:7943-7953 | lib/compiler-llvm/src/translator/code.rs:8102-8112 | lib/compiler-llvm/src/translator/code.rs:8238-8248 | lib/compiler-llvm/src/translator/code.rs:8290-8300 | lib/compiler-llvm/src/translator/code.rs:8342-8352 | lib/compiler-llvm/src/translator/code.rs:8394-8404 | lib/compiler-llvm/src/translator/code.rs:8446-8456 | lib/compiler-llvm/src/translator/code.rs:8498-8508 | lib/compiler-llvm/src/translator/code.rs:10610-10619 — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7458` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 10) · ×2
  • Duplicated block (10 lines × 10) lib/compiler-llvm/src/translator/code.rs:6145 — lib/compiler-llvm/src/translator/code.rs:6145-6155 | lib/compiler-llvm/src/translator/code.rs:6171-6181 | lib/compiler-llvm/src/translator/code.rs:6239-6249 | lib/compiler-llvm/src/translator/code.rs:6265-6275 | lib/compiler-llvm/src/translator/code.rs:6333-6343 | lib/compiler-llvm/src/translator/code.rs:6440-6450 | lib/compiler-llvm/src/translator/code.rs:6721-6730 | lib/compiler-llvm/src/translator/code.rs:6783-6792 | lib/compiler-llvm/src/translator/code.rs:6891-6900 | lib/compiler-llvm/src/translator/code.rs:6954-6963 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 10) lib/compiler-llvm/src/translator/code.rs:7413 — lib/compiler-llvm/src/translator/code.rs:7413-7422 | lib/compiler-llvm/src/translator/code.rs:7488-7497 | lib/compiler-llvm/src/translator/code.rs:7568-7578 | lib/compiler-llvm/src/translator/code.rs:7655-7665 | lib/compiler-llvm/src/translator/code.rs:7727-7737 | lib/compiler-llvm/src/translator/code.rs:7817-7827 | lib/compiler-llvm/src/translator/code.rs:7889-7899 | lib/compiler-llvm/src/translator/code.rs:7979-7989 | lib/compiler-llvm/src/translator/code.rs:8048-8058 | lib/compiler-llvm/src/translator/code.rs:8138-8148 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7413` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) lib/cli/src/commands/package/download.rs:82 — lib/cli/src/commands/package/download.rs:82-89 | lib/cli/src/commands/package/download.rs:103-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/package/download.rs:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/cli/src/commands/package/download.rs:90` calls `to_owned` and `lib/cli/src/commands/package/download.rs:112` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–9 lines × 2) lib/vm/src/instance/allocator.rs:215 — lib/vm/src/instance/allocator.rs:215-223 | lib/vm/src/instance/allocator.rs:250-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/vm/src/instance/allocator.rs:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (2–8 lines × 8) · ×2
  • Duplicated block (2–8 lines × 8) lib/compiler-singlepass/src/machine_arm64.rs:2585 — lib/compiler-singlepass/src/machine_arm64.rs:2585-2586 | lib/compiler-singlepass/src/machine_arm64.rs:2611-2612 | lib/compiler-singlepass/src/machine_arm64.rs:2653-2654 | lib/compiler-singlepass/src/machine_arm64.rs:2691-2692 | lib/compiler-singlepass/src/machine_riscv.rs:2984-2991 | lib/compiler-singlepass/src/machine_riscv.rs:3015-3022 | lib/compiler-singlepass/src/machine_riscv.rs:3062-3069 | lib/compiler-singlepass/src/machine_riscv.rs:3092-3099 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:2982` calls `location_to_reg` and `lib/compiler-singlepass/src/machine_arm64.rs:2583` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (2–8 lines × 8) lib/compiler-singlepass/src/machine_arm64.rs:4768 — lib/compiler-singlepass/src/machine_arm64.rs:4768-4769 | lib/compiler-singlepass/src/machine_arm64.rs:4794-4795 | lib/compiler-singlepass/src/machine_arm64.rs:4836-4837 | lib/compiler-singlepass/src/machine_arm64.rs:4874-4875 | lib/compiler-singlepass/src/machine_riscv.rs:4307-4314 | lib/compiler-singlepass/src/machine_riscv.rs:4338-4345 | lib/compiler-singlepass/src/machine_riscv.rs:4386-4393 | lib/compiler-singlepass/src/machine_riscv.rs:4416-4423 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:4305` calls `location_to_reg` and `lib/compiler-singlepass/src/machine_arm64.rs:4766` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 10) · ×2
  • Duplicated block (7 lines × 10) lib/compiler-llvm/src/translator/code.rs:4020 — lib/compiler-llvm/src/translator/code.rs:4020-4026 | lib/compiler-llvm/src/translator/code.rs:4036-4042 | lib/compiler-llvm/src/translator/code.rs:8554-8560 | lib/compiler-llvm/src/translator/code.rs:8582-8588 | lib/compiler-llvm/src/translator/code.rs:8610-8616 | lib/compiler-llvm/src/translator/code.rs:8638-8644 | lib/compiler-llvm/src/translator/code.rs:8842-8848 | lib/compiler-llvm/src/translator/code.rs:8916-8922 | lib/compiler-llvm/src/translator/code.rs:8991-8997 | lib/compiler-llvm/src/translator/code.rs:9057-9063 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4020` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 10) lib/compiler-singlepass/src/machine_arm64.rs:5755 — lib/compiler-singlepass/src/machine_arm64.rs:5755-5761 | lib/compiler-singlepass/src/machine_arm64.rs:5938-5944 | lib/compiler-singlepass/src/machine_arm64.rs:5999-6005 | lib/compiler-singlepass/src/machine_arm64.rs:6182-6188 | lib/compiler-singlepass/src/machine_arm64.rs:6243-6249 | lib/compiler-singlepass/src/machine_arm64.rs:6426-6432 | lib/compiler-singlepass/src/machine_arm64.rs:6487-6493 | lib/compiler-singlepass/src/machine_arm64.rs:6670-6676 | lib/compiler-singlepass/src/machine_arm64.rs:6731-6737 | lib/compiler-singlepass/src/machine_arm64.rs:6914-6920 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:5755` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) lib/virtual-fs/src/mem_fs/filesystem.rs:200 — lib/virtual-fs/src/mem_fs/filesystem.rs:200-210 | lib/virtual-fs/src/mem_fs/filesystem.rs:262-268 | lib/virtual-fs/src/mem_fs/filesystem.rs:400-410 | lib/virtual-fs/src/mem_fs/filesystem.rs:477-487 | lib/virtual-fs/src/mem_fs/filesystem.rs:630-640 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/filesystem.rs:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 5) lib/virtual-net/src/client.rs:719 — lib/virtual-net/src/client.rs:719-725 | lib/virtual-net/src/client.rs:789-795 | lib/virtual-net/src/client.rs:820-826 | lib/virtual-net/src/client.rs:841-847 | lib/virtual-net/src/client.rs:870-876 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/client.rs:719` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 10) · ×2
  • Duplicated block (6 lines × 10) lib/compiler-singlepass/src/machine_x64.rs:973 — lib/compiler-singlepass/src/machine_x64.rs:973-978 | lib/compiler-singlepass/src/machine_x64.rs:2510-2515 | lib/compiler-singlepass/src/machine_x64.rs:7311-7316 | lib/compiler-singlepass/src/machine_x64.rs:7365-7370 | lib/compiler-singlepass/src/machine_x64.rs:7440-7445 | lib/compiler-singlepass/src/machine_x64.rs:7494-7499 | lib/compiler-singlepass/src/machine_x64.rs:7731-7736 | lib/compiler-singlepass/src/machine_x64.rs:7785-7790 | lib/compiler-singlepass/src/machine_x64.rs:7860-7865 | lib/compiler-singlepass/src/machine_x64.rs:7914-7919 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_x64.rs:979` calls `acquire_temp_simd`, `ok_or_else`, `Codegen` and `lib/compiler-singlepass/src/machine_x64.rs:7317` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 10) lib/compiler-llvm/src/translator/code.rs:9852 — lib/compiler-llvm/src/translator/code.rs:9852-9857 | lib/compiler-llvm/src/translator/code.rs:9866-9871 | lib/compiler-llvm/src/translator/code.rs:9880-9885 | lib/compiler-llvm/src/translator/code.rs:9894-9899 | lib/compiler-llvm/src/translator/code.rs:10306-10311 | lib/compiler-llvm/src/translator/code.rs:10319-10324 | lib/compiler-llvm/src/translator/code.rs:10333-10338 | lib/compiler-llvm/src/translator/code.rs:10348-10353 | lib/compiler-llvm/src/translator/code.rs:10372-10377 | lib/compiler-llvm/src/translator/code.rs:10400-10405 — 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 (5 lines × 6) · ×2
  • Duplicated block (5 lines × 6) lib/compiler-cranelift/src/func_environ.rs:1390 — lib/compiler-cranelift/src/func_environ.rs:1390-1395 | lib/compiler-cranelift/src/func_environ.rs:1411-1415 | lib/compiler-cranelift/src/func_environ.rs:2097-2101 | lib/compiler-cranelift/src/func_environ.rs:2114-2118 | lib/compiler-cranelift/src/func_environ.rs:2251-2255 | lib/compiler-cranelift/src/func_environ.rs:2375-2379 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:1390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn translate_unreachable( &mut` in one and `crate) fn translate_exn_reraise_unmatched( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 6) lib/compiler/src/engine/link.rs:137 — lib/compiler/src/engine/link.rs:137-141 | lib/compiler/src/engine/link.rs:143-147 | lib/compiler/src/engine/link.rs:149-153 | lib/compiler/src/engine/link.rs:181-185 | lib/compiler/src/engine/link.rs:193-197 | lib/compiler/src/engine/link.rs:199-203 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
C2 · Access Controls · No authorization · ×1
  • No authorization lib/cli/src/commands/auth/login/mod.rs:131 — This repository serves requests — a server (.serve_connection) (lib/cli/src/commands/auth/login/mod.rs:131) — and no route guard, auth-gate middleware, global guard or imperative check that refuses a caller (401/403, an Unauthorized/Forbidden error) was found: its endpoints may be unprotected.
D1 · Cyclomatic Complexity · JournalSyscallPlayer · ×1
  • JournalSyscallPlayer::play_event (cyclomatic 118) lib/wasix/src/syscalls/journal/play_event.rs:7 — JournalSyscallPlayer::play_event has cyclomatic complexity 118 (threshold 15). To reduce it, separate the cases: extract each independent 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 · wasmer_compiler_llvm · ×1
  • wasmer_compiler_llvm::object_file::load_object_file (cyclomatic 93) lib/compiler-llvm/src/object_file.rs:131 — wasmer_compiler_llvm::object_file::load_object_file has cyclomatic complexity 93 (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 · virtual_fs · ×1
  • virtual_fs::overlay_fs::open_copy_on_write (cyclomatic 72) lib/virtual-fs/src/overlay_fs.rs:741 — virtual_fs::overlay_fs::open_copy_on_write has cyclomatic complexity 72 (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 · JournalEntry · ×1
  • JournalEntry::fmt (cyclomatic 66) lib/journal/src/concrete/printing.rs:67 — JournalEntry::fmt has cyclomatic complexity 66 (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 · CompactingJournalTx · ×1
  • CompactingJournalTx::write (cyclomatic 60) lib/journal/src/concrete/compacting.rs:528 — CompactingJournalTx::write has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CmdAppDeploy · ×1
  • CmdAppDeploy::run_async (cyclomatic 49) lib/cli/src/commands/app/deploy.rs:565 — CmdAppDeploy::run_async has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InodeValFilePollGuardJoin · ×1
  • InodeValFilePollGuardJoin::poll (cyclomatic 45) lib/wasix/src/fs/inode_guard.rs:161 — InodeValFilePollGuardJoin::poll has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CraneliftCompiler · ×1
  • CraneliftCompiler::compile_module_internal (cyclomatic 40) lib/compiler-cranelift/src/compiler.rs:107 — CraneliftCompiler::compile_module_internal has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · virtual_net · ×1
  • virtual_net::io_err_into_net_error (cyclomatic 39) lib/virtual-net/src/lib.rs:903 — virtual_net::io_err_into_net_error 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.
D1 · Cyclomatic Complexity · SinglepassCompiler · ×1
  • SinglepassCompiler::compile_module_internal (cyclomatic 37) lib/compiler-singlepass/src/compiler.rs:67 — SinglepassCompiler::compile_module_internal has cyclomatic complexity 37 (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 · BackendType · ×1
  • BackendType::get_engine (cyclomatic 32) lib/cli/src/backend.rs:594 — BackendType::get_engine has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RuntimeOptions · ×1
  • RuntimeOptions::get_sys_compiler_config (cyclomatic 30) lib/cli/src/backend.rs:438 — RuntimeOptions::get_sys_compiler_config has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileSystem · ×1
  • FileSystem::open (cyclomatic 30) lib/virtual-fs/src/mem_fs/file_opener.rs:338 — FileSystem::open has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Tty · ×1
  • Tty::apply_canonical_input (cyclomatic 29) lib/wasix/src/os/tty/mod.rs:607 — Tty::apply_canonical_input has cyclomatic complexity 29 (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 · InputParser · ×1
  • InputParser::feed (cyclomatic 29) lib/wasix/src/os/tty/mod.rs:396 — InputParser::feed has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LLVMCompiler · ×1
  • LLVMCompiler::compile_module (cyclomatic 28) lib/compiler-llvm/src/compiler.rs:248 — LLVMCompiler::compile_module has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FuncTranslator · ×1
  • FuncTranslator::translate_to_module (cyclomatic 28) lib/compiler-llvm/src/translator/code.rs:186 — FuncTranslator::translate_to_module has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: LLVMFunctionCodeGenerator::translate_floating_point_arithmetic_operator (cyclomatic 70) 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 · RemoteNetworkingClientDriver · ×1
  • RemoteNetworkingClientDriver::poll (cyclomatic 28) lib/virtual-net/src/client.rs:297 — RemoteNetworkingClientDriver::poll has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemoryMappedBinary · ×1
  • MemoryMappedBinary::try_from_source (cyclomatic 26) lib/compiler/src/engine/mapped_binary.rs:348 — MemoryMappedBinary::try_from_source 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 · Run · ×1
  • Run::execute_inner (cyclomatic 25) lib/cli/src/commands/run/mod.rs:214 — Run::execute_inner 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 · WasiFunctionEnv · ×1
  • WasiFunctionEnv::initialize_handles_and_layout (cyclomatic 25) lib/wasix/src/state/func_env.rs:161 — WasiFunctionEnv::initialize_handles_and_layout 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 · PackageDownload · ×1
  • PackageDownload::execute (cyclomatic 24) lib/cli/src/commands/package/download.rs:58 — PackageDownload::execute has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WasiEnvBuilder · ×1
  • WasiEnvBuilder::build_init (cyclomatic 23) lib/wasix/src/state/builder.rs:884 — WasiEnvBuilder::build_init has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Features · ×1
  • Features::detect_from_wasm (cyclomatic 22) lib/types/src/features.rs:358 — Features::detect_from_wasm 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.
D1 · Cyclomatic Complexity · Artifact · ×1
  • Artifact::from_parts_with_module_file (cyclomatic 21) lib/compiler/src/engine/artifact.rs:476 — Artifact::from_parts_with_module_file 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 · RemoteRx · ×1
  • RemoteRx::poll (cyclomatic 21) lib/virtual-net/src/rx_tx.rs:537 — RemoteRx::poll 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 · CmdAppLogs · ×1
  • CmdAppLogs::run_async (cyclomatic 20) lib/cli/src/commands/app/logs.rs:84 — CmdAppLogs::run_async 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 · FilteredJournalTx · ×1
  • FilteredJournalTx::write (cyclomatic 19) lib/journal/src/concrete/filter.rs:227 — FilteredJournalTx::write 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 · wasmer_compiler_singlepass · ×1
  • wasmer_compiler_singlepass::emitter_arm64::gen_import_call_trampoline_arm64 (cyclomatic 18) lib/compiler-singlepass/src/emitter_arm64.rs:3108 — wasmer_compiler_singlepass::emitter_arm64::gen_import_call_trampoline_arm64 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 · wasmer_package · ×1
  • wasmer_package::convert::webc_to_package::webc_to_package_dir (cyclomatic 18) lib/package/src/convert/webc_to_package.rs:11 — wasmer_package::convert::webc_to_package::webc_to_package_dir 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 · Module · ×1
  • Module::annotate_table_functions (cyclomatic 17) lib/api/src/backend/js/entities/module.rs:327 — Module::annotate_table_functions 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 · OverlayFileSystem · ×1
  • OverlayFileSystem::open (cyclomatic 17) lib/virtual-fs/src/overlay_fs.rs:619 — OverlayFileSystem::open 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 · InodeSocketProtected · ×1
  • InodeSocketProtected::poll_read_ready (cyclomatic 17) lib/wasix/src/net/socket.rs:1759 — InodeSocketProtected::poll_read_ready 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. This is NOT this file's highest cyclomatic complexity: WasiSocketOption::try_from (cyclomatic 28) 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 · InstanceGroupState · ×1
  • InstanceGroupState::define_common_import (cyclomatic 17) lib/wasix/src/state/linker/instance_group/imports.rs:396 — InstanceGroupState::define_common_import 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 · Target · ×1
  • Target::command (cyclomatic 16) lib/cli/src/commands/add.rs:155 — Target::command 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 · GetOrSet · ×1
  • GetOrSet::execute (cyclomatic 16) lib/cli/src/commands/config.rs:239 — GetOrSet::execute 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 · CmdCronInvocations · ×1
  • CmdCronInvocations::run_async (cyclomatic 16) lib/cli/src/commands/cron.rs:161 — CmdCronInvocations::run_async 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 · wasmer_cli · ×1
  • wasmer_cli::commands::init::construct_manifest (cyclomatic 16) lib/cli/src/commands/init.rs:362 — wasmer_cli::commands::init::construct_manifest 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 · CpuFeature · ×1
  • CpuFeature::for_host (cyclomatic 16) lib/types/src/target.rs:57 — CpuFeature::for_host 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. This is NOT this file's highest cyclomatic complexity: CpuFeature::from_str (cyclomatic 17) 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 · OffloadedFile · ×1
  • OffloadedFile::write (cyclomatic 16) lib/virtual-fs/src/mem_fs/offloaded_file.rs:238 — OffloadedFile::write has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · JournalSyscallPlayer · ×1
  • JournalSyscallPlayer::play_event (cognitive 137) lib/wasix/src/syscalls/journal/play_event.rs:7 — JournalSyscallPlayer::play_event has cognitive complexity 137 (threshold 15). Drivers by points: if/else 93 (136 pts), match/switch 1 (nesting depth added 43). 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 · CmdAppDeploy · ×1
  • CmdAppDeploy::run_async (cognitive 112) lib/cli/src/commands/app/deploy.rs:565 — CmdAppDeploy::run_async has cognitive complexity 112 (threshold 15). Drivers by points: if/else 55 (105 pts), boolean chains 6, match/switch 1 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · virtual_fs · ×1
  • virtual_fs::overlay_fs::open_copy_on_write (cognitive 96) lib/virtual-fs/src/overlay_fs.rs:741 — virtual_fs::overlay_fs::open_copy_on_write has cognitive complexity 96 (threshold 15). Drivers by points: match/switch 27 (47 pts), if/else 13 (45 pts), loops 2 (4 pts) (nesting depth added 54). 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 · wasmer_compiler_llvm · ×1
  • wasmer_compiler_llvm::object_file::load_object_file (cognitive 78) lib/compiler-llvm/src/object_file.rs:131 — wasmer_compiler_llvm::object_file::load_object_file has cognitive complexity 78 (threshold 15). Drivers by points: if/else 18 (53 pts), match/switch 6 (21 pts), loops 3 (4 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CraneliftCompiler · ×1
  • CraneliftCompiler::compile_module_internal (cognitive 77) lib/compiler-cranelift/src/compiler.rs:107 — CraneliftCompiler::compile_module_internal has cognitive complexity 77 (threshold 15). Drivers by points: if/else 41 (62 pts), match/switch 4 (7 pts), loops 3 (6 pts), boolean chains 2 (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 · InodeValFilePollGuardJoin · ×1
  • InodeValFilePollGuardJoin::poll (cognitive 77) lib/wasix/src/fs/inode_guard.rs:161 — InodeValFilePollGuardJoin::poll has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (48 pts), match/switch 11 (26 pts), boolean chains 2, loops 1 (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 · LLVMCompiler · ×1
  • LLVMCompiler::compile_module (cognitive 64) lib/compiler-llvm/src/compiler.rs:248 — LLVMCompiler::compile_module has cognitive complexity 64 (threshold 15). Drivers by points: if/else 23 (41 pts), loops 6 (18 pts), match/switch 3 (5 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoteNetworkingClientDriver · ×1
  • RemoteNetworkingClientDriver::poll (cognitive 61) lib/virtual-net/src/client.rs:297 — RemoteNetworkingClientDriver::poll has cognitive complexity 61 (threshold 15). Drivers by points: if/else 9 (38 pts), match/switch 8 (20 pts), loops 2 (3 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasiFunctionEnv · ×1
  • WasiFunctionEnv::initialize_handles_and_layout (cognitive 61) lib/wasix/src/state/func_env.rs:161 — WasiFunctionEnv::initialize_handles_and_layout has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (39 pts), match/switch 6 (22 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactingJournalTx · ×1
  • CompactingJournalTx::write (cognitive 48) lib/journal/src/concrete/compacting.rs:528 — CompactingJournalTx::write has cognitive complexity 48 (threshold 15). Drivers by points: if/else 34 (46 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Run · ×1
  • Run::execute_inner (cognitive 46) lib/cli/src/commands/run/mod.rs:214 — Run::execute_inner has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (27 pts), match/switch 6 (15 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinglepassCompiler · ×1
  • SinglepassCompiler::compile_module_internal (cognitive 46) lib/compiler-singlepass/src/compiler.rs:67 — SinglepassCompiler::compile_module_internal has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (16 pts), match/switch 8 (14 pts), loops 6 (11 pts), boolean chains 5 (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 · BackendType · ×1
  • BackendType::get_engine (cognitive 44) lib/cli/src/backend.rs:594 — BackendType::get_engine has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (38 pts), match/switch 4 (6 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InputParser · ×1
  • InputParser::feed (cognitive 44) lib/wasix/src/os/tty/mod.rs:396 — InputParser::feed has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (32 pts), match/switch 2 (7 pts), loops 2 (3 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.
D2 · Cognitive Complexity · MemoryMappedBinary · ×1
  • MemoryMappedBinary::try_from_source (cognitive 42) lib/compiler/src/engine/mapped_binary.rs:348 — MemoryMappedBinary::try_from_source has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 3 (5 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · PackageTag · ×1
  • PackageTag::get_version (cognitive 40) lib/cli/src/commands/package/tag.rs:387 — PackageTag::get_version has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (38 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 · RuntimeOptions · ×1
  • RuntimeOptions::get_sys_compiler_config (cognitive 39) lib/cli/src/backend.rs:438 — RuntimeOptions::get_sys_compiler_config has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (33 pts), match/switch 4 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Artifact · ×1
  • Artifact::from_parts_with_module_file (cognitive 38) lib/compiler/src/engine/artifact.rs:476 — Artifact::from_parts_with_module_file has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (28 pts), match/switch 8 (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 · FuncTranslator · ×1
  • FuncTranslator::translate_to_module (cognitive 38) lib/compiler-llvm/src/translator/code.rs:186 — FuncTranslator::translate_to_module has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (26 pts), loops 5 (6 pts), match/switch 3 (4 pts), 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.
D2 · Cognitive Complexity · Tty · ×1
  • Tty::apply_canonical_input (cognitive 38) lib/wasix/src/os/tty/mod.rs:607 — Tty::apply_canonical_input has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 4 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 21). 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 · PackageDownload · ×1
  • PackageDownload::execute (cognitive 37) lib/cli/src/commands/package/download.rs:58 — PackageDownload::execute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 24 (32 pts), match/switch 3 (5 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 · FsVolume · ×1
  • FsVolume::as_directory_tree (cognitive 37) lib/package/src/package/volume/fs.rs:304 — FsVolume::as_directory_tree has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wasmer_package · ×1
  • wasmer_package::convert::webc_to_package::webc_to_package_dir (cognitive 36) lib/package/src/convert/webc_to_package.rs:11 — wasmer_package::convert::webc_to_package::webc_to_package_dir has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 5 (8 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CmdAppLogs · ×1
  • CmdAppLogs::run_async (cognitive 35) lib/cli/src/commands/app/logs.rs:84 — CmdAppLogs::run_async has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Selector · ×1
  • Selector::run (cognitive 33) lib/virtual-io/src/selector.rs:220 — Selector::run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Module · ×1
  • Module::annotate_table_functions (cognitive 29) lib/api/src/backend/js/entities/module.rs:327 — Module::annotate_table_functions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (5 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · WasmerCmd · ×1
  • WasmerCmd::run_inner (cognitive 29) lib/cli/src/commands/mod.rs:226 — WasmerCmd::run_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (5 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · RemoteRx · ×1
  • RemoteRx::poll (cognitive 29) lib/virtual-net/src/rx_tx.rs:537 — RemoteRx::poll has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 8 (25 pts), if/else 1 (3 pts), loops 1 (nesting depth added 19). 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 · Features · ×1
  • Features::detect_from_wasm (cognitive 28) lib/types/src/features.rs:358 — Features::detect_from_wasm has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 3, loops 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 · OffloadedFile · ×1
  • OffloadedFile::write (cognitive 28) lib/virtual-fs/src/mem_fs/offloaded_file.rs:238 — OffloadedFile::write has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (5 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasiEnvBuilder · ×1
  • WasiEnvBuilder::build_init (cognitive 28) lib/wasix/src/state/builder.rs:884 — WasiEnvBuilder::build_init has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 7 (8 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasiProcessInner · ×1
  • WasiProcessInner::maybe_checkpoint (cognitive 26) lib/wasix/src/os/task/process.rs:226 — WasiProcessInner::maybe_checkpoint has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalRwLockInner · ×1
  • LocalRwLockInner::poll_lock (cognitive 25) lib/api/src/entities/store/local_rwlock.rs:188 — LocalRwLockInner::poll_lock has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (25 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 · Target · ×1
  • Target::command (cognitive 25) lib/cli/src/commands/add.rs:155 — Target::command has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 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 · TokioTaskManager · ×1
  • TokioTaskManager::task_wasm (cognitive 25) lib/wasix/src/runtime/task_manager/tokio.rs:111 — TokioTaskManager::task_wasm has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 6 (11 pts), loops 1 (2 pts) (nesting depth added 13). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CmdAppSecretsImport · ×1
  • CmdAppSecretsImport::import (cognitive 24) lib/cli/src/commands/app/secrets/import.rs:128 — CmdAppSecretsImport::import has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunTapSocket · ×1
  • TunTapSocket::create (cognitive 24) lib/cli/src/net/tun.rs:42 — TunTapSocket::create has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 6 (8 pts), loops 3 (5 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 · ReqwestHttpClient · ×1
  • ReqwestHttpClient::request (cognitive 24) lib/wasix/src/http/reqwest.rs:41 — ReqwestHttpClient::request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (9 pts), loops 3 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasiThread · ×1
  • WasiThread::add_snapshot (cognitive 24) lib/wasix/src/os/task/thread.rs:433 — WasiThread::add_snapshot has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CmdCronInvocations · ×1
  • CmdCronInvocations::run_async (cognitive 23) lib/cli/src/commands/cron.rs:161 — CmdCronInvocations::run_async has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 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 · Mmap · ×1
  • Mmap::accessible_reserved (cognitive 23) lib/vm/src/mmap.rs:69 — Mmap::accessible_reserved has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MachineRiscv · ×1
  • MachineRiscv::location_to_reg (cognitive 22) lib/compiler-singlepass/src/machine_riscv.rs:136 — MachineRiscv::location_to_reg has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 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 · Manifest · ×1
  • Manifest::validate (cognitive 22) lib/config/src/package/mod.rs:805 — Manifest::validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OverlayFileSystem · ×1
  • OverlayFileSystem::open (cognitive 22) lib/virtual-fs/src/overlay_fs.rs:619 — OverlayFileSystem::open has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (4 pts), boolean chains 3, loops 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 · CmdAppList · ×1
  • CmdAppList::run_async (cognitive 21) lib/cli/src/commands/app/list.rs:56 — CmdAppList::run_async has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 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.
D2 · Cognitive Complexity · GetOrSet · ×1
  • GetOrSet::execute (cognitive 21) lib/cli/src/commands/config.rs:239 — GetOrSet::execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 3 (5 pts), boolean chains 2 (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 · LoopbackNetworking · ×1
  • LoopbackNetworking::allocate_tcp_bind_addr (cognitive 21) lib/virtual-net/src/loopback.rs:82 — LoopbackNetworking::allocate_tcp_bind_addr has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilteredJournalTx · ×1
  • FilteredJournalTx::write (cognitive 20) lib/journal/src/concrete/filter.rs:227 — FilteredJournalTx::write has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MachineX86_64 · ×1
  • MachineX86_64::gen_import_call_trampoline (cognitive 19) lib/compiler-singlepass/src/machine_x64.rs:8244 — MachineX86_64::gen_import_call_trampoline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 2 (6 pts), loops 2 (4 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 · CmdAppSecretsUpdate · ×1
  • CmdAppSecretsUpdate::update (cognitive 18) lib/cli/src/commands/app/secrets/update.rs:139 — CmdAppSecretsUpdate::update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlobalFrameInfo · ×1
  • GlobalFrameInfo::lookup_frame_info (cognitive 18) lib/compiler/src/engine/trap/frame_info.rs:109 — GlobalFrameInfo::lookup_frame_info has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AsyncifyPoller · ×1
  • AsyncifyPoller::poll (cognitive 18) lib/wasix/src/syscalls/mod.rs:396 — AsyncifyPoller::poll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasmerClient · ×1
  • WasmerClient::run_graphql_raw (cognitive 17) lib/backend-api/src/client.rs:121 — WasmerClient::run_graphql_raw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CmdSsh · ×1
  • CmdSsh::run_async (cognitive 17) lib/cli/src/commands/ssh.rs:47 — CmdSsh::run_async has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (3 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 · TunTapDriver · ×1
  • TunTapDriver::poll (cognitive 17) lib/cli/src/net/tun.rs:302 — TunTapDriver::poll has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 3 (6 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasmSourceMap · ×1
  • WasmSourceMap::new (cognitive 17) lib/compiler/src/source_map.rs:35 — WasmSourceMap::new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadConditions · ×1
  • ThreadConditions::do_wait (cognitive 17) lib/vm/src/threadconditions.rs:104 — ThreadConditions::do_wait has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), 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 · AsyncCallFuture · ×1
  • AsyncCallFuture::poll (cognitive 16) lib/api/src/backend/sys/async_runtime.rs:160 — AsyncCallFuture::poll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wasmer · ×1
  • wasmer::backend::js::utils::shared_handle::import_shared_objects (cognitive 16) lib/api/src/backend/js/utils/shared_handle.rs:207 — wasmer::backend::js::utils::shared_handle::import_shared_objects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Logout · ×1
  • Logout::run_async (cognitive 16) lib/cli/src/commands/auth/logout.rs:27 — Logout::run_async has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indented · ×1
  • Indented::write_str (cognitive 16) lib/cli/src/error.rs:115 — Indented::write_str has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CmdWasmer · ×1
  • CmdWasmer::run (cognitive 16) lib/wasix/src/os/command/builtins/cmd_wasmer.rs:94 — CmdWasmer::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (35 members, 24 shared lines) · ×1
  • Near-duplicate member family (35 members, 24 shared lines) lib/compiler-singlepass/src/machine_arm64.rs:3426 — lib/compiler-singlepass/src/machine_arm64.rs:3426-3474 | lib/compiler-singlepass/src/machine_arm64.rs:3487-3535 | lib/compiler-singlepass/src/machine_arm64.rs:3548-3596 | lib/compiler-singlepass/src/machine_arm64.rs:3609-3657 | lib/compiler-singlepass/src/machine_arm64.rs:3670-3718 | lib/compiler-singlepass/src/machine_arm64.rs:3731-3779 | lib/compiler-singlepass/src/machine_arm64.rs:3792-3840 | lib/compiler-singlepass/src/machine_arm64.rs:3853-3901 | lib/compiler-singlepass/src/machine_arm64.rs:3914-3962 | lib/compiler-singlepass/src/machine_arm64.rs:3975-4023 | lib/compiler-singlepass/src/machine_arm64.rs:4036-4084 | lib/compiler-singlepass/src/machine_arm64.rs:4097-4145 | lib/compiler-singlepass/src/machine_arm64.rs:4158-4206 | lib/compiler-singlepass/src/machine_arm64.rs:4219-4267 | lib/compiler-singlepass/src/machine_arm64.rs:4280-4328 | lib/compiler-singlepass/src/machine_arm64.rs:5737-5785 | lib/compiler-singlepass/src/machine_arm64.rs:5798-5846 | lib/compiler-singlepass/src/machine_arm64.rs:5859-5907 | lib/compiler-singlepass/src/machine_arm64.rs:5920-5968 | lib/compiler-singlepass/src/machine_arm64.rs:5981-6029 | lib/compiler-singlepass/src/machine_arm64.rs:6042-6090 | lib/compiler-singlepass/src/machine_arm64.rs:6103-6151 | lib/compiler-singlepass/src/machine_arm64.rs:6164-6212 | lib/compiler-singlepass/src/machine_arm64.rs:6225-6273 | lib/compiler-singlepass/src/machine_arm64.rs:6286-6334 | lib/compiler-singlepass/src/machine_arm64.rs:6347-6395 | lib/compiler-singlepass/src/machine_arm64.rs:6408-6456 | lib/compiler-singlepass/src/machine_arm64.rs:6469-6517 | lib/compiler-singlepass/src/machine_arm64.rs:6530-6578 | lib/compiler-singlepass/src/machine_arm64.rs:6591-6639 | lib/compiler-singlepass/src/machine_arm64.rs:6652-6700 | lib/compiler-singlepass/src/machine_arm64.rs:6713-6761 | lib/compiler-singlepass/src/machine_arm64.rs:6774-6822 | lib/compiler-singlepass/src/machine_arm64.rs:6835-6883 | lib/compiler-singlepass/src/machine_arm64.rs:6896-6944 — These 35 members are variants of one another: a block of 24 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 35 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 35 times.
D4 · Code Duplication · Near-duplicate member family (24 members, 31 shared lines) · ×1
  • Near-duplicate member family (24 members, 31 shared lines) lib/compiler-singlepass/src/machine_arm64.rs:5737 — lib/compiler-singlepass/src/machine_arm64.rs:5737-5785 | lib/compiler-singlepass/src/machine_arm64.rs:5798-5846 | lib/compiler-singlepass/src/machine_arm64.rs:5859-5907 | lib/compiler-singlepass/src/machine_arm64.rs:5920-5968 | lib/compiler-singlepass/src/machine_arm64.rs:5981-6029 | lib/compiler-singlepass/src/machine_arm64.rs:6042-6090 | lib/compiler-singlepass/src/machine_arm64.rs:6103-6151 | lib/compiler-singlepass/src/machine_arm64.rs:6164-6212 | lib/compiler-singlepass/src/machine_arm64.rs:6225-6273 | lib/compiler-singlepass/src/machine_arm64.rs:6286-6334 | lib/compiler-singlepass/src/machine_arm64.rs:6347-6395 | lib/compiler-singlepass/src/machine_arm64.rs:6408-6456 | lib/compiler-singlepass/src/machine_arm64.rs:6469-6517 | lib/compiler-singlepass/src/machine_arm64.rs:6530-6578 | lib/compiler-singlepass/src/machine_arm64.rs:6591-6639 | lib/compiler-singlepass/src/machine_arm64.rs:6652-6700 | lib/compiler-singlepass/src/machine_arm64.rs:6713-6761 | lib/compiler-singlepass/src/machine_arm64.rs:6774-6822 | lib/compiler-singlepass/src/machine_arm64.rs:6835-6883 | lib/compiler-singlepass/src/machine_arm64.rs:6896-6944 | lib/compiler-singlepass/src/machine_arm64.rs:6957-7002 | lib/compiler-singlepass/src/machine_arm64.rs:7015-7060 | lib/compiler-singlepass/src/machine_arm64.rs:7073-7118 | lib/compiler-singlepass/src/machine_arm64.rs:7131-7176 — These 24 members are variants of one another: a block of 31 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 24 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 24 times.
D4 · Code Duplication · Near-duplicate member family (18 members, 31 shared lines) · ×1
  • Near-duplicate member family (18 members, 31 shared lines) lib/compiler-singlepass/src/machine_arm64.rs:3426 — lib/compiler-singlepass/src/machine_arm64.rs:3426-3474 | lib/compiler-singlepass/src/machine_arm64.rs:3487-3535 | lib/compiler-singlepass/src/machine_arm64.rs:3548-3596 | lib/compiler-singlepass/src/machine_arm64.rs:3609-3657 | lib/compiler-singlepass/src/machine_arm64.rs:3670-3718 | lib/compiler-singlepass/src/machine_arm64.rs:3731-3779 | lib/compiler-singlepass/src/machine_arm64.rs:3792-3840 | lib/compiler-singlepass/src/machine_arm64.rs:3853-3901 | lib/compiler-singlepass/src/machine_arm64.rs:3914-3962 | lib/compiler-singlepass/src/machine_arm64.rs:3975-4023 | lib/compiler-singlepass/src/machine_arm64.rs:4036-4084 | lib/compiler-singlepass/src/machine_arm64.rs:4097-4145 | lib/compiler-singlepass/src/machine_arm64.rs:4158-4206 | lib/compiler-singlepass/src/machine_arm64.rs:4219-4267 | lib/compiler-singlepass/src/machine_arm64.rs:4280-4328 | lib/compiler-singlepass/src/machine_arm64.rs:4341-4386 | lib/compiler-singlepass/src/machine_arm64.rs:4399-4444 | lib/compiler-singlepass/src/machine_arm64.rs:4457-4502 — These 18 members are variants of one another: a block of 31 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 18 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 18 times.
D4 · Code Duplication · Near-duplicate member family (7 members, 26 shared lines) · ×1
  • Near-duplicate member family (7 members, 26 shared lines) lib/compiler-singlepass/src/machine_arm64.rs:4516 — lib/compiler-singlepass/src/machine_arm64.rs:4516-4565 | lib/compiler-singlepass/src/machine_arm64.rs:4579-4628 | lib/compiler-singlepass/src/machine_arm64.rs:4642-4691 | lib/compiler-singlepass/src/machine_arm64.rs:7190-7239 | lib/compiler-singlepass/src/machine_arm64.rs:7253-7302 | lib/compiler-singlepass/src/machine_arm64.rs:7316-7365 | lib/compiler-singlepass/src/machine_arm64.rs:7379-7428 — These 7 members are variants of one another: a block of 26 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 (7 members, 25 shared lines) · ×1
  • Near-duplicate member family (7 members, 25 shared lines) lib/compiler-singlepass/src/machine_arm64.rs:4341 — lib/compiler-singlepass/src/machine_arm64.rs:4341-4386 | lib/compiler-singlepass/src/machine_arm64.rs:4399-4444 | lib/compiler-singlepass/src/machine_arm64.rs:4457-4502 | lib/compiler-singlepass/src/machine_arm64.rs:6957-7002 | lib/compiler-singlepass/src/machine_arm64.rs:7015-7060 | lib/compiler-singlepass/src/machine_arm64.rs:7073-7118 | lib/compiler-singlepass/src/machine_arm64.rs:7131-7176 — These 7 members are variants of one another: a block of 25 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 (4 members, 18 shared lines) · ×1
  • Near-duplicate member family (4 members, 18 shared lines) lib/api/src/backend/js/entities/function/mod.rs:192 — lib/api/src/backend/js/entities/function/mod.rs:192-236 | lib/api/src/backend/js/entities/function/mod.rs:249-293 | lib/api/src/backend/sys/entities/function/mod.rs:304-346 | lib/api/src/backend/sys/entities/function/mod.rs:359-403 — These 4 members are variants of one another: a block of 18 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 14 shared lines) · ×1
  • Near-duplicate member family (4 members, 14 shared lines) lib/compiler-singlepass/src/machine_x64.rs:3020 — lib/compiler-singlepass/src/machine_x64.rs:3020-3073 | lib/compiler-singlepass/src/machine_x64.rs:3075-3127 | lib/compiler-singlepass/src/machine_x64.rs:4803-4856 | lib/compiler-singlepass/src/machine_x64.rs:4858-4910 — These 4 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 28 shared lines) · ×1
  • Near-duplicate member family (3 members, 28 shared lines) lib/compiler-singlepass/src/machine_riscv.rs:1379 — lib/compiler-singlepass/src/machine_riscv.rs:1379-1428 | lib/compiler-singlepass/src/machine_riscv.rs:1430-1485 | lib/compiler-singlepass/src/machine_riscv.rs:1487-1556 — These 3 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 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 (192 shared lines) · ×1
  • Near-duplicate member pair (192 shared lines) lib/compiler-llvm/src/translator/code.rs:7391 — lib/compiler-llvm/src/translator/code.rs:7391-8188 | lib/compiler-llvm/src/translator/code.rs:8195-8512 — These two members are variants of one another: 192 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 (74 shared lines) · ×1
  • Near-duplicate member pair (74 shared lines) lib/compiler-singlepass/src/machine_riscv.rs:326 — lib/compiler-singlepass/src/machine_riscv.rs:326-569 | lib/compiler-singlepass/src/machine_riscv.rs:578-774 — These two members are variants of one another: 74 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 (70 shared lines) · ×1
  • Near-duplicate member pair (70 shared lines) lib/api/src/backend/sys/entities/function/typed.rs:35 — lib/api/src/backend/sys/entities/function/typed.rs:35-137 | lib/api/src/backend/sys/entities/function/typed.rs:175-264 — These two members are variants of one another: 70 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (53 shared lines) · ×1
  • Near-duplicate member pair (53 shared lines) lib/api/src/backend/sys/entities/function/mod.rs:65 — lib/api/src/backend/sys/entities/function/mod.rs:65-135 | lib/api/src/backend/sys/entities/function/mod.rs:160-251 — 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 (47 shared lines) · ×1
  • Near-duplicate member pair (47 shared lines) lib/wasix/src/syscalls/wasix/sock_send.rs:90 — lib/wasix/src/syscalls/wasix/sock_send.rs:90-171 | lib/wasix/src/syscalls/wasix/sock_send_to.rs:88-185 — 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 (38 shared lines) · ×1
  • Near-duplicate member pair (38 shared lines) lib/virtual-net/src/rx_tx.rs:160 — lib/virtual-net/src/rx_tx.rs:160-325 | lib/virtual-net/src/rx_tx.rs:327-502 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (34 shared lines) · ×1
  • Near-duplicate member pair (34 shared lines) lib/api/src/backend/v8/entities/function/mod.rs:168 — lib/api/src/backend/v8/entities/function/mod.rs:168-232 | lib/api/src/backend/v8/entities/function/mod.rs:244-312 — These two members are variants of one another: 34 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (33 shared lines) · ×1
  • Near-duplicate member pair (33 shared lines) lib/wasix/src/lib.rs:408 — lib/wasix/src/lib.rs:408-459 | lib/wasix/src/lib.rs:464-516 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (28 shared lines) · ×1
  • Near-duplicate member pair (28 shared lines) lib/compiler-singlepass/src/machine_arm64.rs:2877 — lib/compiler-singlepass/src/machine_arm64.rs:2877-2956 | lib/compiler-singlepass/src/machine_arm64.rs:5060-5140 — These two members are variants of one another: 28 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (25 shared lines) · ×1
  • Near-duplicate member pair (25 shared lines) lib/compiler-singlepass/src/machine_x64.rs:670 — lib/compiler-singlepass/src/machine_x64.rs:670-713 | lib/compiler-singlepass/src/machine_x64.rs:816-859 — 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 · Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (16 members, 50+ identical tokens) lib/compiler-singlepass/src/machine_x64.rs:1056 — lib/compiler-singlepass/src/machine_x64.rs:1056-1143 | lib/compiler-singlepass/src/machine_x64.rs:1144-1210 | lib/compiler-singlepass/src/machine_x64.rs:1211-1257 | lib/compiler-singlepass/src/machine_x64.rs:1258-1290 | lib/compiler-singlepass/src/machine_x64.rs:1291-1349 | lib/compiler-singlepass/src/machine_x64.rs:1350-1394 | lib/compiler-singlepass/src/machine_x64.rs:1395-1435 | lib/compiler-singlepass/src/machine_x64.rs:1436-1468 | lib/compiler-singlepass/src/machine_x64.rs:1469-1556 | lib/compiler-singlepass/src/machine_x64.rs:1557-1623 | lib/compiler-singlepass/src/machine_x64.rs:1624-1670 | lib/compiler-singlepass/src/machine_x64.rs:1671-1702 | lib/compiler-singlepass/src/machine_x64.rs:1703-1749 | lib/compiler-singlepass/src/machine_x64.rs:1750-1782 | lib/compiler-singlepass/src/machine_x64.rs:1783-1822 | lib/compiler-singlepass/src/machine_x64.rs:1823-1854 — These 16 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 16 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 16 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) lib/compiler-singlepass/src/machine_arm64.rs:291 — lib/compiler-singlepass/src/machine_arm64.rs:291-399 | lib/compiler-singlepass/src/machine_arm64.rs:514-546 | lib/compiler-singlepass/src/machine_arm64.rs:552-584 | lib/compiler-singlepass/src/machine_arm64.rs:590-620 | lib/compiler-singlepass/src/machine_arm64.rs:626-656 | lib/compiler-singlepass/src/machine_arm64.rs:662-692 | lib/compiler-singlepass/src/machine_arm64.rs:698-728 | lib/compiler-singlepass/src/machine_arm64.rs:734-764 | lib/compiler-singlepass/src/machine_arm64.rs:765-794 | lib/compiler-singlepass/src/machine_arm64.rs:795-824 | lib/compiler-singlepass/src/machine_arm64.rs:825-852 | lib/compiler-singlepass/src/machine_arm64.rs:853-881 | lib/compiler-singlepass/src/machine_arm64.rs:2065-2146 — 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 · Edited copy of a member (148 corresponding lines) · ×1
  • Edited copy of a member (148 corresponding lines) lib/wasix/src/lib.rs:518 — lib/wasix/src/lib.rs:518-665 | lib/wasix/src/lib.rs:667-814 — These two members are one piece of code written twice and then edited apart: 148 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (129 corresponding lines) · ×1
  • Edited copy of a member (129 corresponding lines) lib/compiler-singlepass/src/emitter_arm64.rs:2954 — lib/compiler-singlepass/src/emitter_arm64.rs:2954-3106 | lib/compiler-singlepass/src/emitter_riscv.rs:1905-2033 — These two members are one piece of code written twice and then edited apart: 129 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (137 corresponding lines) · ×1
  • Edited copy of a member (137 corresponding lines) lib/compiler-singlepass/src/emitter_arm64.rs:2811 — lib/compiler-singlepass/src/emitter_arm64.rs:2811-2947 | lib/compiler-singlepass/src/emitter_riscv.rs:1754-1898 — These two members are one piece of code written twice and then edited apart: 137 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (145 corresponding lines) · ×1
  • Edited copy of a member (145 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:952 — lib/compiler-singlepass/src/machine_arm64.rs:952-1096 | lib/compiler-singlepass/src/machine_riscv.rs:909-1058 — These two members are one piece of code written twice and then edited apart: 145 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (122 corresponding lines) · ×1
  • Edited copy of a member (122 corresponding lines) lib/compiler-singlepass/src/emitter_riscv.rs:2042 — lib/compiler-singlepass/src/emitter_riscv.rs:2042-2190 | lib/compiler-singlepass/src/machine_x64.rs:8251-8372 — These two members are one piece of code written twice and then edited apart: 122 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (87 corresponding lines) · ×1
  • Edited copy of a member (87 corresponding lines) lib/wasix/src/runners/wasi.rs:358 — lib/wasix/src/runners/wasi.rs:358-444 | lib/wasix/src/runners/wasi.rs:451-558 — These two members are one piece of code written twice and then edited apart: 87 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) lib/api/src/backend/js/entities/module.rs:472 — lib/api/src/backend/js/entities/module.rs:472-539 | lib/api/src/backend/js/entities/module.rs:583-649 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:1366 — lib/compiler-singlepass/src/emitter_x64.rs:1366-1409 | lib/compiler-singlepass/src/emitter_x64.rs:1411-1452 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) lib/virtual-net/src/client.rs:144 — lib/virtual-net/src/client.rs:144-198 | lib/virtual-net/src/server.rs:114-166 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (107 corresponding lines) · ×1
  • Edited copy of a member (107 corresponding lines) lib/compiler-llvm/src/translator/code.rs:748 — lib/compiler-llvm/src/translator/code.rs:748-859 | lib/compiler-llvm/src/translator/code.rs:900-1006 — These two members are one piece of code written twice and then edited apart: 107 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) lib/wasix/src/syscalls/wasix/proc_exec3.rs:33 — lib/wasix/src/syscalls/wasix/proc_exec3.rs:33-81 | lib/wasix/src/syscalls/wasix/proc_exec4.rs:28-76 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) lib/wasix/src/syscalls/wasi/path_open.rs:40 — lib/wasix/src/syscalls/wasi/path_open.rs:40-112 | lib/wasix/src/syscalls/wasix/path_open2.rs:43-115 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2253 — lib/compiler-singlepass/src/machine_arm64.rs:2253-2294 | lib/compiler-singlepass/src/machine_riscv.rs:2618-2653 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (70 corresponding lines) · ×1
  • Edited copy of a member (70 corresponding lines) lib/api/src/utils/polyfill.rs:604 — lib/api/src/utils/polyfill.rs:604-673 | lib/compiler/src/translator/sections.rs:117-193 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) lib/compiler-llvm/src/translator/trampoline.rs:83 — lib/compiler-llvm/src/translator/trampoline.rs:83-153 | lib/compiler-llvm/src/translator/trampoline.rs:250-303 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (79 corresponding lines) · ×1
  • Edited copy of a member (79 corresponding lines) lib/wasix/src/syscalls/wasix/fd_pipe.rs:56 — lib/wasix/src/syscalls/wasix/fd_pipe.rs:56-137 | lib/wasix/src/syscalls/wasix/sock_pair.rs:81-159 — These two members are one piece of code written twice and then edited apart: 79 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 35+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2608 — lib/compiler-singlepass/src/machine_arm64.rs:2608-2642 | lib/compiler-singlepass/src/machine_arm64.rs:4791-4825 | lib/compiler-singlepass/src/machine_riscv.rs:3011-3050 | lib/compiler-singlepass/src/machine_riscv.rs:4334-4374 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) lib/wasix/src/syscalls/wasix/port_addr_list.rs:22 — lib/wasix/src/syscalls/wasix/port_addr_list.rs:22-53 | lib/wasix/src/syscalls/wasix/port_route_list.rs:18-61 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) lib/cli/src/commands/app/create.rs:372 — lib/cli/src/commands/app/create.rs:372-436 | lib/cli/src/commands/app/create.rs:460-518 — 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 copies of one member (4 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 31+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:2650 — lib/compiler-singlepass/src/machine_arm64.rs:2650-2680 | lib/compiler-singlepass/src/machine_arm64.rs:2688-2718 | lib/compiler-singlepass/src/machine_arm64.rs:4833-4863 | lib/compiler-singlepass/src/machine_arm64.rs:4871-4901 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) lib/api/src/utils/polyfill.rs:493 — lib/api/src/utils/polyfill.rs:493-527 | lib/compiler/src/translator/sections.rs:286-330 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) lib/wasix/src/syscalls/wasix/sock_send.rs:27 — lib/wasix/src/syscalls/wasix/sock_send.rs:27-83 | lib/wasix/src/syscalls/wasix/sock_send_to.rs:29-80 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) lib/cli/src/commands/app/secrets/create.rs:95 — lib/cli/src/commands/app/secrets/create.rs:95-143 | lib/cli/src/commands/app/secrets/import.rs:87-126 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) lib/compiler/src/engine/artifact.rs:376 — lib/compiler/src/engine/artifact.rs:376-414 | lib/compiler/src/engine/artifact.rs:427-465 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 23+ corresponding lines) lib/compiler-singlepass/src/machine_riscv.rs:2980 — lib/compiler-singlepass/src/machine_riscv.rs:2980-3002 | lib/compiler-singlepass/src/machine_riscv.rs:3058-3080 | lib/compiler-singlepass/src/machine_riscv.rs:3088-3110 | lib/compiler-singlepass/src/machine_riscv.rs:4303-4325 | lib/compiler-singlepass/src/machine_riscv.rs:4382-4404 | lib/compiler-singlepass/src/machine_riscv.rs:4412-4434 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 42+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 42+ corresponding lines) lib/compiler-singlepass/src/arm64_decl.rs:351 — lib/compiler-singlepass/src/arm64_decl.rs:351-408 | lib/compiler-singlepass/src/riscv_decl.rs:386-436 | lib/compiler-singlepass/src/x64_decl.rs:245-286 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 42 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 25+ corresponding lines) lib/api/src/entities/module/inner.rs:165 — lib/api/src/entities/module/inner.rs:165-198 | lib/api/src/entities/module/inner.rs:307-337 | lib/api/src/entities/module/inner.rs:368-392 | lib/api/src/entities/module/inner.rs:415-445 | lib/api/src/entities/module/inner.rs:470-500 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) lib/compiler-singlepass/src/machine.rs:2361 — lib/compiler-singlepass/src/machine.rs:2361-2386 | lib/compiler-singlepass/src/machine.rs:2396-2436 | lib/compiler-singlepass/src/machine.rs:2446-2494 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) lib/wasix/src/syscalls/wasi/path_create_directory.rs:28 — lib/wasix/src/syscalls/wasi/path_create_directory.rs:28-49 | lib/wasix/src/syscalls/wasi/path_remove_directory.rs:13-40 | lib/wasix/src/syscalls/wasix/chdir.rs:11-31 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 23+ corresponding lines) lib/wasix/src/syscalls/wasix/sock_join_multicast_v4.rs:18 — lib/wasix/src/syscalls/wasix/sock_join_multicast_v4.rs:18-41 | lib/wasix/src/syscalls/wasix/sock_join_multicast_v6.rs:18-40 | lib/wasix/src/syscalls/wasix/sock_leave_multicast_v4.rs:18-41 | lib/wasix/src/syscalls/wasix/sock_leave_multicast_v6.rs:18-40 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 16+ corresponding lines) lib/api/src/entities/external/extref/inner.rs:19 — lib/api/src/entities/external/extref/inner.rs:19-34 | lib/api/src/entities/function/inner.rs:182-203 | lib/api/src/entities/function/inner.rs:502-526 | lib/api/src/entities/memory/inner.rs:31-46 | lib/api/src/entities/memory/inner.rs:192-207 | lib/api/src/entities/memory/view/inner.rs:24-42 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 24+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:4228 — lib/compiler-singlepass/src/machine_x64.rs:4228-4251 | lib/compiler-singlepass/src/machine_x64.rs:6352-6375 | lib/compiler-singlepass/src/machine_x64.rs:6388-6420 | lib/compiler-singlepass/src/machine_x64.rs:6433-6465 | lib/compiler-singlepass/src/machine_x64.rs:6478-6510 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) lib/virtual-fs/src/overlay_fs.rs:278 — lib/virtual-fs/src/overlay_fs.rs:278-305 | lib/virtual-fs/src/overlay_fs.rs:525-552 | lib/virtual-fs/src/overlay_fs.rs:554-581 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 18+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:7549 — lib/compiler-singlepass/src/machine_arm64.rs:7549-7569 | lib/compiler-singlepass/src/machine_arm64.rs:7576-7596 | lib/compiler-singlepass/src/machine_arm64.rs:7603-7623 | lib/compiler-singlepass/src/machine_arm64.rs:7630-7650 | lib/compiler-singlepass/src/machine_riscv.rs:1629-1646 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 16+ corresponding lines) lib/api/src/entities/external/extref/inner.rs:65 — lib/api/src/entities/external/extref/inner.rs:65-89 | lib/api/src/entities/function/env/inner.rs:42-59 | lib/api/src/entities/function/inner.rs:107-128 | lib/api/src/entities/function/inner.rs:137-152 | lib/api/src/entities/function/inner.rs:647-662 | lib/api/src/entities/global/inner.rs:172-187 | lib/api/src/entities/memory/inner.rs:50-74 | lib/api/src/entities/tag/inner.rs:51-66 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:408 — lib/compiler-singlepass/src/machine_arm64.rs:408-425 | lib/compiler-singlepass/src/machine_arm64.rs:433-445 | lib/compiler-singlepass/src/machine_riscv.rs:261-273 | lib/compiler-singlepass/src/machine_riscv.rs:282-294 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 20+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:2785 — lib/compiler-singlepass/src/machine_x64.rs:2785-2805 | lib/compiler-singlepass/src/machine_x64.rs:2814-2833 | lib/compiler-singlepass/src/machine_x64.rs:2841-2861 | lib/compiler-singlepass/src/machine_x64.rs:4568-4588 | lib/compiler-singlepass/src/machine_x64.rs:4597-4616 | lib/compiler-singlepass/src/machine_x64.rs:4624-4644 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) lib/wasix/src/syscalls/wasi/fd_advise.rs:22 — lib/wasix/src/syscalls/wasi/fd_advise.rs:22-37 | lib/wasix/src/syscalls/wasi/fd_allocate.rs:19-34 | lib/wasix/src/syscalls/wasi/fd_fdstat_set_rights.rs:19-40 | lib/wasix/src/syscalls/wasi/fd_filestat_set_size.rs:16-31 | lib/wasix/src/syscalls/wasi/fd_filestat_set_times.rs:22-41 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) lib/virtual-fs/src/mount_fs.rs:511 — lib/virtual-fs/src/mount_fs.rs:511-528 | lib/virtual-fs/src/mount_fs.rs:638-657 | lib/virtual-fs/src/mount_fs.rs:753-772 | lib/virtual-fs/src/mount_fs.rs:791-815 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) lib/compiler/src/object/module.rs:723 — lib/compiler/src/object/module.rs:723-740 | lib/compiler/src/object/module.rs:748-764 | lib/compiler/src/object/module.rs:772-789 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 14+ corresponding lines) lib/compiler-cranelift/src/func_environ.rs:1028 — lib/compiler-cranelift/src/func_environ.rs:1028-1042 | lib/compiler-cranelift/src/func_environ.rs:1044-1057 | lib/compiler-cranelift/src/func_environ.rs:1073-1090 | lib/compiler-cranelift/src/func_environ.rs:1095-1112 | lib/compiler-cranelift/src/func_environ.rs:1117-1130 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) lib/wasix/src/net/socket.rs:1019 — lib/wasix/src/net/socket.rs:1019-1035 | lib/wasix/src/net/socket.rs:1037-1050 | lib/wasix/src/net/socket.rs:1052-1068 | lib/wasix/src/net/socket.rs:1070-1083 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 16+ corresponding lines) lib/cli/src/types.rs:238 — lib/cli/src/types.rs:238-253 | lib/cli/src/types.rs:399-414 | lib/cli/src/types.rs:549-566 | lib/cli/src/types.rs:580-595 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) lib/vm/src/libcalls.rs:264 — lib/vm/src/libcalls.rs:264-281 | lib/vm/src/libcalls.rs:376-394 | lib/vm/src/libcalls.rs:407-423 | lib/vm/src/libcalls.rs:436-453 | lib/vm/src/libcalls.rs:466-482 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 20+ corresponding lines) lib/vm/src/instance/mod.rs:922 — lib/vm/src/instance/mod.rs:922-941 | lib/vm/src/instance/mod.rs:950-970 | lib/vm/src/instance/mod.rs:979-998 | lib/vm/src/instance/mod.rs:1007-1027 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) lib/wasix/src/net/socket.rs:1085 — lib/wasix/src/net/socket.rs:1085-1096 | lib/wasix/src/net/socket.rs:1098-1108 | lib/wasix/src/net/socket.rs:1220-1237 | lib/wasix/src/net/socket.rs:1239-1250 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 10+ corresponding lines) lib/wasix/src/os/tty/tty_sys.rs:94 — lib/wasix/src/os/tty/tty_sys.rs:94-104 | lib/wasix/src/os/tty/tty_sys.rs:163-182 | lib/wasix/src/os/tty/tty_sys.rs:184-193 | lib/wasix/src/os/tty/tty_sys.rs:195-204 | lib/wasix/src/os/tty/tty_sys.rs:219-228 | lib/wasix/src/os/tty/tty_sys.rs:230-239 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 19+ corresponding lines) lib/compiler-singlepass/src/machine_arm64.rs:7466 — lib/compiler-singlepass/src/machine_arm64.rs:7466-7485 | lib/compiler-singlepass/src/machine_arm64.rs:7523-7542 | lib/compiler-singlepass/src/machine_riscv.rs:5899-5917 | lib/compiler-singlepass/src/machine_riscv.rs:5954-5972 | lib/compiler-singlepass/src/machine_x64.rs:6789-6813 | lib/compiler-singlepass/src/machine_x64.rs:6858-6882 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 19+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:6104 — lib/compiler-singlepass/src/machine_x64.rs:6104-6122 | lib/compiler-singlepass/src/machine_x64.rs:6135-6153 | lib/compiler-singlepass/src/machine_x64.rs:6166-6184 | lib/compiler-singlepass/src/machine_x64.rs:6197-6215 | lib/compiler-singlepass/src/machine_x64.rs:6228-6246 | lib/compiler-singlepass/src/machine_x64.rs:6259-6277 | lib/compiler-singlepass/src/machine_x64.rs:6290-6308 | lib/compiler-singlepass/src/machine_x64.rs:6321-6339 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 20+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:3940 — lib/compiler-singlepass/src/machine_x64.rs:3940-3959 | lib/compiler-singlepass/src/machine_x64.rs:3972-3991 | lib/compiler-singlepass/src/machine_x64.rs:4004-4023 | lib/compiler-singlepass/src/machine_x64.rs:5976-5995 | lib/compiler-singlepass/src/machine_x64.rs:6008-6027 | lib/compiler-singlepass/src/machine_x64.rs:6040-6059 | lib/compiler-singlepass/src/machine_x64.rs:6072-6091 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 15+ corresponding lines) lib/compiler-cranelift/src/func_environ.rs:574 — lib/compiler-cranelift/src/func_environ.rs:574-588 | lib/compiler-cranelift/src/func_environ.rs:648-662 | lib/compiler-cranelift/src/func_environ.rs:921-935 | lib/compiler-cranelift/src/func_environ.rs:966-980 | lib/compiler-cranelift/src/func_environ.rs:1009-1023 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) lib/compiler-singlepass/src/emitter_x64.rs:2166 — lib/compiler-singlepass/src/emitter_x64.rs:2166-2174 | lib/compiler-singlepass/src/emitter_x64.rs:2176-2184 | lib/compiler-singlepass/src/emitter_x64.rs:2186-2194 | lib/compiler-singlepass/src/emitter_x64.rs:2196-2204 | lib/compiler-singlepass/src/emitter_x64.rs:2206-2214 | lib/compiler-singlepass/src/emitter_x64.rs:2216-2224 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 9+ corresponding lines) lib/wasix/src/fs/inode_guard.rs:586 — lib/wasix/src/fs/inode_guard.rs:586-594 | lib/wasix/src/fs/inode_guard.rs:595-603 | lib/wasix/src/fs/inode_guard.rs:611-619 | lib/wasix/src/fs/inode_guard.rs:620-628 | lib/wasix/src/fs/inode_guard.rs:629-637 | lib/wasix/src/fs/inode_guard.rs:642-650 | lib/wasix/src/fs/inode_guard.rs:667-675 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 14+ corresponding lines) lib/compiler-cranelift/src/func_environ.rs:512 — lib/compiler-cranelift/src/func_environ.rs:512-528 | lib/compiler-cranelift/src/func_environ.rs:552-566 | lib/compiler-cranelift/src/func_environ.rs:590-603 | lib/compiler-cranelift/src/func_environ.rs:627-640 | lib/compiler-cranelift/src/func_environ.rs:892-912 | lib/compiler-cranelift/src/func_environ.rs:937-957 | lib/compiler-cranelift/src/func_environ.rs:982-1000 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 14+ corresponding lines) lib/vm/src/libcalls.rs:748 — lib/vm/src/libcalls.rs:748-761 | lib/vm/src/libcalls.rs:775-788 | lib/vm/src/libcalls.rs:802-815 | lib/vm/src/libcalls.rs:829-842 | lib/vm/src/libcalls.rs:855-868 | lib/vm/src/libcalls.rs:881-894 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) lib/virtual-fs/src/limiter.rs:56 — lib/virtual-fs/src/limiter.rs:56-66 | lib/virtual-fs/src/limiter.rs:84-92 | lib/virtual-fs/src/limiter.rs:94-102 | lib/virtual-fs/src/limiter.rs:104-112 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) lib/wasix/src/syscalls/wasix/port_bridge.rs:61 — lib/wasix/src/syscalls/wasix/port_bridge.rs:61-71 | lib/wasix/src/syscalls/wasix/port_dhcp_acquire.rs:25-33 | lib/wasix/src/syscalls/wasix/port_unbridge.rs:25-32 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 22+ corresponding lines) lib/compiler-singlepass/src/machine_x64.rs:3260 — lib/compiler-singlepass/src/machine_x64.rs:3260-3281 | lib/compiler-singlepass/src/machine_x64.rs:3326-3347 | lib/compiler-singlepass/src/machine_x64.rs:5043-5064 | lib/compiler-singlepass/src/machine_x64.rs:5109-5130 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 8+ corresponding lines) lib/wasix/src/syscalls/wasix/port_addr_add.rs:41 — lib/wasix/src/syscalls/wasix/port_addr_add.rs:41-50 | lib/wasix/src/syscalls/wasix/port_addr_clear.rs:25-32 | lib/wasix/src/syscalls/wasix/port_addr_remove.rs:39-46 | lib/wasix/src/syscalls/wasix/port_gateway_set.rs:39-46 | lib/wasix/src/syscalls/wasix/port_route_add.rs:72-82 | lib/wasix/src/syscalls/wasix/port_route_clear.rs:25-32 | lib/wasix/src/syscalls/wasix/port_route_remove.rs:35-43 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 7+ corresponding lines) lib/c-api-imports/src/lib.rs:1658 — lib/c-api-imports/src/lib.rs:1658-1664 | lib/c-api-imports/src/lib.rs:1666-1672 | lib/c-api-imports/src/lib.rs:1674-1680 | lib/c-api-imports/src/lib.rs:1682-1688 | lib/c-api-imports/src/lib.rs:1690-1697 | lib/c-api-imports/src/lib.rs:1713-1720 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) lib/api/src/entities/store/context.rs:317 — lib/api/src/entities/store/context.rs:317-329 | lib/api/src/entities/store/context.rs:339-351 | lib/api/src/entities/store/context.rs:358-367 | lib/api/src/entities/store/context.rs:370-382 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 12+ corresponding lines) lib/vm/src/libcalls.rs:210 — lib/vm/src/libcalls.rs:210-223 | lib/vm/src/libcalls.rs:238-250 | lib/vm/src/libcalls.rs:531-543 | lib/vm/src/libcalls.rs:557-568 | lib/vm/src/libcalls.rs:582-593 | lib/vm/src/libcalls.rs:608-620 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) lib/cli/src/commands/app/deployments/get.rs:22 — lib/cli/src/commands/app/deployments/get.rs:22-28 | lib/cli/src/commands/domain/list.rs:22-35 | lib/cli/src/commands/namespace/get.rs:22-32 | lib/cli/src/commands/namespace/list.rs:16-24 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) lib/compiler-singlepass/src/arm64_decl.rs:233 — lib/compiler-singlepass/src/arm64_decl.rs:233-238 | lib/compiler-singlepass/src/riscv_decl.rs:272-277 | lib/compiler-singlepass/src/x64_decl.rs:126-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) lib/config/src/app/job.rs:203 — lib/config/src/app/job.rs:203-206 | lib/config/src/app/pretty_duration.rs:309-312 | lib/config/src/package/mod.rs:343-346 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (62 lines × 2) · ×1
  • Duplicated block (62 lines × 2) lib/wasix/src/fs/inode_guard.rs:215 — lib/wasix/src/fs/inode_guard.rs:215-276 | lib/wasix/src/fs/inode_guard.rs:314-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/fs/inode_guard.rs:215` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (58 lines × 2) · ×1
  • Duplicated block (58 lines × 2) lib/wasix/src/syscalls/wasi/fd_write.rs:416 — lib/wasix/src/syscalls/wasi/fd_write.rs:416-473 | lib/wasix/src/syscalls/wasi/fd_write.rs:475-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/wasix/src/syscalls/wasi/fd_write.rs:535` calls `Ok`, `Err` and `lib/wasix/src/syscalls/wasi/fd_write.rs:474` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) lib/wasix/src/syscalls/wasix/proc_spawn2.rs:53 — lib/wasix/src/syscalls/wasix/proc_spawn2.rs:53-96 | lib/wasix/src/syscalls/wasix/proc_spawn3.rs:44-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/proc_spawn2.rs:53` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38–41 lines × 2) · ×1
  • Duplicated block (38–41 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs:95 — lib/api/src/backend/sys/entities/function/mod.rs:95-135 | lib/api/src/backend/sys/entities/function/mod.rs:214-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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/mod.rs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) lib/wasix/src/syscalls/wasi/fd_read.rs:297 — lib/wasix/src/syscalls/wasi/fd_read.rs:297-349 | lib/wasix/src/syscalls/wasi/fd_read.rs:351-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:381 — lib/compiler-singlepass/src/machine_riscv.rs:381-414 | lib/compiler-singlepass/src/machine_riscv.rs:656-689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:381` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) lib/compiler-singlepass/src/machine_riscv.rs:1431 — lib/compiler-singlepass/src/machine_riscv.rs:1431-1463 | lib/compiler-singlepass/src/machine_riscv.rs:1488-1521 — both copies are in the same file, so extract the 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) lib/backend-api/src/subscription.rs:26 — lib/backend-api/src/subscription.rs:26-58 | lib/backend-api/src/subscription.rs:80-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (32 lines × 4) · ×1
  • Duplicated block (32 lines × 4) lib/compiler-singlepass/src/codegen.rs:2828 — lib/compiler-singlepass/src/codegen.rs:2828-2859 | lib/compiler-singlepass/src/codegen.rs:2898-2929 | lib/compiler-singlepass/src/codegen.rs:5733-5764 | lib/compiler-singlepass/src/codegen.rs:5815-5846 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:2828` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) lib/api/src/utils/polyfill.rs:637 — lib/api/src/utils/polyfill.rs:637-668 | lib/compiler/src/translator/sections.rs:156-187 — before extracting anything, compare `lib/api/src/utils/polyfill.rs` and `lib/compiler/src/translator/sections.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/utils/polyfill.rs:637` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/api/src/utils/polyfill.rs:669` calls `FuncExact` and `lib/compiler/src/translator/sections.rs:188` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (29–31 lines × 2) · ×1
  • Duplicated block (29–31 lines × 2) lib/compiler-singlepass/src/compiler.rs:301 — lib/compiler-singlepass/src/compiler.rs:301-331 | lib/compiler-singlepass/src/compiler.rs:347-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/compiler.rs:301` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) lib/compiler-cranelift/src/func_environ.rs:1201 — lib/compiler-cranelift/src/func_environ.rs:1201-1230 | lib/compiler-cranelift/src/func_environ.rs:1271-1301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-cranelift/src/func_environ.rs:1268` calls `current_block`, `expect`, `insert_block_after` and `lib/compiler-cranelift/src/func_environ.rs:1200` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–29 lines × 2) · ×1
  • Duplicated block (17–29 lines × 2) lib/compiler-llvm/src/translator/intrinsics.rs:1497 — lib/compiler-llvm/src/translator/intrinsics.rs:1497-1525 | lib/compiler-llvm/src/translator/trampoline.rs:492-508 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/intrinsics.rs:1497` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) lib/wasix/src/runtime/resolver/backend_source.rs:84 — lib/wasix/src/runtime/resolver/backend_source.rs:84-111 | lib/wasix/src/runtime/resolver/backend_source.rs:146-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/runtime/resolver/backend_source.rs:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26 lines × 4) · ×1
  • Duplicated block (26 lines × 4) lib/compiler-singlepass/src/machine_x64.rs:6527 — lib/compiler-singlepass/src/machine_x64.rs:6527-6552 | lib/compiler-singlepass/src/machine_x64.rs:6581-6606 | lib/compiler-singlepass/src/machine_x64.rs:6641-6666 | lib/compiler-singlepass/src/machine_x64.rs:6701-6726 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:6527` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) lib/compiler-singlepass/src/machine_x64.rs:4358 — lib/compiler-singlepass/src/machine_x64.rs:4358-4383 | lib/compiler-singlepass/src/machine_x64.rs:4412-4437 | lib/compiler-singlepass/src/machine_x64.rs:4472-4497 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:4358` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (24–25 lines × 3) · ×1
  • Duplicated block (24–25 lines × 3) lib/cli/src/commands/app/logs.rs:140 — lib/cli/src/commands/app/logs.rs:140-163 | lib/cli/src/commands/app/logs.rs:175-198 | lib/cli/src/commands/app/logs.rs:209-233 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/logs.rs:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/cli/src/commands/app/logs.rs:139` calls `clone` and `lib/cli/src/commands/app/logs.rs:208` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) lib/api/src/backend/js/entities/module.rs:508 — lib/api/src/backend/js/entities/module.rs:508-532 | lib/api/src/backend/js/entities/module.rs:620-643 — both copies are in the same file, so extract the 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) · ×1
  • Duplicated block (25 lines × 2) lib/compiler-llvm/src/translator/code.rs:12150 — lib/compiler-llvm/src/translator/code.rs:12150-12174 | lib/compiler-llvm/src/translator/code.rs:12188-12212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:12150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) lib/cli/src/commands/app/secrets/create.rs:173 — lib/cli/src/commands/app/secrets/create.rs:173-196 | lib/cli/src/commands/app/secrets/import.rs:168-191 | lib/cli/src/commands/app/secrets/update.rs:167-190 — before extracting anything, compare `lib/cli/src/commands/app/secrets/create.rs` and `lib/cli/src/commands/app/secrets/update.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/secrets/create.rs:173` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–24 lines × 2) · ×1
  • Duplicated block (19–24 lines × 2) lib/cli/src/commands/app/deploy.rs:331 — lib/cli/src/commands/app/deploy.rs:331-349 | lib/cli/src/commands/app/deploy.rs:994-1017 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/app/deploy.rs:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) lib/backend-api/src/query.rs:281 — lib/backend-api/src/query.rs:281-303 | lib/backend-api/src/query.rs:657-679 | lib/backend-api/src/query.rs:713-735 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/backend-api/src/query.rs:281` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–23 lines × 2) · ×1
  • Duplicated block (12–23 lines × 2) lib/compiler-llvm/src/translator/intrinsics.rs:1512 — lib/compiler-llvm/src/translator/intrinsics.rs:1512-1534 | lib/compiler-llvm/src/translator/intrinsics.rs:1617-1628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/intrinsics.rs:1512` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) lib/wasix/src/net/socket.rs:332 — lib/wasix/src/net/socket.rs:332-352 | lib/wasix/src/net/socket.rs:373-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:373` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) lib/wasix/src/syscalls/wasix/fd_pipe.rs:101 — lib/wasix/src/syscalls/wasix/fd_pipe.rs:101-123 | lib/wasix/src/syscalls/wasix/sock_pair.rs:122-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/fd_pipe.rs:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) lib/api/src/backend/sys/entities/function/mod.rs:313 — lib/api/src/backend/sys/entities/function/mod.rs:313-333 | lib/api/src/backend/sys/entities/function/mod.rs:366-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/sys/entities/function/mod.rs:313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–22 lines × 2) · ×1
  • Duplicated block (17–22 lines × 2) lib/compiler-cranelift/src/translator/code_translator.rs:398 — lib/compiler-cranelift/src/translator/code_translator.rs:398-419 | lib/compiler-cranelift/src/translator/code_translator.rs:2691-2707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/translator/code_translator.rs:398` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (18–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) lib/wasix/src/net/socket.rs:451 — lib/wasix/src/net/socket.rs:451-472 | lib/wasix/src/net/socket.rs:485-502 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:451` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 5) · ×1
  • Duplicated block (20–21 lines × 5) lib/compiler-llvm/src/translator/intrinsics.rs:2024 — lib/compiler-llvm/src/translator/intrinsics.rs:2024-2043 | lib/compiler-llvm/src/translator/intrinsics.rs:2070-2089 | lib/compiler-llvm/src/translator/intrinsics.rs:2115-2135 | lib/compiler-llvm/src/translator/intrinsics.rs:2162-2181 | lib/compiler-llvm/src/translator/intrinsics.rs:2207-2227 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/intrinsics.rs:2024` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) lib/compiler-llvm/src/translator/code.rs:2355 — lib/compiler-llvm/src/translator/code.rs:2355-2375 | lib/compiler-llvm/src/translator/code.rs:3490-3507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:2355` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) lib/compiler-singlepass/src/codegen.rs:2945 — lib/compiler-singlepass/src/codegen.rs:2945-2964 | lib/compiler-singlepass/src/codegen.rs:5889-5908 | lib/compiler-singlepass/src/codegen.rs:5939-5958 | lib/compiler-singlepass/src/codegen.rs:5988-6007 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:2945` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) lib/api/src/backend/js/entities/function/mod.rs:201 — lib/api/src/backend/js/entities/function/mod.rs:201-219 | lib/api/src/backend/js/entities/function/mod.rs:256-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/js/entities/function/mod.rs:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/api/src/backend/js/entities/function/mod.rs:276` calls `as_mut` and `lib/api/src/backend/js/entities/function/mod.rs:220` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) lib/cli/src/commands/run/capabilities/mod.rs:44 — lib/cli/src/commands/run/capabilities/mod.rs:44-63 | lib/cli/src/commands/run/capabilities/mod.rs:68-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/cli/src/commands/run/capabilities/mod.rs:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 20) · ×1
  • Duplicated block (19 lines × 20) lib/compiler-singlepass/src/machine_arm64.rs:5767 — lib/compiler-singlepass/src/machine_arm64.rs:5767-5785 | lib/compiler-singlepass/src/machine_arm64.rs:5828-5846 | lib/compiler-singlepass/src/machine_arm64.rs:5889-5907 | lib/compiler-singlepass/src/machine_arm64.rs:5950-5968 | lib/compiler-singlepass/src/machine_arm64.rs:6011-6029 | lib/compiler-singlepass/src/machine_arm64.rs:6072-6090 | lib/compiler-singlepass/src/machine_arm64.rs:6133-6151 | lib/compiler-singlepass/src/machine_arm64.rs:6194-6212 | lib/compiler-singlepass/src/machine_arm64.rs:6255-6273 | lib/compiler-singlepass/src/machine_arm64.rs:6316-6334 | lib/compiler-singlepass/src/machine_arm64.rs:6377-6395 | lib/compiler-singlepass/src/machine_arm64.rs:6438-6456 | lib/compiler-singlepass/src/machine_arm64.rs:6499-6517 | lib/compiler-singlepass/src/machine_arm64.rs:6560-6578 | lib/compiler-singlepass/src/machine_arm64.rs:6621-6639 | lib/compiler-singlepass/src/machine_arm64.rs:6682-6700 | lib/compiler-singlepass/src/machine_arm64.rs:6743-6761 | lib/compiler-singlepass/src/machine_arm64.rs:6804-6822 | lib/compiler-singlepass/src/machine_arm64.rs:6865-6883 | lib/compiler-singlepass/src/machine_arm64.rs:6926-6944 — all 20 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:5767` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 15) · ×1
  • Duplicated block (19 lines × 15) lib/compiler-singlepass/src/machine_arm64.rs:3456 — lib/compiler-singlepass/src/machine_arm64.rs:3456-3474 | lib/compiler-singlepass/src/machine_arm64.rs:3517-3535 | lib/compiler-singlepass/src/machine_arm64.rs:3578-3596 | lib/compiler-singlepass/src/machine_arm64.rs:3639-3657 | lib/compiler-singlepass/src/machine_arm64.rs:3700-3718 | lib/compiler-singlepass/src/machine_arm64.rs:3761-3779 | lib/compiler-singlepass/src/machine_arm64.rs:3822-3840 | lib/compiler-singlepass/src/machine_arm64.rs:3883-3901 | lib/compiler-singlepass/src/machine_arm64.rs:3944-3962 | lib/compiler-singlepass/src/machine_arm64.rs:4005-4023 | lib/compiler-singlepass/src/machine_arm64.rs:4066-4084 | lib/compiler-singlepass/src/machine_arm64.rs:4127-4145 | lib/compiler-singlepass/src/machine_arm64.rs:4188-4206 | lib/compiler-singlepass/src/machine_arm64.rs:4249-4267 | lib/compiler-singlepass/src/machine_arm64.rs:4310-4328 — all 15 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:3456` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) lib/compiler-llvm/src/compiler.rs:517 — lib/compiler-llvm/src/compiler.rs:517-535 | lib/compiler-llvm/src/translator/trampoline.rs:387-401 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/compiler.rs:517` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) lib/virtual-net/src/client.rs:301 — lib/virtual-net/src/client.rs:301-318 | lib/virtual-net/src/server.rs:359-377 — before extracting anything, compare `lib/virtual-net/src/client.rs` and `lib/virtual-net/src/server.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/client.rs:301` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/virtual-net/src/client.rs:297` calls `poll` and `lib/virtual-net/src/server.rs:354` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–18 lines × 3) · ×1
  • Duplicated block (15–18 lines × 3) lib/virtual-fs/src/mem_fs/file.rs:1843 — lib/virtual-fs/src/mem_fs/file.rs:1843-1860 | lib/virtual-fs/src/mem_fs/file.rs:1946-1960 | lib/virtual-fs/src/mem_fs/offloaded_file.rs:164-179 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/file.rs:1843` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 8) · ×1
  • Duplicated block (17 lines × 8) lib/compiler-singlepass/src/machine_x64.rs:7324 — lib/compiler-singlepass/src/machine_x64.rs:7324-7340 | lib/compiler-singlepass/src/machine_x64.rs:7344-7360 | lib/compiler-singlepass/src/machine_x64.rs:7453-7469 | lib/compiler-singlepass/src/machine_x64.rs:7473-7489 | lib/compiler-singlepass/src/machine_x64.rs:7744-7760 | lib/compiler-singlepass/src/machine_x64.rs:7764-7780 | lib/compiler-singlepass/src/machine_x64.rs:7873-7889 | lib/compiler-singlepass/src/machine_x64.rs:7893-7909 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:7324` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) lib/compiler-singlepass/src/codegen.rs:2955 — lib/compiler-singlepass/src/codegen.rs:2955-2971 | lib/compiler-singlepass/src/codegen.rs:5779-5795 | lib/compiler-singlepass/src/codegen.rs:5899-5915 | lib/compiler-singlepass/src/codegen.rs:5949-5965 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:2955` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–30 lines × 2) · ×1
  • Duplicated block (23–30 lines × 2) lib/wasix/src/syscalls/wasix/proc_exec4.rs:89 — lib/wasix/src/syscalls/wasix/proc_exec4.rs:89-111 | lib/wasix/src/syscalls/wasix/proc_spawn3.rs:105-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/wasix/proc_exec4.rs:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 49) · ×1
  • Duplicated block (15–16 lines × 49) lib/compiler-singlepass/src/machine_arm64.rs:3427 — lib/compiler-singlepass/src/machine_arm64.rs:3427-3441 | lib/compiler-singlepass/src/machine_arm64.rs:3488-3502 | lib/compiler-singlepass/src/machine_arm64.rs:3549-3563 | lib/compiler-singlepass/src/machine_arm64.rs:3610-3624 | lib/compiler-singlepass/src/machine_arm64.rs:3671-3685 | lib/compiler-singlepass/src/machine_arm64.rs:3732-3746 | lib/compiler-singlepass/src/machine_arm64.rs:3793-3807 | lib/compiler-singlepass/src/machine_arm64.rs:3854-3868 | lib/compiler-singlepass/src/machine_arm64.rs:3915-3929 | lib/compiler-singlepass/src/machine_arm64.rs:3976-3990 | lib/compiler-singlepass/src/machine_arm64.rs:4037-4051 | lib/compiler-singlepass/src/machine_arm64.rs:4098-4112 | lib/compiler-singlepass/src/machine_arm64.rs:4159-4173 | lib/compiler-singlepass/src/machine_arm64.rs:4220-4234 | lib/compiler-singlepass/src/machine_arm64.rs:4281-4295 | lib/compiler-singlepass/src/machine_arm64.rs:4342-4357 | lib/compiler-singlepass/src/machine_arm64.rs:4400-4415 | lib/compiler-singlepass/src/machine_arm64.rs:4458-4473 | lib/compiler-singlepass/src/machine_arm64.rs:4517-4532 | lib/compiler-singlepass/src/machine_arm64.rs:4580-4595 | lib/compiler-singlepass/src/machine_arm64.rs:4643-4658 | lib/compiler-singlepass/src/machine_arm64.rs:5738-5752 | lib/compiler-singlepass/src/machine_arm64.rs:5799-5813 | lib/compiler-singlepass/src/machine_arm64.rs:5860-5874 | lib/compiler-singlepass/src/machine_arm64.rs:5921-5935 | lib/compiler-singlepass/src/machine_arm64.rs:5982-5996 | lib/compiler-singlepass/src/machine_arm64.rs:6043-6057 | lib/compiler-singlepass/src/machine_arm64.rs:6104-6118 | lib/compiler-singlepass/src/machine_arm64.rs:6165-6179 | lib/compiler-singlepass/src/machine_arm64.rs:6226-6240 | lib/compiler-singlepass/src/machine_arm64.rs:6287-6301 | lib/compiler-singlepass/src/machine_arm64.rs:6348-6362 | lib/compiler-singlepass/src/machine_arm64.rs:6409-6423 | lib/compiler-singlepass/src/machine_arm64.rs:6470-6484 | lib/compiler-singlepass/src/machine_arm64.rs:6531-6545 | lib/compiler-singlepass/src/machine_arm64.rs:6592-6606 | lib/compiler-singlepass/src/machine_arm64.rs:6653-6667 | lib/compiler-singlepass/src/machine_arm64.rs:6714-6728 | lib/compiler-singlepass/src/machine_arm64.rs:6775-6789 | lib/compiler-singlepass/src/machine_arm64.rs:6836-6850 | lib/compiler-singlepass/src/machine_arm64.rs:6897-6911 | lib/compiler-singlepass/src/machine_arm64.rs:6958-6973 | lib/compiler-singlepass/src/machine_arm64.rs:7016-7031 | lib/compiler-singlepass/src/machine_arm64.rs:7074-7089 | lib/compiler-singlepass/src/machine_arm64.rs:7132-7147 | lib/compiler-singlepass/src/machine_arm64.rs:7191-7206 | lib/compiler-singlepass/src/machine_arm64.rs:7254-7269 | lib/compiler-singlepass/src/machine_arm64.rs:7317-7332 | lib/compiler-singlepass/src/machine_arm64.rs:7380-7395 — all 49 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:3427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) lib/backend-api/src/query.rs:2411 — lib/backend-api/src/query.rs:2411-2426 | lib/backend-api/src/query.rs:2458-2473 | lib/backend-api/src/query.rs:2505-2520 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/backend-api/src/query.rs:2411` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) lib/compiler-singlepass/src/machine_riscv.rs:481 — lib/compiler-singlepass/src/machine_riscv.rs:481-496 | lib/compiler-singlepass/src/machine_riscv.rs:504-518 | lib/compiler-singlepass/src/machine_riscv.rs:542-556 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:481` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 5) · ×1
  • Duplicated block (12–15 lines × 5) lib/compiler-singlepass/src/machine_x64.rs:977 — lib/compiler-singlepass/src/machine_x64.rs:977-988 | lib/compiler-singlepass/src/machine_x64.rs:7312-7326 | lib/compiler-singlepass/src/machine_x64.rs:7441-7455 | lib/compiler-singlepass/src/machine_x64.rs:7732-7746 | lib/compiler-singlepass/src/machine_x64.rs:7861-7875 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:977` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) lib/compiler-llvm/src/translator/code.rs:6741 — lib/compiler-llvm/src/translator/code.rs:6741-6755 | lib/compiler-llvm/src/translator/code.rs:6803-6817 | lib/compiler-llvm/src/translator/code.rs:6911-6925 | lib/compiler-llvm/src/translator/code.rs:6974-6988 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6741` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (10–15 lines × 3) · ×1
  • Duplicated block (10–15 lines × 3) lib/virtual-fs/src/overlay_fs.rs:365 — lib/virtual-fs/src/overlay_fs.rs:365-379 | lib/virtual-fs/src/overlay_fs.rs:392-401 | lib/virtual-fs/src/overlay_fs.rs:408-417 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/overlay_fs.rs:365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) lib/wasix/src/net/socket.rs:1459 — lib/wasix/src/net/socket.rs:1459-1473 | lib/wasix/src/net/socket.rs:1552-1566 | lib/wasix/src/net/socket.rs:1641-1655 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/socket.rs:1459` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–26 lines × 2) · ×1
  • Duplicated block (22–26 lines × 2) lib/compiler-cranelift/src/translator/code_translator.rs:3246 — lib/compiler-cranelift/src/translator/code_translator.rs:3246-3267 | lib/compiler-cranelift/src/translator/code_translator.rs:3295-3320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/translator/code_translator.rs:3246` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7–15 lines × 2) · ×1
  • Duplicated block (7–15 lines × 2) lib/compiler-singlepass/src/machine_x64.rs:7182 — lib/compiler-singlepass/src/machine_x64.rs:7182-7188 | lib/compiler-singlepass/src/machine_x64.rs:7201-7215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/machine_x64.rs:7181` calls `move_location`, `GPR` and `lib/compiler-singlepass/src/machine_x64.rs:7199` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–14 lines × 8) · ×1
  • Duplicated block (12–14 lines × 8) lib/compiler-llvm/src/translator/code.rs:6142 — lib/compiler-llvm/src/translator/code.rs:6142-6155 | lib/compiler-llvm/src/translator/code.rs:6168-6181 | lib/compiler-llvm/src/translator/code.rs:6236-6249 | lib/compiler-llvm/src/translator/code.rs:6262-6275 | lib/compiler-llvm/src/translator/code.rs:6330-6343 | lib/compiler-llvm/src/translator/code.rs:6437-6450 | lib/compiler-llvm/src/translator/code.rs:6580-6591 | lib/compiler-llvm/src/translator/code.rs:6603-6614 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6142` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) lib/compiler-singlepass/src/codegen.rs:2954 — lib/compiler-singlepass/src/codegen.rs:2954-2967 | lib/compiler-singlepass/src/codegen.rs:5778-5791 | lib/compiler-singlepass/src/codegen.rs:5898-5911 | lib/compiler-singlepass/src/codegen.rs:5948-5961 | lib/compiler-singlepass/src/codegen.rs:5997-6010 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:2954` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) lib/compiler-llvm/src/translator/code.rs:6365 — lib/compiler-llvm/src/translator/code.rs:6365-6378 | lib/compiler-llvm/src/translator/code.rs:6411-6424 | lib/compiler-llvm/src/translator/code.rs:6472-6485 | lib/compiler-llvm/src/translator/code.rs:6518-6531 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6365` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:6363` calls `into` and `lib/compiler-llvm/src/translator/code.rs:6409` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–14 lines × 3) · ×1
  • Duplicated block (8–14 lines × 3) lib/compiler-cranelift/src/func_environ.rs:2216 — lib/compiler-cranelift/src/func_environ.rs:2216-2223 | lib/compiler-cranelift/src/func_environ.rs:2275-2288 | lib/compiler-cranelift/src/func_environ.rs:2309-2316 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:2216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–24 lines × 3) · ×1
  • Duplicated block (19–24 lines × 3) lib/compiler-llvm/src/translator/code.rs:4599 — lib/compiler-llvm/src/translator/code.rs:4599-4617 | lib/compiler-llvm/src/translator/code.rs:4696-4719 | lib/compiler-llvm/src/translator/code.rs:4815-4838 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4599` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) lib/api/src/backend/v8/entities/function/mod.rs:201 — lib/api/src/backend/v8/entities/function/mod.rs:201-211 | lib/api/src/backend/v8/entities/function/mod.rs:278-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/function/mod.rs:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) lib/wasix/src/syscalls/unix/mod.rs:16 — lib/wasix/src/syscalls/unix/mod.rs:16-28 | lib/wasix/src/syscalls/unix/mod.rs:40-53 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/syscalls/unix/mod.rs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13 lines × 24) · ×1
  • Duplicated block (13 lines × 24) lib/compiler-singlepass/src/machine_arm64.rs:5768 — lib/compiler-singlepass/src/machine_arm64.rs:5768-5780 | lib/compiler-singlepass/src/machine_arm64.rs:5829-5841 | lib/compiler-singlepass/src/machine_arm64.rs:5890-5902 | lib/compiler-singlepass/src/machine_arm64.rs:5951-5963 | lib/compiler-singlepass/src/machine_arm64.rs:6012-6024 | lib/compiler-singlepass/src/machine_arm64.rs:6073-6085 | lib/compiler-singlepass/src/machine_arm64.rs:6134-6146 | lib/compiler-singlepass/src/machine_arm64.rs:6195-6207 | lib/compiler-singlepass/src/machine_arm64.rs:6256-6268 | lib/compiler-singlepass/src/machine_arm64.rs:6317-6329 | lib/compiler-singlepass/src/machine_arm64.rs:6378-6390 | lib/compiler-singlepass/src/machine_arm64.rs:6439-6451 | lib/compiler-singlepass/src/machine_arm64.rs:6500-6512 | lib/compiler-singlepass/src/machine_arm64.rs:6561-6573 | lib/compiler-singlepass/src/machine_arm64.rs:6622-6634 | lib/compiler-singlepass/src/machine_arm64.rs:6683-6695 | lib/compiler-singlepass/src/machine_arm64.rs:6744-6756 | lib/compiler-singlepass/src/machine_arm64.rs:6805-6817 | lib/compiler-singlepass/src/machine_arm64.rs:6866-6878 | lib/compiler-singlepass/src/machine_arm64.rs:6927-6939 | lib/compiler-singlepass/src/machine_arm64.rs:6986-6998 | lib/compiler-singlepass/src/machine_arm64.rs:7044-7056 | lib/compiler-singlepass/src/machine_arm64.rs:7102-7114 | lib/compiler-singlepass/src/machine_arm64.rs:7160-7172 — all 24 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:5768` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_arm64.rs:5781` calls `release_gpr` and `lib/compiler-singlepass/src/machine_arm64.rs:6999` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 18) · ×1
  • Duplicated block (13 lines × 18) lib/compiler-singlepass/src/machine_arm64.rs:3457 — lib/compiler-singlepass/src/machine_arm64.rs:3457-3469 | lib/compiler-singlepass/src/machine_arm64.rs:3518-3530 | lib/compiler-singlepass/src/machine_arm64.rs:3579-3591 | lib/compiler-singlepass/src/machine_arm64.rs:3640-3652 | lib/compiler-singlepass/src/machine_arm64.rs:3701-3713 | lib/compiler-singlepass/src/machine_arm64.rs:3762-3774 | lib/compiler-singlepass/src/machine_arm64.rs:3823-3835 | lib/compiler-singlepass/src/machine_arm64.rs:3884-3896 | lib/compiler-singlepass/src/machine_arm64.rs:3945-3957 | lib/compiler-singlepass/src/machine_arm64.rs:4006-4018 | lib/compiler-singlepass/src/machine_arm64.rs:4067-4079 | lib/compiler-singlepass/src/machine_arm64.rs:4128-4140 | lib/compiler-singlepass/src/machine_arm64.rs:4189-4201 | lib/compiler-singlepass/src/machine_arm64.rs:4250-4262 | lib/compiler-singlepass/src/machine_arm64.rs:4311-4323 | lib/compiler-singlepass/src/machine_arm64.rs:4370-4382 | lib/compiler-singlepass/src/machine_arm64.rs:4428-4440 | lib/compiler-singlepass/src/machine_arm64.rs:4486-4498 — all 18 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:3457` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_arm64.rs:3470` calls `release_gpr` and `lib/compiler-singlepass/src/machine_arm64.rs:4383` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 12) · ×1
  • Duplicated block (13 lines × 12) lib/compiler-llvm/src/translator/code.rs:6141 — lib/compiler-llvm/src/translator/code.rs:6141-6153 | lib/compiler-llvm/src/translator/code.rs:6167-6179 | lib/compiler-llvm/src/translator/code.rs:6235-6247 | lib/compiler-llvm/src/translator/code.rs:6261-6273 | lib/compiler-llvm/src/translator/code.rs:6329-6341 | lib/compiler-llvm/src/translator/code.rs:6364-6376 | lib/compiler-llvm/src/translator/code.rs:6410-6422 | lib/compiler-llvm/src/translator/code.rs:6436-6448 | lib/compiler-llvm/src/translator/code.rs:6471-6483 | lib/compiler-llvm/src/translator/code.rs:6517-6529 | lib/compiler-llvm/src/translator/code.rs:6579-6591 | lib/compiler-llvm/src/translator/code.rs:6602-6614 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6141` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:6363` calls `into` and `lib/compiler-llvm/src/translator/code.rs:6140` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) lib/api/src/backend/js/entities/memory/view.rs:255 — lib/api/src/backend/js/entities/memory/view.rs:255-267 | lib/api/src/backend/sys/entities/memory/view.rs:178-190 | lib/api/src/backend/v8/entities/memory/view.rs:173-185 | lib/api/src/entities/memory/view/inner.rs:208-220 — before extracting anything, compare `lib/api/src/backend/sys/entities/memory/view.rs` and `lib/api/src/backend/v8/entities/memory/view.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (7–13 lines × 3) · ×1
  • Duplicated block (7–13 lines × 3) lib/virtual-fs/src/mem_fs/filesystem.rs:261 — lib/virtual-fs/src/mem_fs/filesystem.rs:261-267 | lib/virtual-fs/src/mem_fs/filesystem.rs:397-409 | lib/virtual-fs/src/mem_fs/filesystem.rs:627-639 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/filesystem.rs:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) lib/api/src/backend/js/entities/function/mod.rs:222 — lib/api/src/backend/js/entities/function/mod.rs:222-234 | lib/api/src/backend/sys/entities/function/mod.rs:334-344 — before extracting anything, compare `lib/api/src/backend/js/entities/function/mod.rs` and `lib/api/src/backend/sys/entities/function/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/js/entities/function/mod.rs:222` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–13 lines × 3) · ×1
  • Duplicated block (4–13 lines × 3) lib/compiler-llvm/src/translator/code.rs:4652 — lib/compiler-llvm/src/translator/code.rs:4652-4655 | lib/compiler-llvm/src/translator/code.rs:4747-4759 | lib/compiler-llvm/src/translator/code.rs:4866-4878 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4652` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:4746` calls `build_shuffle_vector` and `lib/compiler-llvm/src/translator/code.rs:4651` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 8) · ×1
  • Duplicated block (12 lines × 8) lib/compiler-llvm/src/translator/code.rs:7025 — lib/compiler-llvm/src/translator/code.rs:7025-7036 | lib/compiler-llvm/src/translator/code.rs:7054-7065 | lib/compiler-llvm/src/translator/code.rs:7083-7094 | lib/compiler-llvm/src/translator/code.rs:7112-7123 | lib/compiler-llvm/src/translator/code.rs:7140-7151 | lib/compiler-llvm/src/translator/code.rs:7168-7179 | lib/compiler-llvm/src/translator/code.rs:7197-7208 | lib/compiler-llvm/src/translator/code.rs:7226-7237 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7025` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-llvm/src/translator/code.rs:7240` calls `apply_pending_canonicalization` and `lib/compiler-llvm/src/translator/code.rs:7126` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) lib/compiler-singlepass/src/machine_x64.rs:4356 — lib/compiler-singlepass/src/machine_x64.rs:4356-4367 | lib/compiler-singlepass/src/machine_x64.rs:4410-4421 | lib/compiler-singlepass/src/machine_x64.rs:4470-4481 | lib/compiler-singlepass/src/machine_x64.rs:6525-6536 | lib/compiler-singlepass/src/machine_x64.rs:6579-6590 | lib/compiler-singlepass/src/machine_x64.rs:6639-6650 | lib/compiler-singlepass/src/machine_x64.rs:6699-6710 — 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 (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) lib/compiler-llvm/src/translator/code.rs:6097 — lib/compiler-llvm/src/translator/code.rs:6097-6108 | lib/compiler-llvm/src/translator/code.rs:6118-6129 | lib/compiler-llvm/src/translator/code.rs:6191-6202 | lib/compiler-llvm/src/translator/code.rs:6212-6223 | lib/compiler-llvm/src/translator/code.rs:6285-6296 | lib/compiler-llvm/src/translator/code.rs:6306-6317 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:6097` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–12 lines × 6) · ×1
  • Duplicated block (11–12 lines × 6) lib/virtual-fs/src/mem_fs/file.rs:440 — lib/virtual-fs/src/mem_fs/file.rs:440-451 | lib/virtual-fs/src/mem_fs/file.rs:487-498 | lib/virtual-fs/src/mem_fs/file.rs:1074-1085 | lib/virtual-fs/src/mem_fs/file.rs:1238-1248 | lib/virtual-fs/src/mem_fs/file.rs:1278-1289 | lib/virtual-fs/src/mem_fs/file.rs:1315-1326 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/file.rs:440` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–12 lines × 4) · ×1
  • Duplicated block (8–12 lines × 4) lib/virtual-fs/src/mem_fs/filesystem.rs:262 — lib/virtual-fs/src/mem_fs/filesystem.rs:262-269 | lib/virtual-fs/src/mem_fs/filesystem.rs:400-411 | lib/virtual-fs/src/mem_fs/filesystem.rs:477-488 | lib/virtual-fs/src/mem_fs/filesystem.rs:630-641 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/mem_fs/filesystem.rs:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) lib/compiler-singlepass/src/codegen.rs:2801 — lib/compiler-singlepass/src/codegen.rs:2801-2810 | lib/compiler-singlepass/src/codegen.rs:2869-2880 | lib/compiler-singlepass/src/codegen.rs:5856-5867 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:2801` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–12 lines × 3) · ×1
  • Duplicated block (8–12 lines × 3) lib/compiler-singlepass/src/machine_arm64.rs:1229 — lib/compiler-singlepass/src/machine_arm64.rs:1229-1237 | lib/compiler-singlepass/src/machine_riscv.rs:362-369 | lib/compiler-singlepass/src/machine_riscv.rs:632-643 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_riscv.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 348 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/machine_arm64.rs:1228` calls `emit_read_fpcr` and `lib/compiler-singlepass/src/machine_riscv.rs:361` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 39) · ×1
  • Duplicated block (11 lines × 39) lib/compiler-singlepass/src/codegen.rs:3267 — lib/compiler-singlepass/src/codegen.rs:3267-3277 | lib/compiler-singlepass/src/codegen.rs:3317-3327 | lib/compiler-singlepass/src/codegen.rs:3342-3352 | lib/compiler-singlepass/src/codegen.rs:3367-3377 | lib/compiler-singlepass/src/codegen.rs:3392-3402 | lib/compiler-singlepass/src/codegen.rs:3417-3427 | lib/compiler-singlepass/src/codegen.rs:3442-3452 | lib/compiler-singlepass/src/codegen.rs:3976-3986 | lib/compiler-singlepass/src/codegen.rs:4001-4011 | lib/compiler-singlepass/src/codegen.rs:4026-4036 | lib/compiler-singlepass/src/codegen.rs:4051-4061 | lib/compiler-singlepass/src/codegen.rs:4200-4210 | lib/compiler-singlepass/src/codegen.rs:4281-4291 | lib/compiler-singlepass/src/codegen.rs:4308-4318 | lib/compiler-singlepass/src/codegen.rs:4335-4345 | lib/compiler-singlepass/src/codegen.rs:4389-4399 | lib/compiler-singlepass/src/codegen.rs:4470-4480 | lib/compiler-singlepass/src/codegen.rs:4497-4507 | lib/compiler-singlepass/src/codegen.rs:4524-4534 | lib/compiler-singlepass/src/codegen.rs:4578-4588 | lib/compiler-singlepass/src/codegen.rs:4659-4669 | lib/compiler-singlepass/src/codegen.rs:4686-4696 | lib/compiler-singlepass/src/codegen.rs:4713-4723 | lib/compiler-singlepass/src/codegen.rs:4767-4777 | lib/compiler-singlepass/src/codegen.rs:4848-4858 | lib/compiler-singlepass/src/codegen.rs:4875-4885 | lib/compiler-singlepass/src/codegen.rs:4902-4912 | lib/compiler-singlepass/src/codegen.rs:4956-4966 | lib/compiler-singlepass/src/codegen.rs:5037-5047 | lib/compiler-singlepass/src/codegen.rs:5064-5074 | lib/compiler-singlepass/src/codegen.rs:5091-5101 | lib/compiler-singlepass/src/codegen.rs:5145-5155 | lib/compiler-singlepass/src/codegen.rs:5226-5236 | lib/compiler-singlepass/src/codegen.rs:5253-5263 | lib/compiler-singlepass/src/codegen.rs:5280-5290 | lib/compiler-singlepass/src/codegen.rs:5337-5347 | lib/compiler-singlepass/src/codegen.rs:5424-5434 | lib/compiler-singlepass/src/codegen.rs:5453-5463 | lib/compiler-singlepass/src/codegen.rs:5482-5492 — all 39 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:3267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/codegen.rs:4199` calls `pop_value_released` and `lib/compiler-singlepass/src/codegen.rs:3266` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 29) · ×1
  • Duplicated block (11 lines × 29) lib/compiler-singlepass/src/codegen.rs:3019 — lib/compiler-singlepass/src/codegen.rs:3019-3029 | lib/compiler-singlepass/src/codegen.rs:3069-3079 | lib/compiler-singlepass/src/codegen.rs:3094-3104 | lib/compiler-singlepass/src/codegen.rs:3119-3129 | lib/compiler-singlepass/src/codegen.rs:3144-3154 | lib/compiler-singlepass/src/codegen.rs:3829-3839 | lib/compiler-singlepass/src/codegen.rs:3854-3864 | lib/compiler-singlepass/src/codegen.rs:3879-3889 | lib/compiler-singlepass/src/codegen.rs:4173-4183 | lib/compiler-singlepass/src/codegen.rs:4227-4237 | lib/compiler-singlepass/src/codegen.rs:4254-4264 | lib/compiler-singlepass/src/codegen.rs:4362-4372 | lib/compiler-singlepass/src/codegen.rs:4416-4426 | lib/compiler-singlepass/src/codegen.rs:4443-4453 | lib/compiler-singlepass/src/codegen.rs:4551-4561 | lib/compiler-singlepass/src/codegen.rs:4605-4615 | lib/compiler-singlepass/src/codegen.rs:4632-4642 | lib/compiler-singlepass/src/codegen.rs:4740-4750 | lib/compiler-singlepass/src/codegen.rs:4794-4804 | lib/compiler-singlepass/src/codegen.rs:4821-4831 | lib/compiler-singlepass/src/codegen.rs:4929-4939 | lib/compiler-singlepass/src/codegen.rs:4983-4993 | lib/compiler-singlepass/src/codegen.rs:5010-5020 | lib/compiler-singlepass/src/codegen.rs:5118-5128 | lib/compiler-singlepass/src/codegen.rs:5172-5182 | lib/compiler-singlepass/src/codegen.rs:5199-5209 | lib/compiler-singlepass/src/codegen.rs:5308-5318 | lib/compiler-singlepass/src/codegen.rs:5366-5376 | lib/compiler-singlepass/src/codegen.rs:5395-5405 — all 29 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:3019` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-singlepass/src/codegen.rs:4172` calls `pop_value_released` and `lib/compiler-singlepass/src/codegen.rs:3018` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–11 lines × 8) · ×1
  • Duplicated block (10–11 lines × 8) lib/compiler-llvm/src/translator/code.rs:4082 — lib/compiler-llvm/src/translator/code.rs:4082-4091 | lib/compiler-llvm/src/translator/code.rs:4094-4103 | lib/compiler-llvm/src/translator/code.rs:4882-4891 | lib/compiler-llvm/src/translator/code.rs:4898-4907 | lib/compiler-llvm/src/translator/code.rs:8664-8674 | lib/compiler-llvm/src/translator/code.rs:8688-8698 | lib/compiler-llvm/src/translator/code.rs:8712-8722 | lib/compiler-llvm/src/translator/code.rs:8736-8746 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4082` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-llvm/src/translator/code.rs:4104` calls `extend_op`, `build_int_add` and `lib/compiler-llvm/src/translator/code.rs:8674` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) lib/compiler-llvm/src/translator/code.rs:8857 — lib/compiler-llvm/src/translator/code.rs:8857-8867 | lib/compiler-llvm/src/translator/code.rs:8931-8941 | lib/compiler-llvm/src/translator/code.rs:8998-9008 | lib/compiler-llvm/src/translator/code.rs:9064-9074 | lib/compiler-llvm/src/translator/code.rs:9233-9243 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8857` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–11 lines × 3) · ×1
  • Duplicated block (5–11 lines × 3) lib/compiler-llvm/src/translator/intrinsics.rs:1511 — lib/compiler-llvm/src/translator/intrinsics.rs:1511-1521 | lib/compiler-llvm/src/translator/intrinsics.rs:1808-1817 | lib/compiler-llvm/src/translator/trampoline.rs:502-506 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/intrinsics.rs:1511` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) lib/api/src/backend/v8/entities/function/mod.rs:264 — lib/api/src/backend/v8/entities/function/mod.rs:264-274 | lib/api/src/backend/v8/entities/tag.rs:36-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/api/src/backend/v8/entities/function/mod.rs:264` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (1–11 lines × 3) · ×1
  • Duplicated block (1–11 lines × 3) lib/wasix/src/net/mod.rs:113 — lib/wasix/src/net/mod.rs:113-122 | lib/wasix/src/net/mod.rs:221-221 | lib/wasix/src/net/mod.rs:253-263 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/mod.rs:113` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 19) · ×1
  • Duplicated block (10 lines × 19) lib/compiler-llvm/src/translator/code.rs:7443 — lib/compiler-llvm/src/translator/code.rs:7443-7452 | lib/compiler-llvm/src/translator/code.rs:7518-7527 | lib/compiler-llvm/src/translator/code.rs:7604-7614 | lib/compiler-llvm/src/translator/code.rs:7691-7701 | lib/compiler-llvm/src/translator/code.rs:7763-7773 | lib/compiler-llvm/src/translator/code.rs:7853-7863 | lib/compiler-llvm/src/translator/code.rs:7925-7935 | lib/compiler-llvm/src/translator/code.rs:8015-8025 | lib/compiler-llvm/src/translator/code.rs:8084-8094 | lib/compiler-llvm/src/translator/code.rs:8174-8184 | lib/compiler-llvm/src/translator/code.rs:8220-8230 | lib/compiler-llvm/src/translator/code.rs:8272-8282 | lib/compiler-llvm/src/translator/code.rs:8324-8334 | lib/compiler-llvm/src/translator/code.rs:8376-8386 | lib/compiler-llvm/src/translator/code.rs:8428-8438 | lib/compiler-llvm/src/translator/code.rs:8480-8490 | lib/compiler-llvm/src/translator/code.rs:8674-8683 | lib/compiler-llvm/src/translator/code.rs:8698-8707 | lib/compiler-llvm/src/translator/code.rs:10572-10581 — all 19 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7443` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 14) · ×1
  • Duplicated block (10 lines × 14) lib/compiler-singlepass/src/codegen.rs:3169 — lib/compiler-singlepass/src/codegen.rs:3169-3178 | lib/compiler-singlepass/src/codegen.rs:3219-3228 | lib/compiler-singlepass/src/codegen.rs:3243-3252 | lib/compiler-singlepass/src/codegen.rs:3467-3477 | lib/compiler-singlepass/src/codegen.rs:3518-3527 | lib/compiler-singlepass/src/codegen.rs:3542-3551 | lib/compiler-singlepass/src/codegen.rs:3566-3575 | lib/compiler-singlepass/src/codegen.rs:3904-3913 | lib/compiler-singlepass/src/codegen.rs:3928-3937 | lib/compiler-singlepass/src/codegen.rs:3952-3961 | lib/compiler-singlepass/src/codegen.rs:4076-4085 | lib/compiler-singlepass/src/codegen.rs:4100-4109 | lib/compiler-singlepass/src/codegen.rs:4124-4133 | lib/compiler-singlepass/src/codegen.rs:4148-4157 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:3169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 11) · ×1
  • Duplicated block (10 lines × 11) lib/compiler-llvm/src/translator/code.rs:4132 — lib/compiler-llvm/src/translator/code.rs:4132-4141 | lib/compiler-llvm/src/translator/code.rs:4150-4159 | lib/compiler-llvm/src/translator/code.rs:4168-4177 | lib/compiler-llvm/src/translator/code.rs:4186-4195 | lib/compiler-llvm/src/translator/code.rs:4256-4265 | lib/compiler-llvm/src/translator/code.rs:4274-4283 | lib/compiler-llvm/src/translator/code.rs:4292-4301 | lib/compiler-llvm/src/translator/code.rs:4310-4319 | lib/compiler-llvm/src/translator/code.rs:4369-4378 | lib/compiler-llvm/src/translator/code.rs:5060-5069 | lib/compiler-llvm/src/translator/code.rs:10424-10433 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 9) · ×1
  • Duplicated block (10 lines × 9) lib/compiler-llvm/src/translator/code.rs:4619 — lib/compiler-llvm/src/translator/code.rs:4619-4628 | lib/compiler-llvm/src/translator/code.rs:4630-4639 | lib/compiler-llvm/src/translator/code.rs:4641-4650 | lib/compiler-llvm/src/translator/code.rs:4721-4730 | lib/compiler-llvm/src/translator/code.rs:4732-4742 | lib/compiler-llvm/src/translator/code.rs:4744-4753 | lib/compiler-llvm/src/translator/code.rs:4840-4849 | lib/compiler-llvm/src/translator/code.rs:4851-4861 | lib/compiler-llvm/src/translator/code.rs:4863-4872 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4619` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) lib/compiler-singlepass/src/machine_arm64.rs:4546 — lib/compiler-singlepass/src/machine_arm64.rs:4546-4555 | lib/compiler-singlepass/src/machine_arm64.rs:4609-4618 | lib/compiler-singlepass/src/machine_arm64.rs:4672-4681 | lib/compiler-singlepass/src/machine_arm64.rs:7220-7229 | lib/compiler-singlepass/src/machine_arm64.rs:7283-7292 | lib/compiler-singlepass/src/machine_arm64.rs:7346-7355 | lib/compiler-singlepass/src/machine_arm64.rs:7409-7418 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:4546` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) lib/compiler-llvm/src/translator/code.rs:8856 — lib/compiler-llvm/src/translator/code.rs:8856-8865 | lib/compiler-llvm/src/translator/code.rs:8930-8939 | lib/compiler-llvm/src/translator/code.rs:8997-9006 | lib/compiler-llvm/src/translator/code.rs:9063-9072 | lib/compiler-llvm/src/translator/code.rs:9232-9241 | lib/compiler-llvm/src/translator/code.rs:9668-9677 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8856` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (9–10 lines × 5) · ×1
  • Duplicated block (9–10 lines × 5) lib/compiler-singlepass/src/codegen.rs:2817 — lib/compiler-singlepass/src/codegen.rs:2817-2825 | lib/compiler-singlepass/src/codegen.rs:2887-2895 | lib/compiler-singlepass/src/codegen.rs:5721-5730 | lib/compiler-singlepass/src/codegen.rs:5767-5775 | lib/compiler-singlepass/src/codegen.rs:5804-5812 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:2817` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) lib/virtual-net/src/rx_tx.rs:171 — lib/virtual-net/src/rx_tx.rs:171-179 | lib/virtual-net/src/rx_tx.rs:209-218 | lib/virtual-net/src/rx_tx.rs:270-279 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) lib/compiler-cranelift/src/func_environ.rs:2236 — lib/compiler-cranelift/src/func_environ.rs:2236-2242 | lib/compiler-cranelift/src/func_environ.rs:2330-2339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:2236` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn translate_data_drop( &mut` in one and `crate) fn translate_elem_drop( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (9 lines × 35) · ×1
  • Duplicated block (9 lines × 35) lib/compiler-singlepass/src/machine_arm64.rs:3455 — lib/compiler-singlepass/src/machine_arm64.rs:3455-3463 | lib/compiler-singlepass/src/machine_arm64.rs:3516-3524 | lib/compiler-singlepass/src/machine_arm64.rs:3577-3585 | lib/compiler-singlepass/src/machine_arm64.rs:3638-3646 | lib/compiler-singlepass/src/machine_arm64.rs:3699-3707 | lib/compiler-singlepass/src/machine_arm64.rs:3760-3768 | lib/compiler-singlepass/src/machine_arm64.rs:3821-3829 | lib/compiler-singlepass/src/machine_arm64.rs:3882-3890 | lib/compiler-singlepass/src/machine_arm64.rs:3943-3951 | lib/compiler-singlepass/src/machine_arm64.rs:4004-4012 | lib/compiler-singlepass/src/machine_arm64.rs:4065-4073 | lib/compiler-singlepass/src/machine_arm64.rs:4126-4134 | lib/compiler-singlepass/src/machine_arm64.rs:4187-4195 | lib/compiler-singlepass/src/machine_arm64.rs:4248-4256 | lib/compiler-singlepass/src/machine_arm64.rs:4309-4317 | lib/compiler-singlepass/src/machine_arm64.rs:5766-5774 | lib/compiler-singlepass/src/machine_arm64.rs:5827-5835 | lib/compiler-singlepass/src/machine_arm64.rs:5888-5896 | lib/compiler-singlepass/src/machine_arm64.rs:5949-5957 | lib/compiler-singlepass/src/machine_arm64.rs:6010-6018 | lib/compiler-singlepass/src/machine_arm64.rs:6071-6079 | lib/compiler-singlepass/src/machine_arm64.rs:6132-6140 | lib/compiler-singlepass/src/machine_arm64.rs:6193-6201 | lib/compiler-singlepass/src/machine_arm64.rs:6254-6262 | lib/compiler-singlepass/src/machine_arm64.rs:6315-6323 | lib/compiler-singlepass/src/machine_arm64.rs:6376-6384 | lib/compiler-singlepass/src/machine_arm64.rs:6437-6445 | lib/compiler-singlepass/src/machine_arm64.rs:6498-6506 | lib/compiler-singlepass/src/machine_arm64.rs:6559-6567 | lib/compiler-singlepass/src/machine_arm64.rs:6620-6628 | lib/compiler-singlepass/src/machine_arm64.rs:6681-6689 | lib/compiler-singlepass/src/machine_arm64.rs:6742-6750 | lib/compiler-singlepass/src/machine_arm64.rs:6803-6811 | lib/compiler-singlepass/src/machine_arm64.rs:6864-6872 | lib/compiler-singlepass/src/machine_arm64.rs:6925-6933 — all 35 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:3455` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7–9 lines × 15) · ×1
  • Duplicated block (7–9 lines × 15) lib/compiler-llvm/src/translator/code.rs:7399 — lib/compiler-llvm/src/translator/code.rs:7399-7407 | lib/compiler-llvm/src/translator/code.rs:7474-7482 | lib/compiler-llvm/src/translator/code.rs:7551-7560 | lib/compiler-llvm/src/translator/code.rs:7640-7646 | lib/compiler-llvm/src/translator/code.rs:7710-7719 | lib/compiler-llvm/src/translator/code.rs:7800-7809 | lib/compiler-llvm/src/translator/code.rs:7872-7881 | lib/compiler-llvm/src/translator/code.rs:7962-7971 | lib/compiler-llvm/src/translator/code.rs:8121-8130 | lib/compiler-llvm/src/translator/code.rs:8203-8212 | lib/compiler-llvm/src/translator/code.rs:8255-8264 | lib/compiler-llvm/src/translator/code.rs:8307-8316 | lib/compiler-llvm/src/translator/code.rs:8359-8368 | lib/compiler-llvm/src/translator/code.rs:8411-8420 | lib/compiler-llvm/src/translator/code.rs:8463-8472 — all 15 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:7399` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-llvm/src/translator/code.rs:7646` calls `push1` and `lib/compiler-llvm/src/translator/code.rs:7407` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 10) · ×1
  • Duplicated block (9 lines × 10) lib/compiler-llvm/src/translator/code.rs:4023 — lib/compiler-llvm/src/translator/code.rs:4023-4031 | lib/compiler-llvm/src/translator/code.rs:4039-4047 | lib/compiler-llvm/src/translator/code.rs:8557-8565 | lib/compiler-llvm/src/translator/code.rs:8585-8593 | lib/compiler-llvm/src/translator/code.rs:8613-8621 | lib/compiler-llvm/src/translator/code.rs:8641-8649 | lib/compiler-llvm/src/translator/code.rs:8853-8861 | lib/compiler-llvm/src/translator/code.rs:8927-8935 | lib/compiler-llvm/src/translator/code.rs:8994-9002 | lib/compiler-llvm/src/translator/code.rs:9060-9068 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4023` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-llvm/src/translator/code.rs:4048` calls `extend_op`, `build_int_add` and `lib/compiler-llvm/src/translator/code.rs:8566` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) lib/compiler-singlepass/src/machine_x64.rs:1155 — lib/compiler-singlepass/src/machine_x64.rs:1155-1163 | lib/compiler-singlepass/src/machine_x64.rs:1269-1277 | lib/compiler-singlepass/src/machine_x64.rs:1361-1369 | lib/compiler-singlepass/src/machine_x64.rs:1447-1455 | lib/compiler-singlepass/src/machine_x64.rs:1568-1576 | lib/compiler-singlepass/src/machine_x64.rs:1682-1690 | lib/compiler-singlepass/src/machine_x64.rs:1761-1769 | lib/compiler-singlepass/src/machine_x64.rs:1834-1842 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) lib/virtual-net/src/rx_tx.rs:117 — lib/virtual-net/src/rx_tx.rs:117-125 | lib/virtual-net/src/rx_tx.rs:138-146 | lib/virtual-net/src/rx_tx.rs:226-234 | lib/virtual-net/src/rx_tx.rs:287-295 | lib/virtual-net/src/rx_tx.rs:381-389 | lib/virtual-net/src/rx_tx.rs:443-451 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) lib/compiler-llvm/src/translator/code.rs:2737 — lib/compiler-llvm/src/translator/code.rs:2737-2745 | lib/compiler-llvm/src/translator/code.rs:2766-2774 | lib/compiler-llvm/src/translator/code.rs:2777-2785 | lib/compiler-llvm/src/translator/code.rs:2937-2945 | lib/compiler-llvm/src/translator/code.rs:11643-11651 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:2737` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:2736` calls `blocktype_params_results` and `lib/compiler-llvm/src/translator/code.rs:2776` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–9 lines × 5) · ×1
  • Duplicated block (8–9 lines × 5) lib/compiler-llvm/src/translator/code.rs:4014 — lib/compiler-llvm/src/translator/code.rs:4014-4022 | lib/compiler-llvm/src/translator/code.rs:8549-8556 | lib/compiler-llvm/src/translator/code.rs:8577-8584 | lib/compiler-llvm/src/translator/code.rs:8605-8612 | lib/compiler-llvm/src/translator/code.rs:8633-8640 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4014` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) lib/compiler-llvm/src/translator/code.rs:4475 — lib/compiler-llvm/src/translator/code.rs:4475-4481 | lib/compiler-llvm/src/translator/code.rs:4527-4533 | lib/compiler-llvm/src/translator/code.rs:4573-4579 | lib/compiler-llvm/src/translator/code.rs:8780-8788 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8780` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–19 lines × 2) · ×1
  • Duplicated block (9–19 lines × 2) lib/c-api/src/wasm_c_api/wasi/mod.rs:92 — lib/c-api/src/wasm_c_api/wasi/mod.rs:92-100 | lib/c-api/src/wasm_c_api/wasi/mod.rs:116-134 — both copies are in the same file, so extract the 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 (8 lines × 16) · ×1
  • Duplicated block (8 lines × 16) lib/compiler-llvm/src/translator/code.rs:5729 — lib/compiler-llvm/src/translator/code.rs:5729-5736 | lib/compiler-llvm/src/translator/code.rs:5744-5751 | lib/compiler-llvm/src/translator/code.rs:5759-5766 | lib/compiler-llvm/src/translator/code.rs:5774-5781 | lib/compiler-llvm/src/translator/code.rs:5789-5796 | lib/compiler-llvm/src/translator/code.rs:5804-5811 | lib/compiler-llvm/src/translator/code.rs:5819-5826 | lib/compiler-llvm/src/translator/code.rs:5834-5841 | lib/compiler-llvm/src/translator/code.rs:5849-5856 | lib/compiler-llvm/src/translator/code.rs:5864-5871 | lib/compiler-llvm/src/translator/code.rs:5879-5886 | lib/compiler-llvm/src/translator/code.rs:5894-5901 | lib/compiler-llvm/src/translator/code.rs:6767-6774 | lib/compiler-llvm/src/translator/code.rs:6829-6836 | lib/compiler-llvm/src/translator/code.rs:6937-6945 | lib/compiler-llvm/src/translator/code.rs:7000-7007 — all 16 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:5729` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 14) · ×1
  • Duplicated block (8 lines × 14) lib/compiler-llvm/src/translator/code.rs:4017 — lib/compiler-llvm/src/translator/code.rs:4017-4024 | lib/compiler-llvm/src/translator/code.rs:4033-4040 | lib/compiler-llvm/src/translator/code.rs:4081-4088 | lib/compiler-llvm/src/translator/code.rs:4093-4100 | lib/compiler-llvm/src/translator/code.rs:4881-4888 | lib/compiler-llvm/src/translator/code.rs:4897-4904 | lib/compiler-llvm/src/translator/code.rs:8551-8558 | lib/compiler-llvm/src/translator/code.rs:8579-8586 | lib/compiler-llvm/src/translator/code.rs:8607-8614 | lib/compiler-llvm/src/translator/code.rs:8635-8642 | lib/compiler-llvm/src/translator/code.rs:8663-8670 | lib/compiler-llvm/src/translator/code.rs:8687-8694 | lib/compiler-llvm/src/translator/code.rs:8711-8718 | lib/compiler-llvm/src/translator/code.rs:8735-8742 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4017` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:4877` calls `build_int_mul`, `build_int_add` and `lib/compiler-llvm/src/translator/code.rs:4896` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 8) · ×1
  • Duplicated block (8 lines × 8) lib/compiler-llvm/src/translator/code.rs:4884 — lib/compiler-llvm/src/translator/code.rs:4884-4891 | lib/compiler-llvm/src/translator/code.rs:4900-4907 | lib/compiler-llvm/src/translator/code.rs:8666-8675 | lib/compiler-llvm/src/translator/code.rs:8690-8699 | lib/compiler-llvm/src/translator/code.rs:8714-8723 | lib/compiler-llvm/src/translator/code.rs:8738-8747 | lib/compiler-llvm/src/translator/code.rs:9230-9239 | lib/compiler-llvm/src/translator/code.rs:9666-9675 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:4884` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–8 lines × 8) · ×1
  • Duplicated block (7–8 lines × 8) lib/compiler-llvm/src/translator/code.rs:8820 — lib/compiler-llvm/src/translator/code.rs:8820-8826 | lib/compiler-llvm/src/translator/code.rs:8828-8835 | lib/compiler-llvm/src/translator/code.rs:8894-8900 | lib/compiler-llvm/src/translator/code.rs:8902-8909 | lib/compiler-llvm/src/translator/code.rs:8969-8975 | lib/compiler-llvm/src/translator/code.rs:8977-8984 | lib/compiler-llvm/src/translator/code.rs:9035-9041 | lib/compiler-llvm/src/translator/code.rs:9043-9050 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:8820` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) lib/compiler-singlepass/src/codegen.rs:2818 — lib/compiler-singlepass/src/codegen.rs:2818-2825 | lib/compiler-singlepass/src/codegen.rs:2888-2895 | lib/compiler-singlepass/src/codegen.rs:5554-5561 | lib/compiler-singlepass/src/codegen.rs:5679-5686 | lib/compiler-singlepass/src/codegen.rs:5723-5730 | lib/compiler-singlepass/src/codegen.rs:5768-5775 | lib/compiler-singlepass/src/codegen.rs:5805-5812 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:2818` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–8 lines × 6) · ×1
  • Duplicated block (6–8 lines × 6) lib/compiler-singlepass/src/machine_x64.rs:1171 — lib/compiler-singlepass/src/machine_x64.rs:1171-1178 | lib/compiler-singlepass/src/machine_x64.rs:1584-1591 | lib/compiler-singlepass/src/machine_x64.rs:7368-7373 | lib/compiler-singlepass/src/machine_x64.rs:7497-7502 | lib/compiler-singlepass/src/machine_x64.rs:7788-7793 | lib/compiler-singlepass/src/machine_x64.rs:7917-7922 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) lib/compiler-singlepass/src/codegen.rs:5549 — lib/compiler-singlepass/src/codegen.rs:5549-5562 | lib/compiler-singlepass/src/codegen.rs:5594-5606 | lib/compiler-singlepass/src/codegen.rs:5674-5687 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/codegen.rs:5549` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 17) · ×1
  • Duplicated block (7 lines × 17) lib/compiler-llvm/src/translator/code.rs:5094 — lib/compiler-llvm/src/translator/code.rs:5094-5100 | lib/compiler-llvm/src/translator/code.rs:5729-5736 | lib/compiler-llvm/src/translator/code.rs:5744-5751 | lib/compiler-llvm/src/translator/code.rs:5759-5766 | lib/compiler-llvm/src/translator/code.rs:5774-5781 | lib/compiler-llvm/src/translator/code.rs:5789-5796 | lib/compiler-llvm/src/translator/code.rs:5804-5811 | lib/compiler-llvm/src/translator/code.rs:5819-5826 | lib/compiler-llvm/src/translator/code.rs:5834-5841 | lib/compiler-llvm/src/translator/code.rs:5849-5856 | lib/compiler-llvm/src/translator/code.rs:5864-5871 | lib/compiler-llvm/src/translator/code.rs:5879-5886 | lib/compiler-llvm/src/translator/code.rs:5894-5901 | lib/compiler-llvm/src/translator/code.rs:6767-6774 | lib/compiler-llvm/src/translator/code.rs:6829-6836 | lib/compiler-llvm/src/translator/code.rs:6937-6945 | lib/compiler-llvm/src/translator/code.rs:7000-7007 — all 17 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/code.rs:5094` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–7 lines × 12) · ×1
  • Duplicated block (6–7 lines × 12) lib/compiler-singlepass/src/machine_x64.rs:1471 — lib/compiler-singlepass/src/machine_x64.rs:1471-1477 | lib/compiler-singlepass/src/machine_x64.rs:1560-1565 | lib/compiler-singlepass/src/machine_x64.rs:1572-1578 | lib/compiler-singlepass/src/machine_x64.rs:1626-1632 | lib/compiler-singlepass/src/machine_x64.rs:1674-1679 | lib/compiler-singlepass/src/machine_x64.rs:1686-1692 | lib/compiler-singlepass/src/machine_x64.rs:1705-1711 | lib/compiler-singlepass/src/machine_x64.rs:1753-1758 | lib/compiler-singlepass/src/machine_x64.rs:1765-1771 | lib/compiler-singlepass/src/machine_x64.rs:1785-1790 | lib/compiler-singlepass/src/machine_x64.rs:1826-1831 | lib/compiler-singlepass/src/machine_x64.rs:1838-1843 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1471` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6–7 lines × 10) · ×1
  • Duplicated block (6–7 lines × 10) lib/compiler-singlepass/src/machine_x64.rs:1058 — lib/compiler-singlepass/src/machine_x64.rs:1058-1064 | lib/compiler-singlepass/src/machine_x64.rs:1147-1152 | lib/compiler-singlepass/src/machine_x64.rs:1159-1165 | lib/compiler-singlepass/src/machine_x64.rs:1213-1219 | lib/compiler-singlepass/src/machine_x64.rs:1261-1266 | lib/compiler-singlepass/src/machine_x64.rs:1273-1279 | lib/compiler-singlepass/src/machine_x64.rs:1353-1358 | lib/compiler-singlepass/src/machine_x64.rs:1397-1403 | lib/compiler-singlepass/src/machine_x64.rs:1439-1444 | lib/compiler-singlepass/src/machine_x64.rs:1451-1457 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_x64.rs:1058` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) lib/compiler-singlepass/src/machine_riscv.rs:1382 — lib/compiler-singlepass/src/machine_riscv.rs:1382-1388 | lib/compiler-singlepass/src/machine_riscv.rs:1434-1440 | lib/compiler-singlepass/src/machine_riscv.rs:1491-1497 | lib/compiler-singlepass/src/machine_x64.rs:7316-7322 | lib/compiler-singlepass/src/machine_x64.rs:7445-7451 | lib/compiler-singlepass/src/machine_x64.rs:7736-7742 | lib/compiler-singlepass/src/machine_x64.rs:7865-7871 — before extracting anything, compare `lib/compiler-singlepass/src/machine_riscv.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_riscv.rs:1382` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:1391` calls `move_location`, `Imm32`, `GPR` and `lib/compiler-singlepass/src/machine_riscv.rs:1443` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–7 lines × 6) · ×1
  • Duplicated block (6–7 lines × 6) lib/compiler-llvm/src/translator/intrinsics.rs:1944 — lib/compiler-llvm/src/translator/intrinsics.rs:1944-1950 | lib/compiler-llvm/src/translator/intrinsics.rs:2028-2033 | lib/compiler-llvm/src/translator/intrinsics.rs:2074-2079 | lib/compiler-llvm/src/translator/intrinsics.rs:2119-2124 | lib/compiler-llvm/src/translator/intrinsics.rs:2166-2171 | lib/compiler-llvm/src/translator/intrinsics.rs:2211-2216 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-llvm/src/translator/intrinsics.rs:1944` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×1
  • Duplicated block (6–7 lines × 3) lib/virtual-net/src/rx_tx.rs:342 — lib/virtual-net/src/rx_tx.rs:342-347 | lib/virtual-net/src/rx_tx.rs:394-400 | lib/virtual-net/src/rx_tx.rs:456-462 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-net/src/rx_tx.rs:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 22) · ×1
  • Duplicated block (6 lines × 22) lib/compiler-singlepass/src/machine_x64.rs:1057 — lib/compiler-singlepass/src/machine_x64.rs:1057-1062 | lib/compiler-singlepass/src/machine_x64.rs:1146-1151 | lib/compiler-singlepass/src/machine_x64.rs:1158-1163 | lib/compiler-singlepass/src/machine_x64.rs:1212-1217 | lib/compiler-singlepass/src/machine_x64.rs:1260-1265 | lib/compiler-singlepass/src/machine_x64.rs:1272-1277 | lib/compiler-singlepass/src/machine_x64.rs:1352-1357 | lib/compiler-singlepass/src/machine_x64.rs:1396-1401 | lib/compiler-singlepass/src/machine_x64.rs:1438-1443 | lib/compiler-singlepass/src/machine_x64.rs:1450-1455 | lib/compiler-singlepass/src/machine_x64.rs:1470-1475 | lib/compiler-singlepass/src/machine_x64.rs:1559-1564 | lib/compiler-singlepass/src/machine_x64.rs:1571-1576 | lib/compiler-singlepass/src/machine_x64.rs:1625-1630 | lib/compiler-singlepass/src/machine_x64.rs:1673-1678 | lib/compiler-singlepass/src/machine_x64.rs:1685-1690 | lib/compiler-singlepass/src/machine_x64.rs:1704-1709 | lib/compiler-singlepass/src/machine_x64.rs:1752-1757 | lib/compiler-singlepass/src/machine_x64.rs:1764-1769 | lib/compiler-singlepass/src/machine_x64.rs:1784-1789 | lib/compiler-singlepass/src/machine_x64.rs:1825-1830 | lib/compiler-singlepass/src/machine_x64.rs:1837-1842 — all 22 copies are in the same file, so extract the block into one function there and call 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 × 14) · ×1
  • Duplicated block (6 lines × 14) lib/compiler-singlepass/src/machine_arm64.rs:381 — lib/compiler-singlepass/src/machine_arm64.rs:381-386 | lib/compiler-singlepass/src/machine_arm64.rs:523-528 | lib/compiler-singlepass/src/machine_arm64.rs:561-566 | lib/compiler-singlepass/src/machine_arm64.rs:597-602 | lib/compiler-singlepass/src/machine_arm64.rs:633-638 | lib/compiler-singlepass/src/machine_arm64.rs:669-674 | lib/compiler-singlepass/src/machine_arm64.rs:705-710 | lib/compiler-singlepass/src/machine_arm64.rs:741-746 | lib/compiler-singlepass/src/machine_arm64.rs:774-779 | lib/compiler-singlepass/src/machine_arm64.rs:804-809 | lib/compiler-singlepass/src/machine_arm64.rs:832-837 | lib/compiler-singlepass/src/machine_arm64.rs:861-866 | lib/compiler-singlepass/src/machine_arm64.rs:2092-2098 | lib/compiler-singlepass/src/machine_arm64.rs:2116-2122 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:381` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–6 lines × 8) · ×1
  • Duplicated block (5–6 lines × 8) lib/compiler-llvm/src/translator/code.rs:9853 — lib/compiler-llvm/src/translator/code.rs:9853-9857 | lib/compiler-llvm/src/translator/code.rs:9867-9871 | lib/compiler-llvm/src/translator/code.rs:9881-9885 | lib/compiler-llvm/src/translator/code.rs:9895-9899 | lib/compiler-llvm/src/translator/code.rs:10307-10311 | lib/compiler-llvm/src/translator/code.rs:10320-10324 | lib/compiler-llvm/src/translator/code.rs:10334-10339 | lib/compiler-llvm/src/translator/code.rs:10349-10354 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) lib/compiler-singlepass/src/machine_riscv.rs:1383 — lib/compiler-singlepass/src/machine_riscv.rs:1383-1388 | lib/compiler-singlepass/src/machine_riscv.rs:1435-1440 | lib/compiler-singlepass/src/machine_riscv.rs:1492-1497 | lib/compiler-singlepass/src/machine_riscv.rs:6063-6068 | lib/compiler-singlepass/src/machine_riscv.rs:6299-6304 | lib/compiler-singlepass/src/machine_x64.rs:185-190 | lib/compiler-singlepass/src/machine_x64.rs:7174-7179 — before extracting anything, compare `lib/compiler-singlepass/src/machine_riscv.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_riscv.rs:1391` calls `move_location`, `Imm32`, `GPR` and `lib/compiler-singlepass/src/machine_riscv.rs:1443` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–6 lines × 4) · ×1
  • Duplicated block (3–6 lines × 4) lib/compiler-singlepass/src/machine_x64.rs:686 — lib/compiler-singlepass/src/machine_x64.rs:686-688 | lib/compiler-singlepass/src/machine_x64.rs:697-702 | lib/compiler-singlepass/src/machine_x64.rs:832-834 | lib/compiler-singlepass/src/machine_x64.rs:843-848 — 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 (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) lib/wasix/src/net/mod.rs:154 — lib/wasix/src/net/mod.rs:154-158 | lib/wasix/src/net/mod.rs:317-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wasix/src/net/mod.rs:154` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 28) · ×1
  • Duplicated block (5 lines × 28) lib/compiler-singlepass/src/machine_arm64.rs:5753 — lib/compiler-singlepass/src/machine_arm64.rs:5753-5757 | lib/compiler-singlepass/src/machine_arm64.rs:5814-5818 | lib/compiler-singlepass/src/machine_arm64.rs:5875-5879 | lib/compiler-singlepass/src/machine_arm64.rs:5936-5940 | lib/compiler-singlepass/src/machine_arm64.rs:5997-6001 | lib/compiler-singlepass/src/machine_arm64.rs:6058-6062 | lib/compiler-singlepass/src/machine_arm64.rs:6119-6123 | lib/compiler-singlepass/src/machine_arm64.rs:6180-6184 | lib/compiler-singlepass/src/machine_arm64.rs:6241-6245 | lib/compiler-singlepass/src/machine_arm64.rs:6302-6306 | lib/compiler-singlepass/src/machine_arm64.rs:6363-6367 | lib/compiler-singlepass/src/machine_arm64.rs:6424-6428 | lib/compiler-singlepass/src/machine_arm64.rs:6485-6489 | lib/compiler-singlepass/src/machine_arm64.rs:6546-6550 | lib/compiler-singlepass/src/machine_arm64.rs:6607-6611 | lib/compiler-singlepass/src/machine_arm64.rs:6668-6672 | lib/compiler-singlepass/src/machine_arm64.rs:6729-6733 | lib/compiler-singlepass/src/machine_arm64.rs:6790-6794 | lib/compiler-singlepass/src/machine_arm64.rs:6851-6855 | lib/compiler-singlepass/src/machine_arm64.rs:6912-6916 | lib/compiler-singlepass/src/machine_arm64.rs:6970-6975 | lib/compiler-singlepass/src/machine_arm64.rs:7028-7033 | lib/compiler-singlepass/src/machine_arm64.rs:7086-7091 | lib/compiler-singlepass/src/machine_arm64.rs:7144-7149 | lib/compiler-singlepass/src/machine_arm64.rs:7203-7208 | lib/compiler-singlepass/src/machine_arm64.rs:7266-7271 | lib/compiler-singlepass/src/machine_arm64.rs:7329-7334 | lib/compiler-singlepass/src/machine_arm64.rs:7392-7397 — all 28 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_arm64.rs:7211` calls `get_label` and `lib/compiler-singlepass/src/machine_arm64.rs:6979` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 21) · ×1
  • Duplicated block (5 lines × 21) lib/compiler-singlepass/src/machine_arm64.rs:3442 — lib/compiler-singlepass/src/machine_arm64.rs:3442-3446 | lib/compiler-singlepass/src/machine_arm64.rs:3503-3507 | lib/compiler-singlepass/src/machine_arm64.rs:3564-3568 | lib/compiler-singlepass/src/machine_arm64.rs:3625-3629 | lib/compiler-singlepass/src/machine_arm64.rs:3686-3690 | lib/compiler-singlepass/src/machine_arm64.rs:3747-3751 | lib/compiler-singlepass/src/machine_arm64.rs:3808-3812 | lib/compiler-singlepass/src/machine_arm64.rs:3869-3873 | lib/compiler-singlepass/src/machine_arm64.rs:3930-3934 | lib/compiler-singlepass/src/machine_arm64.rs:3991-3995 | lib/compiler-singlepass/src/machine_arm64.rs:4052-4056 | lib/compiler-singlepass/src/machine_arm64.rs:4113-4117 | lib/compiler-singlepass/src/machine_arm64.rs:4174-4178 | lib/compiler-singlepass/src/machine_arm64.rs:4235-4239 | lib/compiler-singlepass/src/machine_arm64.rs:4296-4300 | lib/compiler-singlepass/src/machine_arm64.rs:4354-4359 | lib/compiler-singlepass/src/machine_arm64.rs:4412-4417 | lib/compiler-singlepass/src/machine_arm64.rs:4470-4475 | lib/compiler-singlepass/src/machine_arm64.rs:4529-4534 | lib/compiler-singlepass/src/machine_arm64.rs:4592-4597 | lib/compiler-singlepass/src/machine_arm64.rs:4655-4660 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/compiler-singlepass/src/machine_arm64.rs:4537` calls `get_label` and `lib/compiler-singlepass/src/machine_arm64.rs:4363` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) lib/compiler-cranelift/src/func_environ.rs:1390 — lib/compiler-cranelift/src/func_environ.rs:1390-1395 | lib/compiler-cranelift/src/func_environ.rs:1411-1415 | lib/compiler-cranelift/src/func_environ.rs:2097-2101 | lib/compiler-cranelift/src/func_environ.rs:2355-2360 | lib/compiler-cranelift/src/func_environ.rs:2375-2379 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-cranelift/src/func_environ.rs:1390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn translate_unreachable( &mut` in one and `crate) fn translate_exn_reraise_unmatched( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (4–5 lines × 5) · ×1
  • Duplicated block (4–5 lines × 5) lib/virtual-fs/src/cow_file.rs:152 — lib/virtual-fs/src/cow_file.rs:152-156 | lib/virtual-fs/src/cow_file.rs:165-169 | lib/virtual-fs/src/cow_file.rs:276-279 | lib/virtual-fs/src/overlay_fs.rs:1162-1166 | lib/virtual-fs/src/overlay_fs.rs:1175-1179 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/cow_file.rs:276` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `cx` to `&mut Context<'_>` in one and `&mut std::task::Context<'_>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (3–5 lines × 31) · ×1
  • Duplicated block (3–5 lines × 31) lib/compiler-llvm/src/translator/code.rs:3975 — lib/compiler-llvm/src/translator/code.rs:3975-3977 | lib/compiler-llvm/src/translator/code.rs:4197-4199 | lib/compiler-llvm/src/translator/code.rs:4321-4323 | lib/compiler-llvm/src/translator/code.rs:4922-4924 | lib/compiler-llvm/src/translator/code.rs:4934-4938 | lib/compiler-llvm/src/translator/code.rs:4944-4946 | lib/compiler-llvm/src/translator/code.rs:5000-5004 | lib/compiler-llvm/src/translator/code.rs:5010-5012 | lib/compiler-llvm/src/translator/code.rs:5018-5020 | lib/compiler-llvm/src/translator/code.rs:5026-5028 | lib/compiler-llvm/src/translator/code.rs:5034-5036 | lib/compiler-llvm/src/translator/code.rs:5170-5172 | lib/compiler-llvm/src/translator/code.rs:5180-5182 | lib/compiler-llvm/src/translator/code.rs:5272-5274 | lib/compiler-llvm/src/translator/code.rs:5282-5284 | lib/compiler-llvm/src/translator/code.rs:5374-5376 | lib/compiler-llvm/src/translator/code.rs:5384-5386 | lib/compiler-llvm/src/translator/code.rs:5476-5478 | lib/compiler-llvm/src/translator/code.rs:5492-5494 | lib/compiler-llvm/src/translator/code.rs:5508-5510 | lib/compiler-llvm/src/translator/code.rs:5524-5526 | lib/compiler-llvm/src/translator/code.rs:7394-7396 | lib/compiler-llvm/src/translator/code.rs:7469-7471 | lib/compiler-llvm/src/translator/code.rs:7544-7546 | lib/compiler-llvm/src/translator/code.rs:7634-7636 | lib/compiler-llvm/src/translator/code.rs:7703-7705 | lib/compiler-llvm/src/translator/code.rs:7793-7795 | lib/compiler-llvm/src/translator/code.rs:7865-7867 | lib/compiler-llvm/src/translator/code.rs:7955-7957 | lib/compiler-llvm/src/translator/code.rs:8027-8029 | lib/compiler-llvm/src/translator/code.rs:8114-8116 — all 31 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/compiler-llvm/src/translator/code.rs:4934` calls `apply_pending_canonicalization` and `lib/compiler-llvm/src/translator/code.rs:3975` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (71 lines × 2) · ×1
  • Duplicated block (71 lines × 2) lib/virtual-fs/src/null_file.rs:16 — lib/virtual-fs/src/null_file.rs:16-86 | lib/virtual-fs/src/special_file.rs:25-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/virtual-fs/src/null_file.rs:16` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14 lines × 11) · ×1
  • Duplicated block (14 lines × 11) lib/compiler-singlepass/src/machine_arm64.rs:3197 — lib/compiler-singlepass/src/machine_arm64.rs:3197-3210 | lib/compiler-singlepass/src/machine_arm64.rs:3222-3235 | lib/compiler-singlepass/src/machine_arm64.rs:3247-3260 | lib/compiler-singlepass/src/machine_arm64.rs:5432-5445 | lib/compiler-singlepass/src/machine_arm64.rs:5457-5470 | lib/compiler-singlepass/src/machine_arm64.rs:5482-5495 | lib/compiler-singlepass/src/machine_arm64.rs:5507-5520 | lib/compiler-singlepass/src/machine_x64.rs:5515-5528 | lib/compiler-singlepass/src/machine_x64.rs:5540-5553 | lib/compiler-singlepass/src/machine_x64.rs:5565-5578 | lib/compiler-singlepass/src/machine_x64.rs:5590-5603 — before extracting anything, compare `lib/compiler-singlepass/src/machine_arm64.rs` and `lib/compiler-singlepass/src/machine_x64.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:3197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 7) · ×1
  • Duplicated block (14 lines × 7) lib/compiler-singlepass/src/machine_arm64.rs:533 — lib/compiler-singlepass/src/machine_arm64.rs:533-546 | lib/compiler-singlepass/src/machine_arm64.rs:571-584 | lib/compiler-singlepass/src/machine_arm64.rs:607-620 | lib/compiler-singlepass/src/machine_arm64.rs:643-656 | lib/compiler-singlepass/src/machine_arm64.rs:679-692 | lib/compiler-singlepass/src/machine_arm64.rs:715-728 | lib/compiler-singlepass/src/machine_arm64.rs:751-764 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/compiler-singlepass/src/machine_arm64.rs:533` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) scripts/make-release.py:398 — scripts/make-release.py:398-407 | scripts/make-release.py:467-478 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D5 · Coupling · Unstable project wasmer-journal · ×1
  • Unstable project wasmer-journal — wasmer-journal has instability 0.83 with 1 dependents.
X1 · Async correctness · Blocking `thread · ×1
  • Blocking `thread::sleep` inside an `async` body lib/backend-api/src/query.rs:2356 — This `async` body is polled on an executor's worker thread, and `std::thread::sleep` blocks that thread: for the whole delay no other task scheduled on it makes progress — the Rust form of blocking on a task. Use `tokio::time::sleep(…).await` (or the runtime's own timer), which suspends only this task. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the executor with `tokio::task::spawn_blocking(…).await`.
Minor — 203 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×128
  • Orphaned file lib/journal/src/concrete/log_file.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 lib/wasix/src/os/posix_err.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 lib/journal/src/concrete/printing.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 lib/journal/src/concrete/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 lib/api/src/entities/imports.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 lib/types/src/entity/primary_map.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 lib/virtual-net/src/meta.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 lib/cli/src/config/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 lib/vm/src/probestack/compiler_builtins.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 lib/cli/src/commands/package/push.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 lib/wasix/src/journal/effector/memory_and_snapshot.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 lib/c-api/src/wasm_c_api/unstable/middlewares/metering.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 lib/cli/src/commands/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 lib/types/src/entity/secondary_map.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 lib/c-api/src/wasm_c_api/instance.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 lib/virtual-fs/src/ops.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 lib/cli/src/commands/run/capabilities/net.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 lib/api/src/entities/function/host/imp.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 lib/virtual-fs/src/mem_fs/stdio.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 lib/c-api/src/wasm_c_api/types/extern_.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 lib/api/src/backend/v8/entities/store/obj.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 lib/api/src/utils/mem/ptr.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 lib/wasix/src/runtime/module_cache/fallback.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 lib/types/src/entity/boxed_slice.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 lib/journal/src/concrete/compacting_log_file.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.
  • + 103 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging lib/wasix/src/utils/mod.rs:44 — `warn!` at line 44 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:408 — `debug!` at line 408 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:486 — `trace!` at line 486 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:795 — `warn!` at line 795 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:828 — `warn!` at line 828 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:841 — `warn!` at line 841 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:1126 — `trace!` at line 1126 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:1230 — `warn!` at line 1230 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:1256 — `trace!` at line 1256 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:1269 — `trace!` at line 1269 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:1375 — `warn!` at line 1375 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:1496 — `warn!` at line 1496 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/mod.rs:1515 — `trace!` at line 1515 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/windows.rs:41 — `debug!` at line 41 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/callback_signal.rs:21 — `warn!` at line 21 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/chdir.rs:25 — `error!` at line 25 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/closure_allocate.rs:25 — `error!` at line 25 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/context_create.rs:23 — `trace!` at line 23 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/context_create.rs:37 — `trace!` at line 37 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/context_destroy.rs:40 — `trace!` at line 40 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/context_destroy.rs:48 — `trace!` at line 48 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/context_destroy.rs:62 — `trace!` at line 62 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/context_switch.rs:49 — `trace!` at line 49 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/context_switch.rs:59 — `trace!` at line 59 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging lib/wasix/src/syscalls/wasix/context_switch.rs:68 — `trace!` at line 68 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×9
  • Duplicated predicate lib/cli/src/commands/app/secrets/create.rs:172 — `!self.non_interactive && self.from_file.is_some()` appears character-identically in 2 files — lib/cli/src/commands/app/secrets/create.rs, lib/cli/src/commands/app/secrets/update.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 lib/wasix/src/syscalls/wasi/fd_filestat_set_times.rs:62 — `(fst_flags.contains(Fstflags::SET_ATIM) && fst_flags.contains(Fstflags::SET_ATIM_NOW)) || (fst_flags.contains(Fstflags::SET_MTIM) && fst_fla…` appears character-identically in 2 files — lib/wasix/src/syscalls/wasi/fd_filestat_set_times.rs, lib/wasix/src/syscalls/wasi/path_filestat_set_times.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 lib/wasix/src/syscalls/wasi/fd_filestat_set_times.rs:73 — `fst_flags.contains(Fstflags::SET_ATIM) || fst_flags.contains(Fstflags::SET_ATIM_NOW)` appears character-identically in 2 files — lib/wasix/src/syscalls/wasi/fd_filestat_set_times.rs, lib/wasix/src/syscalls/wasi/path_filestat_set_times.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 lib/wasix/src/syscalls/wasi/fd_filestat_set_times.rs:83 — `fst_flags.contains(Fstflags::SET_MTIM) || fst_flags.contains(Fstflags::SET_MTIM_NOW)` appears character-identically in 2 files — lib/wasix/src/syscalls/wasi/fd_filestat_set_times.rs, lib/wasix/src/syscalls/wasi/path_filestat_set_times.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 lib/wasix/src/syscalls/wasix/sock_recv.rs:137 — `nonblocking_flag || fd.inner.flags.contains(Fdflags::NONBLOCK)` appears character-identically in 4 files — lib/wasix/src/syscalls/wasix/sock_recv.rs, lib/wasix/src/syscalls/wasix/sock_recv_from.rs, lib/wasix/src/syscalls/wasix/sock_send.rs, lib/wasix/src/syscalls/wasix/sock_send_to.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 lib/wasix/src/syscalls/wasix/proc_exec4.rs:110 — `search_path == Bool::False && !name.starts_with('/')` appears character-identically in 2 files — lib/wasix/src/syscalls/wasix/proc_exec4.rs, lib/wasix/src/syscalls/wasix/proc_spawn3.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 lib/wasix/src/syscalls/wasix/proc_exec4.rs:89 — `search_path == Bool::True && !name.contains('/')` appears character-identically in 2 files — lib/wasix/src/syscalls/wasix/proc_exec4.rs, lib/wasix/src/syscalls/wasix/proc_spawn3.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 lib/cli/src/commands/package/common/wait.rs:23 — `self.container || self.native_executables || self.bindings` appears character-identically in 2 files — lib/cli/src/commands/package/common/wait.rs, lib/package-sdk/src/package/publish.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 lib/api/src/backend/sys/entities/memory/view.rs:214 — `source_end > self.buffer.len || target_end > new_memory.buffer.len` appears character-identically in 2 files — lib/api/src/backend/sys/entities/memory/view.rs, lib/api/src/backend/v8/entities/memory/view.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 · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 36 significant file(s) lose their only recent owner: lib/compiler-singlepass/src/machine_x64.rs, lib/compiler-singlepass/src/codegen.rs, lib/compiler-singlepass/src/machine_riscv.rs, lib/compiler-singlepass/src/machine.rs, lib/compiler-singlepass/src/emitter_riscv.rs, lib/compiler/src/engine/mapped_binary.rs, lib/compiler/src/compiler.rs, lib/compiler-llvm/src/abi.rs (+28 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 12 significant file(s) lose their only recent owner: lib/c-api-imports/src/lib.rs, lib/wasix/src/state/linker/mod.rs, lib/api/src/backend/js/entities/module.rs, lib/wasix/src/state/linker/instance_group.rs, lib/wasix/src/http/web_http_client.rs, lib/api/src/backend/sys/entities/memory/view.rs, lib/api/src/backend/js/entities/function/typed.rs, lib/wasix/src/syscalls/wasm.rs (+4 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 5 significant file(s) lose their only recent owner: lib/wasix/src/utils/thread_local_executor.rs, lib/wasix/src/syscalls/wasix/context_switch.rs, lib/wasix/src/syscalls/wasix/proc_fork_env.rs, lib/wasix/src/syscalls/wasix/proc_exit2.rs, lib/wasix/src/syscalls/wasix/context_destroy.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 4 significant file(s) lose their only recent owner: lib/wasix/src/syscalls/wasix/proc_exec4.rs, lib/virtual-fs/src/special_file.rs, lib/virtual-fs/src/null_file.rs, lib/virtual-fs/src/zero_file.rs. Pair on, review, or document these before any departure.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
M4 · Documentation accuracy · README/code drift · ×3
  • README/code drift lib/c-api/README.md:202 — lib/c-api/README.md links to `./wasmer.hh`, but `lib/c-api/wasmer.hh` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift lib/config/README.md:17 — lib/config/README.md links to `.github/workflows/release-please.yml`, but `lib/config/.github/workflows/release-please.yml` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift lib/wasix/tests/wasm_tests/README.md:31 — lib/wasix/tests/wasm_tests/README.md links to `../wasm_tests.rs`, but `lib/wasix/tests/wasm_tests.rs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
X7 · Silent fallback defaults · Silent fallback default on Err · ×2
  • Silent fallback default on Err lib/api/src/backend/js/vm/memory.rs:36 — `get_runtime_size` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err lib/cli/src/config/mod.rs:224 — `from_file` turns every `Err` into `Ok(Self::default())` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (59 single-owned of 568 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; 568 of the 970 production source files in this repository met that bar). They are anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: lib/cli/src/commands/cron.rs, lib/cli/src/commands/namespace/create.rs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found lib/config/src/bin/generate-core-schemas.rs:1 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `lib/config/src/bin/generate-core-schemas.rs` makes this repository a deployable product (line 1).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 6 of 26 project(s) overshoot their size bounds, lowering Project Cohesion to 5.5/10. The most over is `lib/wasix` (58162 LoC, 411 module-visible types across 29 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) — 128 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: lib/journal/src/concrete/log_file.rs, lib/api/src/entities/imports.rs, lib/wasix/src/os/posix_err.rs, lib/journal/src/concrete/printing.rs, lib/api/src/entities/function/host/imp.rs, lib/journal/src/concrete/filter.rs, lib/types/src/entity/primary_map.rs, lib/api/src/backend/v8/entities/store/obj.rs (and 120 more) (133 orphaned of 568 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; 568 of the 970 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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 15/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `lib/config`.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `.serve_connection(` (lib/cli/src/commands/auth/login/mod.rs:131).
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `.serve_connection(` (lib/cli/src/commands/auth/login/mod.rs:131).
Minor — 14 finding(s)
D12 · Dependency Hygiene · Outdated · ×14
  • Outdated: cc — `cc` is locked at 1.10.0 but 1.11.2 is the current stable release on crates.io, and it already satisfies the `"1.2.47"` requirement declared in lib/compiler/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cc` and commit the updated REDACTED.
  • Outdated: crc32fast — `crc32fast` is locked at 1.5.3 but 1.5.5 is the current stable release on crates.io, and it already satisfies the `"1.5.0"` requirement declared in lib/types/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32fast` and commit the updated REDACTED.
  • Outdated: fixedbitset — `fixedbitset` is locked at 0.5.7 but 0.5.9 is the current stable release on crates.io, and it already satisfies the `"0.5.7"` requirement declared in lib/compiler-singlepass/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p fixedbitset` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.10 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1.0.34"` requirement declared in lib/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: log — `log` is locked at 0.4.34 but 0.4.35 is the current stable release on crates.io, and it already satisfies the `"0.4.22"` requirement declared in lib/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
  • Outdated: mio — `mio` is locked at 1.2.4 but 1.2.5 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in lib/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p mio` and commit the updated REDACTED.
  • Outdated: smallvec — `smallvec` is locked at 1.16.4 but 1.16.5 is the current stable release on crates.io, and it already satisfies the `"1.6"` requirement declared in lib/compiler-cranelift/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p smallvec` and commit the updated REDACTED.
  • Outdated: syn — `syn` is locked at 3.0.9 but 3.0.10 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in lib/derive/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p syn` and commit the updated REDACTED.
  • Outdated: target-lexicon — `target-lexicon` is locked at 0.13.5 but 0.13.6 is the current stable release on crates.io, and it already satisfies the `"0.13.3"` requirement declared in lib/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p target-lexicon` and commit the updated REDACTED.
  • Outdated: toml — `toml` is locked at 1.1.8+spec-1.1.0 but 1.2.1+spec-1.1.0 is the current stable release on crates.io, and it already satisfies the `"1.1.0"` requirement declared in lib/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p toml` and commit the updated REDACTED.
  • Outdated: uuid — `uuid` is locked at 1.29.0 but 1.29.2 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in lib/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
  • Outdated: yaml-edit — `yaml-edit` is locked at 0.3.5 but 0.3.6 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in lib/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p yaml-edit` and commit the updated REDACTED.
  • Outdated: zip — `zip` is locked at 9.1.3 but 9.5.1 is the current stable release on crates.io, and it already satisfies the `"9.0.4"` requirement declared in lib/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zip` and commit the updated REDACTED.
  • Outdated: zstd — `zstd` is locked at 0.14.3 but 0.14.4 is the current stable release on crates.io, and it already satisfies the `"0.14.0"` requirement declared in lib/wasix/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zstd` and commit the updated REDACTED.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-ac125352775743d29e78e392f249e661/history.json --exit-code 0 --source .9artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-ac125352775743d29e78e392f249e661/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .149artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .8artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .9artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.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 Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1d8cc-d2ea-7c04-990d-d8cbd5c30d46 · 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